@igamingcareer/igaming-components 1.2.4 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -7718,7 +7718,7 @@
7718
7718
  hover:border-gray-300 hover:bg-white
7719
7719
  focus:outline-none focus:ring-2 focus:ring-yellow-400 focus:border-yellow-400 focus:bg-white
7720
7720
  ${i}
7721
- `,children:s.map(o=>e.jsx("option",{value:o,children:o},o))}),e.jsx("span",{className:"pointer-events-none absolute right-2.5 top-1/2 -translate-y-1/2 text-gray-400",children:e.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M2 4l4 4 4-4"})})})]}),e.jsx("span",{className:"text-xs text-gray-400 hidden lg:inline-block select-none",children:"/ page"})]}),PC=({viewMode:t,onToggleViewMode:a,selectedItemsPerPage:s,onItemsPerPageChange:r,totalCount:i,startIndex:o,endIndex:l,title:c})=>e.jsx("div",{className:"lg:block hidden bg-white rounded-lg shadow-sm border border-gray-200 p-4 mb-6",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:c}),e.jsxs("p",{className:"text-sm text-gray-600",children:["Showing ",e.jsx("span",{className:"font-semibold text-gray-900",children:o}),"–",e.jsx("span",{className:"font-semibold text-gray-900",children:l})," of"," ",e.jsx("span",{className:"font-semibold text-gray-900",children:i})," articles"]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3",children:[e.jsx(aM,{viewMode:t,onToggle:a}),e.jsx(QM,{value:s,onChange:r})]})]})}),CI=({title:t,description:a,ctaText:s,ctaLink:r,bgColor:i="bg-yellow-50",textColor:o="text-yellow-800"})=>e.jsx("div",{className:`promo-card ${i} p-4 rounded-lg shadow-sm hidden md:block`,children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:`font-bold text-lg ${o}`,children:t}),e.jsx("p",{className:`text-sm mt-1 ${o} opacity-90`,children:a})]}),e.jsx("a",{href:r,className:"bg-white text-yellow-600 hover:bg-yellow-50 px-4 py-2 rounded-md text-sm font-medium shadow-sm transition-colors",children:s})]})}),SI=({items:t,cardType:a,viewMode:s,savedJobs:r,onSaveJob:i,onViewJob:o,onApplyJob:l,firstItemRef:c=null,userAccess:h})=>{const[d,p]=m.useState([]),[g,y]=m.useState(null);m.useEffect(()=>{try{if(!Array.isArray(t)){console.error("❌ Items is not an array:",t),y("Invalid data format received"),p([]);return}const x=[...t];t.length>5&&x.splice(5,0,{id:"promo-1",title:"Promo",isPromo:!0}),p(x),y(null)}catch(x){console.error("Error processing items:",x),y(`Error processing items: ${x instanceof Error?x.message:String(x)}`),p([])}},[t]);const u=(x,v)=>{const k=v===0&&!x.isPromo?{ref:c}:{};try{if(x.isPromo)return e.jsx("div",{className:"col-span-full my-4",children:e.jsx(CI,{title:"Upgrade Your Job Search",description:"Get personalized job recommendations and stand out to employers.",ctaText:"Learn More",ctaLink:"#premium-features",bgColor:"bg-yellow-50",textColor:"text-yellow-800"})},`promo-${v}`);if(!x||typeof x!="object")return console.error("❌ Invalid item detected:",x),e.jsxs("div",{className:"error-card bg-red-50 p-4 rounded-md border border-red-200",children:[e.jsx("p",{className:"text-red-800 font-medium",children:"Invalid Job Data"}),e.jsx("p",{className:"text-red-600 text-sm",children:"The job data is in an unexpected format."})]});const w=x.id?`${x._id}-${v}`:x.slug?`${x.slug}-${v}`:`item-${v}`;switch(a){case"job":return e.jsx("div",{...k,children:e.jsx(YM,{job:x,positionInList:v,onSaveJob:j=>i(j,v),onViewJob:(j,b,T)=>o(j,v,T),onApplyJob:l?(j,b,T)=>l(j,v,T):void 0,isSaved:r.includes(x.id||x.slug||x.link),userAccess:h})},w);default:return console.warn(`⚠️ Unknown cardType: ${a}`),e.jsxs("div",{className:"error-card bg-yellow-50 p-4 rounded-md border border-yellow-200",children:[e.jsx("p",{className:"text-yellow-800 font-medium",children:"Unknown Card Type"}),e.jsx("p",{className:"text-yellow-700 text-sm",children:"The specified card type is not supported."})]})}}catch(w){return console.error("Error rendering card:",w),e.jsxs("div",{className:"error-card bg-red-50 p-4 rounded-md border border-red-200",children:[e.jsx("p",{className:"text-red-800 font-medium",children:"Error Rendering Card"}),e.jsx("p",{className:"text-red-600 text-sm",children:w instanceof Error?w.message:String(w)})]})}};return g?e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-800 rounded-lg p-6",children:[e.jsx("h3",{className:"font-semibold mb-2",children:"Error Loading Items"}),e.jsx("p",{children:g})]}):d.length===0?e.jsxs("div",{className:"no-results",children:[e.jsx("h3",{children:"No items found matching your criteria"}),e.jsx("p",{children:"Try adjusting your filters or search term"})]}):e.jsx("div",{className:s==="grid"?"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4":"flex flex-col gap-4","data-view-mode":s,children:d.map((x,v)=>u(x,v))})},sM=({currentPage:t,totalPages:a,onPageChange:s})=>{if(a<=1)return null;const r=5,i=Math.max(1,t-Math.floor(r/2)),o=Math.min(a,i+r-1),l=[];for(let c=i;c<=o;c++)l.push(c);return e.jsx("div",{className:"mt-6 flex justify-center",children:e.jsxs("nav",{className:"flex items-center space-x-2",children:[e.jsx("button",{onClick:()=>s(Math.max(1,t-1)),disabled:t===1,className:"px-3 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:e.jsx(Wa,{})}),l.map(c=>e.jsx("button",{onClick:()=>s(c),className:`px-3 py-2 text-sm font-medium rounded-md ${t===c?"bg-yellow-600 text-white":"text-gray-700 bg-white border border-gray-300 hover:bg-gray-50"}`,children:c},c)),e.jsx("button",{onClick:()=>s(Math.min(a,t+1)),disabled:t===a,className:"px-3 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:e.jsx(Za,{})})]})})},jN=t=>typeof t=="string"?t:(t==null?void 0:t.name)??"Unknown company",LI=({jobs:t,onViewJob:a})=>!t||t.length===0?null:e.jsxs("div",{className:"last-visited-jobs mt-8 bg-white rounded-lg shadow p-4",children:[e.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Recently Viewed Jobs"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:t.map((s,r)=>e.jsxs("div",{className:"p-3 border rounded-md hover:shadow-md transition-shadow cursor-pointer",onClick:()=>a(s,r,"same_tab","last_visited"),children:[e.jsxs("div",{className:"flex items-center mb-2",children:[e.jsx("img",{src:s.logo||"/placeholder.svg?height=30&width=30",alt:`${jN(s.company)} logo`,className:"w-6 h-6 mr-2"}),e.jsx("h3",{className:"font-medium text-sm truncate",children:s.title})]}),e.jsx("p",{className:"text-xs text-gray-600 truncate",children:jN(s.company)}),e.jsx("p",{className:"text-xs text-gray-500 truncate",children:s.location})]},s._id||s.slug||s.link))})]}),II=(t,a,s="date")=>{if(a==="all")return t;const r=new Date,i=new Date(r.getFullYear(),r.getMonth(),r.getDate());return t.filter(o=>{const l=o[s]||o.created_at||o.published_at||o.scraped_at;if(!l)return!1;const c=new Date(l);switch(a){case"today":return c>=i;case"this_week":{const h=new Date(r);return h.setDate(r.getDate()-r.getDay()),h.setHours(0,0,0,0),c>=h}case"this_month":{const h=new Date(r.getFullYear(),r.getMonth(),1);return c>=h}case"last_30_days":{const h=new Date(r);return h.setDate(r.getDate()-30),c>=h}case"last_90_days":{const h=new Date(r);return h.setDate(r.getDate()-90),c>=h}default:return!0}})},AI=(t,a)=>t.filter(s=>{var r,i,o,l,c;if(a.jobTypes.length>0){const h=((r=s.department)==null?void 0:r.toLowerCase())||"";if(!a.jobTypes.some(d=>h.includes(d)))return!1}if(a.experienceLevels.length>0){const h=((i=s.title)==null?void 0:i.toLowerCase())||"";if(!a.experienceLevels.some(d=>!!(d==="senior"&&h.includes("senior")||d==="mid"&&(h.includes("mid")||h.includes("mid-level"))||d==="entry"&&(h.includes("junior")||h.includes("entry")))))return!1}return!(a.country&&!(((o=s.location)==null?void 0:o.toLowerCase())||((l=s.city)==null?void 0:l.toLowerCase())||"").includes(a.country.toLowerCase())||a.city&&!(((c=s.company_type)==null?void 0:c.toLowerCase())||"").includes(a.city.toLowerCase()))}),pl=(t,a)=>{const s={};for(const r of t)for(const i of a){s[i]||(s[i]=new Set);const o=r[i];Array.isArray(o)?o.forEach(l=>{typeof l=="string"&&l.trim()&&s[i].add(l.trim())}):typeof o=="string"&&o.trim()&&s[i].add(o.trim())}return Object.fromEntries(Object.entries(s).map(([r,i])=>[r,Array.from(i)]))},TC=t=>{const a=new URLSearchParams(window.location.search);t==="all"?a.delete("date_filter"):a.set("date_filter",t);const s=`${window.location.pathname}?${a.toString()}`;window.history.replaceState({},"",s)},Yi=(t,a,s,r,i="date")=>{let o=t.filter(l=>Object.entries(a).every(([c,h])=>{const d=l[c];return typeof d=="string"?d.toLowerCase()===h.toLowerCase():Array.isArray(d)?d.some(p=>typeof p=="string"&&p.toLowerCase()===h.toLowerCase()):!1}));return s.length>0&&(o=o.filter(l=>s.every(c=>{var h,d;return((h=l.title)==null?void 0:h.toLowerCase().includes(c.toLowerCase()))||((d=l.overview)==null?void 0:d.toLowerCase().includes(c.toLowerCase()))}))),o=II(o,r,i),o},Al=(t,a,s=[],r="date")=>{const i=h=>{const d=h[r]||h.created_at||h.published_at||h.scraped_at;return d?new Date(d).getTime():0},o=h=>{var p;const d=h.views??h.viewCount??((p=h.metrics)==null?void 0:p.views)??0;return typeof d=="number"?d:0},l=h=>{if(s.length===0)return 0;const d=(h.title??"").toLowerCase(),p=(h.overview??"").toLowerCase();return s.reduce((g,y)=>{const u=y.toLowerCase();let x=g;return d.includes(u)&&(x+=3),p.includes(u)&&(x+=1),x},0)},c=[...t];return c.sort((h,d)=>{switch(a){case"date_asc":return i(h)-i(d);case"views_desc":return o(d)-o(h);case"views_asc":return o(h)-o(d);case"relevance":{const p=l(d)-l(h);return p!==0?p:i(d)-i(h)}case"title_asc":{const p=(h.title??"").localeCompare(d.title??"",void 0,{sensitivity:"base"});return p!==0?p:i(d)-i(h)}case"date_desc":default:return i(d)-i(h)}}),c},RC=({dateFieldLabel:t,activeDateFilter:a,onDateFilterChange:s,filterKeys:r,searchableFilters:i,filtersData:o,activeFilters:l,handleFilterChange:c,toggleSavedJobsFilter:h,showOnlySaved:d,savedJobs:p})=>e.jsx("div",{className:"hidden lg:block lg:w-1/4 space-y-6",children:e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-5",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Filters"}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-2",children:t}),e.jsx(SC,{activeDateFilter:a,onDateFilterChange:s,dateFieldLabel:""})]}),r.map(g=>{var y;return e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-2",children:g.replace(/_/g," ").replace(/^\w/,u=>u.toUpperCase())}),i.includes(g)?e.jsx(eM,{options:o[g]||[],value:l[g]||"",onChange:u=>c(g,u),placeholder:`Select ${g.replace(/_/g," ")}`,className:"w-full"}):e.jsxs("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-yellow--500 focus:border-yellow--500 bg-white",value:l[g]||"",onChange:u=>c(g,u.target.value),children:[e.jsxs("option",{value:"",children:["Select ",g.replace(/_/g," ")]}),(y=o[g])==null?void 0:y.map(u=>e.jsx("option",{value:u,children:u},u))]})]},g)}),e.jsx("div",{className:"mt-6",children:e.jsxs("button",{onClick:h,className:`w-full px-4 py-2 rounded-lg flex items-center justify-center ${d?"bg-yellow-100 text-indigo-800":"bg-gray-100 text-gray-800 hover:bg-gray-200"}`,children:[e.jsx(St,{size:16,className:"mr-2"}),e.jsxs("span",{children:["Saved Jobs (",p.length,")"]})]})})]})}),tt=Tt.Root,DC=Tt.Trigger,PI=Tt.Portal,zC=ie.forwardRef(({className:t,...a},s)=>e.jsx(Tt.Overlay,{ref:s,className:ne("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...a}));zC.displayName=Tt.Overlay.displayName;const Xe=ie.forwardRef(({className:t,children:a,...s},r)=>e.jsxs(PI,{children:[e.jsx(zC,{}),e.jsxs(Tt.Content,{ref:r,className:ne("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...s,children:[a,e.jsxs(Tt.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(jl.Cross2Icon,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Xe.displayName=Tt.Content.displayName;const Be=({className:t,...a})=>e.jsx("div",{className:ne("flex flex-col space-y-1.5 text-center sm:text-left",t),...a});Be.displayName="DialogHeader";const et=({className:t,...a})=>e.jsx("div",{className:ne("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a});et.displayName="DialogFooter";const Ie=ie.forwardRef(({className:t,...a},s)=>e.jsx(Tt.Title,{ref:s,className:ne("text-lg font-semibold leading-none tracking-tight",t),...a}));Ie.displayName=Tt.Title.displayName;const nt=ie.forwardRef(({className:t,...a},s)=>e.jsx(Tt.Description,{ref:s,className:ne("text-sm text-muted-foreground",t),...a}));nt.displayName=Tt.Description.displayName;const TI=X8("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),V=ie.forwardRef(({className:t,...a},s)=>e.jsx(b7.Root,{ref:s,className:ne(TI(),t),...a}));V.displayName=b7.Root.displayName;const RI=1,DI=1e6;let hM=0;function zI(){return hM=(hM+1)%Number.MAX_SAFE_INTEGER,hM.toString()}const mM=new Map,wN=t=>{if(mM.has(t))return;const a=setTimeout(()=>{mM.delete(t),G8({type:"REMOVE_TOAST",toastId:t})},DI);mM.set(t,a)},qI=(t,a)=>{switch(a.type){case"ADD_TOAST":return{...t,toasts:[a.toast,...t.toasts].slice(0,RI)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(s=>s.id===a.toast.id?{...s,...a.toast}:s)};case"DISMISS_TOAST":{const{toastId:s}=a;return s?wN(s):t.toasts.forEach(r=>{wN(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===s||s===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return a.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(s=>s.id!==a.toastId)}}},FI=[];let uM={toasts:[]};function G8(t){uM=qI(uM,t),FI.forEach(a=>{a(uM)})}function MN({...t}){const a=zI(),s=i=>G8({type:"UPDATE_TOAST",toast:{...i,id:a}}),r=()=>G8({type:"DISMISS_TOAST",toastId:a});return G8({type:"ADD_TOAST",toast:{...t,id:a,open:!0,onOpenChange:i=>{i||r()}}}),{id:a,dismiss:r,update:s}}const HI=new Set([200,201,202,204]);function EI(t){return t===400?"BAD_REQUEST":t===401?"UNAUTHORIZED":t===403?"FORBIDDEN":t===404?"NOT_FOUND":t===409?"CONFLICT":t===429?"RATE_LIMITED":t>=500?"SERVER":"UNKNOWN"}function BI(t){if(t.friendly)return t.friendly;switch(t.code){case"TIMEOUT":return"The request took too long. Please try again.";case"NETWORK":return"You appear to be offline or the server can’t be reached.";case"RATE_LIMITED":return"Too many requests. Please wait a moment and try again.";case"SERVER":return"The server had an issue. Please try again shortly.";case"CONFLICT":return"This email may already be subscribed.";case"BAD_REQUEST":return"Please check your input and try again.";case"UNAUTHORIZED":return"Please sign in to continue.";default:return"Something went wrong. Please try again."}}async function VI(t,a){const{timeoutMs:s=12e3,...r}=a??{},i=new AbortController,o=setTimeout(()=>i.abort(),s);try{const l=await fetch(t,{...r,signal:i.signal});if(HI.has(l.status)){if(l.status===204)return{ok:!0,data:void 0};const p=await l.text();return{ok:!0,data:p?JSON.parse(p):void 0}}let c=null;try{c=await l.json()}catch{}return{ok:!1,error:{code:EI(l.status),status:l.status,message:(c==null?void 0:c.message)||`${l.status} ${l.statusText}`,details:c}}}catch(l){const c=(l==null?void 0:l.name)==="AbortError";return{ok:!1,error:{code:c?"TIMEOUT":"NETWORK",message:c?"Request aborted by timeout":(l==null?void 0:l.message)||"Network error"}}}finally{clearTimeout(o)}}function OI({open:t,onOpenChange:a,onSubscriptionSuccess:s,searchQuery:r,filters:i,apiUrl:o="http://localhost:5147"}){const[l,c]=m.useState(""),[h,d]=m.useState(!1),[p,g]=m.useState(null),y=async u=>{if(u.preventDefault(),g(null),!l||!l.includes("@")){g("Please enter a valid email address.");return}d(!0);try{const x=await VI(`${o}/api/leads`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:l,source:"filters_modal",utmCampaign:"jobs_filters",utmMedium:"ui",utmSource:"subscription_modal"}),timeoutMs:1e4});if(!x.ok){g(BI(x.error)),MN({title:"Subscription failed",description:x.error.message});return}localStorage.setItem("leadId",x.data.id),localStorage.setItem("email",l),MN({title:"You're subscribed",description:`We'll notify you at ${l} when new jobs match your criteria.`}),s==null||s(),c("")}finally{d(!1)}};return e.jsx(tt,{open:t,onOpenChange:a,children:e.jsxs(Xe,{className:"sm:max-w-md",children:[e.jsxs(Be,{children:[e.jsxs(Ie,{className:"flex items-center gap-2",children:[e.jsx(ga,{className:"h-5 w-5 text-orange-500"}),"Create Job Alert"]}),e.jsx(nt,{children:"Subscribe to get notified when new jobs matching your search criteria are posted."})]}),e.jsxs("form",{onSubmit:y,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{htmlFor:"email",children:"Email address"}),e.jsxs("div",{className:"relative",children:[e.jsx(Yt,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),e.jsx(ee,{id:"email",type:"email",placeholder:"Enter your email address",value:l,onChange:u=>c(u.target.value),className:"pl-10",required:!0,"aria-invalid":!!p,"aria-describedby":p?"email-error":void 0})]}),p&&e.jsx("p",{id:"email-error",role:"alert",className:"text-sm text-red-600",children:p})]}),r&&e.jsxs("div",{className:"rounded-lg bg-muted p-3 text-sm",children:[e.jsx("p",{className:"font-medium",children:"Alert criteria:"}),e.jsxs("p",{className:"text-muted-foreground",children:['"',r,'"']})]}),e.jsxs(et,{className:"gap-2 sm:gap-0",children:[e.jsx(P,{type:"button",variant:"outline",onClick:()=>a(!1),disabled:h,children:"Cancel"}),e.jsx(P,{type:"submit",disabled:h,children:h?"Creating Alert...":"Create Alert"})]})]})]})})}function qC(){const t="savedJobs",[a,s]=m.useState([]);return m.useEffect(()=>{try{const o=localStorage.getItem(t);o&&s(JSON.parse(o))}catch(o){console.error("Failed to load saved jobs:",o)}},[]),{savedJobs:a,toggleJob:o=>{s(l=>{const h=l.includes(o)?l.filter(d=>d!==o):[...l,o];try{localStorage.setItem(t,JSON.stringify(h))}catch(d){console.error("Failed to persist saved jobs:",d)}return h})},isSaved:o=>o?a.includes(o):!1}}const GI=({value:t,options:a,onChange:s})=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Order by"}),e.jsxs("div",{className:"relative",children:[e.jsx("select",{"aria-label":"Order results",value:t,onChange:r=>s(r.target.value),className:"block w-full rounded-lg border border-gray-300 bg-white px-3 py-2 pr-9 text-sm text-gray-700 shadow-sm focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-100",children:a.map(r=>e.jsx("option",{value:r.value,children:r.label},r.value))}),e.jsx("span",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 text-gray-400",children:"▼"})]})]}),UI=6,pM={jobTypes:[],experienceLevels:[],country:"",city:"",location:"",minSalary:"",maxSalary:"",industry:""},_I=({apiUrl:t,itemsPerPage:a=12,filterKeys:s,banner:r,enableMobileFilter:i=!0,cardType:o,dateField:l="created_at",dateFieldLabel:c="Published",searchableFilters:h=["companies"],notification_url:d="http://localhost:5147",userAccess:p,onEmitEvent:g,eventContext:y,onPopularTagClick:u,onPopularTagRemove:x,allowPopularTagRemoval:v=!1})=>{var cN;const[f,k]=m.useState([]),[w,j]=m.useState([]),[b,T]=m.useState([]),[S,N]=m.useState(1),[L,I]=m.useState({}),[A,C]=m.useState([]),[M,R]=m.useState({}),[D,H]=m.useState(""),[G,E]=m.useState([]),[W,J]=m.useState(!1),[Y,re]=m.useState(a),[oe,$]=m.useState("grid"),[Q,de]=m.useState(!1),[ve,he]=m.useState([]),[te,O]=m.useState(!0),[X,F]=m.useState(null),[z,B]=m.useState("all"),[ce,ue]=m.useState(!1),[Ne,xt]=m.useState(!1),[ot,me]=m.useState({...pM}),[Fe,It]=m.useState({open:!1,type:"info",message:""}),[dt,_t]=m.useState("date_desc"),{savedJobs:ta,toggleJob:zs}=qC(),jt=tM(p),rt=m.useMemo(()=>({component:"Listing",...y??{}}),[y]),ls=m.useMemo(()=>[{value:"relevance",label:"Best match (relevance)"},{value:"date_desc",label:`${c} (newest)`},{value:"date_asc",label:`${c} (oldest)`},{value:"views_desc",label:"Most viewed"},{value:"views_asc",label:"Least viewed"},{value:"title_asc",label:"Title A → Z"}],[c]),it=m.useCallback((K,pe)=>{g&&g({domain:"jobs",name:K,payload:pe,timestamp:new Date().toISOString(),context:rt})},[rt,g]),wa=m.useCallback((K,pe)=>{g&&g({domain:"newsletter",name:K,payload:pe,timestamp:new Date().toISOString(),context:rt})},[rt,g]),pa=m.useCallback(async K=>{wa("newsletter_subscribe_requested",K)},[wa]),aa=m.useCallback(()=>({filters:{...L},advancedFilters:ot,dateFilter:z}),[L,z,ot]),qa=m.useCallback(()=>({page:S,pageSize:Y,totalResults:w.length,viewMode:oe,showOnlySaved:Q}),[S,w.length,Y,Q,oe]),sa=m.useRef(!1),Ma=(K,pe)=>{It({open:!0,type:K,message:pe})};m.useEffect(()=>{try{const K=localStorage.getItem("lastVisitedJobs");K&&he(JSON.parse(K));try{localStorage.getItem("email")&&xt(!0)}catch(pe){console.error("Error checking subscription state:",pe)}}catch(K){console.error("Error loading data from localStorage:",K)}},[]),m.useEffect(()=>{const pe=new URLSearchParams(window.location.search).get("date_filter");pe&&pe!=="all"&&B(pe)},[]),m.useEffect(()=>{if(!t){F("❌ Missing API URL for Listing component!"),O(!1);return}O(!0),F(null),(async()=>{try{const pe=await fetch(t);if(!pe.ok)throw new Error(`API responded with status: ${pe.status}`);const we=await pe.json();if(!Array.isArray(we))throw new Error("Expected an array but received: "+typeof we);const qe=we.map((Ht,Na)=>({...Ht,sponsored:Na%7===0,topTag:AC(Ht.title||"")})),mt=Array.from(new Set(qe.map(Ht=>Ht.topTag).filter(Ht=>typeof Ht=="string"))).slice(0,10);T(mt);const ra=Al(qe,dt,A,l);k(qe),j(ra);const Fa=pl(qe,s);R(Fa)}catch(pe){console.error("Error fetching data:",pe),F(`Failed to load data: ${pe instanceof Error?pe.message:String(pe)}`);const we=jI(20),qe=Al(we,dt,A,l);k(we),j(qe);const mt=pl(we,s);R(mt)}finally{O(!1)}})()},[t,l,A,dt]),m.useEffect(()=>{const K=new URLSearchParams(window.location.search),pe={};s.forEach(mt=>{const ra=K.get(mt);ra&&(pe[mt]=ra)}),I(pe);const we=K.get("q")||K.get("searchTerm")||"";we&&H(we);const qe={};s.forEach(mt=>{const ra=K.get(mt);ra&&(qe[mt]=ra)}),I(qe)},[]),m.useEffect(()=>{if(Q){const K=f.filter(we=>ta.includes(we.id||we.slug||we.link)),pe=Al(K,dt,A,l);j(pe),N(1)}else Wt()},[]),m.useEffect(()=>{sa.current||te||!w.length&&!f.length||(it("jobs_listing_viewed",{...aa(),...qa()}),sa.current=!0)},[f.length,it,w.length,aa,qa,te]);const $t=m.useCallback(K=>{const pe=pl(K,s);R(pe)},[s]),Wt=m.useCallback(K=>{const pe=(K==null?void 0:K.baseItems)??f,we=(K==null?void 0:K.filters)??L,qe=(K==null?void 0:K.search)??A,mt=(K==null?void 0:K.dateFilter)??z,ra=(K==null?void 0:K.advanced)??ot;let Fa=Yi(pe,we,qe,mt,l);Fa=AI(Fa,ra);const Ht=Al(Fa,dt,qe,l);return j(Ht),((K==null?void 0:K.resetPage)??!0)&&N(1),((K==null?void 0:K.refreshFiltersData)??!0)&&$t(Ht),Ht},[z,L,ot,f,l,A,dt,$t]);m.useEffect(()=>{Wt({resetPage:!1,refreshFiltersData:!1})},[dt,Wt]);const fe=(K,pe)=>{const we={...L};pe?we[K]=pe:delete we[K],Q&&de(!1),I(we),Wt({filters:we});const qe={...aa(),filters:we};pe?it("jobs_filter_selected",{key:K,value:pe,...qe}):it("jobs_filter_cleared",{key:K,...qe})},Ae=()=>{xt(!0),be().then(()=>ue(!1))},Re=m.useRef(null),He=K=>{N(K),it("jobs_listing_page_changed",{page:K,pageSize:Y,totalResults:w.length}),setTimeout(()=>{var pe;(pe=Re.current)==null||pe.scrollIntoView({behavior:"smooth",block:"start"})},100)},Le=K=>{Q&&de(!1),B(K),Wt({dateFilter:K}),TC(K),it("jobs_date_filter_changed",{dateFilter:K})},Qe=K=>{if(H(K),K){const pe=f.map(we=>we.title).filter((we,qe,mt)=>we&&we.toLowerCase().includes(K.toLowerCase())&&mt.indexOf(we)===qe).slice(0,5);E(pe)}else E([])},lt=K=>{if(!K.trim())return;Q&&de(!1);const pe=[...A,K.trim()];C(pe),Wt({search:pe}),H(""),it("jobs_search_submitted",{searchKeywords:pe,query:K.trim(),...aa()})},ye=K=>{const pe=A.filter(we=>we!==K);C(pe),Wt({search:pe}),it("jobs_search_filter_removed",{removedKeyword:K,remainingKeywords:pe})},Z=()=>{I({}),C([]),de(!1),B("all"),me({...pM}),Wt({filters:{},search:[],dateFilter:"all",advanced:pM}),it("jobs_filters_cleared_all",{})},le=K=>{const pe=new Set,we=[];for(const qe of K){const mt=`${qe.key??""}|${qe.value.toLowerCase()}`;pe.has(mt)||(pe.add(mt),we.push(qe))}return we},ge=K=>K.replace(/\/+$/,""),be=async()=>{if(it("jobs_alert_cta_clicked",{searchKeywords:A,query:D.trim()||void 0,...aa()}),!Ne)ue(!0),it("jobs_subscription_modal_opened",{});else{const K=localStorage.getItem("email"),pe=localStorage.getItem("leadId");if(!K||!pe){Ma("info","Please subscribe first to create alerts.");return}const we="keyword",qe=(ia,Ha)=>Ha&&Ha.trim()?{key:ia.toLowerCase(),value:Ha.trim()}:null,mt=Object.entries(L).map(([ia,Ha])=>qe(ia,Ha)).filter(ia=>ia!==null),ra=A.map(ia=>qe(we,ia)).filter(ia=>ia!==null),Fa=qe(we,D),Ht=Fa?[Fa]:[],Na=le([...mt,...ra,...Ht]);if(Na.length===0){Ma("info","No filters/keywords to save.");return}try{const ia=ge(d??"http://localhost:5147"),Ha=await fetch(`${ia}/api/leads/${pe}/preferences/bulk`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Na)});if(!Ha.ok){let Sl="";try{Sl=await Ha.text()}catch{}throw new Error(`${Ha.status} ${Ha.statusText} ${Sl}`.trim())}Ma("success","Alert saved. We’ll notify you about new matching jobs."),H(""),it("jobs_alert_created",{preferences:Na.filter(Sl=>Sl!==null)})}catch(ia){console.error("Create alert failed:",ia),Ma("error","Failed to save alert.")}}},De=()=>{J(!W)},Rt=w.length===0?0:(S-1)*Y+1,We=Math.min(S*Y,w.length),ht=K=>{re(K),N(1),it("jobs_listing_items_per_page_changed",{pageSize:K})},Fo=()=>{$(K=>{const pe=K==="grid"?"list":"grid";return it("jobs_listing_viewmode_changed",{viewMode:pe}),pe})},wt=(K,pe,we="same_tab",qe="listing")=>{const mt=K.id||K.slug||K.link;mt&&(he(ra=>{const Fa=ra.filter(Na=>(Na.id||Na.slug||Na.link)!==mt),Ht=[K,...Fa].slice(0,UI);try{localStorage.setItem("lastVisitedJobs",JSON.stringify(Ht))}catch(Na){console.error("Error saving to localStorage:",Na)}return Ht}),it("job_opened",{jobId:mt,slug:K.slug,positionInList:pe,openedFrom:qe,openedIn:we}))},na=(K,pe)=>{const we=K.id||K.slug||K.link;if(!we)return;const qe=ta.includes(we);zs(we),it(qe?"job_unsaved":"job_saved",{jobId:we,slug:K.slug,positionInList:pe})},rM=(K,pe,we="external")=>{const qe=K.id||K.slug||K.link;qe&&it("job_apply_clicked",{jobId:qe,slug:K.slug,positionInList:pe,applyType:we})},lN=()=>{de(!Q)},K9=Math.ceil(w.length/Y),X9=w.slice((S-1)*Y,S*Y);return X&&!f.length?e.jsx("div",{className:"flex-grow p-8",children:e.jsx("div",{className:"max-w-7xl mx-auto",children:e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-800 rounded-lg p-6",children:[e.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Error Loading Jobs"}),e.jsx("p",{className:"mb-4",children:X}),e.jsx("button",{onClick:()=>window.location.reload(),className:"bg-red-100 hover:bg-red-200 text-red-800 font-medium py-2 px-4 rounded",children:"Retry"})]})})}):e.jsxs("div",{className:"flex flex-col min-h-screen pb-16 md:pb-0",children:[e.jsxs("div",{className:"flex-grow",children:[e.jsx(KM,{onSearchChange:Qe,searchPlaceholder:"Search jobs, companies, or keywords...",title:"Job Listings",description:"",popularTags:b,generateHref:K=>`/jobs?q=${K.toLowerCase().replace(/\s+/g,"+")}`,onTagClick:u,onTagRemove:x,allowTagRemoval:v}),e.jsxs("div",{className:"container mx-auto py-8 pb-20 md:pb-8",children:[e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"relative flex items-center gap-2 sm:my-6 my-2",children:[e.jsx(IC,{data:f.map(K=>K.title).filter(Boolean),onSelect:K=>{lt(K)},onTyping:K=>{H(K),Qe(K)},placeholder:"Search for jobs, companies, or keywords...",className:"w-full",showSubmitButton:!0}),e.jsx("button",{className:"block md:hidden flex items-center justify-center p-3 bg-white border-2 border-gray-200 text-gray-700 rounded-xl hover:border-gray-300 hover:bg-gray-50 transition-all duration-200 focus:ring-4 focus:ring-gray-200 focus:outline-none hover:scale-105",onClick:De,children:e.jsx(ws,{size:16,className:"mr-1.5"})})]}),e.jsx("div",{className:"relative flex items-center gap-2 sm:my-6 my-2",children:e.jsx(XM,{filters:[...z!=="all"?[{key:"date",label:c,value:z.replace(/_/g," "),onRemove:()=>Le("all")}]:[],...A.map(K=>({key:"search",label:"",value:K,onRemove:()=>ye(K)})),...Object.entries(L).map(([K,pe])=>({key:K,label:K.replace(/_/g," "),value:pe,onRemove:()=>fe(K,"")}))],onClearAll:Z,handleCreateAlert:be})})]}),i&&e.jsxs("button",{className:"md:hidden w-full mb-6 px-4 py-3 bg-yellow-600 text-white rounded-lg flex items-center justify-center",onClick:De,"aria-expanded":W,children:[e.jsx(ws,{className:"w-4 h-4 mr-2"}),W?"Close Filters":"Filters"]}),e.jsxs("div",{className:"flex flex-col lg:flex-row lg:gap-6",children:[e.jsx(RC,{dateFieldLabel:"Date",activeDateFilter:z,onDateFilterChange:Le,filterKeys:s,searchableFilters:h,filtersData:M,activeFilters:L,handleFilterChange:fe,toggleSavedJobsFilter:lN,showOnlySaved:Q,savedJobs:ta}),te?e.jsx(ua,{}):e.jsxs("div",{className:"lg:gap-6 w-fit",children:[e.jsx(PC,{viewMode:oe,onToggleViewMode:Fo,selectedItemsPerPage:Y,onItemsPerPageChange:ht,totalCount:w.length,startIndex:Rt,endIndex:We,title:"Latest Jobs"}),e.jsxs("div",{className:"",children:[e.jsx("div",{className:"mb-6",children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("h3",{className:"text-xl font-semibold text-gray-900 flex items-center",children:[Q?"Saved Jobs":"Open Positions",z!=="all"&&!Q&&e.jsxs("span",{className:"text-sm font-normal text-gray-500 ml-2",children:["(",z.replace(/_/g," "),")"]})]}),e.jsxs("p",{className:"text-sm text-gray-600",children:[e.jsx("span",{className:"font-semibold text-gray-900",children:w.length})," found"]})]}),e.jsx(GI,{value:dt,options:ls,onChange:_t})]})}),e.jsx(SI,{items:X9,cardType:o,viewMode:oe,savedJobs:ta,onSaveJob:na,onViewJob:wt,onApplyJob:rM,firstItemRef:Re,userAccess:jt}),w.length>0&&e.jsx("div",{className:"mt-6",children:e.jsx(sM,{currentPage:S,totalPages:K9,onPageChange:He})})]}),ve.length>0&&e.jsx("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-5",children:e.jsx(LI,{jobs:ve,onViewJob:wt})})]}),e.jsx("div",{className:"hidden lg:block lg:w-1/4 space-y-6",children:((cN=r==null?void 0:r.sidebar)==null?void 0:cN.enabled)&&e.jsxs("div",{className:"sticky top-4",children:[e.jsx(Do,{position:"sidebar",url:r.sidebar.url,link:r.sidebar.link,alt:r.sidebar.alt}),e.jsx(Q8,{onSubscribe:pa}),e.jsxs("div",{className:"mt-6 bg-white rounded-lg shadow-sm border border-gray-200 p-5",children:[e.jsx("h3",{className:"font-semibold text-lg mb-3",children:"Featured Employers"}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:[...Array(6)].map((K,pe)=>e.jsx("div",{className:"flex items-center justify-center p-2 bg-gray-50 rounded-md",children:e.jsx("img",{src:`/placeholder.svg?height=40&width=40&text=${String.fromCharCode(65+pe)}`,alt:`Featured employer ${pe+1}`,className:"w-10 h-10 object-contain"})},pe))})]})]})})]})]})]}),e.jsx(LC,{activeDateFilter:z,handleDateFilterChange:Le,filterKeys:s,searchableFilters:h,dateFieldLabel:c,activeFilters:L,handleFilterChange:fe,toggleSavedJobsFilter:lN,filtersData:M,savedJobs:ta,showOnlySaved:Q,isMobileFilterOpen:W,toggleMobileFilter:De}),e.jsx(oo,{}),e.jsx(NC,{open:Fe.open,type:Fe.type,message:Fe.message,onClose:()=>It(K=>({...K,open:!1}))}),e.jsx(OI,{open:ce,onOpenChange:ue,onSubscriptionSuccess:Ae,apiUrl:d})]})},FC=ie.forwardRef(({className:t,...a},s)=>e.jsxs(_o.Root,{ref:s,className:ne("relative flex w-full touch-none select-none items-center",t),...a,children:[e.jsx(_o.Track,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:e.jsx(_o.Range,{className:"absolute h-full bg-primary"})}),e.jsx(_o.Thumb,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));FC.displayName=_o.Root.displayName;const HC=({title:t="Filters",sections:a,onFilterChange:s,onClearAll:r,activeFiltersCount:i,maxVisible:o=5,rangeConfig:l,savedCount:c=0,showSavedOnly:h=!1,onToggleSavedOnly:d,savedLabel:p="Saved Items",className:g=""})=>e.jsxs("div",{className:`bg-card rounded-lg shadow-sm border border-border sticky top-24 max-h-[calc(100vh-7rem)] overflow-y-auto scrollbar-thin ${g}`,children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Xa,{className:"w-5 h-5 text-accent"}),e.jsx("h2",{className:"font-semibold text-foreground",children:t}),i>0&&e.jsx("span",{className:"bg-accent text-accent-foreground text-xs font-bold px-2 py-0.5 rounded-full",children:i})]}),i>0&&e.jsx("button",{onClick:r,className:"text-sm text-accent hover:underline",children:"Clear all"})]}),e.jsxs("div",{className:"p-4 space-y-4",children:[a.map(y=>e.jsx($I,{section:y,onFilterChange:s,maxVisible:o,rangeConfig:l},y.key)),d&&e.jsx("div",{className:"pt-4 border-t border-border",children:e.jsxs("button",{onClick:d,className:`w-full px-4 py-2.5 rounded-lg flex items-center justify-center gap-2 transition-colors ${h?"bg-accent text-accent-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,children:[e.jsx(St,{className:"w-4 h-4"}),e.jsxs("span",{className:"font-medium",children:[p," (",c,")"]})]})})]})]}),$I=({section:t,onFilterChange:a,maxVisible:s,rangeConfig:r})=>{var b,T,S;const[i,o]=m.useState(t.defaultExpanded??!0),[l,c]=m.useState(""),[h,d]=m.useState(!1),p=t.maxVisible??s,g=m.useMemo(()=>{var A;const N=((A=t.options)==null?void 0:A.filter(C=>C.label.toLowerCase().includes(l.toLowerCase())))||[],L=N.filter(C=>t.selectedValues.includes(C.value)),I=N.filter(C=>!t.selectedValues.includes(C.value));return[...L,...I]},[t.options,l,t.selectedValues]),y=m.useMemo(()=>h||p>=g.length?g:g.slice(0,p),[g,h,p]),u=g.length>p,x=t.searchable!==!1&&(((b=t.options)==null?void 0:b.length)||0)>6,v=N=>{const L=t.selectedValues.includes(N)?t.selectedValues.filter(I=>I!==N):[...t.selectedValues,N];a(t.key,L)},f=N=>{a(t.key,N?[N]:[])},k=t.rangeConfig??r,w=t.selectedValues.length===2?t.selectedValues.map(Number):k?[k.min,k.max]:[0,100],j=N=>{if(k!=null&&k.formatLabel)return k.formatLabel(N);const L=(k==null?void 0:k.unit)||"";return((k==null?void 0:k.unitPosition)||"prefix")==="prefix"?`${L}${N.toLocaleString()}`:`${N.toLocaleString()}${L}`};return e.jsxs("div",{className:"border-b border-border pb-4 last:border-b-0 last:pb-0",children:[t.collapsible!==!1?e.jsxs("button",{onClick:()=>o(!i),className:"flex items-center justify-between w-full py-2 text-left",children:[e.jsx("h3",{className:"text-sm font-medium text-foreground",children:t.label}),i?e.jsx(bs,{className:"w-4 h-4 text-muted-foreground"}):e.jsx(Pt,{className:"w-4 h-4 text-muted-foreground"})]}):e.jsx("h3",{className:"text-sm font-medium text-foreground py-2",children:t.label}),i&&e.jsxs("div",{className:"mt-2 space-y-2",children:[x&&t.type==="checkbox"&&e.jsxs("div",{className:"relative mb-3",children:[e.jsx(ft,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx("input",{type:"text",value:l,onChange:N=>c(N.target.value),placeholder:`Search ${t.label.toLowerCase()}...`,className:"w-full h-8 pl-8 pr-8 text-sm rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),l&&e.jsx("button",{onClick:()=>c(""),className:"absolute right-2 top-1/2 -translate-y-1/2",children:e.jsx(Oe,{className:"w-4 h-4 text-muted-foreground hover:text-foreground"})})]}),t.type==="checkbox"&&e.jsxs("div",{className:"space-y-2",children:[y.map(N=>e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer group",children:[e.jsx("input",{type:"checkbox",checked:t.selectedValues.includes(N.value),onChange:()=>v(N.value),className:"h-4 w-4 rounded border-input text-accent focus:ring-accent"}),e.jsx("span",{className:"text-sm text-foreground group-hover:text-accent transition-colors flex-1 truncate",children:N.label}),N.count!==void 0&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",N.count,")"]})]},N.value)),g.length===0&&l&&e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No matching options"}),u&&!l&&e.jsx("button",{onClick:()=>d(N=>!N),className:"text-sm text-accent hover:underline font-medium mt-1",children:h?"View less":`View more (${g.length-p})`})]}),(t.type==="select"||t.type==="searchable-select")&&e.jsxs("select",{value:t.selectedValues[0]||"",onChange:N=>f(N.target.value),className:"w-full h-9 px-3 rounded-md border border-input bg-background text-sm focus:outline-none focus:ring-2 focus:ring-ring",children:[e.jsxs("option",{value:"",children:["All ",t.label]}),(T=t.options)==null?void 0:T.map(N=>e.jsxs("option",{value:N.value,children:[N.label,N.count!==void 0&&` (${N.count})`]},N.value))]}),t.type==="range"&&k&&e.jsxs("div",{className:"space-y-3 px-1",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[e.jsx("span",{children:j(w[0])}),e.jsx("span",{children:j(w[1])})]}),e.jsx(FC,{min:k.min,max:k.max,step:k.step??1,value:w,onValueChange:N=>{a(t.key,N.map(String))},className:"w-full"}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[e.jsx("span",{children:j(k.min)}),e.jsx("span",{children:j(k.max)})]})]}),t.type==="toggle"&&((S=t.options)==null?void 0:S.map(N=>e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:t.selectedValues.includes(N.value),onChange:()=>v(N.value),className:"h-4 w-4 rounded border-input text-accent focus:ring-accent"}),e.jsx("span",{className:"text-sm text-foreground",children:N.label})]},N.value)))]})]})},WI=({isOpen:t,onClose:a,title:s="Filters",children:r})=>t?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 bg-gray-600 bg-opacity-75 z-40",onClick:a}),e.jsxs("div",{className:"fixed inset-y-0 right-0 max-w-xs w-full bg-white shadow-xl z-50 overflow-y-auto",children:[e.jsxs("div",{className:"px-4 py-2 border-b border-gray-200 flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:s}),e.jsx("button",{onClick:a,className:"p-2 rounded-full hover:bg-gray-100","aria-label":"Close filters",children:e.jsx("svg",{className:"h-6 w-6 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsx("div",{className:"p-4",children:r})]})]}):null,EC=({sort:t,viewMode:a,onViewModeChange:s,itemsPerPage:r,onItemsPerPageChange:i,itemsPerPageOptions:o,showItemsPerPage:l=!0,trailingSlot:c,className:h="",summaryTitle:d,startIndex:p,endIndex:g,totalCount:y,itemLabel:u="items"})=>{var k;const[x,v]=m.useState(!1);m.useEffect(()=>{var b;if(typeof window>"u"||typeof window.matchMedia!="function")return;const w=window.matchMedia("(max-width: 767px)"),j=()=>v(w.matches);return j(),(b=w.addEventListener)==null||b.call(w,"change",j),()=>{var T;return(T=w.removeEventListener)==null?void 0:T.call(w,"change",j)}},[]);const f=d&&typeof y=="number"&&typeof p=="number"&&typeof g=="number";return e.jsx("div",{className:`rounded-lg border border-gray-200 bg-white p-4 ${h}`,children:e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row items-center lg:justify-between",children:[e.jsx("div",{className:"flex-1 min-w-0 hidden lg:inline-block",children:f&&e.jsxs("div",{className:"mb-3 hidden lg:block",children:[e.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:d}),e.jsxs("p",{className:"text-sm text-gray-600",children:["Showing ",e.jsx("span",{className:"font-semibold text-gray-900",children:p}),"–",e.jsx("span",{className:"font-semibold text-gray-900",children:g})," of"," ",e.jsx("span",{className:"font-semibold text-gray-900",children:y})," ",u]})]})}),e.jsx("div",{className:"w-full lg:w-auto",children:e.jsxs("div",{className:"flex w-full flex-nowrap items-center gap-1.5 lg:w-auto lg:justify-end",children:[f&&e.jsxs("div",{className:"min-w-0 flex-1 truncate whitespace-nowrap text-xs text-gray-600 lg:hidden",children:[e.jsx("span",{className:"font-semibold text-gray-900",children:p}),"–",e.jsx("span",{className:"font-semibold text-gray-900",children:g})," of"," ",e.jsx("span",{className:"font-semibold text-gray-900",children:y})," ",u]}),t&&((k=t.options)==null?void 0:k.length)>0&&e.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[e.jsx("span",{className:"text-xs text-gray-500 whitespace-nowrap hidden lg:inline-block cursor-pointer select-none",children:t.label??"Order"}),e.jsx("select",{value:t.value,onChange:w=>t.onChange(w.target.value),className:"h-8 w-[7.5rem] pl-3 pr-8 rounded-lg border border-gray-200 bg-gray-50 text-xs lg:w-auto lg:text-sm focus:outline-none focus:ring-2 focus:ring-yellow-500",children:t.options.map(w=>e.jsx("option",{value:w.value,children:w.label},w.value))})]}),a&&s&&!x&&e.jsx(aM,{viewMode:a,onViewModeChange:s}),l&&r!==void 0&&i&&e.jsx(QM,{value:r,onChange:i,options:o,className:"shrink-0",selectClassName:"w-[4rem] lg:w-auto"}),c]})})]})})},BC=({value:t,onChange:a,onSubmit:s,onClear:r,onFilterClick:i,placeholder:o="Search...",suggestions:l=[],onSuggestionSelect:c,showFilterButton:h=!0,filterCount:d=0,className:p=""})=>{const[g,y]=m.useState(!1),u=x=>{x.key==="Enter"&&t.trim()&&(s(t.trim()),y(!1)),x.key==="Escape"&&y(!1)};return e.jsxs("div",{className:`relative ${p}`,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(ft,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-muted-foreground"}),e.jsx("input",{type:"text",value:t,onChange:x=>{a(x.target.value),y(x.target.value.length>0)},onKeyDown:u,onFocus:()=>y(t.length>0&&l.length>0),onBlur:()=>setTimeout(()=>y(!1),200),placeholder:o,className:"w-full h-12 pl-10 pr-20 rounded-lg border border-input bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2"}),t&&r&&e.jsx("button",{onClick:r,"aria-label":"Clear search",className:"absolute right-14 top-1/2 -translate-y-1/2 p-1 hover:bg-muted rounded",children:e.jsx(Oe,{className:"h-4 w-4 text-muted-foreground"})}),e.jsx("button",{onClick:()=>t.trim()&&s(t.trim()),className:"absolute right-2 top-1/2 -translate-y-1/2 bg-accent hover:bg-accent-hover text-accent-foreground p-2 rounded-md transition-colors",children:e.jsx(ft,{className:"h-4 w-4"})})]}),h&&i&&e.jsxs("button",{onClick:i,className:"lg:hidden flex items-center justify-center h-12 w-12 rounded-lg border border-input bg-background hover:bg-muted transition-colors relative",children:[e.jsx(ws,{className:"h-5 w-5 text-muted-foreground"}),d>0&&e.jsx("span",{className:"absolute -top-1 -right-1 bg-accent text-accent-foreground text-xs font-bold w-5 h-5 rounded-full flex items-center justify-center",children:d})]})]}),g&&l.length>0&&e.jsx("ul",{className:"absolute z-20 mt-1 w-full bg-card border border-border rounded-lg shadow-lg max-h-60 overflow-y-auto",children:l.map((x,v)=>e.jsx("li",{children:e.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-foreground hover:bg-muted flex items-center gap-2",onClick:()=>{c==null||c(x),y(!1)},children:[e.jsx(ft,{className:"h-4 w-4 text-muted-foreground"}),x]})},v))})]})},xM=({config:t,className:a=""})=>{const s=t.url.match(/\.(mp4|webm|ogg)$/i),r={sidebar:"w-full max-w-[300px] h-[250px]",top:"w-full h-[48px] md:h-[90px]",bottom:"w-full h-[48px] md:h-[90px]"};return e.jsx("div",{className:`flex justify-center items-center rounded-lg overflow-hidden bg-muted ${a}`,children:e.jsx("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",className:"block",children:s?e.jsxs("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:`${r[t.position]} object-cover`,children:[e.jsx("source",{src:t.url,type:"video/mp4"}),"Your browser does not support the video tag."]}):e.jsx("img",{src:t.url,alt:t.alt??"Advertisement",className:`${r[t.position]} object-cover`})})})},ja=({title:t,description:a,headerPopularTags:s=[],sponsoredSlot:r,sidebarSlot:i,filtersPanel:o,mobileFiltersPanel:l,filters:c,filterValues:h,onFilterChange:d,onClearFilters:p,activeFilters:g,search:y,sort:u,viewMode:x,onViewModeChange:v,pagination:f,showToolbar:k=!0,toolbarTrailingSlot:w,resultsClassName:j="",banner:b,headerActions:T,children:S,maxFiltersVisible:N=5})=>{const[L,I]=m.useState(!1),[A,C]=m.useState(""),M=()=>I(!0);m.useEffect(()=>{if(typeof window>"u")return;const $=new URLSearchParams(window.location.search),Q=$.get("searchTerm")??$.get("q")??"";y&&Q&&(C(Q),y.onChange(Q),y.onSubmit&&y.onSubmit!==y.onChange&&y.onSubmit(Q)),!(!c||!d)&&c.forEach(de=>{const ve=[...$.getAll(de.key),...$.getAll(`filters[${de.key}]`)],he=Array.from(new Set(ve.flatMap(te=>te.split(",")).map(te=>te.trim()).filter(Boolean)));he.length>0&&d(de.key,he)})},[]);const R=!!(o||c&&c.length>0),D=m.useMemo(()=>c?c.map($=>({...$,selectedValues:(h==null?void 0:h[$.key])??[]})):[],[c,h]),H=m.useMemo(()=>h?Object.values(h).reduce(($,Q)=>$+Q.length,0):g?g.length:0,[h,g]),G=(f==null?void 0:f.toolbarTotalCount)??(f==null?void 0:f.totalCount)??0,E=f&&G>0?(f.page-1)*f.pageSize+1:0,W=f&&G>0?Math.min(f.page*f.pageSize,G):0,J=m.useMemo(()=>o||(c&&d&&p?e.jsx(HC,{sections:D,onFilterChange:d,onClearAll:p,activeFiltersCount:H,maxVisible:N}):null),[o,c,d,p,D,H]),Y=l??J,re=m.useMemo(()=>{const $=g?[...g]:[],Q=A.trim();return Q&&!$.some(de=>de.key==="searchTerm"&&de.value===Q)&&$.unshift({key:"searchTerm",label:"Search",value:Q,onRemove:()=>{C(""),y!=null&&y.onClear?y.onClear():y!=null&&y.onChange&&y.onChange("")}}),$},[g,y,A]),oe=()=>{p==null||p(),C(""),y!=null&&y.onClear?y.onClear():y!=null&&y.onChange&&y.onChange("")};return e.jsxs("div",{className:"bg-gray-50",children:[e.jsx(KM,{onSearchChange:()=>{},title:t,description:a,sponsoredSlot:r,popularTags:s}),T&&e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-4 flex justify-end",children:T}),e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6",children:[y&&e.jsx("div",{className:"mb-4",children:e.jsx(BC,{value:y.value,onChange:y.onChange,onSubmit:$=>{const Q=$.trim();Q&&C(Q),y.onSubmit($)},onClear:()=>{C(""),y.onClear?y.onClear():y.onChange("")},placeholder:y.placeholder,suggestions:y.suggestions,onSuggestionSelect:y.onSuggestionSelect,onFilterClick:R?M:void 0,filterCount:H,showFilterButton:R})}),k&&e.jsx(EC,{sort:u,viewMode:x,onViewModeChange:v,itemsPerPage:f==null?void 0:f.pageSize,onItemsPerPageChange:f==null?void 0:f.onPageSizeChange,itemsPerPageOptions:f==null?void 0:f.pageSizeOptions,showItemsPerPage:(f==null?void 0:f.showItemsPerPage)!==!1,trailingSlot:w,summaryTitle:(f==null?void 0:f.toolbarTitle)??t,totalCount:G,startIndex:E,endIndex:W,itemLabel:(f==null?void 0:f.toolbarItemLabel)??"items"}),re.length>0&&e.jsx("div",{className:"mt-4",children:e.jsx(XM,{filters:re,onClearAll:oe})}),e.jsxs("div",{className:"mt-6 flex flex-col gap-6 lg:flex-row",children:[J&&e.jsxs("aside",{className:"hidden lg:block lg:w-72 space-y-4",children:[J,b&&b.position==="sidebar"&&e.jsx(xM,{config:b})]}),e.jsxs("div",{className:`flex-1 ${j}`,children:[b&&b.position==="top"&&e.jsx("div",{className:"mb-4",children:e.jsx(xM,{config:b})}),S,b&&b.position==="bottom"&&e.jsx("div",{className:"mt-4",children:e.jsx(xM,{config:b})}),f&&f.enabled!==!1&&e.jsx(sM,{currentPage:f.page,totalPages:f.totalPages,onPageChange:f.onPageChange})]}),i&&e.jsx("aside",{className:"lg:w-72",children:i})]})]}),Y&&e.jsx(WI,{isOpen:L,onClose:()=>I(!1),children:Y})]})},xl=["categories","jobType","salaryRange","created","company","country","city","department","workplace","companySize"],ZI={created_at:"created",createdAt:"created",published_at:"created",publishedAt:"created",job_type:"jobType",company_size:"companySize",deparment:"department"},NN=t=>{const a=[];return t.forEach(s=>{const r=ZI[s]??s;xl.includes(r)&&!a.includes(r)&&a.push(r)}),a.length>0?a:[...xl]},JI=[{value:"full-time",label:"Full-time"},{value:"part-time",label:"Part-time"},{value:"intern",label:"Intern"},{value:"seasonal",label:"Seasonal"},{value:"contract",label:"Contract"}],YI=[{value:"today",label:"Today"},{value:"this_week",label:"This week"},{value:"last_week",label:"Last week"},{value:"this_month",label:"This month"},{value:"last_3_months",label:"Last 3 months"},{value:"this_year",label:"This year"}],KI=[{value:"remote",label:"Remote"},{value:"hybrid",label:"Hybrid"},{value:"onsite",label:"On-site"}],XI=["company","country","city"],U8=(t,a)=>{if(typeof t=="string"){const s=t.trim();if(!s)return"";const r=s.match(new RegExp(`['"]${a}['"]\\s*:\\s*['"]([^'"]+)['"]`,"i"));if(r!=null&&r[1])return r[1].trim();if(s.startsWith("{")&&s.endsWith("}")){const i=s.replace(/([{,]\s*)'([^']+)'\s*:/g,'$1"$2":').replace(/:\s*'([^']*)'/g,': "$1"');try{const o=JSON.parse(i);return U8(o,a)}catch{return s}}return s}if(Array.isArray(t))return t.map(s=>U8(s,a)).find(Boolean)??"";if(t&&typeof t=="object"){const s=t,r=[a,"name","label","value","title"];for(const i of r){const o=s[i],l=U8(o,a);if(l)return l}}return""},Ro=(t,a)=>{const s=t[a];return U8(s,a)},QI=t=>{const a=Ro(t,"workplace")||Ro(t,"workplace_type");if(a)return a.toLowerCase();const s=(t.location??"").toLowerCase();return s.includes("remote")?"remote":s.includes("hybrid")?"hybrid":"onsite"},eA=(t,{optionSort:a="alphabetical",showOptionCounts:s=!0})=>{const r=t.reduce((i,o)=>{const l=o.trim();return l&&i.set(l,(i.get(l)??0)+1),i},new Map);return Array.from(r.entries()).sort(([i,o],[l,c])=>a==="count_desc"?c-o||i.localeCompare(l):a==="count_asc"&&o-c||i.localeCompare(l)).map(([i,o])=>({value:i,label:i,...s?{count:o}:{}}))},tA=(t,a,s={})=>{const r=s.multiSelectKeys??XI;return a.map(i=>{if(i==="jobType")return{key:i,label:"Job Type",type:"checkbox",options:JI};if(i==="salaryRange"){const p=Math.max(1e5,...t.flatMap(g=>[Number(g.min_salary??0),Number(g.max_salary??0)]));return{key:i,label:"Salary Range",type:"range",rangeConfig:{min:0,max:p,step:1e3,unit:"$",unitPosition:"prefix"}}}if(i==="created")return{key:i,label:"Created",type:"checkbox",options:YI};if(i==="workplace")return{key:i,label:"Remote / Hybrid / On-site",type:"checkbox",options:KI};const o={categories:"Categories",company:"Company",country:"Country",city:"City",department:"Department",companySize:"Company Size"},l={categories:"category",company:"company",country:"country",city:"city",department:"department",companySize:"company_size"},c=eA(t.map(p=>Ro(p,l[i])),s),h=r.includes(i),d=["company","country","city"].includes(i);return{key:i,label:o[i],type:d&&!h?"searchable-select":"checkbox",searchable:i==="categories"||i==="department"||d&&h,options:c}})},aA=t=>new Date(t.created_at??t.published_at??t.scraped_at??0),sA=(t,a)=>{const s=new Date,r=aA(t);if(Number.isNaN(r.getTime()))return!1;const i=24*60*60*1e3,o=s.getTime()-r.getTime();switch(a){case"today":return r.toDateString()===s.toDateString();case"this_week":return o<=7*i;case"last_week":return o>7*i&&o<=14*i;case"this_month":return r.getMonth()===s.getMonth()&&r.getFullYear()===s.getFullYear();case"last_3_months":return o<=90*i;case"this_year":return r.getFullYear()===s.getFullYear();default:return!0}},nA=(t,a,s)=>{if(s.length===0)return!0;if(a==="salaryRange"){if(s.length<2)return!0;const[l,c]=s.map(Number),h=Number(t.min_salary??0),d=Number(t.max_salary??h);return!Number.isNaN(l)&&!Number.isNaN(c)&&d>=l&&h<=c}if(a==="created")return s.some(l=>sA(t,l));if(a==="jobType"){const l=Ro(t,"job_type")||Ro(t,"type");return s.includes(l.toLowerCase())}if(a==="workplace")return s.includes(QI(t));const i=Ro(t,{categories:"category",company:"company",country:"country",city:"city",department:"department",companySize:"company_size"}[a]).toLowerCase();return s.map(l=>l.toLowerCase()).includes(i)},rA=[{value:"date_desc",label:"Newest"},{value:"date_asc",label:"Oldest"},{value:"title_asc",label:"Title (A-Z)"},{value:"company_asc",label:"Company (A-Z)"}],CN="savedJobs",iA=["vip","casino","marketing","sportsbook","compliance","money laundering","igaming","payments","crm","ai"],Pl=t=>new Date(t.created_at??t.published_at??t.scraped_at??0).getTime(),yM=t=>{if(typeof t=="string")return t;if(t&&typeof t=="object"){const a=t,s=a.name??a.label??a.value;return typeof s=="string"?s:""}return""},oA=({apiUrl:t,itemsPerPage:a=12,filterKeys:s,filterOptions:r,enablePagination:i=!0,enableMobileFilter:o=!0,searchableFilters:l=["company"],filterDisplayConfig:c,banner:h,cardType:d="job",userAccess:p,onEmitEvent:g,eventContext:y,initialJobs:u})=>{var X;const[x,v]=m.useState(u??[]),[f,k]=m.useState(!u),[w,j]=m.useState(""),[b,T]=m.useState({}),[S,N]=m.useState(1),[L,I]=m.useState(a),[A,C]=m.useState("date_desc"),[M,R]=m.useState("grid"),[D,H]=m.useState([]),G=tM(p),E=m.useMemo(()=>{const F=r??s??[...xl];return NN(F)},[s,r]),W=m.useMemo(()=>({...c,multiSelectKeys:c!=null&&c.multiSelectKeys?NN(c.multiSelectKeys):void 0}),[c]);m.useEffect(()=>{try{const F=localStorage.getItem(CN);if(F){const z=JSON.parse(F);Array.isArray(z)&&H(z.filter(B=>typeof B=="string"))}}catch(F){console.error("Failed to load saved jobs",F)}},[]),m.useEffect(()=>{try{localStorage.setItem(CN,JSON.stringify(D))}catch(F){console.error("Failed to persist saved jobs",F)}},[D]),m.useEffect(()=>{if(u)return;let F=!0;const z=async()=>{try{const B=await fetch(t);if(!B.ok)throw new Error("Could not load jobs");const ce=await B.json();F&&Array.isArray(ce)&&v(ce)}catch(B){console.error("Failed to fetch jobs",B),F&&v([])}finally{F&&k(!1)}};return k(!0),z(),()=>{F=!1}},[t,u]),m.useEffect(()=>{if(typeof window>"u")return;const F=new URLSearchParams(window.location.search),z=F.get("searchTerm")??F.get("q")??F.get("skill")??F.get("skills")??"";z&&j(z);const B={};E.forEach(ue=>{const Ne=[...F.getAll(ue),...F.getAll(`filters[${ue}]`),...ue==="created"?F.getAll("created_at"):[],...ue==="created"?F.getAll("filters[created_at]"):[]].flatMap(xt=>xt.split(",")).map(xt=>xt.trim()).filter(Boolean);Ne.length&&(B[ue]=Array.from(new Set(Ne)))});const ce=[...F.getAll("market"),...F.getAll("markets")].flatMap(ue=>ue.split(",")).map(ue=>ue.trim()).filter(Boolean);ce.length>0&&(B.country=Array.from(new Set([...B.country??[],...ce]))),Object.keys(B).length>0&&T(ue=>({...ue,...B}))},[E]);const J=m.useMemo(()=>tA(x,E,W).map(F=>({...F,searchable:F.searchable??l.includes(F.key)})),[x,W,E,l]),Y=m.useMemo(()=>{const F=w.trim().toLowerCase();return x.filter(z=>{const B=yM(z.company);return!F||`${z.title} ${B} ${z.location??""}`.toLowerCase().includes(F)?Object.entries(b).every(([ue,Ne])=>Ne.length===0||!xl.includes(ue)?!0:nA(z,ue,Ne)):!1})},[x,w,b]),re=m.useMemo(()=>{const F=[...Y];return F.sort((z,B)=>{switch(A){case"date_asc":return Pl(z)-Pl(B);case"title_asc":return(z.title??"").localeCompare(B.title??"");case"company_asc":return yM(z.company).localeCompare(yM(B.company));case"date_desc":default:return Pl(B)-Pl(z)}}),F},[Y,A]),oe=m.useMemo(()=>{const F=(S-1)*L;return re.slice(F,F+L)},[S,L,re]),$=Math.max(1,Math.ceil(re.length/L));m.useEffect(()=>{N(1)},[w,b,L]);const Q=m.useMemo(()=>{const F={categories:"Categories",jobType:"Job Type",salaryRange:"Salary Range",created:"Created",company:"Company",country:"Country",city:"City",department:"Department",workplace:"Remote / Hybrid / On-site",companySize:"Company Size"},z=(B,ce)=>{var xt;const ue=J.find(ot=>ot.key===B),Ne=(xt=ue==null?void 0:ue.options)==null?void 0:xt.find(ot=>ot.value.toLowerCase()===ce.toLowerCase());return Ne!=null&&Ne.label?Ne.label:ce.split(/\s+/).filter(Boolean).map(ot=>ot.charAt(0).toUpperCase()+ot.slice(1)).join(" ")};return Object.entries(b).flatMap(([B,ce])=>ce.map(ue=>({key:B,value:z(B,ue),label:xl.includes(B)?F[B]:B,onRemove:()=>{T(Ne=>({...Ne,[B]:(Ne[B]??[]).filter(xt=>xt!==ue)}))}})))},[J,b]),de=F=>{const z=String(F.id??F._id??"");z&&H(B=>B.includes(z)?B.filter(ce=>ce!==z):[...B,z])},ve=()=>{},he=m.useCallback((F,z)=>{g&&g({domain:"newsletter",name:F,payload:z,timestamp:new Date().toISOString(),context:{component:"Listing",...y??{}}})},[y,g]),te=m.useCallback(F=>{he(F.name,F.payload)},[he]),O=(X=h==null?void 0:h.sidebar)!=null&&X.enabled?e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"sticky top-4 space-y-6",children:[e.jsx(Do,{position:"sidebar",url:h.sidebar.url,link:h.sidebar.link,alt:h.sidebar.alt}),e.jsx(Q8,{onEmitEvent:te,isAuthenticated:p==null?void 0:p.registered,userEmail:p==null?void 0:p.email}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-5",children:[e.jsx("h3",{className:"font-semibold text-lg mb-3",children:"Featured Employers"}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:[...Array(6)].map((F,z)=>e.jsx("div",{className:"flex items-center justify-center p-2 bg-gray-50 rounded-md",children:e.jsx("img",{src:`/placeholder.svg?height=40&width=40&text=${String.fromCharCode(65+z)}`,alt:`Featured employer ${z+1}`,className:"w-10 h-10 object-contain"})},z))})]})]})}):void 0;return e.jsx(e.Fragment,{children:e.jsx(ja,{title:"Jobs",description:"Discover fresh opportunities across iGaming teams.",headerPopularTags:iA,search:{value:w,onChange:j,onSubmit:j,onClear:()=>j(""),placeholder:"Search jobs"},filters:J,filterValues:b,onFilterChange:(F,z)=>T(B=>({...B,[F]:z})),onClearFilters:()=>T({}),activeFilters:Q,sort:{value:A,options:rA,onChange:C},viewMode:M,onViewModeChange:R,pagination:{enabled:i,page:S,pageSize:L,totalPages:$,totalCount:re.length,toolbarTotalCount:re.length,toolbarTitle:"Latest Jobs",toolbarItemLabel:"jobs",onPageChange:N,onPageSizeChange:I},sidebarSlot:O,resultsClassName:M==="grid"?"grid gap-4 sm:grid-cols-2":"space-y-4",children:f?e.jsx(ua,{totalColumns:L}):oe.length>0?oe.map((F,z)=>{const B=String(F.id??F._id??"");return e.jsx(YM,{job:F,positionInList:(S-1)*L+z,onSaveJob:de,onViewJob:ve,isSaved:!!(B&&D.includes(B)),layout:M==="grid"?"grid":"list",userAccess:G},B||`${F.title}-${z}`)}):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(je,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No jobs found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters."}),e.jsx(P,{variant:"outline",onClick:()=>T({}),children:"Clear all filters"})]})})})},lA=t=>{const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})},cA=t=>t>=1e3?`${(t/1e3).toFixed(1)}k`:t.toString(),dA=({title:t,organizer:a,category:s,format:r,city:i,country:o,date:l,attendeeCount:c,tags:h=[],isFeatured:d=!1,isFree:p=!1,link:g})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card",children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[d&&e.jsx(q,{className:"bg-primary text-primary-foreground",children:"Featured"}),p&&e.jsx(q,{className:"bg-emerald-500/10 text-emerald-600",children:"Free"}),e.jsx(q,{variant:"outline",children:s}),e.jsx(q,{variant:"secondary",children:r})]}),e.jsx("h3",{className:"mb-2 line-clamp-2 text-lg font-semibold text-foreground",children:t}),e.jsxs("p",{className:"mb-3 text-sm text-muted-foreground",children:["by ",a]}),e.jsxs("div",{className:"mb-3 flex flex-wrap gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(da,{className:"h-3.5 w-3.5"}),lA(l)]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Te,{className:"h-3.5 w-3.5"}),i,", ",o]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ze,{className:"h-3.5 w-3.5"}),cA(c)," attendees"]})]}),h.length>0&&e.jsx("div",{className:"mb-4 flex flex-wrap gap-1.5",children:h.slice(0,3).map(y=>e.jsx(q,{variant:"outline",className:"text-xs",children:y},y))}),g&&e.jsx(P,{variant:"outline",size:"sm",className:"w-full",asChild:!0,children:e.jsxs("a",{href:g,target:"_blank",rel:"noopener noreferrer",children:["View Event",e.jsx(bt,{className:"ml-2 h-3.5 w-3.5"})]})})]}),SN=[{id:"event-1",title:"European iGaming Leadership Summit",organizer:"iGaming Career",category:"Conference",format:"In-person",country:"Malta",city:"Valletta",date:"2026-05-12",attendeeCount:1200,tags:["leadership","strategy"],isFeatured:!0,link:"https://example.com/events/leadership-summit"},{id:"event-2",title:"AML Compliance Masterclass",organizer:"Compliance Academy",category:"Workshop",format:"Online",country:"Remote",city:"Remote",date:"2026-04-04",attendeeCount:380,tags:["compliance","aml"],isFree:!0,link:"https://example.com/events/aml-masterclass"},{id:"event-3",title:"Sportsbook Product Roundtable",organizer:"Bet Product Guild",category:"Roundtable",format:"Hybrid",country:"United Kingdom",city:"London",date:"2026-06-19",attendeeCount:540,tags:["sportsbook","product"],link:"https://example.com/events/sportsbook-roundtable"},{id:"event-4",title:"Affiliate Growth Forum",organizer:"Affiliate Network EU",category:"Forum",format:"In-person",country:"Spain",city:"Barcelona",date:"2026-03-21",attendeeCount:750,tags:["affiliate","marketing"],link:"https://example.com/events/affiliate-growth-forum"},{id:"event-5",title:"Responsible Gaming Webinar",organizer:"RG Alliance",category:"Webinar",format:"Online",country:"Remote",city:"Remote",date:"2026-02-28",attendeeCount:910,tags:["responsible-gaming","policy"],isFree:!0,link:"https://example.com/events/rg-webinar"},{id:"event-6",title:"Payments and Fraud Prevention Expo",organizer:"Fintech iGaming Expo",category:"Expo",format:"In-person",country:"Cyprus",city:"Limassol",date:"2026-07-10",attendeeCount:660,tags:["payments","fraud"],isFeatured:!0,link:"https://example.com/events/payments-fraud-expo"}],yt=ie.forwardRef(({className:t,...a},s)=>e.jsx(LM.Root,{className:ne("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",t),...a,ref:s,children:e.jsx(LM.Thumb,{className:ne("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));yt.displayName=LM.Root.displayName;const Je=gt.Root,Ye=gt.Value,Ue=ie.forwardRef(({className:t,children:a,...s},r)=>e.jsxs(gt.Trigger,{ref:r,className:ne("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...s,children:[a,e.jsx(gt.Icon,{asChild:!0,children:e.jsx(jl.ChevronDownIcon,{className:"h-4 w-4 opacity-50"})})]}));Ue.displayName=gt.Trigger.displayName;const VC=ie.forwardRef(({className:t,...a},s)=>e.jsx(gt.ScrollUpButton,{ref:s,className:ne("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(jl.ChevronUpIcon,{className:"h-4 w-4"})}));VC.displayName=gt.ScrollUpButton.displayName;const OC=ie.forwardRef(({className:t,...a},s)=>e.jsx(gt.ScrollDownButton,{ref:s,className:ne("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(jl.ChevronDownIcon,{className:"h-4 w-4"})}));OC.displayName=gt.ScrollDownButton.displayName;const _e=ie.forwardRef(({className:t,children:a,position:s="popper",...r},i)=>e.jsx(gt.Portal,{children:e.jsxs(gt.Content,{ref:i,className:ne("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:s,...r,children:[e.jsx(VC,{}),e.jsx(gt.Viewport,{className:ne("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:a}),e.jsx(OC,{})]})}));_e.displayName=gt.Content.displayName;const hA=ie.forwardRef(({className:t,...a},s)=>e.jsx(gt.Label,{ref:s,className:ne("px-2 py-1.5 text-sm font-semibold",t),...a}));hA.displayName=gt.Label.displayName;const xe=ie.forwardRef(({className:t,children:a,...s},r)=>e.jsxs(gt.Item,{ref:r,className:ne("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...s,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(gt.ItemIndicator,{children:e.jsx(jl.CheckIcon,{className:"h-4 w-4"})})}),e.jsx(gt.ItemText,{children:a})]}));xe.displayName=gt.Item.displayName;const mA=ie.forwardRef(({className:t,...a},s)=>e.jsx(gt.Separator,{ref:s,className:ne("-mx-1 my-1 h-px bg-muted",t),...a}));mA.displayName=gt.Separator.displayName;const uA=["C-level","B2B","Regulators","Affiliates","Tech","Operators","Providers","General"],pA=["In-person","Online","Hybrid"],xA=["Conference","Summit","Expo","Webinar","Meetup","Awards","Hackathon"],yA=({open:t,onOpenChange:a,onSubmit:s})=>{const[r,i]=m.useState(""),[o,l]=m.useState(""),[c,h]=m.useState(""),[d,p]=m.useState(""),[g,y]=m.useState(""),[u,x]=m.useState(""),[v,f]=m.useState(""),[k,w]=m.useState(""),[j,b]=m.useState(""),[T,S]=m.useState(""),[N,L]=m.useState([]),[I,A]=m.useState(!1),[C,M]=m.useState(!1),R=r.trim().length>=3&&o.trim().length>=2&&c&&d&&g.trim().length>=2&&u.trim().length>=2&&v&&j.trim().length>=20,D=E=>{L(W=>W.includes(E)?W.filter(J=>J!==E):[...W,E])},H=()=>{!R||!d||(s==null||s({title:r.trim(),organizer:o.trim(),category:c,format:d,country:g.trim(),city:u.trim(),date:v,endDate:k||void 0,description:j.trim(),link:T.trim()||void 0,audience:N,isFree:I}),M(!0))},G=()=>{i(""),l(""),h(""),p(""),y(""),x(""),f(""),w(""),b(""),S(""),L([]),A(!1),M(!1),a(!1)};return e.jsx(tt,{open:t,onOpenChange:G,children:e.jsx(Xe,{className:"sm:max-w-[560px]",children:C?e.jsxs(e.Fragment,{children:[e.jsxs(Be,{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-gaming-success/10 flex items-center justify-center mx-auto mb-4",children:e.jsx(Ct,{className:"w-8 h-8 text-gaming-success"})}),e.jsx(Ie,{children:"Event Submitted!"}),e.jsx(nt,{className:"text-center",children:"Thank you for submitting your event. It will appear on the calendar after review (usually within 24-48 hours)."})]}),e.jsx(et,{children:e.jsx(P,{variant:"accent",onClick:G,className:"w-full",children:"Done"})})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Be,{children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-accent/10 flex items-center justify-center mb-2",children:e.jsx(da,{className:"w-6 h-6 text-accent"})}),e.jsx(Ie,{children:"Submit an Event"}),e.jsx(nt,{children:"Add your iGaming event to our calendar. All submissions are reviewed before publishing."})]}),e.jsxs("div",{className:"space-y-4 py-2 max-h-[60vh] overflow-y-auto",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Event Name *"}),e.jsx(ee,{placeholder:"e.g. ICE London 2026",value:r,onChange:E=>i(E.target.value),maxLength:150})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Organizer *"}),e.jsx(ee,{placeholder:"e.g. Clarion Gaming",value:o,onChange:E=>l(E.target.value),maxLength:100})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Event Type *"}),e.jsxs(Je,{value:c,onValueChange:h,children:[e.jsx(Ue,{children:e.jsx(Ye,{placeholder:"Select type"})}),e.jsx(_e,{children:xA.map(E=>e.jsx(xe,{value:E,children:E},E))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Format *"}),e.jsxs(Je,{value:d,onValueChange:E=>p(E),children:[e.jsx(Ue,{children:e.jsx(Ye,{placeholder:"Select format"})}),e.jsx(_e,{children:pA.map(E=>e.jsx(xe,{value:E,children:E},E))})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Country *"}),e.jsx(ee,{placeholder:"e.g. United Kingdom",value:g,onChange:E=>y(E.target.value),maxLength:60})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"City *"}),e.jsx(ee,{placeholder:"e.g. London",value:u,onChange:E=>x(E.target.value),maxLength:60})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Start Date *"}),e.jsx(ee,{type:"date",value:v,onChange:E=>f(E.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["End Date ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),e.jsx(ee,{type:"date",value:k,onChange:E=>w(E.target.value)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["Description *"," ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(min 20 characters)"})]}),e.jsx(st,{placeholder:"Describe the event, topics covered, who should attend...",value:j,onChange:E=>b(E.target.value),rows:3,maxLength:2e3})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["Event Website ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),e.jsx(ee,{type:"url",placeholder:"https://...",value:T,onChange:E=>S(E.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["Target Audience ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(select all that apply)"})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:uA.map(E=>e.jsx("button",{type:"button",onClick:()=>D(E),className:`px-3 py-1.5 rounded-full text-xs font-medium border transition-colors ${N.includes(E)?"bg-accent text-accent-foreground border-accent":"bg-secondary text-muted-foreground border-border hover:border-accent/50"}`,children:E},E))})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border px-4 py-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Free event"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This event is free to attend"})]}),e.jsx(yt,{checked:I,onCheckedChange:A})]})]}),e.jsxs(et,{children:[e.jsx(P,{variant:"outline",onClick:G,children:"Cancel"}),e.jsx(P,{variant:"accent",onClick:H,disabled:!R,children:"Submit Event"})]})]})})})};function Ke(t){const a=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&a==="[object Date]"?new t.constructor(+t):typeof t=="number"||a==="[object Number]"||typeof t=="string"||a==="[object String]"?new Date(t):new Date(NaN)}function Ps(t,a){return t instanceof Date?new t.constructor(a):new Date(a)}const GC=6048e5,gA=864e5,Tl=43200,LN=1440;let fA={};function Ml(){return fA}function vl(t,a){var c,h,d,p;const s=Ml(),r=(a==null?void 0:a.weekStartsOn)??((h=(c=a==null?void 0:a.locale)==null?void 0:c.options)==null?void 0:h.weekStartsOn)??s.weekStartsOn??((p=(d=s.locale)==null?void 0:d.options)==null?void 0:p.weekStartsOn)??0,i=Ke(t),o=i.getDay(),l=(o<r?7:0)+o-r;return i.setDate(i.getDate()-l),i.setHours(0,0,0,0),i}function J8(t){return vl(t,{weekStartsOn:1})}function UC(t){const a=Ke(t),s=a.getFullYear(),r=Ps(t,0);r.setFullYear(s+1,0,4),r.setHours(0,0,0,0);const i=J8(r),o=Ps(t,0);o.setFullYear(s,0,4),o.setHours(0,0,0,0);const l=J8(o);return a.getTime()>=i.getTime()?s+1:a.getTime()>=l.getTime()?s:s-1}function IN(t){const a=Ke(t);return a.setHours(0,0,0,0),a}function Y8(t){const a=Ke(t),s=new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()));return s.setUTCFullYear(a.getFullYear()),+t-+s}function vA(t,a){const s=IN(t),r=IN(a),i=+s-Y8(s),o=+r-Y8(r);return Math.round((i-o)/gA)}function kA(t){const a=UC(t),s=Ps(t,0);return s.setFullYear(a,0,4),s.setHours(0,0,0,0),J8(s)}function _8(t,a){const s=Ke(t),r=Ke(a),i=s.getTime()-r.getTime();return i<0?-1:i>0?1:i}function bA(t){return Ps(t,Date.now())}function jA(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function wA(t){if(!jA(t)&&typeof t!="number")return!1;const a=Ke(t);return!isNaN(Number(a))}function MA(t,a){const s=Ke(t),r=Ke(a),i=s.getFullYear()-r.getFullYear(),o=s.getMonth()-r.getMonth();return i*12+o}function NA(t){return a=>{const r=(t?Math[t]:Math.trunc)(a);return r===0?0:r}}function CA(t,a){return+Ke(t)-+Ke(a)}function SA(t){const a=Ke(t);return a.setHours(23,59,59,999),a}function LA(t){const a=Ke(t),s=a.getMonth();return a.setFullYear(a.getFullYear(),s+1,0),a.setHours(23,59,59,999),a}function IA(t){const a=Ke(t);return+SA(a)==+LA(a)}function AA(t,a){const s=Ke(t),r=Ke(a),i=_8(s,r),o=Math.abs(MA(s,r));let l;if(o<1)l=0;else{s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-i*o);let c=_8(s,r)===-i;IA(Ke(t))&&o===1&&_8(t,r)===1&&(c=!1),l=i*(o-Number(c))}return l===0?0:l}function PA(t,a,s){const r=CA(t,a)/1e3;return NA(s==null?void 0:s.roundingMethod)(r)}function TA(t){const a=Ke(t),s=Ps(t,0);return s.setFullYear(a.getFullYear(),0,1),s.setHours(0,0,0,0),s}const RA={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},DA=(t,a,s)=>{let r;const i=RA[t];return typeof i=="string"?r=i:a===1?r=i.one:r=i.other.replace("{{count}}",a.toString()),s!=null&&s.addSuffix?s.comparison&&s.comparison>0?"in "+r:r+" ago":r};function gM(t){return(a={})=>{const s=a.width?String(a.width):t.defaultWidth;return t.formats[s]||t.formats[t.defaultWidth]}}const zA={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},qA={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},FA={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},HA={date:gM({formats:zA,defaultWidth:"full"}),time:gM({formats:qA,defaultWidth:"full"}),dateTime:gM({formats:FA,defaultWidth:"full"})},EA={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},BA=(t,a,s,r)=>EA[t];function Oo(t){return(a,s)=>{const r=s!=null&&s.context?String(s.context):"standalone";let i;if(r==="formatting"&&t.formattingValues){const l=t.defaultFormattingWidth||t.defaultWidth,c=s!=null&&s.width?String(s.width):l;i=t.formattingValues[c]||t.formattingValues[l]}else{const l=t.defaultWidth,c=s!=null&&s.width?String(s.width):t.defaultWidth;i=t.values[c]||t.values[l]}const o=t.argumentCallback?t.argumentCallback(a):a;return i[o]}}const VA={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},OA={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},GA={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},UA={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},_A={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},$A={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},WA=(t,a)=>{const s=Number(t),r=s%100;if(r>20||r<10)switch(r%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},ZA={ordinalNumber:WA,era:Oo({values:VA,defaultWidth:"wide"}),quarter:Oo({values:OA,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Oo({values:GA,defaultWidth:"wide"}),day:Oo({values:UA,defaultWidth:"wide"}),dayPeriod:Oo({values:_A,defaultWidth:"wide",formattingValues:$A,defaultFormattingWidth:"wide"})};function Go(t){return(a,s={})=>{const r=s.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=a.match(i);if(!o)return null;const l=o[0],c=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],h=Array.isArray(c)?YA(c,g=>g.test(l)):JA(c,g=>g.test(l));let d;d=t.valueCallback?t.valueCallback(h):h,d=s.valueCallback?s.valueCallback(d):d;const p=a.slice(l.length);return{value:d,rest:p}}}function JA(t,a){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&a(t[s]))return s}function YA(t,a){for(let s=0;s<t.length;s++)if(a(t[s]))return s}function KA(t){return(a,s={})=>{const r=a.match(t.matchPattern);if(!r)return null;const i=r[0],o=a.match(t.parsePattern);if(!o)return null;let l=t.valueCallback?t.valueCallback(o[0]):o[0];l=s.valueCallback?s.valueCallback(l):l;const c=a.slice(i.length);return{value:l,rest:c}}}const XA=/^(\d+)(th|st|nd|rd)?/i,QA=/\d+/i,eP={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},tP={any:[/^b/i,/^(a|c)/i]},aP={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},sP={any:[/1/i,/2/i,/3/i,/4/i]},nP={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},rP={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},iP={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},oP={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},lP={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},cP={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},dP={ordinalNumber:KA({matchPattern:XA,parsePattern:QA,valueCallback:t=>parseInt(t,10)}),era:Go({matchPatterns:eP,defaultMatchWidth:"wide",parsePatterns:tP,defaultParseWidth:"any"}),quarter:Go({matchPatterns:aP,defaultMatchWidth:"wide",parsePatterns:sP,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Go({matchPatterns:nP,defaultMatchWidth:"wide",parsePatterns:rP,defaultParseWidth:"any"}),day:Go({matchPatterns:iP,defaultMatchWidth:"wide",parsePatterns:oP,defaultParseWidth:"any"}),dayPeriod:Go({matchPatterns:lP,defaultMatchWidth:"any",parsePatterns:cP,defaultParseWidth:"any"})},_C={code:"en-US",formatDistance:DA,formatLong:HA,formatRelative:BA,localize:ZA,match:dP,options:{weekStartsOn:0,firstWeekContainsDate:1}};function hP(t){const a=Ke(t);return vA(a,TA(a))+1}function mP(t){const a=Ke(t),s=+J8(a)-+kA(a);return Math.round(s/GC)+1}function $C(t,a){var p,g,y,u;const s=Ke(t),r=s.getFullYear(),i=Ml(),o=(a==null?void 0:a.firstWeekContainsDate)??((g=(p=a==null?void 0:a.locale)==null?void 0:p.options)==null?void 0:g.firstWeekContainsDate)??i.firstWeekContainsDate??((u=(y=i.locale)==null?void 0:y.options)==null?void 0:u.firstWeekContainsDate)??1,l=Ps(t,0);l.setFullYear(r+1,0,o),l.setHours(0,0,0,0);const c=vl(l,a),h=Ps(t,0);h.setFullYear(r,0,o),h.setHours(0,0,0,0);const d=vl(h,a);return s.getTime()>=c.getTime()?r+1:s.getTime()>=d.getTime()?r:r-1}function uP(t,a){var c,h,d,p;const s=Ml(),r=(a==null?void 0:a.firstWeekContainsDate)??((h=(c=a==null?void 0:a.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??s.firstWeekContainsDate??((p=(d=s.locale)==null?void 0:d.options)==null?void 0:p.firstWeekContainsDate)??1,i=$C(t,a),o=Ps(t,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),vl(o,a)}function pP(t,a){const s=Ke(t),r=+vl(s,a)-+uP(s,a);return Math.round(r/GC)+1}function Ve(t,a){const s=t<0?"-":"",r=Math.abs(t).toString().padStart(a,"0");return s+r}const ms={y(t,a){const s=t.getFullYear(),r=s>0?s:1-s;return Ve(a==="yy"?r%100:r,a.length)},M(t,a){const s=t.getMonth();return a==="M"?String(s+1):Ve(s+1,2)},d(t,a){return Ve(t.getDate(),a.length)},a(t,a){const s=t.getHours()/12>=1?"pm":"am";switch(a){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];case"aaaa":default:return s==="am"?"a.m.":"p.m."}},h(t,a){return Ve(t.getHours()%12||12,a.length)},H(t,a){return Ve(t.getHours(),a.length)},m(t,a){return Ve(t.getMinutes(),a.length)},s(t,a){return Ve(t.getSeconds(),a.length)},S(t,a){const s=a.length,r=t.getMilliseconds(),i=Math.trunc(r*Math.pow(10,s-3));return Ve(i,a.length)}},lo={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},AN={G:function(t,a,s){const r=t.getFullYear()>0?1:0;switch(a){case"G":case"GG":case"GGG":return s.era(r,{width:"abbreviated"});case"GGGGG":return s.era(r,{width:"narrow"});case"GGGG":default:return s.era(r,{width:"wide"})}},y:function(t,a,s){if(a==="yo"){const r=t.getFullYear(),i=r>0?r:1-r;return s.ordinalNumber(i,{unit:"year"})}return ms.y(t,a)},Y:function(t,a,s,r){const i=$C(t,r),o=i>0?i:1-i;if(a==="YY"){const l=o%100;return Ve(l,2)}return a==="Yo"?s.ordinalNumber(o,{unit:"year"}):Ve(o,a.length)},R:function(t,a){const s=UC(t);return Ve(s,a.length)},u:function(t,a){const s=t.getFullYear();return Ve(s,a.length)},Q:function(t,a,s){const r=Math.ceil((t.getMonth()+1)/3);switch(a){case"Q":return String(r);case"QQ":return Ve(r,2);case"Qo":return s.ordinalNumber(r,{unit:"quarter"});case"QQQ":return s.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,a,s){const r=Math.ceil((t.getMonth()+1)/3);switch(a){case"q":return String(r);case"qq":return Ve(r,2);case"qo":return s.ordinalNumber(r,{unit:"quarter"});case"qqq":return s.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,a,s){const r=t.getMonth();switch(a){case"M":case"MM":return ms.M(t,a);case"Mo":return s.ordinalNumber(r+1,{unit:"month"});case"MMM":return s.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(r,{width:"wide",context:"formatting"})}},L:function(t,a,s){const r=t.getMonth();switch(a){case"L":return String(r+1);case"LL":return Ve(r+1,2);case"Lo":return s.ordinalNumber(r+1,{unit:"month"});case"LLL":return s.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(r,{width:"wide",context:"standalone"})}},w:function(t,a,s,r){const i=pP(t,r);return a==="wo"?s.ordinalNumber(i,{unit:"week"}):Ve(i,a.length)},I:function(t,a,s){const r=mP(t);return a==="Io"?s.ordinalNumber(r,{unit:"week"}):Ve(r,a.length)},d:function(t,a,s){return a==="do"?s.ordinalNumber(t.getDate(),{unit:"date"}):ms.d(t,a)},D:function(t,a,s){const r=hP(t);return a==="Do"?s.ordinalNumber(r,{unit:"dayOfYear"}):Ve(r,a.length)},E:function(t,a,s){const r=t.getDay();switch(a){case"E":case"EE":case"EEE":return s.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(r,{width:"short",context:"formatting"});case"EEEE":default:return s.day(r,{width:"wide",context:"formatting"})}},e:function(t,a,s,r){const i=t.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(a){case"e":return String(o);case"ee":return Ve(o,2);case"eo":return s.ordinalNumber(o,{unit:"day"});case"eee":return s.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(i,{width:"short",context:"formatting"});case"eeee":default:return s.day(i,{width:"wide",context:"formatting"})}},c:function(t,a,s,r){const i=t.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(a){case"c":return String(o);case"cc":return Ve(o,a.length);case"co":return s.ordinalNumber(o,{unit:"day"});case"ccc":return s.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(i,{width:"narrow",context:"standalone"});case"cccccc":return s.day(i,{width:"short",context:"standalone"});case"cccc":default:return s.day(i,{width:"wide",context:"standalone"})}},i:function(t,a,s){const r=t.getDay(),i=r===0?7:r;switch(a){case"i":return String(i);case"ii":return Ve(i,a.length);case"io":return s.ordinalNumber(i,{unit:"day"});case"iii":return s.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(r,{width:"short",context:"formatting"});case"iiii":default:return s.day(r,{width:"wide",context:"formatting"})}},a:function(t,a,s){const i=t.getHours()/12>=1?"pm":"am";switch(a){case"a":case"aa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,a,s){const r=t.getHours();let i;switch(r===12?i=lo.noon:r===0?i=lo.midnight:i=r/12>=1?"pm":"am",a){case"b":case"bb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,a,s){const r=t.getHours();let i;switch(r>=17?i=lo.evening:r>=12?i=lo.afternoon:r>=4?i=lo.morning:i=lo.night,a){case"B":case"BB":case"BBB":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,a,s){if(a==="ho"){let r=t.getHours()%12;return r===0&&(r=12),s.ordinalNumber(r,{unit:"hour"})}return ms.h(t,a)},H:function(t,a,s){return a==="Ho"?s.ordinalNumber(t.getHours(),{unit:"hour"}):ms.H(t,a)},K:function(t,a,s){const r=t.getHours()%12;return a==="Ko"?s.ordinalNumber(r,{unit:"hour"}):Ve(r,a.length)},k:function(t,a,s){let r=t.getHours();return r===0&&(r=24),a==="ko"?s.ordinalNumber(r,{unit:"hour"}):Ve(r,a.length)},m:function(t,a,s){return a==="mo"?s.ordinalNumber(t.getMinutes(),{unit:"minute"}):ms.m(t,a)},s:function(t,a,s){return a==="so"?s.ordinalNumber(t.getSeconds(),{unit:"second"}):ms.s(t,a)},S:function(t,a){return ms.S(t,a)},X:function(t,a,s){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(a){case"X":return TN(r);case"XXXX":case"XX":return Ki(r);case"XXXXX":case"XXX":default:return Ki(r,":")}},x:function(t,a,s){const r=t.getTimezoneOffset();switch(a){case"x":return TN(r);case"xxxx":case"xx":return Ki(r);case"xxxxx":case"xxx":default:return Ki(r,":")}},O:function(t,a,s){const r=t.getTimezoneOffset();switch(a){case"O":case"OO":case"OOO":return"GMT"+PN(r,":");case"OOOO":default:return"GMT"+Ki(r,":")}},z:function(t,a,s){const r=t.getTimezoneOffset();switch(a){case"z":case"zz":case"zzz":return"GMT"+PN(r,":");case"zzzz":default:return"GMT"+Ki(r,":")}},t:function(t,a,s){const r=Math.trunc(t.getTime()/1e3);return Ve(r,a.length)},T:function(t,a,s){const r=t.getTime();return Ve(r,a.length)}};function PN(t,a=""){const s=t>0?"-":"+",r=Math.abs(t),i=Math.trunc(r/60),o=r%60;return o===0?s+String(i):s+String(i)+a+Ve(o,2)}function TN(t,a){return t%60===0?(t>0?"-":"+")+Ve(Math.abs(t)/60,2):Ki(t,a)}function Ki(t,a=""){const s=t>0?"-":"+",r=Math.abs(t),i=Ve(Math.trunc(r/60),2),o=Ve(r%60,2);return s+i+a+o}const RN=(t,a)=>{switch(t){case"P":return a.date({width:"short"});case"PP":return a.date({width:"medium"});case"PPP":return a.date({width:"long"});case"PPPP":default:return a.date({width:"full"})}},WC=(t,a)=>{switch(t){case"p":return a.time({width:"short"});case"pp":return a.time({width:"medium"});case"ppp":return a.time({width:"long"});case"pppp":default:return a.time({width:"full"})}},xP=(t,a)=>{const s=t.match(/(P+)(p+)?/)||[],r=s[1],i=s[2];if(!i)return RN(t,a);let o;switch(r){case"P":o=a.dateTime({width:"short"});break;case"PP":o=a.dateTime({width:"medium"});break;case"PPP":o=a.dateTime({width:"long"});break;case"PPPP":default:o=a.dateTime({width:"full"});break}return o.replace("{{date}}",RN(r,a)).replace("{{time}}",WC(i,a))},yP={p:WC,P:xP},gP=/^D+$/,fP=/^Y+$/,vP=["D","DD","YY","YYYY"];function kP(t){return gP.test(t)}function bP(t){return fP.test(t)}function jP(t,a,s){const r=wP(t,a,s);if(console.warn(r),vP.includes(t))throw new RangeError(r)}function wP(t,a,s){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${a}\`) for formatting ${r} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const MP=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,NP=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,CP=/^'([^]*?)'?$/,SP=/''/g,LP=/[a-zA-Z]/;function IP(t,a,s){var p,g,y,u;const r=Ml(),i=r.locale??_C,o=r.firstWeekContainsDate??((g=(p=r.locale)==null?void 0:p.options)==null?void 0:g.firstWeekContainsDate)??1,l=r.weekStartsOn??((u=(y=r.locale)==null?void 0:y.options)==null?void 0:u.weekStartsOn)??0,c=Ke(t);if(!wA(c))throw new RangeError("Invalid time value");let h=a.match(NP).map(x=>{const v=x[0];if(v==="p"||v==="P"){const f=yP[v];return f(x,i.formatLong)}return x}).join("").match(MP).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const v=x[0];if(v==="'")return{isToken:!1,value:AP(x)};if(AN[v])return{isToken:!0,value:x};if(v.match(LP))throw new RangeError("Format string contains an unescaped latin alphabet character `"+v+"`");return{isToken:!1,value:x}});i.localize.preprocessor&&(h=i.localize.preprocessor(c,h));const d={firstWeekContainsDate:o,weekStartsOn:l,locale:i};return h.map(x=>{if(!x.isToken)return x.value;const v=x.value;(bP(v)||kP(v))&&jP(v,a,String(t));const f=AN[v[0]];return f(c,v,i.localize,d)}).join("")}function AP(t){const a=t.match(CP);return a?a[1].replace(SP,"'"):t}function PP(t,a,s){const r=Ml(),i=(s==null?void 0:s.locale)??r.locale??_C,o=2520,l=_8(t,a);if(isNaN(l))throw new RangeError("Invalid time value");const c=Object.assign({},s,{addSuffix:s==null?void 0:s.addSuffix,comparison:l});let h,d;l>0?(h=Ke(a),d=Ke(t)):(h=Ke(t),d=Ke(a));const p=PA(d,h),g=(Y8(d)-Y8(h))/1e3,y=Math.round((p-g)/60);let u;if(y<2)return s!=null&&s.includeSeconds?p<5?i.formatDistance("lessThanXSeconds",5,c):p<10?i.formatDistance("lessThanXSeconds",10,c):p<20?i.formatDistance("lessThanXSeconds",20,c):p<40?i.formatDistance("halfAMinute",0,c):p<60?i.formatDistance("lessThanXMinutes",1,c):i.formatDistance("xMinutes",1,c):y===0?i.formatDistance("lessThanXMinutes",1,c):i.formatDistance("xMinutes",y,c);if(y<45)return i.formatDistance("xMinutes",y,c);if(y<90)return i.formatDistance("aboutXHours",1,c);if(y<LN){const x=Math.round(y/60);return i.formatDistance("aboutXHours",x,c)}else{if(y<o)return i.formatDistance("xDays",1,c);if(y<Tl){const x=Math.round(y/LN);return i.formatDistance("xDays",x,c)}else if(y<Tl*2)return u=Math.round(y/Tl),i.formatDistance("aboutXMonths",u,c)}if(u=AA(d,h),u<12){const x=Math.round(y/Tl);return i.formatDistance("xMonths",x,c)}else{const x=u%12,v=Math.trunc(u/12);return x<3?i.formatDistance("aboutXYears",v,c):x<9?i.formatDistance("overXYears",v,c):i.formatDistance("almostXYears",v+1,c)}}function eN(t,a){return PP(t,bA(t),a)}const TP=t=>{const a=new Date(t);return{day:a.getDate(),month:a.toLocaleDateString("en-US",{month:"short"}).toUpperCase()}},RP=(t,a)=>{const s=new Date(t),r={month:"short",day:"numeric"};if(!a)return s.toLocaleDateString("en-US",{...r,year:"numeric"});const i=new Date(a);return s.getMonth()===i.getMonth()?`${s.toLocaleDateString("en-US",r)} - ${i.getDate()}, ${i.getFullYear()}`:`${s.toLocaleDateString("en-US",r)} - ${i.toLocaleDateString("en-US",{...r,year:"numeric"})}`},DP=t=>t>=1e3?`${(t/1e3).toFixed(t>=1e4?0:1)}k`:t.toString(),zP=({event:t})=>{const{day:a,month:s}=TP(t.date),r=t.isFeatured;return e.jsxs("div",{className:`group relative flex gap-4 rounded-lg border bg-card p-4 transition-all duration-200 hover:shadow-card ${r?"border-accent/30 bg-accent/[0.02]":"border-border"}`,children:[e.jsxs("div",{className:`flex h-16 w-16 flex-shrink-0 flex-col items-center justify-center rounded-lg ${r?"bg-accent text-accent-foreground":"bg-primary text-primary-foreground"}`,children:[e.jsx("span",{className:"text-[10px] font-bold uppercase leading-none tracking-wider",children:s}),e.jsx("span",{className:"text-2xl font-bold leading-tight",children:a})]}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsxs("div",{className:"mb-1 flex flex-wrap items-center gap-1.5",children:[r&&e.jsx(q,{className:"bg-accent/10 text-accent text-[10px] px-1.5 py-0 font-semibold uppercase",children:"Recommended"}),t.isFree&&e.jsx(q,{className:"bg-gaming-success/10 text-gaming-success text-[10px] px-1.5 py-0 font-semibold uppercase",children:"Free"}),e.jsx(q,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:t.category}),e.jsx(q,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:t.format})]}),e.jsx("h3",{className:"mb-1 text-base font-semibold leading-snug text-foreground group-hover:text-accent transition-colors",children:t.title}),t.description&&e.jsx("p",{className:"mb-2 line-clamp-2 text-sm text-muted-foreground leading-relaxed",children:t.description}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(da,{className:"h-3.5 w-3.5"}),RP(t.date,t.endDate)]}),e.jsxs("span",{className:"flex items-center gap-1",children:[t.format==="Online"?e.jsx(Lt,{className:"h-3.5 w-3.5"}):e.jsx(Te,{className:"h-3.5 w-3.5"}),t.format==="Online"?"Online":`${t.city}, ${t.country}`]}),t.attendeeCount>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ze,{className:"h-3.5 w-3.5"}),DP(t.attendeeCount)," attendees"]}),e.jsxs("span",{className:"text-muted-foreground/60",children:["by ",t.organizer]})]}),t.audience&&t.audience.length>0&&e.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:t.audience.map(i=>e.jsx("span",{className:"rounded bg-secondary px-1.5 py-0.5 text-[10px] font-medium text-secondary-foreground",children:i},i))})]}),e.jsx("div",{className:"flex flex-shrink-0 flex-col items-end justify-between",children:t.link&&e.jsx(P,{variant:"outline",size:"sm",className:"text-xs",asChild:!0,children:e.jsxs("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",children:["Event Info",e.jsx(bt,{className:"ml-1.5 h-3 w-3"})]})})})]})},qP=[{value:"upcoming",label:"Upcoming"},{value:"newest",label:"Newest added"},{value:"popular",label:"Most attendees"},{value:"name",label:"Name (A-Z)"}],FP=[{value:"01",label:"January"},{value:"02",label:"February"},{value:"03",label:"March"},{value:"04",label:"April"},{value:"05",label:"May"},{value:"06",label:"June"},{value:"07",label:"July"},{value:"08",label:"August"},{value:"09",label:"September"},{value:"10",label:"October"},{value:"11",label:"November"},{value:"12",label:"December"}],HP=[{value:"C-level",label:"C-level"},{value:"B2B",label:"B2B"},{value:"Regulators",label:"Regulators"},{value:"Affiliates",label:"Affiliates"},{value:"Tech",label:"Tech"},{value:"Operators",label:"Operators"},{value:"Providers",label:"Providers"},{value:"General",label:"General"}],EP=({apiUrl:t,eventsData:a,itemsPerPage:s=20,enableMobileFilter:r=!0,onSubmitEvent:i})=>{const[o,l]=m.useState(!1),[c,h]=m.useState(a??[]),[d,p]=m.useState(!a),[g,y]=m.useState(1),[u,x]=m.useState(s),[v,f]=m.useState(""),[k,w]=m.useState("upcoming"),[j,b]=m.useState("list"),[T,S]=m.useState({category:[],format:[],country:[],month:[],audience:[],organizer:[],signals:[]});m.useEffect(()=>{if(a)return;let H=!0;const G=async()=>{try{if(!t){H&&h(SN);return}const E=await fetch(t);if(!E.ok)throw new Error(`Failed loading events: ${E.status}`);const W=await E.json();H&&Array.isArray(W)&&h(W)}catch(E){console.error("Failed to fetch events list",E),H&&h(SN)}finally{H&&p(!1)}};return p(!0),G(),()=>{H=!1}},[t,a]);const N=m.useMemo(()=>{const H=Array.from(new Set(c.map(J=>J.category))).sort(),G=Array.from(new Set(c.map(J=>J.format))).sort(),E=Array.from(new Set(c.map(J=>J.country).filter(J=>J!=="Remote"))).sort(),W=Array.from(new Set(c.map(J=>J.organizer))).sort();return[{key:"month",label:"Month",type:"checkbox",options:FP},{key:"audience",label:"Audience",type:"checkbox",options:HP},{key:"category",label:"Event Type",type:"checkbox",options:H.map(J=>({value:J,label:J}))},{key:"format",label:"Format",type:"checkbox",options:G.map(J=>({value:J,label:J}))},{key:"country",label:"Country",type:"searchable-select",searchable:!0,options:E.map(J=>({value:J,label:J}))},{key:"organizer",label:"Organizer",type:"searchable-select",searchable:!0,options:W.map(J=>({value:J,label:J}))},{key:"signals",label:"Signals",type:"toggle",options:[{value:"featured",label:"Featured only"},{value:"free",label:"Free events only"}]}]},[c]),L=m.useMemo(()=>Object.entries(T).flatMap(([H,G])=>G.map(E=>({key:H,label:H.charAt(0).toUpperCase()+H.slice(1),value:E,onRemove:()=>S(W=>({...W,[H]:(W[H]??[]).filter(J=>J!==E)}))}))),[T]),I=m.useMemo(()=>{const H=v.trim().toLowerCase();return c.filter(G=>{if(H&&!`${G.title} ${G.organizer} ${G.city} ${G.country} ${G.description??""}`.toLowerCase().includes(H)||T.category.length&&!T.category.includes(G.category)||T.format.length&&!T.format.includes(G.format)||T.country.length&&!T.country.includes(G.country)||T.organizer.length&&!T.organizer.includes(G.organizer))return!1;if(T.month.length){const E=new Date(G.date).toISOString().slice(5,7);if(!T.month.includes(E))return!1}return!(T.audience.length&&(!G.audience||!T.audience.some(E=>G.audience.includes(E)))||T.signals.includes("featured")&&!G.isFeatured||T.signals.includes("free")&&!G.isFree)})},[c,T,v]),A=m.useMemo(()=>{const H=[...I];return H.sort((G,E)=>{switch(k){case"newest":return new Date(E.date).getTime()-new Date(G.date).getTime();case"popular":return E.attendeeCount-G.attendeeCount;case"name":return G.title.localeCompare(E.title);case"upcoming":default:return new Date(G.date).getTime()-new Date(E.date).getTime()}}),H},[I,k]);m.useEffect(()=>{y(1)},[v,T,u]);const C=Math.max(1,Math.ceil(A.length/u)),M=A.slice((g-1)*u,g*u),R=m.useMemo(()=>{if(j!=="list")return null;const H={};for(const G of M){const E=IP(new Date(G.date),"MMMM yyyy");H[E]||(H[E]=[]),H[E].push(G)}return H},[M,j]),D={category:[],format:[],country:[],month:[],audience:[],organizer:[],signals:[]};return e.jsxs(e.Fragment,{children:[e.jsx(ja,{title:"iGaming Events & Conferences Calendar",description:"Discover the most important iGaming conferences, expos, webinars, and networking events worldwide. Filter by region, audience, and event type.",headerActions:e.jsxs(P,{variant:"accent",size:"sm",className:"gap-1.5",onClick:()=>l(!0),children:[e.jsx(da,{className:"w-4 h-4"}),"Submit Event"]}),search:{value:v,onChange:f,onSubmit:f,onClear:()=>f(""),placeholder:"Search events by name, organizer, or location..."},filters:N,filterValues:T,onFilterChange:(H,G)=>S(E=>({...E,[H]:G})),onClearFilters:()=>S(D),activeFilters:L,sort:{value:k,options:qP,onChange:w},viewMode:j,onViewModeChange:b,pagination:{page:g,pageSize:u,totalPages:C,totalCount:A.length,toolbarTotalCount:c.length,toolbarTitle:"Events Calendar",toolbarItemLabel:"events",onPageChange:y,onPageSizeChange:H=>{x(H),y(1)},pageSizeOptions:[10,20,50]},resultsClassName:j==="grid"?"grid gap-4 sm:grid-cols-2 xl:grid-cols-3":"",children:d?e.jsx(ua,{totalColumns:6}):M.length?j==="list"&&R?e.jsx("div",{className:"space-y-8",children:Object.entries(R).map(([H,G])=>e.jsxs("div",{children:[e.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[e.jsx("span",{className:"inline-flex items-center rounded-md bg-accent px-3 py-1.5 text-sm font-bold text-accent-foreground uppercase tracking-wide",children:H}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),e.jsx("div",{className:"space-y-3",children:G.map(E=>e.jsx(zP,{event:E},E.id))})]},H))}):M.map(H=>e.jsx(dA,{id:H.id,title:H.title,organizer:H.organizer,category:H.category,format:H.format,city:H.city,country:H.country,date:H.date,attendeeCount:H.attendeeCount,tags:H.tags,isFeatured:H.isFeatured,isFree:H.isFree,link:H.link,viewMode:j},H.id)):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(da,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No events found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters or search."}),e.jsx(P,{variant:"outline",onClick:()=>S(D),children:"Clear all filters"})]})}),e.jsx(yA,{open:o,onOpenChange:l,onSubmit:H=>{i==null||i(H),console.log("[EventsList] Submit event:",H)}})]})},BP=t=>t>=1e3?`${(t/1e3).toFixed(1)}k`:t.toString(),VP=({name:t,type:a,city:s,country:r,shortDescription:i,services:o,tags:l=[],rating:c,reviewCount:h,website:d,isFeatured:p=!1})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsx(q,{variant:"secondary",children:a}),p&&e.jsx(q,{className:"bg-primary text-primary-foreground",children:"Featured"})]}),e.jsx("h3",{className:"mb-2 text-lg font-semibold text-foreground",children:t}),e.jsx("p",{className:"mb-2 line-clamp-2 text-sm text-muted-foreground",children:i}),e.jsxs("div",{className:"mb-3 flex flex-wrap gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Te,{className:"h-3.5 w-3.5"}),s,", ",r]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ze,{className:"h-3.5 w-3.5 fill-gaming-gold text-gaming-gold"}),c.toFixed(1)," (",BP(h),")"]})]}),e.jsx("div",{className:"mb-3 flex flex-wrap gap-1.5",children:o.slice(0,3).map(g=>e.jsx(q,{variant:"outline",className:"text-xs",children:g},g))}),l.length>0&&e.jsx("div",{className:"mb-4 flex flex-wrap gap-1.5",children:l.slice(0,2).map(g=>e.jsx(q,{variant:"outline",className:"text-xs",children:g},g))}),d&&e.jsx(P,{variant:"outline",size:"sm",className:"w-full",asChild:!0,children:e.jsxs("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:["Visit Place",e.jsx(bt,{className:"ml-2 h-3.5 w-3.5"})]})})]}),DN=[{id:"place-1",name:"Valletta Gaming Campus",type:"Innovation Hub",city:"Valletta",country:"Malta",shortDescription:"Innovation campus focused on sportsbook and casino startups.",services:["Events","Mentorship","Recruitment"],tags:["startup","community"],rating:4.8,reviewCount:132,isFeatured:!0,website:"https://example.com/places/valletta-campus"},{id:"place-2",name:"Barcelona Betting Labs",type:"Coworking",city:"Barcelona",country:"Spain",shortDescription:"Flexible workspaces for game, risk, and analytics teams.",services:["Coworking","Meeting Rooms","Events"],tags:["analytics","product"],rating:4.5,reviewCount:89,website:"https://example.com/places/barcelona-labs"},{id:"place-3",name:"Tallinn Compliance Center",type:"Office",city:"Tallinn",country:"Estonia",shortDescription:"Specialized compliance hub for regulated operators.",services:["Compliance Advisory","Training"],tags:["compliance","regulation"],rating:4.6,reviewCount:64,website:"https://example.com/places/tallinn-compliance-center"},{id:"place-4",name:"London iGaming Forum Hall",type:"Conference Venue",city:"London",country:"United Kingdom",shortDescription:"Large conference venue for iGaming networking and expos.",services:["Conferences","Streaming","Booths"],tags:["conference","networking"],rating:4.4,reviewCount:210,website:"https://example.com/places/london-forum-hall"},{id:"place-5",name:"Sofia Product Studio",type:"Office",city:"Sofia",country:"Bulgaria",shortDescription:"Product-focused office optimized for agile delivery teams.",services:["Product Sprints","Hiring Support"],tags:["product","engineering"],rating:4.3,reviewCount:48,website:"https://example.com/places/sofia-product-studio"},{id:"place-6",name:"Riga Talent House",type:"Coworking",city:"Riga",country:"Latvia",shortDescription:"Coworking location with hiring events and mentorship sessions.",services:["Coworking","Recruitment","Mentorship"],tags:["talent","recruitment"],rating:4.7,reviewCount:73,isFeatured:!0,website:"https://example.com/places/riga-talent-house"}],OP=[{value:"relevance",label:"Most relevant"},{value:"rating",label:"Highest rated"},{value:"reviews",label:"Most reviews"},{value:"name",label:"Name (A-Z)"}],GP=({apiUrl:t,itemsPerPage:a=9,enableMobileFilter:s=!0})=>{const[r,i]=m.useState([]),[o,l]=m.useState(!0),[c,h]=m.useState(1),[d,p]=m.useState(a),[g,y]=m.useState(""),[u,x]=m.useState("relevance"),[v,f]=m.useState("grid"),[k,w]=m.useState({type:[],country:[],city:[],services:[],tags:[],signals:[]});m.useEffect(()=>{let I=!0;const A=async()=>{try{if(!t){I&&i(DN);return}const C=await fetch(t);if(!C.ok)throw new Error(`Failed loading places: ${C.status}`);const M=await C.json();I&&Array.isArray(M)&&i(M)}catch(C){console.error("Failed to fetch places list",C),I&&i(DN)}finally{I&&l(!1)}};return l(!0),A(),()=>{I=!1}},[t]);const j=m.useMemo(()=>{const I=Array.from(new Set(r.map(D=>D.type))).sort(),A=Array.from(new Set(r.map(D=>D.country))).sort(),C=Array.from(new Set(r.map(D=>D.city))).sort(),M=Array.from(new Set(r.flatMap(D=>D.services))).sort(),R=Array.from(new Set(r.flatMap(D=>D.tags))).sort();return[{key:"type",label:"Type",type:"checkbox",options:I.map(D=>({value:D,label:D}))},{key:"country",label:"Country",type:"searchable-select",searchable:!0,options:A.map(D=>({value:D,label:D}))},{key:"city",label:"City",type:"searchable-select",searchable:!0,options:C.map(D=>({value:D,label:D}))},{key:"services",label:"Services",type:"checkbox",searchable:!0,options:M.map(D=>({value:D,label:D}))},{key:"tags",label:"Tags",type:"checkbox",searchable:!0,options:R.map(D=>({value:D,label:D}))},{key:"signals",label:"Signals",type:"toggle",options:[{value:"featured",label:"Featured only"}]}]},[r]),b=m.useMemo(()=>Object.entries(k).flatMap(([I,A])=>A.map(C=>({key:I,label:I.charAt(0).toUpperCase()+I.slice(1),value:C,onRemove:()=>{w(M=>({...M,[I]:(M[I]??[]).filter(R=>R!==C)}))}}))),[k]),T=m.useMemo(()=>{const I=g.trim().toLowerCase();return r.filter(A=>!(I&&!`${A.name} ${A.shortDescription} ${A.city} ${A.country}`.toLowerCase().includes(I)||k.type.length&&!k.type.includes(A.type)||k.country.length&&!k.country.includes(A.country)||k.city.length&&!k.city.includes(A.city)||k.services.length&&!k.services.every(C=>A.services.includes(C))||k.tags.length&&!k.tags.every(C=>A.tags.includes(C))||k.signals.includes("featured")&&!A.isFeatured))},[k,r,g]),S=m.useMemo(()=>{const I=[...T];return I.sort((A,C)=>{switch(u){case"rating":return C.rating-A.rating;case"reviews":return C.reviewCount-A.reviewCount;case"name":return A.name.localeCompare(C.name);case"relevance":default:return Number(C.isFeatured)-Number(A.isFeatured)||C.rating-A.rating}}),I},[T,u]);m.useEffect(()=>{h(1)},[g,k,d]);const N=Math.max(1,Math.ceil(S.length/d)),L=S.slice((c-1)*d,c*d);return e.jsx(ja,{title:"Places",description:"Browse offices, venues, and hubs where iGaming teams work and connect.",search:{value:g,onChange:y,onSubmit:y,onClear:()=>y(""),placeholder:"Search places"},filters:j,filterValues:k,onFilterChange:(I,A)=>w(C=>({...C,[I]:A})),onClearFilters:()=>w({type:[],country:[],city:[],services:[],tags:[],signals:[]}),activeFilters:b,sort:{value:u,options:OP,onChange:x},viewMode:v,onViewModeChange:f,pagination:{page:c,pageSize:d,totalPages:N,totalCount:S.length,toolbarTotalCount:r.length,toolbarTitle:"Popular Places",toolbarItemLabel:"places",onPageChange:h,onPageSizeChange:I=>{p(I),h(1)}},resultsClassName:v==="grid"?"grid gap-4 sm:grid-cols-2 xl:grid-cols-3":"grid gap-4",children:o?e.jsx(ua,{totalColumns:d}):L.length?L.map(I=>e.jsx(VP,{id:I.id,name:I.name,type:I.type,city:I.city,country:I.country,shortDescription:I.shortDescription,services:I.services,tags:I.tags,rating:I.rating,reviewCount:I.reviewCount,website:I.website,isFeatured:I.isFeatured,viewMode:v},I.id)):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(Te,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No places found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters."}),e.jsx(P,{variant:"outline",onClick:()=>w({type:[],country:[],city:[],services:[],tags:[],signals:[]}),children:"Clear all filters"})]})})},UP={Low:"bg-gaming-success/10 text-gaming-success",Medium:"bg-gaming-warning/10 text-gaming-warning",High:"bg-destructive/10 text-destructive"},_P=({slug:t,name:a,parentCategory:s,description:r,vendorCount:i,productCount:o,jobCount:l,complianceLevel:c,tags:h=[],isFeatured:d=!1,isTrending:p=!1,subcategories:g=[],topCompanies:y=[]})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card cursor-pointer",onClick:()=>window.location.replace(`/product-categories/${t}`),children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[e.jsx(q,{variant:"secondary",children:s}),e.jsxs(q,{className:UP[c],children:[c," Compliance"]}),d&&e.jsx(q,{className:"bg-primary text-primary-foreground",children:"Featured"}),p&&e.jsx(q,{variant:"accent",children:"Trending"})]}),e.jsx("h3",{className:"mb-2 text-lg font-semibold text-foreground",children:a}),e.jsx("p",{className:"mb-3 line-clamp-2 text-sm text-muted-foreground",children:r}),e.jsxs("div",{className:"mb-3 flex flex-wrap gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Me,{className:"h-3.5 w-3.5"}),i," vendors"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(No,{className:"h-3.5 w-3.5"}),o," products"]}),l!==void 0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(je,{className:"h-3.5 w-3.5"}),l," jobs"]})]}),g.length>0&&e.jsxs("div",{className:"mb-3 flex flex-wrap gap-1.5",children:[g.slice(0,3).map(u=>e.jsx(q,{variant:"outline",className:"text-xs",children:u.name},u.slug)),g.length>3&&e.jsxs(q,{variant:"outline",className:"text-xs text-muted-foreground",children:["+",g.length-3]})]}),y.length>0&&e.jsxs("div",{className:"mb-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Top vendors:"}),e.jsxs("p",{className:"text-xs font-medium text-foreground",children:[y.slice(0,3).map(u=>u.name).join(", "),y.length>3&&` +${y.length-3} more`]})]}),e.jsxs(P,{variant:"outline",size:"sm",className:"w-full",onClick:u=>{u.stopPropagation(),window.location.replace(`/product-categories/${t}`)},children:[e.jsx(fa,{className:"mr-1.5 h-3.5 w-3.5"})," Explore Category"]})]}),zN=[{id:"pc-1",slug:"platform-pam",name:"Platform (PAM)",parentCategory:"Core Platform",description:"Player Account Management — the operating system for online gambling businesses.",longDescription:"A PAM (Player Account Management) platform is the core backend system that powers an online gambling operation. It manages player registration, wallets, KYC, game integrations, bonus engines, and regulatory reporting. PAM providers are the backbone of the iGaming B2B stack, enabling operators to launch and run their businesses across multiple jurisdictions.",synonyms:["Player Account Management","PAM","iGaming Platform","Operator Platform"],subcategories:[{name:"Full-Stack PAM",slug:"full-stack-pam",description:"End-to-end platform covering all operator needs"},{name:"White-Label Solutions",slug:"white-label",description:"Turnkey operator launch packages"},{name:"Modular PAM",slug:"modular-pam",description:"Component-based platforms for custom builds"}],vendorCount:38,productCount:52,jobCount:245,complianceLevel:"High",tags:["platform","pam","operator","backend"],lastUpdated:"2026-02-15",isFeatured:!0,topCompanies:[{name:"SOFTSWISS",slug:"softswiss",offeringsStrength:"core"},{name:"EveryMatrix",slug:"everymatrix",offeringsStrength:"core"},{name:"Aspire Global",slug:"aspire-global",offeringsStrength:"core"},{name:"GiG",slug:"gig",offeringsStrength:"core"}],sampleJobs:[{title:"Platform Engineer",company:"SOFTSWISS",location:"Malta",slug:"platform-engineer-softswiss"},{title:"Integration Manager",company:"EveryMatrix",location:"Remote",slug:"integration-manager-everymatrix"}],keySkills:[{name:"Microservices Architecture",demandLevel:"High"},{name:"API Design",demandLevel:"High"},{name:"Multi-tenancy",demandLevel:"Medium"},{name:"Regulatory Compliance",demandLevel:"High"}],relatedCategories:[{name:"Sportsbook",slug:"sportsbook"},{name:"Payments",slug:"payments"},{name:"Casino Games / Studios",slug:"casino-games"}]},{id:"pc-2",slug:"sportsbook",name:"Sportsbook",parentCategory:"Core Platform",description:"Odds, trading, risk management, and real-time bet settlement stack.",longDescription:"Sportsbook platforms power the sports betting vertical, handling odds compilation, live trading, risk management, bet settlement, and feed integrations. The category spans full sportsbook solutions, odds feed providers, and specialized trading tools used by operators to manage their sports betting products.",synonyms:["Sports Betting Platform","Betting Engine","Trading Platform"],subcategories:[{name:"Full Sportsbook",slug:"full-sportsbook",description:"End-to-end sports betting solution"},{name:"Odds Feed",slug:"odds-feed",description:"Data feeds for pre-match and live odds"},{name:"Trading Tools",slug:"trading-tools",description:"Risk and liability management systems"},{name:"Bet Builder",slug:"bet-builder",description:"Same-game multi and custom bet construction"}],vendorCount:42,productCount:68,jobCount:312,complianceLevel:"High",tags:["sportsbook","risk","trading","odds"],lastUpdated:"2026-01-22",isTrending:!0,isFeatured:!0,topCompanies:[{name:"Kambi",slug:"kambi",offeringsStrength:"core"},{name:"Sportradar",slug:"sportradar",offeringsStrength:"core"},{name:"Betgenius",slug:"betgenius",offeringsStrength:"core"}],sampleJobs:[{title:"Sportsbook Trader",company:"Kambi",location:"Malta",slug:"sportsbook-trader-kambi"},{title:"Sports Data Analyst",company:"Sportradar",location:"London",slug:"sports-data-analyst"}],keySkills:[{name:"Odds Compilation",demandLevel:"High"},{name:"Risk Management",demandLevel:"High"},{name:"Real-time Data Processing",demandLevel:"High"},{name:"Sports Knowledge",demandLevel:"Medium"}],relatedCategories:[{name:"Platform (PAM)",slug:"platform-pam"},{name:"Data / Analytics",slug:"data-analytics"},{name:"Fraud / Risk",slug:"fraud-risk"}]},{id:"pc-3",slug:"casino-games",name:"Casino Games / Studios",parentCategory:"Content",description:"Slots, table games, and specialty game development studios.",longDescription:"Casino game studios create the content that drives the online casino vertical — slots, table games, crash games, and specialty titles. This category encompasses both large studios producing hundreds of titles annually and boutique studios focused on innovative mechanics and premium experiences.",synonyms:["Game Provider","Slot Studio","RNG Games","Casino Content"],subcategories:[{name:"Slots",slug:"slots",description:"Online slot machine games"},{name:"Table Games",slug:"table-games",description:"Digital versions of casino table games"},{name:"Crash / Instant Games",slug:"crash-games",description:"Fast-paced multiplier games"}],vendorCount:85,productCount:420,jobCount:580,complianceLevel:"Medium",tags:["casino","games","slots","studio"],lastUpdated:"2026-02-18",isFeatured:!0,isTrending:!0,topCompanies:[{name:"Evolution",slug:"evolution",offeringsStrength:"core"},{name:"Pragmatic Play",slug:"pragmatic-play",offeringsStrength:"core"},{name:"Play'n GO",slug:"playngo",offeringsStrength:"core"},{name:"Push Gaming",slug:"push-gaming",offeringsStrength:"core"}],sampleJobs:[{title:"Game Mathematician",company:"Pragmatic Play",location:"Malta",slug:"game-mathematician"},{title:"2D Game Artist",company:"Push Gaming",location:"London",slug:"game-artist"}],keySkills:[{name:"Game Mathematics",demandLevel:"High"},{name:"2D/3D Art & Animation",demandLevel:"High"},{name:"Unity / HTML5",demandLevel:"High"},{name:"Game Design",demandLevel:"Medium"}],relatedCategories:[{name:"Live Casino",slug:"live-casino"},{name:"Aggregation",slug:"aggregation"}]},{id:"pc-4",slug:"live-casino",name:"Live Casino",parentCategory:"Content",description:"Real-time streamed dealer games with studio operations and streaming tech.",longDescription:"Live casino providers operate physical studios with real dealers, streaming table games (blackjack, roulette, baccarat, game shows) to players in real-time. This combines broadcast technology, studio operations, dealer management, and specialized game mechanics.",synonyms:["Live Dealer","Live Gaming","Live Streaming Casino"],subcategories:[{name:"Live Table Games",slug:"live-tables",description:"Classic dealer-operated table games"},{name:"Game Shows",slug:"game-shows",description:"Entertainment-style live games"},{name:"Studio Technology",slug:"studio-tech",description:"Streaming and studio infrastructure"}],vendorCount:18,productCount:95,jobCount:890,complianceLevel:"Medium",tags:["live-casino","streaming","dealers"],lastUpdated:"2026-02-12",isTrending:!0,topCompanies:[{name:"Evolution",slug:"evolution",offeringsStrength:"core"},{name:"Pragmatic Play Live",slug:"pragmatic-play",offeringsStrength:"core"},{name:"Playtech Live",slug:"playtech",offeringsStrength:"core"}],sampleJobs:[{title:"Live Casino Dealer",company:"Evolution",location:"Riga",slug:"live-dealer-riga"},{title:"Studio Manager",company:"Evolution",location:"Malta",slug:"studio-manager"}],keySkills:[{name:"Broadcast Operations",demandLevel:"High"},{name:"Studio Management",demandLevel:"Medium"},{name:"Customer Interaction",demandLevel:"High"}],relatedCategories:[{name:"Casino Games / Studios",slug:"casino-games"},{name:"Aggregation",slug:"aggregation"}]},{id:"pc-5",slug:"aggregation",name:"Aggregation",parentCategory:"Content",description:"Unified API layer for slots, live casino, and jackpots from multiple studios.",longDescription:"Game aggregators provide a single API integration point that gives operators access to thousands of games from hundreds of studios. They handle content management, regulatory filtering, wallet transactions, and promotional tools across the entire game portfolio.",synonyms:["Casino Aggregator","Content Aggregator","Game Hub","GAP"],subcategories:[{name:"Game Aggregation Platform",slug:"gap",description:"Multi-provider API hub"},{name:"Content Management",slug:"content-mgmt",description:"Game portfolio curation tools"}],vendorCount:35,productCount:77,jobCount:120,complianceLevel:"Medium",tags:["aggregation","api","content"],lastUpdated:"2026-02-05",topCompanies:[{name:"SoftSwiss",slug:"softswiss",offeringsStrength:"core"},{name:"EveryMatrix",slug:"everymatrix",offeringsStrength:"core"},{name:"Pariplay",slug:"pariplay",offeringsStrength:"core"}],sampleJobs:[{title:"Integration Engineer",company:"Pariplay",location:"Gibraltar",slug:"integration-engineer"}],keySkills:[{name:"API Integration",demandLevel:"High"},{name:"Multi-vendor Management",demandLevel:"Medium"}],relatedCategories:[{name:"Casino Games / Studios",slug:"casino-games"},{name:"Platform (PAM)",slug:"platform-pam"}]},{id:"pc-6",slug:"payments",name:"Payments",parentCategory:"Operations",description:"Payment processing, payouts, crypto, and chargeback management for iGaming.",longDescription:"Payment solutions for iGaming cover the full lifecycle from deposit to withdrawal — PSPs, payment orchestration, crypto processing, payout automation, and chargeback management. The category is heavily regulated and requires deep knowledge of jurisdiction-specific payment method preferences.",synonyms:["PSP","Payment Service Provider","Payment Gateway","Cashier"],subcategories:[{name:"PSP",slug:"psp",description:"Payment service providers for deposit/withdrawal"},{name:"Payout Solutions",slug:"payouts",description:"Automated withdrawal and cashout systems"},{name:"Crypto Payments",slug:"crypto",description:"Cryptocurrency deposit and withdrawal"},{name:"Chargebacks",slug:"chargebacks",description:"Fraud-related payment dispute management"}],vendorCount:55,productCount:82,jobCount:195,complianceLevel:"High",tags:["payments","psp","crypto","fintech"],lastUpdated:"2026-02-08",isFeatured:!0,topCompanies:[{name:"Nuvei",slug:"nuvei",offeringsStrength:"core"},{name:"Trustly",slug:"trustly",offeringsStrength:"core"},{name:"Praxis Tech",slug:"praxis-tech",offeringsStrength:"core"}],sampleJobs:[{title:"Payments Manager",company:"Entain",location:"London",slug:"payments-manager"},{title:"Payment Integration Developer",company:"Nuvei",location:"Remote",slug:"payment-dev"}],keySkills:[{name:"Payment Processing",demandLevel:"High"},{name:"PCI DSS",demandLevel:"High"},{name:"Anti-fraud",demandLevel:"High"},{name:"Crypto/Blockchain",demandLevel:"Medium"}],relatedCategories:[{name:"Fraud / Risk",slug:"fraud-risk"},{name:"KYC / AML",slug:"kyc-aml"},{name:"Platform (PAM)",slug:"platform-pam"}]},{id:"pc-7",slug:"kyc-aml",name:"KYC / AML",parentCategory:"Compliance",description:"Identity verification, sanctions screening, and ongoing AML monitoring.",longDescription:"KYC (Know Your Customer) and AML (Anti-Money Laundering) solutions are critical for regulatory compliance in iGaming. They cover identity verification, document checking, sanctions/PEP screening, source of funds/wealth checks, and ongoing transaction monitoring.",synonyms:["Know Your Customer","Anti-Money Laundering","Identity Verification","IDV"],subcategories:[{name:"Identity Verification",slug:"idv",description:"Document and biometric identity checks"},{name:"Screening",slug:"screening",description:"Sanctions, PEP, and adverse media screening"},{name:"Transaction Monitoring",slug:"transaction-monitoring",description:"Ongoing AML surveillance"}],vendorCount:28,productCount:41,jobCount:310,complianceLevel:"High",tags:["kyc","aml","compliance","verification"],lastUpdated:"2025-12-11",isFeatured:!0,topCompanies:[{name:"Sumsub",slug:"sumsub",offeringsStrength:"core"},{name:"Jumio",slug:"jumio",offeringsStrength:"core"},{name:"GBG",slug:"gbg",offeringsStrength:"core"}],sampleJobs:[{title:"AML Analyst",company:"Entain",location:"London",slug:"aml-analyst-entain"},{title:"KYC Operations Lead",company:"Betsson",location:"Malta",slug:"kyc-lead"}],keySkills:[{name:"AML Regulations",demandLevel:"High"},{name:"Risk Assessment",demandLevel:"High"},{name:"Document Verification",demandLevel:"Medium"},{name:"SAR/STR Reporting",demandLevel:"High"}],relatedCategories:[{name:"Fraud / Risk",slug:"fraud-risk"},{name:"Compliance / Legal Tech",slug:"compliance-legaltech"}]},{id:"pc-8",slug:"fraud-risk",name:"Fraud / Risk",parentCategory:"Compliance",description:"Fraud prevention, bonus abuse detection, and real-time risk scoring.",longDescription:"Fraud and risk management solutions protect iGaming operators from financial losses due to fraudulent activity, multi-accounting, bonus abuse, collusion, and match-fixing. They employ machine learning, behavioral analytics, and device fingerprinting to detect and prevent threats in real-time.",synonyms:["Fraud Prevention","Risk Management","Anti-Fraud"],subcategories:[{name:"Fraud Detection",slug:"fraud-detection",description:"Real-time fraud scoring and alerts"},{name:"Bonus Abuse Prevention",slug:"bonus-abuse",description:"Multi-account and promo abuse detection"},{name:"Device Fingerprinting",slug:"device-fingerprint",description:"Device and browser identification"}],vendorCount:22,productCount:34,jobCount:185,complianceLevel:"High",tags:["fraud","risk","security","ml"],lastUpdated:"2026-01-28",topCompanies:[{name:"Featurespace",slug:"featurespace",offeringsStrength:"core"},{name:"SEON",slug:"seon",offeringsStrength:"core"}],sampleJobs:[{title:"Fraud Analyst",company:"Flutter",location:"Dublin",slug:"fraud-analyst"}],keySkills:[{name:"Machine Learning",demandLevel:"High"},{name:"Behavioral Analytics",demandLevel:"High"},{name:"Pattern Recognition",demandLevel:"Medium"}],relatedCategories:[{name:"KYC / AML",slug:"kyc-aml"},{name:"Payments",slug:"payments"}]},{id:"pc-9",slug:"crm-cdp",name:"CRM / CDP",parentCategory:"Operations",description:"Player lifecycle messaging, segmentation, bonuses, and personalization.",longDescription:"CRM (Customer Relationship Management) and CDP (Customer Data Platform) solutions for iGaming manage the entire player lifecycle — from acquisition through retention. They handle segmentation, automated campaigns, bonus management, real-time personalization, and churn prediction.",synonyms:["Customer Relationship Management","Customer Data Platform","Player CRM","Retention Platform"],subcategories:[{name:"Segmentation",slug:"segmentation",description:"Player cohort and behavior analysis"},{name:"Bonus Engine",slug:"bonus-engine",description:"Promotion and bonus management"},{name:"Messaging",slug:"messaging",description:"Omnichannel player communications"},{name:"Personalization",slug:"personalization",description:"Real-time content and offer personalization"}],vendorCount:39,productCount:59,jobCount:280,complianceLevel:"Low",tags:["crm","retention","personalization","bonuses"],lastUpdated:"2026-02-10",topCompanies:[{name:"Optimove",slug:"optimove",offeringsStrength:"core"},{name:"Fast Track",slug:"fast-track",offeringsStrength:"core"}],sampleJobs:[{title:"CRM Manager",company:"Betsson",location:"Malta",slug:"crm-manager"},{title:"Retention Specialist",company:"LeoVegas",location:"Stockholm",slug:"retention-specialist"}],keySkills:[{name:"Player Segmentation",demandLevel:"High"},{name:"Campaign Automation",demandLevel:"High"},{name:"Data Analysis",demandLevel:"High"},{name:"A/B Testing",demandLevel:"Medium"}],relatedCategories:[{name:"Data / Analytics",slug:"data-analytics"},{name:"Affiliates",slug:"affiliates"}]},{id:"pc-10",slug:"affiliates",name:"Affiliates",parentCategory:"Marketing",description:"Performance attribution, affiliate management, and campaign analytics.",longDescription:"Affiliate platforms and networks connect iGaming operators with marketing affiliates who drive player traffic. The category covers tracking platforms, affiliate management systems, reporting tools, and compliance monitoring for affiliate marketing activities.",synonyms:["Affiliate Marketing","Affiliate Tracking","Partner Management"],subcategories:[{name:"Tracking Platform",slug:"tracking",description:"Click and conversion attribution"},{name:"Affiliate Network",slug:"affiliate-network",description:"Marketplace connecting affiliates and operators"},{name:"Compliance Monitoring",slug:"affiliate-compliance",description:"Regulatory compliance for affiliate content"}],vendorCount:31,productCount:52,jobCount:220,complianceLevel:"Medium",tags:["affiliate","analytics","marketing","performance"],lastUpdated:"2025-11-29",topCompanies:[{name:"Income Access",slug:"income-access",offeringsStrength:"core"},{name:"Affilka by SOFTSWISS",slug:"softswiss",offeringsStrength:"secondary"}],sampleJobs:[{title:"Affiliate Manager",company:"Entain",location:"London",slug:"affiliate-manager"}],keySkills:[{name:"Affiliate Management",demandLevel:"High"},{name:"Performance Marketing",demandLevel:"High"},{name:"Negotiation",demandLevel:"Medium"}],relatedCategories:[{name:"CRM / CDP",slug:"crm-cdp"},{name:"Data / Analytics",slug:"data-analytics"}]},{id:"pc-11",slug:"data-analytics",name:"Data / Analytics",parentCategory:"Operations",description:"Business intelligence, player analytics, and data warehousing for iGaming.",longDescription:"Data and analytics solutions provide iGaming operators with business intelligence, player behavior analysis, real-time dashboards, and data infrastructure. This includes BI tools, data warehouses, predictive analytics, and specialized gaming analytics platforms.",synonyms:["Business Intelligence","BI","Player Analytics","Data Platform"],subcategories:[{name:"BI & Dashboards",slug:"bi-dashboards",description:"Reporting and visualization tools"},{name:"Player Analytics",slug:"player-analytics",description:"Behavioral analysis and segmentation"},{name:"Data Infrastructure",slug:"data-infra",description:"Warehousing and pipeline tools"}],vendorCount:26,productCount:38,jobCount:340,complianceLevel:"Low",tags:["analytics","data","bi","ml"],lastUpdated:"2026-02-01",topCompanies:[{name:"Sportradar",slug:"sportradar",offeringsStrength:"secondary"}],sampleJobs:[{title:"Data Engineer",company:"Flutter",location:"Dublin",slug:"data-engineer"},{title:"BI Analyst",company:"Kindred",location:"Malta",slug:"bi-analyst"}],keySkills:[{name:"SQL",demandLevel:"High"},{name:"Python",demandLevel:"High"},{name:"Data Modeling",demandLevel:"High"},{name:"Visualization (Tableau/Looker)",demandLevel:"Medium"}],relatedCategories:[{name:"CRM / CDP",slug:"crm-cdp"},{name:"Fraud / Risk",slug:"fraud-risk"}]},{id:"pc-12",slug:"compliance-legaltech",name:"Compliance / Legal Tech",parentCategory:"Compliance",description:"Regulatory reporting, responsible gaming tools, and compliance automation.",longDescription:"Compliance and legal technology solutions help iGaming operators meet regulatory requirements across jurisdictions. This includes responsible gaming tools (affordability checks, self-exclusion), regulatory reporting automation, license management, and compliance workflow platforms.",synonyms:["RegTech","Responsible Gaming","Compliance Automation"],subcategories:[{name:"Responsible Gaming",slug:"responsible-gaming",description:"Player protection and intervention tools"},{name:"Regulatory Reporting",slug:"reg-reporting",description:"Automated regulatory submission systems"},{name:"License Management",slug:"license-mgmt",description:"Multi-jurisdiction license tracking"}],vendorCount:24,productCount:36,jobCount:290,complianceLevel:"High",tags:["compliance","responsible-gaming","regtech"],lastUpdated:"2026-01-31",isTrending:!0,topCompanies:[{name:"Neccton",slug:"neccton",offeringsStrength:"core"},{name:"BetBuddy",slug:"betbuddy",offeringsStrength:"core"}],sampleJobs:[{title:"Compliance Officer",company:"Entain",location:"London",slug:"compliance-officer"},{title:"Responsible Gaming Analyst",company:"Flutter",location:"Dublin",slug:"rg-analyst"}],keySkills:[{name:"Regulatory Knowledge",demandLevel:"High"},{name:"Risk Assessment",demandLevel:"High"},{name:"Reporting & Documentation",demandLevel:"Medium"}],relatedCategories:[{name:"KYC / AML",slug:"kyc-aml"},{name:"Fraud / Risk",slug:"fraud-risk"}]},{id:"pc-13",slug:"hosting-infrastructure",name:"Hosting / Infrastructure",parentCategory:"Infrastructure",description:"Cloud hosting, CDN, and managed infrastructure for regulated iGaming workloads.",longDescription:"Hosting and infrastructure providers offer cloud, co-location, and managed services specifically designed for the iGaming industry's requirements — including data residency compliance, DDoS protection, low-latency game delivery, and regulatory-approved hosting environments.",synonyms:["Cloud Hosting","iGaming Hosting","Managed Infrastructure"],subcategories:[{name:"Cloud Hosting",slug:"cloud-hosting",description:"Regulated cloud environments"},{name:"CDN",slug:"cdn",description:"Content delivery for game assets and streaming"},{name:"DDoS Protection",slug:"ddos",description:"Security against denial-of-service attacks"}],vendorCount:15,productCount:22,jobCount:85,complianceLevel:"Medium",tags:["hosting","cloud","infrastructure","devops"],lastUpdated:"2026-01-15",topCompanies:[{name:"Continent 8",slug:"continent-8",offeringsStrength:"core"}],sampleJobs:[{title:"DevOps Engineer",company:"Continent 8",location:"London",slug:"devops-engineer"}],keySkills:[{name:"Cloud Architecture (AWS/GCP)",demandLevel:"High"},{name:"Kubernetes",demandLevel:"High"},{name:"Network Security",demandLevel:"Medium"}],relatedCategories:[{name:"Platform (PAM)",slug:"platform-pam"}]}],$P=[{value:"popularity",label:"Most popular"},{value:"vendors",label:"Most vendors"},{value:"jobs",label:"Most jobs"},{value:"name",label:"Name (A-Z)"}],WP=["Payments","KYC / AML","Platform (PAM)","Sportsbook","Casino Games / Studios","CRM / CDP","Affiliates","Fraud / Risk"],qN={parentCategory:[],complianceLevel:[],tags:[],signals:[]},ZP=({apiUrl:t,categoriesData:a,productCategoriesData:s,itemsPerPage:r=9})=>{const[i,o]=m.useState(a??s??[]),[l,c]=m.useState(!(a??s)),[h,d]=m.useState(1),[p,g]=m.useState(r),[y,u]=m.useState(""),[x,v]=m.useState("popularity"),[f,k]=m.useState("grid"),[w,j]=m.useState(qN);m.useEffect(()=>{if(a||s){o(a??s??[]),c(!1);return}let C=!0;const M=async()=>{try{if(!t){C&&o(zN);return}const R=await fetch(t);if(!R.ok)throw new Error(`${R.status}`);const D=await R.json();C&&Array.isArray(D)&&o(D)}catch{C&&o(zN)}finally{C&&c(!1)}};return c(!0),M(),()=>{C=!1}},[t,a,s]);const b=m.useMemo(function(){const C=M=>Array.from(new Set(M)).sort();return[{key:"parentCategory",label:"Pillar",type:"checkbox",options:C(i.map(M=>M.parentCategory)).map(M=>({value:M,label:M}))},{key:"complianceLevel",label:"Compliance Level",type:"checkbox",options:C(i.map(M=>M.complianceLevel)).map(M=>({value:M,label:M}))},{key:"tags",label:"Tags",type:"checkbox",searchable:!0,options:C(i.flatMap(M=>M.tags)).map(M=>({value:M,label:M}))},{key:"signals",label:"Signals",type:"toggle",options:[{value:"featured",label:"Featured only"},{value:"trending",label:"Trending only"}]}]},[i]),T=m.useMemo(()=>Object.entries(w).flatMap(([C,M])=>M.map(R=>({key:C,label:C.charAt(0).toUpperCase()+C.slice(1),value:R,onRemove:()=>j(D=>({...D,[C]:(D[C]??[]).filter(H=>H!==R)}))}))),[w]),S=m.useMemo(()=>{const C=y.trim().toLowerCase();return i.filter(M=>!(C&&!`${M.name} ${M.description} ${M.parentCategory} ${M.synonyms.join(" ")}`.toLowerCase().includes(C)||w.parentCategory.length&&!w.parentCategory.includes(M.parentCategory)||w.complianceLevel.length&&!w.complianceLevel.includes(M.complianceLevel)||w.tags.length&&!w.tags.every(R=>M.tags.includes(R))||w.signals.includes("featured")&&!M.isFeatured||w.signals.includes("trending")&&!M.isTrending))},[i,w,y]),N=m.useMemo(()=>{const C=[...S];return C.sort((M,R)=>{switch(x){case"vendors":return R.vendorCount-M.vendorCount;case"jobs":return R.jobCount-M.jobCount;case"name":return M.name.localeCompare(R.name);default:return R.vendorCount+R.productCount-(M.vendorCount+M.productCount)}}),C},[S,x]);m.useEffect(()=>{d(1)},[y,w,p]);const L=Math.max(1,Math.ceil(N.length/p)),I=N.slice((h-1)*p,h*p),A=()=>j(qN);return e.jsx(ja,{title:"Product Categories",description:"Explore the iGaming B2B technology stack — platforms, content, payments, compliance, and more.",headerPopularTags:WP,search:{value:y,onChange:u,onSubmit:u,onClear:()=>u(""),placeholder:"Search categories or synonyms (e.g. PAM, PSP)"},filters:b,filterValues:w,onFilterChange:(C,M)=>j(R=>({...R,[C]:M})),onClearFilters:A,activeFilters:T,sort:{value:x,options:$P,onChange:v},viewMode:f,onViewModeChange:k,pagination:{page:h,pageSize:p,totalPages:L,totalCount:N.length,toolbarTotalCount:i.length,toolbarTitle:"B2B Stack Categories",toolbarItemLabel:"categories",onPageChange:d,onPageSizeChange:C=>{g(C),d(1)}},resultsClassName:f==="grid"?"grid gap-4 sm:grid-cols-2 xl:grid-cols-3":"grid gap-4",children:l?e.jsx(ua,{totalColumns:p}):I.length?I.map(C=>e.jsx(_P,{id:C.id,slug:C.slug,name:C.name,parentCategory:C.parentCategory,description:C.description,vendorCount:C.vendorCount,productCount:C.productCount,jobCount:C.jobCount,complianceLevel:C.complianceLevel,tags:C.tags,isFeatured:C.isFeatured,isTrending:C.isTrending,subcategories:C.subcategories,topCompanies:C.topCompanies,viewMode:f},C.id)):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(mo,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No categories found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters."}),e.jsx(P,{variant:"outline",onClick:A,children:"Clear all filters"})]})})},JP={core:"bg-gaming-success/10 text-gaming-success border-gaming-success/20",secondary:"bg-gaming-warning/10 text-gaming-warning border-gaming-warning/20",emerging:"bg-accent/10 text-accent border-accent/20"},YP={High:"text-gaming-success",Medium:"text-gaming-warning",Low:"text-muted-foreground"},KP=({category:t,onNavigate:a})=>e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(At,{className:"w-5 h-5 text-accent"})," What is ",t.name,"?"]})}),e.jsx(_,{children:e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:t.longDescription})})]}),t.subcategories.length>0&&e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(fo,{className:"w-5 h-5 text-accent"})," Subcategories"]})}),e.jsx(_,{children:e.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:t.subcategories.map(s=>e.jsxs("div",{className:"p-3 rounded-lg border border-border/50",children:[e.jsx("p",{className:"text-sm font-medium text-foreground mb-1",children:s.name}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s.description})]},s.slug))})})]}),t.topCompanies.length>0&&e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(Me,{className:"w-5 h-5 text-accent"})," Top Companies Offering ",t.name]})}),e.jsxs(_,{children:[e.jsx("div",{className:"space-y-3",children:t.topCompanies.map((s,r)=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border border-border/50 hover:bg-secondary/50 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"w-6 h-6 rounded-full bg-accent/10 flex items-center justify-center text-xs font-bold text-accent",children:r+1}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:s.name})]}),e.jsx(q,{variant:"outline",className:`text-xs ${JP[s.offeringsStrength]}`,children:s.offeringsStrength})]},s.slug))}),e.jsxs(P,{variant:"outline",size:"sm",className:"w-full mt-4 gap-1.5",onClick:()=>a("/companies"),children:["View all ",t.name," companies ",e.jsx(qt,{className:"w-3.5 h-3.5"})]})]})]}),t.sampleJobs.length>0&&e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(je,{className:"w-5 h-5 text-gaming-success"})," Jobs Hiring in ",t.name,e.jsxs(q,{variant:"secondary",className:"text-xs ml-auto",children:[t.jobCount," total"]})]})}),e.jsxs(_,{children:[e.jsx("div",{className:"space-y-3",children:t.sampleJobs.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border border-border/50",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:s.title}),e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-2",children:[e.jsx(Me,{className:"w-3 h-3"})," ",s.company,e.jsx(Te,{className:"w-3 h-3 ml-1"})," ",s.location]})]}),e.jsx(P,{variant:"ghost",size:"sm",className:"text-accent",children:"View →"})]},s.slug))}),e.jsxs(P,{variant:"outline",size:"sm",className:"w-full mt-4 gap-1.5",onClick:()=>a("/jobs"),children:["Browse all ",t.name," jobs ",e.jsx(qt,{className:"w-3.5 h-3.5"})]})]})]}),t.keySkills.length>0&&e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(ha,{className:"w-5 h-5 text-gaming-gold"})," Skills to Work in ",t.name]})}),e.jsxs(_,{children:[e.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:t.keySkills.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border border-border/50",children:[e.jsx("span",{className:"text-sm font-medium text-foreground",children:s.name}),e.jsxs("span",{className:`text-xs font-medium ${YP[s.demandLevel]}`,children:[e.jsx(Cs,{className:"w-3 h-3 inline mr-0.5"}),s.demandLevel," demand"]})]},s.name))}),e.jsxs(P,{variant:"outline",size:"sm",className:"w-full mt-4 gap-1.5",onClick:()=>a("/courses"),children:["Browse related courses ",e.jsx(qt,{className:"w-3.5 h-3.5"})]})]})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(U,{children:e.jsxs(_,{className:"p-4 space-y-3",children:[e.jsx("h3",{className:"font-semibold text-foreground",children:"Category Info"}),e.jsx(co,{label:"Pillar",value:t.parentCategory}),e.jsx(co,{label:"Vendors",value:t.vendorCount.toString()}),e.jsx(co,{label:"Products",value:t.productCount.toString()}),e.jsx(co,{label:"Active Jobs",value:t.jobCount.toString()}),e.jsx(co,{label:"Compliance",value:t.complianceLevel}),e.jsx(co,{label:"Last Updated",value:t.lastUpdated}),t.synonyms.length>0&&e.jsxs("div",{className:"pt-2 border-t border-border/50",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Synonyms"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:t.synonyms.map(s=>e.jsx(q,{variant:"outline",className:"text-xs",children:s},s))})]})]})}),t.relatedCategories.length>0&&e.jsx(U,{children:e.jsxs(_,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold text-foreground flex items-center gap-2",children:[e.jsx(fo,{className:"w-4 h-4 text-accent"})," Related Categories"]}),t.relatedCategories.map(s=>e.jsxs(P,{variant:"outline",size:"sm",className:"w-full justify-start gap-2",onClick:()=>a(`/product-categories/${s.slug}`),children:[e.jsx(mo,{className:"w-3.5 h-3.5"})," ",s.name]},s.slug))]})}),e.jsx(U,{children:e.jsxs(_,{className:"p-4 space-y-3",children:[e.jsx("h3",{className:"font-semibold text-foreground",children:"Tags"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.tags.map(s=>e.jsxs(q,{variant:"secondary",className:"text-xs",children:["#",s]},s))})]})})]})]})}),co=({label:t,value:a})=>e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:t}),e.jsx("span",{className:"text-foreground font-medium text-right max-w-[60%]",children:a})]}),FN={Regulated:"bg-gaming-success/10 text-gaming-success",Restricted:"bg-destructive/10 text-destructive",Emerging:"bg-gaming-warning/10 text-gaming-warning"},HN={positive:"bg-gaming-success/10 text-gaming-success border-gaming-success/20",neutral:"bg-secondary text-muted-foreground border-border",warning:"bg-gaming-warning/10 text-gaming-warning border-gaming-warning/20"},Rl={Low:"text-muted-foreground",Medium:"text-gaming-warning",High:"text-gaming-success"},XP=({market:t,viewMode:a="grid"})=>a==="list"?e.jsx(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card cursor-pointer",onClick:()=>window.location.replace(`/markets/${t.slug}`),children:e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-1",children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground",children:t.name}),e.jsx(q,{variant:"secondary",className:"text-xs",children:t.region}),e.jsx(q,{className:`text-xs ${FN[t.status]}`,children:t.status}),t.isFeatured&&e.jsx(q,{className:"bg-primary text-primary-foreground text-xs",children:"Featured"})]}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mb-2",children:t.overview}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.badges.map(s=>e.jsx(q,{variant:"outline",className:`text-xs ${HN[s.type]}`,children:s.label},s.label))})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4 text-center sm:min-w-[280px]",children:[e.jsx(fM,{icon:je,label:"Jobs",value:t.stats.jobsCount.toLocaleString()}),e.jsx(fM,{icon:Me,label:"Companies",value:t.stats.companiesCount.toLocaleString()}),e.jsx(fM,{icon:so,label:"Remote",value:`${t.stats.remoteRatio}%`})]})]})}):e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card cursor-pointer group",onClick:()=>window.location.replace(`/markets/${t.slug}`),children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[e.jsx(q,{variant:"secondary",className:"text-xs",children:t.region}),e.jsx(q,{className:`text-xs ${FN[t.status]}`,children:t.status}),t.isFeatured&&e.jsx(q,{className:"bg-primary text-primary-foreground text-xs",children:"Featured"})]}),e.jsx("h3",{className:"mb-1 text-lg font-semibold text-foreground group-hover:text-accent transition-colors",children:t.name}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 mb-3 py-2 border-y border-border/50",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-bold text-foreground",children:t.stats.jobsCount.toLocaleString()}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Jobs"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-bold text-foreground",children:t.stats.companiesCount.toLocaleString()}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Companies"})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-lg font-bold text-foreground",children:[t.stats.remoteRatio,"%"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Remote"})]})]}),e.jsxs("div",{className:"flex gap-4 mb-3 text-xs",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Cs,{className:`h-3.5 w-3.5 ${Rl[t.stats.hiringIntensity]}`}),e.jsx("span",{className:"text-muted-foreground",children:"Hiring:"}),e.jsx("span",{className:`font-medium ${Rl[t.stats.hiringIntensity]}`,children:t.stats.hiringIntensity})]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Kt,{className:`h-3.5 w-3.5 ${Rl[t.stats.complianceIntensity]}`}),e.jsx("span",{className:"text-muted-foreground",children:"Compliance:"}),e.jsx("span",{className:`font-medium ${Rl[t.stats.complianceIntensity]}`,children:t.stats.complianceIntensity})]})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-3",children:t.badges.slice(0,3).map(s=>e.jsx(q,{variant:"outline",className:`text-xs ${HN[s.type]}`,children:s.label},s.label))}),t.trendingRoles[0]&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx($e,{className:"h-3 w-3 text-gaming-success"}),e.jsxs("span",{children:["Trending: ",e.jsx("strong",{className:"text-foreground",children:t.trendingRoles[0].roleFamily})]}),e.jsxs("span",{className:"text-gaming-success",children:["+",t.trendingRoles[0].changePercent,"%"]})]})]}),fM=({icon:t,label:a,value:s})=>e.jsxs("div",{children:[e.jsx(t,{className:"h-4 w-4 mx-auto mb-0.5 text-muted-foreground"}),e.jsx("p",{className:"text-sm font-bold text-foreground",children:s}),e.jsx("p",{className:"text-xs text-muted-foreground",children:a})]}),zM=[{id:"mk-malta",slug:"malta",name:"Malta",region:"Europe",countries:["Malta"],cities:["Sliema","St. Julian's","Birkirkara"],status:"Regulated",verticals:["Casino","Sportsbook","Poker","Live Casino"],languages:["English","Maltese"],currency:"EUR",timezone:"CET",populationM:.5,revenuePotentialM:2200,licensesRequired:4,isFeatured:!0,overview:"Malta is the undisputed hub of European iGaming, home to 300+ licensed operators and suppliers. The Malta Gaming Authority (MGA) provides one of the most recognized regulatory frameworks globally, making it the jurisdiction of choice for B2B and B2C companies.",badges:[{label:"Remote-friendly",type:"positive"},{label:"High hiring",type:"positive"},{label:"High compliance",type:"neutral"}],stats:{jobsCount:842,companiesCount:312,remoteRatio:62,complianceIntensity:"High",hiringIntensity:"High"},topEmployers:[{name:"Evolution",slug:"evolution",openRoles:45,employeeRange:"10,000+",isClaimed:!0},{name:"Betsson",slug:"betsson",openRoles:32,employeeRange:"1,001-5,000",isClaimed:!0},{name:"Kindred Group",slug:"kindred-group",openRoles:28,employeeRange:"1,001-5,000",isClaimed:!0},{name:"SOFTSWISS",slug:"softswiss",openRoles:24,employeeRange:"501-1,000",isClaimed:!0},{name:"Yggdrasil",slug:"yggdrasil",openRoles:15,employeeRange:"201-500"}],trendingRoles:[{roleFamily:"Engineering",count:210,changePercent:12},{roleFamily:"Compliance",count:95,changePercent:18},{roleFamily:"Product",count:78,changePercent:8},{roleFamily:"Payments",count:52,changePercent:22},{roleFamily:"Marketing",count:68,changePercent:-3}],salaryPulse:{currency:"EUR",medianAnnual:52e3,rangeMin:28e3,rangeMax:12e4,topRoleFamilies:[{role:"Engineering",median:62e3},{role:"Product",median:58e3},{role:"Compliance",median:48e3},{role:"Marketing",median:45e3}]},regulators:[{name:"Malta Gaming Authority",slug:"mga",authority:"MGA",licenseTypes:["B2B","B2C","Type 1","Type 2","Type 3","Type 4"]}],upcomingEvents:[{name:"SiGMA Europe",slug:"sigma-europe",date:"2026-11-11",city:"Valletta"},{name:"Malta iGaming Seminar",slug:"migs-2026",date:"2026-06-15",city:"St. Julian's"}],news:[{title:"iGB@ICE 2026: The context behind Malta’s success as an iGaming hub",link:"https://igamingbusiness.com/igb-ice/context-malta-success-igaming-hub",scraped_at:"2026-03-01T10:22:30.746000",company_name:"iGaming Business"},{title:"Make it in Malta: Supporting operators every step of the way on their Malta success story",link:"https://igamingbusiness.com/finance/make-it-in-malta-supporting-operators-every-step-of-the-way/",scraped_at:"2026-03-01T10:22:30.743000",company_name:"iGaming Business"},{title:"Responsible innovation: The MGA’s vision for AI in iGaming",link:"https://igamingbusiness.com/legal-compliance/regulation/responsible-innovation-the-mgas-vision-for-ai-in-igaming/",scraped_at:"2026-03-01T10:22:30.740000",company_name:"iGaming Business"},{title:"Super Technologies to acquire Maxbet Romania and Malta operations",link:"https://igamingbusiness.com/strategy/super-technologies-acquire-maxbet-romania-malta/",scraped_at:"2026-03-01T10:22:30.735000",company_name:"iGaming Business"},{title:"Deloitte Malta and Fieldstream collaborate to elevate iGaming performance through AI-powered analytics",link:"https://igamingbusiness.com/company-news/deloitte-malta-and-fieldstream-collaborate-to-elevate-igaming-performance-through-ai-powered-analytics/",scraped_at:"2026-03-01T10:22:30.721000",company_name:"iGaming Business"}]},{id:"mk-uk",slug:"united-kingdom",name:"United Kingdom",region:"Europe",countries:["United Kingdom"],cities:["London","Manchester","Leeds","Edinburgh"],status:"Regulated",verticals:["Sportsbook","Casino","Poker","Bingo"],languages:["English"],currency:"GBP",timezone:"GMT",populationM:67,revenuePotentialM:5800,licensesRequired:3,isFeatured:!0,overview:"The UK is the world's most mature and tightly regulated iGaming market. The UK Gambling Commission (UKGC) sets global standards for player protection and responsible gambling. London is a key hub for iGaming headquarters and talent.",badges:[{label:"High compliance",type:"warning"},{label:"High hiring",type:"positive"}],stats:{jobsCount:1250,companiesCount:420,remoteRatio:45,complianceIntensity:"High",hiringIntensity:"High"},topEmployers:[{name:"Flutter Entertainment",slug:"flutter",openRoles:68,employeeRange:"10,000+",isClaimed:!0},{name:"Entain",slug:"entain",openRoles:55,employeeRange:"10,000+",isClaimed:!0},{name:"Playtech",slug:"playtech",openRoles:42,employeeRange:"5,001-10,000",isClaimed:!0},{name:"bet365",slug:"bet365",openRoles:38,employeeRange:"5,001-10,000"}],trendingRoles:[{roleFamily:"Compliance",count:185,changePercent:25},{roleFamily:"Engineering",count:320,changePercent:8},{roleFamily:"Data Science",count:120,changePercent:15},{roleFamily:"Responsible Gambling",count:65,changePercent:30}],salaryPulse:{currency:"GBP",medianAnnual:58e3,rangeMin:3e4,rangeMax:15e4,topRoleFamilies:[{role:"Engineering",median:72e3},{role:"Data Science",median:68e3},{role:"Product",median:65e3},{role:"Compliance",median:55e3}]},regulators:[{name:"UK Gambling Commission",slug:"ukgc",authority:"UKGC",licenseTypes:["Remote","Non-remote","Software"]}],upcomingEvents:[{name:"ICE London",slug:"ice-london-2026",date:"2026-02-10",city:"London"},{name:"Betting on Sports",slug:"bos-2026",date:"2026-09-15",city:"London"}]},{id:"mk-gibraltar",slug:"gibraltar",name:"Gibraltar",region:"Europe",countries:["Gibraltar"],cities:["Gibraltar"],status:"Regulated",verticals:["Sportsbook","Casino","Poker"],languages:["English"],currency:"GBP",timezone:"CET",populationM:.03,revenuePotentialM:1800,licensesRequired:2,isFeatured:!1,overview:"Gibraltar has long been a premium jurisdiction for iGaming, offering favorable tax rates and a well-established regulatory framework. Despite its small size, it hosts some of the industry's biggest names.",badges:[{label:"Tax-friendly",type:"positive"},{label:"High compliance",type:"neutral"}],stats:{jobsCount:280,companiesCount:65,remoteRatio:30,complianceIntensity:"High",hiringIntensity:"Medium"},topEmployers:[{name:"bet365",slug:"bet365",openRoles:22,employeeRange:"1,001-5,000"},{name:"888 Holdings",slug:"888",openRoles:18,employeeRange:"1,001-5,000",isClaimed:!0},{name:"Lottoland",slug:"lottoland",openRoles:8,employeeRange:"201-500"}],trendingRoles:[{roleFamily:"Engineering",count:65,changePercent:5},{roleFamily:"Finance",count:40,changePercent:10},{roleFamily:"Compliance",count:35,changePercent:12}],salaryPulse:{currency:"GBP",medianAnnual:55e3,rangeMin:32e3,rangeMax:13e4,topRoleFamilies:[{role:"Engineering",median:68e3},{role:"Finance",median:6e4},{role:"Compliance",median:52e3}]},regulators:[{name:"Gibraltar Gambling Commissioner",slug:"ggc",authority:"GGC",licenseTypes:["B2B","B2C"]}],upcomingEvents:[]},{id:"mk-spain",slug:"spain",name:"Spain",region:"Europe",countries:["Spain"],cities:["Madrid","Barcelona","Valencia"],status:"Regulated",verticals:["Sportsbook","Casino","Poker"],languages:["Spanish"],currency:"EUR",timezone:"CET",populationM:47,revenuePotentialM:1400,licensesRequired:2,isFeatured:!1,overview:"Spain's regulated market under the DGOJ provides a structured framework for online gambling. The market is competitive with strong brand presence from local and international operators.",badges:[{label:"Growing market",type:"positive"}],stats:{jobsCount:185,companiesCount:78,remoteRatio:40,complianceIntensity:"Medium",hiringIntensity:"Medium"},topEmployers:[{name:"Codere",slug:"codere",openRoles:15,employeeRange:"1,001-5,000"},{name:"Luckia",slug:"luckia",openRoles:8,employeeRange:"501-1,000"}],trendingRoles:[{roleFamily:"Marketing",count:45,changePercent:15},{roleFamily:"Engineering",count:38,changePercent:6}],salaryPulse:{currency:"EUR",medianAnnual:42e3,rangeMin:25e3,rangeMax:9e4,topRoleFamilies:[{role:"Engineering",median:48e3},{role:"Marketing",median:38e3}]},regulators:[{name:"DGOJ",slug:"dgoj",authority:"DGOJ",licenseTypes:["General","Sports Betting"]}],upcomingEvents:[{name:"SBC Summit Barcelona",slug:"sbc-barcelona",date:"2026-09-16",city:"Barcelona"}]},{id:"mk-sweden",slug:"sweden",name:"Sweden",region:"Europe",countries:["Sweden"],cities:["Stockholm","Gothenburg","Malmö"],status:"Regulated",verticals:["Sportsbook","Casino"],languages:["Swedish","English"],currency:"SEK",timezone:"CET",populationM:10,revenuePotentialM:1800,licensesRequired:2,isFeatured:!1,overview:"Sweden's re-regulated market under Spelinspektionen has created a structured competitive environment. Stockholm is a thriving tech hub with a strong gaming talent pipeline.",badges:[{label:"Remote-friendly",type:"positive"},{label:"High compliance",type:"neutral"}],stats:{jobsCount:320,companiesCount:95,remoteRatio:65,complianceIntensity:"High",hiringIntensity:"Medium"},topEmployers:[{name:"Betsson",slug:"betsson",openRoles:28,employeeRange:"1,001-5,000",isClaimed:!0},{name:"LeoVegas",slug:"leovegas",openRoles:15,employeeRange:"501-1,000"},{name:"NetEnt (Evolution)",slug:"netent",openRoles:20,employeeRange:"1,001-5,000"}],trendingRoles:[{roleFamily:"Engineering",count:95,changePercent:10},{roleFamily:"Product",count:42,changePercent:7}],salaryPulse:{currency:"SEK",medianAnnual:54e4,rangeMin:32e4,rangeMax:11e5,topRoleFamilies:[{role:"Engineering",median:62e4},{role:"Product",median:58e4}]},regulators:[{name:"Spelinspektionen",slug:"spelinspektionen",authority:"SGA",licenseTypes:["Online Gambling","Land-based"]}],upcomingEvents:[]},{id:"mk-cyprus",slug:"cyprus",name:"Cyprus",region:"Europe",countries:["Cyprus"],cities:["Limassol","Nicosia","Larnaca"],status:"Regulated",verticals:["Casino","Sportsbook"],languages:["Greek","English"],currency:"EUR",timezone:"EET",populationM:1.2,revenuePotentialM:600,licensesRequired:2,isFeatured:!1,overview:"Cyprus has emerged as a popular alternative to Malta for iGaming companies, offering EU membership, favorable taxes, and a growing talent pool attracted by the Mediterranean lifestyle.",badges:[{label:"Growing hub",type:"positive"},{label:"Tax-friendly",type:"positive"}],stats:{jobsCount:220,companiesCount:85,remoteRatio:50,complianceIntensity:"Medium",hiringIntensity:"High"},topEmployers:[{name:"EveryMatrix",slug:"everymatrix",openRoles:18,employeeRange:"501-1,000"},{name:"Pragmatic Play",slug:"pragmatic-play",openRoles:22,employeeRange:"1,001-5,000",isClaimed:!0}],trendingRoles:[{roleFamily:"Engineering",count:55,changePercent:20},{roleFamily:"Customer Support",count:40,changePercent:15}],salaryPulse:{currency:"EUR",medianAnnual:38e3,rangeMin:22e3,rangeMax:85e3,topRoleFamilies:[{role:"Engineering",median:45e3},{role:"Customer Support",median:28e3}]},regulators:[{name:"National Betting Authority",slug:"nba-cyprus",authority:"NBA",licenseTypes:["Class A","Class B"]}],upcomingEvents:[]},{id:"mk-brazil",slug:"brazil",name:"Brazil",region:"Latin America",countries:["Brazil"],cities:["São Paulo","Rio de Janeiro","Curitiba"],status:"Emerging",verticals:["Sportsbook","Casino"],languages:["Portuguese"],currency:"BRL",timezone:"BRT",populationM:214,revenuePotentialM:3500,licensesRequired:1,isFeatured:!0,overview:"Brazil represents the largest untapped iGaming opportunity in Latin America. With regulatory frameworks taking shape, international operators are racing to establish presence in this massive market.",badges:[{label:"High growth",type:"positive"},{label:"Emerging regulation",type:"neutral"}],stats:{jobsCount:145,companiesCount:42,remoteRatio:55,complianceIntensity:"Low",hiringIntensity:"High"},topEmployers:[{name:"Betano",slug:"betano",openRoles:20,employeeRange:"201-500"},{name:"Bet365 Brazil",slug:"bet365-brazil",openRoles:15,employeeRange:"51-200"}],trendingRoles:[{roleFamily:"Marketing",count:42,changePercent:35},{roleFamily:"Engineering",count:35,changePercent:28},{roleFamily:"Compliance",count:25,changePercent:40}],salaryPulse:{currency:"BRL",medianAnnual:18e4,rangeMin:8e4,rangeMax:45e4,topRoleFamilies:[{role:"Engineering",median:22e4},{role:"Marketing",median:16e4}]},regulators:[{name:"SPA/MF",slug:"spa-brazil",authority:"SPA",licenseTypes:["Sports Betting","Online Casino"]}],upcomingEvents:[{name:"BiS - Brazilian iGaming Summit",slug:"bis-2026",date:"2026-06-25",city:"São Paulo"}]},{id:"mk-canada",slug:"canada-ontario",name:"Canada (Ontario)",region:"North America",countries:["Canada"],cities:["Toronto","Ottawa"],status:"Regulated",verticals:["Sportsbook","Casino","Poker"],languages:["English","French"],currency:"CAD",timezone:"EST",populationM:15,revenuePotentialM:2800,licensesRequired:2,isFeatured:!0,overview:"Ontario's regulated iGaming market launched in 2022 and has rapidly become one of North America's most competitive markets, attracting major international operators.",badges:[{label:"Fast-growing",type:"positive"},{label:"High compliance",type:"neutral"}],stats:{jobsCount:380,companiesCount:55,remoteRatio:70,complianceIntensity:"High",hiringIntensity:"High"},topEmployers:[{name:"BetMGM",slug:"betmgm",openRoles:25,employeeRange:"501-1,000"},{name:"theScore",slug:"thescore",openRoles:18,employeeRange:"201-500"},{name:"PointsBet",slug:"pointsbet",openRoles:12,employeeRange:"201-500"}],trendingRoles:[{roleFamily:"Engineering",count:95,changePercent:18},{roleFamily:"Marketing",count:65,changePercent:22},{roleFamily:"Compliance",count:55,changePercent:30}],salaryPulse:{currency:"CAD",medianAnnual:85e3,rangeMin:5e4,rangeMax:18e4,topRoleFamilies:[{role:"Engineering",median:105e3},{role:"Product",median:95e3},{role:"Compliance",median:78e3}]},regulators:[{name:"AGCO (iGO)",slug:"agco",authority:"AGCO",licenseTypes:["Operator","Supplier"]}],upcomingEvents:[{name:"Canadian Gaming Summit",slug:"cgs-2026",date:"2026-06-10",city:"Toronto"}]},{id:"mk-us",slug:"united-states",name:"United States",region:"North America",countries:["United States"],cities:["New York","New Jersey","Las Vegas","Chicago"],status:"Restricted",verticals:["Sportsbook","Casino","Poker","DFS"],languages:["English"],currency:"USD",timezone:"EST",populationM:330,revenuePotentialM:9500,licensesRequired:6,isFeatured:!0,overview:"The US iGaming market is expanding state-by-state, creating massive opportunities but also regulatory complexity. Sports betting is legal in 30+ states, while iCasino remains limited to a handful of jurisdictions.",badges:[{label:"Highest revenue potential",type:"positive"},{label:"Complex regulation",type:"warning"}],stats:{jobsCount:1800,companiesCount:280,remoteRatio:55,complianceIntensity:"High",hiringIntensity:"High"},topEmployers:[{name:"DraftKings",slug:"draftkings",openRoles:85,employeeRange:"5,001-10,000",isClaimed:!0},{name:"FanDuel",slug:"fanduel",openRoles:72,employeeRange:"5,001-10,000"},{name:"BetMGM",slug:"betmgm",openRoles:55,employeeRange:"1,001-5,000"},{name:"Caesars Digital",slug:"caesars",openRoles:40,employeeRange:"10,000+"}],trendingRoles:[{roleFamily:"Engineering",count:420,changePercent:14},{roleFamily:"Compliance",count:280,changePercent:32},{roleFamily:"Data Science",count:195,changePercent:20},{roleFamily:"Marketing",count:310,changePercent:8}],salaryPulse:{currency:"USD",medianAnnual:95e3,rangeMin:5e4,rangeMax:22e4,topRoleFamilies:[{role:"Engineering",median:125e3},{role:"Data Science",median:115e3},{role:"Product",median:11e4},{role:"Compliance",median:9e4}]},regulators:[{name:"NJ DGE",slug:"nj-dge",authority:"DGE",licenseTypes:["Casino","Sports Wagering"]},{name:"PGCB (Pennsylvania)",slug:"pgcb",authority:"PGCB",licenseTypes:["Interactive Gaming","Sports Wagering"]}],upcomingEvents:[{name:"G2E Las Vegas",slug:"g2e-2026",date:"2026-10-06",city:"Las Vegas"},{name:"SBC Summit North America",slug:"sbc-na-2026",date:"2026-05-13",city:"New York"}]},{id:"mk-philippines",slug:"philippines",name:"Philippines",region:"Asia-Pacific",countries:["Philippines"],cities:["Manila","Cebu","Clark"],status:"Regulated",verticals:["Casino","Sportsbook","Poker"],languages:["Filipino","English"],currency:"PHP",timezone:"PHT",populationM:115,revenuePotentialM:1200,licensesRequired:2,isFeatured:!1,overview:"The Philippines is a major hub for offshore gaming operations (POGOs) and has a growing domestic market regulated by PAGCOR. It offers cost-effective operations and a large English-speaking talent pool.",badges:[{label:"Cost-effective",type:"positive"},{label:"Offshore hub",type:"neutral"}],stats:{jobsCount:420,companiesCount:95,remoteRatio:35,complianceIntensity:"Medium",hiringIntensity:"Medium"},topEmployers:[{name:"PAGCOR",slug:"pagcor",openRoles:15,employeeRange:"5,001-10,000"},{name:"Philweb",slug:"philweb",openRoles:10,employeeRange:"201-500"}],trendingRoles:[{roleFamily:"Customer Support",count:120,changePercent:5},{roleFamily:"Engineering",count:65,changePercent:12}],salaryPulse:{currency:"PHP",medianAnnual:85e4,rangeMin:4e5,rangeMax:25e5,topRoleFamilies:[{role:"Engineering",median:12e5},{role:"Customer Support",median:55e4}]},regulators:[{name:"PAGCOR",slug:"pagcor-reg",authority:"PAGCOR",licenseTypes:["POGO","Domestic"]}],upcomingEvents:[]},{id:"mk-india",slug:"india",name:"India",region:"Asia-Pacific",countries:["India"],cities:["Bangalore","Mumbai","Goa","Hyderabad"],status:"Emerging",verticals:["Sportsbook","Fantasy Sports","Rummy"],languages:["Hindi","English"],currency:"INR",timezone:"IST",populationM:1400,revenuePotentialM:2e3,licensesRequired:1,isFeatured:!1,overview:"India is one of the world's most promising iGaming markets, driven by massive mobile adoption and a young population. Fantasy sports and real-money gaming are growing rapidly despite regulatory uncertainty.",badges:[{label:"Massive TAM",type:"positive"},{label:"Regulatory uncertainty",type:"warning"}],stats:{jobsCount:180,companiesCount:65,remoteRatio:60,complianceIntensity:"Low",hiringIntensity:"Medium"},topEmployers:[{name:"Dream11",slug:"dream11",openRoles:25,employeeRange:"1,001-5,000"},{name:"Games24x7",slug:"games24x7",openRoles:15,employeeRange:"501-1,000"}],trendingRoles:[{roleFamily:"Engineering",count:55,changePercent:25},{roleFamily:"Product",count:30,changePercent:18}],salaryPulse:{currency:"INR",medianAnnual:18e5,rangeMin:8e5,rangeMax:5e6,topRoleFamilies:[{role:"Engineering",median:22e5},{role:"Product",median:2e6}]},regulators:[],upcomingEvents:[{name:"SPiCE India",slug:"spice-india",date:"2026-03-18",city:"Goa"}]},{id:"mk-nigeria",slug:"nigeria",name:"Nigeria",region:"Africa",countries:["Nigeria"],cities:["Lagos","Abuja"],status:"Emerging",verticals:["Sportsbook"],languages:["English"],currency:"NGN",timezone:"WAT",populationM:220,revenuePotentialM:800,licensesRequired:1,isFeatured:!1,overview:"Nigeria is Africa's largest iGaming market, driven by sports betting popularity and mobile-first consumer behavior. The regulatory environment is evolving with state-level licensing.",badges:[{label:"Mobile-first",type:"positive"},{label:"Emerging regulation",type:"neutral"}],stats:{jobsCount:85,companiesCount:30,remoteRatio:40,complianceIntensity:"Low",hiringIntensity:"Medium"},topEmployers:[{name:"Bet9ja",slug:"bet9ja",openRoles:12,employeeRange:"501-1,000"},{name:"BetKing",slug:"betking",openRoles:8,employeeRange:"201-500"}],trendingRoles:[{roleFamily:"Marketing",count:25,changePercent:30},{roleFamily:"Engineering",count:18,changePercent:20}],salaryPulse:{currency:"NGN",medianAnnual:12e6,rangeMin:5e6,rangeMax:35e6,topRoleFamilies:[{role:"Engineering",median:15e6},{role:"Marketing",median:1e7}]},regulators:[{name:"National Lottery Regulatory Commission",slug:"nlrc",authority:"NLRC",licenseTypes:["Sports Betting"]}],upcomingEvents:[]},{id:"mk-germany",slug:"germany",name:"Germany",region:"Europe",countries:["Germany"],cities:["Berlin","Hamburg","Munich","Frankfurt"],status:"Regulated",verticals:["Sportsbook","Casino"],languages:["German"],currency:"EUR",timezone:"CET",populationM:84,revenuePotentialM:2800,licensesRequired:3,isFeatured:!1,overview:"Germany's regulated market under the GGL has strict requirements including deposit limits and mandatory pauses. Despite restrictions, the market size makes it essential for European operators.",badges:[{label:"Strict regulation",type:"warning"},{label:"Large market",type:"positive"}],stats:{jobsCount:290,companiesCount:110,remoteRatio:50,complianceIntensity:"High",hiringIntensity:"Medium"},topEmployers:[{name:"Tipico",slug:"tipico",openRoles:22,employeeRange:"1,001-5,000"},{name:"bwin",slug:"bwin",openRoles:15,employeeRange:"501-1,000"}],trendingRoles:[{roleFamily:"Compliance",count:65,changePercent:28},{roleFamily:"Engineering",count:72,changePercent:6}],salaryPulse:{currency:"EUR",medianAnnual:6e4,rangeMin:35e3,rangeMax:13e4,topRoleFamilies:[{role:"Engineering",median:72e3},{role:"Compliance",median:58e3}]},regulators:[{name:"GGL",slug:"ggl",authority:"GGL",licenseTypes:["Virtual Slots","Poker","Sports Betting"]}],upcomingEvents:[]},{id:"mk-colombia",slug:"colombia",name:"Colombia",region:"Latin America",countries:["Colombia"],cities:["Bogotá","Medellín"],status:"Regulated",verticals:["Sportsbook","Casino"],languages:["Spanish"],currency:"COP",timezone:"COT",populationM:51,revenuePotentialM:600,licensesRequired:2,isFeatured:!1,overview:"Colombia was the first Latin American country to regulate online gambling, creating a model for the region. Coljuegos oversees licensing and the market continues to attract international operators.",badges:[{label:"LatAm pioneer",type:"positive"}],stats:{jobsCount:65,companiesCount:28,remoteRatio:45,complianceIntensity:"Medium",hiringIntensity:"Low"},topEmployers:[{name:"Betplay",slug:"betplay",openRoles:8,employeeRange:"201-500"},{name:"Wplay",slug:"wplay",openRoles:5,employeeRange:"51-200"}],trendingRoles:[{roleFamily:"Marketing",count:18,changePercent:12},{roleFamily:"Engineering",count:12,changePercent:8}],salaryPulse:{currency:"COP",medianAnnual:72e6,rangeMin:36e6,rangeMax:18e7,topRoleFamilies:[{role:"Engineering",median:9e7},{role:"Marketing",median:6e7}]},regulators:[{name:"Coljuegos",slug:"coljuegos",authority:"Coljuegos",licenseTypes:["Online Gambling"]}],upcomingEvents:[]}],QP=t=>zM.find(a=>a.slug===t),eT=["Europe","North America","Latin America","Asia-Pacific","Africa","Middle East"],tT=({open:t,onOpenChange:a,onSubmit:s})=>{const[r,i]=m.useState(""),[o,l]=m.useState(""),[c,h]=m.useState(""),[d,p]=m.useState(""),[g,y]=m.useState(!1),u=r.trim().length>=2&&o&&c.trim().length>=10,x=()=>{u&&(s==null||s({marketName:r.trim(),region:o,description:c.trim(),contactEmail:d.trim()||void 0}),y(!0))},v=()=>{i(""),l(""),h(""),p(""),y(!1),a(!1)};return e.jsx(tt,{open:t,onOpenChange:v,children:e.jsx(Xe,{className:"sm:max-w-[480px]",children:g?e.jsxs(e.Fragment,{children:[e.jsxs(Be,{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-gaming-success/10 flex items-center justify-center mx-auto mb-4",children:e.jsx(Ct,{className:"w-8 h-8 text-gaming-success"})}),e.jsx(Ie,{children:"Suggestion Received!"}),e.jsx(nt,{className:"text-center",children:"Thank you! We'll review your suggestion and add it to the directory if applicable."})]}),e.jsx(et,{children:e.jsx(P,{variant:"accent",onClick:v,className:"w-full",children:"Done"})})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Be,{children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-accent/10 flex items-center justify-center mb-2",children:e.jsx(Lt,{className:"w-6 h-6 text-accent"})}),e.jsx(Ie,{children:"Suggest a Market"}),e.jsx(nt,{children:"Can't find a market you're interested in? Suggest it and we'll research and add it to the directory."})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Market / Country Name *"}),e.jsx(ee,{placeholder:"e.g. Peru, South Korea, Kenya",value:r,onChange:f=>i(f.target.value),maxLength:80})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Region *"}),e.jsxs(Je,{value:o,onValueChange:l,children:[e.jsx(Ue,{children:e.jsx(Ye,{placeholder:"Select region"})}),e.jsx(_e,{children:eT.map(f=>e.jsx(xe,{value:f,children:f},f))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Why should we add this market? *"}),e.jsx(st,{placeholder:"Tell us about the iGaming activity in this market...",value:c,onChange:f=>h(f.target.value),rows:3,maxLength:500})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["Your Email ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional — for updates)"})]}),e.jsx(ee,{type:"email",placeholder:"you@example.com",value:d,onChange:f=>p(f.target.value)})]})]}),e.jsxs(et,{children:[e.jsx(P,{variant:"outline",onClick:v,children:"Cancel"}),e.jsx(P,{variant:"accent",onClick:x,disabled:!u,children:"Submit Suggestion"})]})]})})})},aT=[{value:"hiring",label:"Hiring now"},{value:"revenue",label:"Revenue potential"},{value:"salary",label:"Salary (median)"},{value:"remote",label:"Remote friendliness"},{value:"compliance",label:"Compliance intensity"},{value:"name",label:"Name (A-Z)"}],sT=({apiUrl:t,marketsData:a,itemsPerPage:s=12,onSuggestMarket:r})=>{const[i,o]=m.useState([]),[l,c]=m.useState(!0),[h,d]=m.useState(1),[p,g]=m.useState(s),[y,u]=m.useState(""),[x,v]=m.useState("hiring"),[f,k]=m.useState("grid"),[w,j]=m.useState(!1),[b,T]=m.useState({region:[],status:[],verticals:[],hiringIntensity:[],signals:[]});m.useEffect(()=>{let D=!0;const H=async()=>{try{if(!t){D&&o(a??zM);return}const G=await fetch(t);if(!G.ok)throw new Error(`${G.status}`);const E=await G.json();D&&Array.isArray(E)&&o(E)}catch{D&&o(a??zM)}finally{D&&c(!1)}};return c(!0),H(),()=>{D=!1}},[t,a]);const S=m.useMemo(()=>{const D=Array.from(new Set(i.map(E=>E.region))).sort(),H=Array.from(new Set(i.map(E=>E.status))).sort(),G=Array.from(new Set(i.flatMap(E=>E.verticals))).sort();return[{key:"region",label:"Region",type:"checkbox",options:D.map(E=>({value:E,label:E}))},{key:"status",label:"Market Status",type:"checkbox",options:H.map(E=>({value:E,label:E}))},{key:"hiringIntensity",label:"Hiring Intensity",type:"checkbox",options:[{value:"High",label:"High"},{value:"Medium",label:"Medium"},{value:"Low",label:"Low"}]},{key:"verticals",label:"Verticals",type:"checkbox",searchable:!0,options:G.map(E=>({value:E,label:E}))},{key:"signals",label:"Signals",type:"toggle",options:[{value:"featured",label:"Featured only"},{value:"remote-friendly",label:"Remote-friendly (50%+)"}]}]},[i]),N=m.useMemo(()=>Object.entries(b).flatMap(([D,H])=>H.map(G=>({key:D,label:D.charAt(0).toUpperCase()+D.slice(1),value:G,onRemove:()=>T(E=>({...E,[D]:(E[D]??[]).filter(W=>W!==G)}))}))),[b]),L=m.useMemo(()=>{const D=y.trim().toLowerCase();return i.filter(H=>{var G;return!(D&&!`${H.name} ${H.region} ${((G=H.countries)==null?void 0:G.join(" "))??""}`.toLowerCase().includes(D)||b.region.length&&!b.region.includes(H.region)||b.status.length&&!b.status.includes(H.status)||b.hiringIntensity.length&&!b.hiringIntensity.includes(H.stats.hiringIntensity)||b.verticals.length&&!b.verticals.some(E=>H.verticals.includes(E))||b.signals.includes("featured")&&!H.isFeatured||b.signals.includes("remote-friendly")&&H.stats.remoteRatio<50)})},[i,b,y]),I=m.useMemo(()=>{const D=[...L];return D.sort((H,G)=>{switch(x){case"hiring":return G.stats.jobsCount-H.stats.jobsCount;case"revenue":return G.revenuePotentialM-H.revenuePotentialM;case"salary":return G.salaryPulse.medianAnnual-H.salaryPulse.medianAnnual;case"remote":return G.stats.remoteRatio-H.stats.remoteRatio;case"compliance":{const E={High:3,Medium:2,Low:1};return E[G.stats.complianceIntensity]-E[H.stats.complianceIntensity]}case"name":return H.name.localeCompare(G.name);default:return 0}}),D},[L,x]);m.useEffect(()=>{d(1)},[y,b,p]);const A=Math.max(1,Math.ceil(I.length/p)),C=I.slice((h-1)*p,h*p),M=()=>T({region:[],status:[],verticals:[],hiringIntensity:[],signals:[]}),R=m.useCallback(D=>{r==null||r(D),console.log("[MarketsList] Suggest market:",D)},[r]);return e.jsxs(e.Fragment,{children:[e.jsx(ja,{title:"iGaming Markets — Career Intelligence",description:"Explore global iGaming markets by hiring intensity, salary levels, regulatory complexity, and remote-friendliness. Find where the opportunities are.",headerActions:e.jsxs(P,{variant:"accent",size:"sm",className:"gap-1.5",onClick:()=>j(!0),children:[e.jsx(kt,{className:"w-4 h-4"}),"Suggest a Market"]}),search:{value:y,onChange:u,onSubmit:u,onClear:()=>u(""),placeholder:"Search markets (e.g. Brazil, Malta, Ontario...)"},filters:S,filterValues:b,onFilterChange:(D,H)=>T(G=>({...G,[D]:H})),onClearFilters:M,activeFilters:N,sort:{value:x,options:aT,onChange:v},viewMode:f,onViewModeChange:k,pagination:{page:h,pageSize:p,totalPages:A,totalCount:I.length,toolbarTotalCount:i.length,toolbarTitle:"Global Markets",toolbarItemLabel:"markets",onPageChange:d,onPageSizeChange:D=>{g(D),d(1)},pageSizeOptions:[6,12,24]},resultsClassName:f==="grid"?"grid gap-4 sm:grid-cols-2 xl:grid-cols-3":"grid gap-4",children:l?e.jsx(ua,{totalColumns:p>6?6:p}):C.length?C.map(D=>e.jsx(XP,{market:D,viewMode:f},D.id)):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(Lt,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No markets found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters or search."}),e.jsxs("div",{className:"flex gap-3 justify-center",children:[e.jsx(P,{variant:"outline",onClick:M,children:"Clear all filters"}),e.jsx(P,{variant:"accent",onClick:()=>j(!0),children:"Suggest a market"})]})]})}),e.jsx(tT,{open:w,onOpenChange:j,onSubmit:R})]})},nT=({slug:t,name:a,acronym:s,country:r,region:i,jurisdiction:o,sectors:l,licenseTypes:c,scopeTags:h=[],establishedYear:d,complianceRating:p,website:g,isPrimary:y=!1,description:u,viewMode:x})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card cursor-pointer",onClick:()=>window.location.replace(`/regulators/${t}`),children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[e.jsx(q,{variant:"secondary",children:i}),e.jsx(q,{variant:"outline",children:o}),y&&e.jsx(q,{className:"bg-primary text-primary-foreground",children:"Primary"})]}),e.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground",children:a}),e.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["(",s,")"]})]}),e.jsx("p",{className:"mb-2 text-sm text-muted-foreground",children:r}),u&&e.jsx("p",{className:"mb-3 text-xs text-muted-foreground line-clamp-2",children:u}),e.jsxs("div",{className:"mb-3 flex flex-wrap gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ze,{className:"h-3.5 w-3.5 fill-gaming-gold text-gaming-gold"}),p.toFixed(1)," compliance"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ta,{className:"h-3.5 w-3.5"}),"Since ",d]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ul,{className:"h-3.5 w-3.5"}),c.length," license types"]})]}),e.jsxs("div",{className:"mb-3 flex flex-wrap gap-1.5",children:[l.slice(0,3).map(v=>e.jsx(q,{variant:"outline",className:"text-xs",children:v},v)),h.slice(0,2).map(v=>e.jsx(q,{variant:"accent",className:"text-xs",children:v},v))]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(P,{variant:"outline",size:"sm",className:"flex-1",onClick:v=>{v.stopPropagation(),window.location.replace(`/regulators/${t}`)},children:[e.jsx(fa,{className:"mr-1.5 h-3.5 w-3.5"})," Details"]}),g&&e.jsx(P,{variant:"outline",size:"sm",asChild:!0,onClick:v=>v.stopPropagation(),children:e.jsx("a",{href:g,target:"_blank",rel:"noopener noreferrer",children:e.jsx(bt,{className:"h-3.5 w-3.5"})})})]})]}),qM=[{id:"reg-1",slug:"uk-gambling-commission",name:"UK Gambling Commission",acronym:"UKGC",country:"United Kingdom",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino","Bingo","Lottery"],licenseTypes:["B2C","B2B","Remote"],scopeTags:["Player Protection","AML","Advertising Standards"],establishedYear:2007,complianceRating:4.8,isPrimary:!0,website:"https://www.gamblingcommission.gov.uk",registerUrl:"https://www.gamblingcommission.gov.uk/public-register",description:"The UK Gambling Commission regulates all commercial gambling in Great Britain, ensuring fairness, preventing crime, and protecting vulnerable players. It is widely regarded as one of the most stringent regulators globally.",scope:"Covers all forms of remote and land-based gambling including casinos, betting, bingo, lotteries, and gaming machines. Applies to both B2C operators and B2B suppliers serving the UK market.",careerImplications:"UKGC regulation creates high demand for compliance professionals, responsible gaming specialists, and AML analysts. Companies operating under UKGC licenses typically maintain dedicated UK compliance teams.",careerRoles:[{roleFamily:"Compliance & AML",description:"Ensuring adherence to LCCP conditions and AML/CTF requirements."},{roleFamily:"Responsible Gaming",description:"Implementing player protection measures, self-exclusion systems, and affordability checks."},{roleFamily:"Legal & Regulatory",description:"Monitoring regulatory changes and managing license conditions."},{roleFamily:"Risk & Fraud",description:"Identifying and mitigating fraud, money laundering, and match-fixing risks."}],keyRequirements:["Player protection & affordability checks","Anti-money laundering controls","Advertising & marketing compliance","Regular regulatory returns & reporting","Customer interaction and social responsibility"],linkedMarkets:[{name:"United Kingdom",slug:"united-kingdom"}],linkedCompanies:[{name:"Entain",slug:"entain",evidenceLevel:"verified",evidenceUrl:"https://www.gamblingcommission.gov.uk/public-register",licenseId:"001-042579-R"},{name:"Flutter Entertainment",slug:"flutter-entertainment",evidenceLevel:"verified"},{name:"bet365",slug:"bet365",evidenceLevel:"self-reported"}]},{id:"reg-2",slug:"malta-gaming-authority",name:"Malta Gaming Authority",acronym:"MGA",country:"Malta",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino","Poker","Lottery","Fantasy Sports"],licenseTypes:["B2C","B2B"],scopeTags:["Remote Gaming","AML","Player Protection","Responsible Gaming"],establishedYear:2015,complianceRating:4.7,isPrimary:!0,website:"https://www.mga.org.mt",registerUrl:"https://www.mga.org.mt/licensee-register/",description:"The Malta Gaming Authority is one of the world's most respected online gaming regulators. Its licensing framework has made Malta the European hub for iGaming, hosting hundreds of licensed operators and suppliers.",scope:"Regulates all forms of remote gaming from Malta, including casino, sports betting, poker, and skill games. Covers both B2C operations and B2B critical supply.",careerImplications:"Malta's MGA licensing has created one of the largest iGaming talent markets globally. The concentration of licensed operators drives massive demand for compliance, tech, and commercial roles.",careerRoles:[{roleFamily:"Compliance & AML",description:"Managing MGA license compliance, player fund protection, and AML obligations."},{roleFamily:"Legal & Regulatory",description:"Navigating multi-jurisdictional licensing requirements with MGA as the primary license."},{roleFamily:"Product & Technology",description:"Building compliant gaming platforms that meet MGA technical standards."},{roleFamily:"Payments",description:"Managing payment processing within MGA regulatory frameworks."}],keyRequirements:["Player fund protection (segregated accounts)","Responsible gaming tools","AML/CFT compliance","Fit and proper assessments","Regular auditing and reporting"],linkedMarkets:[{name:"Malta",slug:"malta"}],linkedCompanies:[{name:"Betsson Group",slug:"betsson-group",evidenceLevel:"verified",evidenceUrl:"https://www.mga.org.mt/licensee-register/"},{name:"Kindred Group",slug:"kindred-group",evidenceLevel:"verified"},{name:"LeoVegas",slug:"leovegas",evidenceLevel:"self-reported"}]},{id:"reg-3",slug:"kansspelautoriteit",name:"Kansspelautoriteit",acronym:"KSA",country:"Netherlands",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino"],licenseTypes:["Remote"],scopeTags:["Player Protection","Advertising Restrictions","AML"],establishedYear:2012,complianceRating:4.5,website:"https://kansspelautoriteit.nl",description:"The Dutch Gaming Authority oversees the regulated online gambling market in the Netherlands, which opened in October 2021 under the Remote Gambling Act (KOA).",scope:"Regulates online casino and sports betting operators serving Dutch consumers. Known for strict advertising and bonus restrictions.",careerImplications:"The relatively new Dutch market creates demand for compliance experts who understand KSA-specific advertising restrictions and player protection requirements.",careerRoles:[{roleFamily:"Compliance & AML",description:"Ensuring compliance with Dutch Remote Gambling Act requirements."},{roleFamily:"Marketing Compliance",description:"Managing strict advertising limitations and bonus restrictions."}],keyRequirements:["Strict advertising limitations","Cooling-off period enforcement","Centraal Register Uitsluiting Kansspelen (CRUKS)","Player loss limits"],linkedMarkets:[{name:"Netherlands",slug:"netherlands"}],linkedCompanies:[{name:"Kindred Group",slug:"kindred-group",evidenceLevel:"self-reported"}]},{id:"reg-4",slug:"agco-ontario",name:"Alcohol and Gaming Commission of Ontario",acronym:"AGCO",country:"Canada",region:"North America",jurisdiction:"State",sectors:["Sportsbook","Casino"],licenseTypes:["Operator","Supplier"],scopeTags:["Player Protection","Responsible Gaming","AML"],establishedYear:1998,complianceRating:4.4,isPrimary:!0,website:"https://www.agco.ca",description:"AGCO regulates Ontario's iGaming market through iGaming Ontario (iGO), which opened in April 2022 as Canada's first regulated province-level online gaming market.",scope:"Oversees online sports betting and casino gaming in Ontario through the iGaming Ontario subsidiary. Covers both operators and gaming-related suppliers.",careerImplications:"Ontario's market opening created North America's fastest-growing iGaming talent pool, with demand for professionals experienced in both North American and European regulatory frameworks.",careerRoles:[{roleFamily:"Compliance & AML",description:"Meeting AGCO standards and FINTRAC reporting requirements."},{roleFamily:"Responsible Gaming",description:"Implementing Ontario-specific player protection measures."}],keyRequirements:["FINTRAC AML registration","Responsible gaming commitments","Play-management tools","Advertising standards compliance"],linkedMarkets:[{name:"Canada (Ontario)",slug:"canada-ontario"}],linkedCompanies:[{name:"theScore",slug:"thescore",evidenceLevel:"self-reported"}]},{id:"reg-5",slug:"spelinspektionen",name:"Spelinspektionen",acronym:"SGA",country:"Sweden",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino"],licenseTypes:["Commercial Online Gaming"],scopeTags:["Player Protection","Bonus Restrictions","AML"],establishedYear:2019,complianceRating:4.3,website:"https://www.spelinspektionen.se",description:"The Swedish Gambling Authority supervises the regulated online gambling market under the Gambling Act (2018:1138), which re-regulated the Swedish market in January 2019.",scope:"Regulates commercial online gaming licenses in Sweden, covering sports betting and casino. Known for strict bonus limitations (first deposit only).",careerImplications:"Sweden's strict regulatory environment requires deep compliance expertise, particularly around bonus restrictions and responsible gaming mandates.",careerRoles:[{roleFamily:"Compliance & AML",description:"Managing Swedish Gambling Act compliance and Spelpaus integration."},{roleFamily:"Responsible Gaming",description:"Implementing mandatory deposit limits and self-exclusion (Spelpaus)."}],keyRequirements:["Bonus restrictions (welcome bonus only)","Spelpaus self-exclusion system","Moderate gambling messaging","SEK 3-second delay on in-play betting"],linkedMarkets:[{name:"Sweden",slug:"sweden"}],linkedCompanies:[]},{id:"reg-6",slug:"njdge",name:"New Jersey Division of Gaming Enforcement",acronym:"NJDGE",country:"United States",region:"North America",jurisdiction:"State",sectors:["Casino","Sportsbook"],licenseTypes:["Casino Service Industry","Online Sports Wagering"],scopeTags:["Licensing","Testing","AML","Geolocation"],establishedYear:1977,complianceRating:4.6,website:"https://www.njoag.gov/about/divisions-and-offices/division-of-gaming-enforcement-home/",description:"The NJDGE oversees all legal gambling activity in New Jersey, including Atlantic City casinos and the pioneering online gaming market launched in 2013.",scope:"Regulates casino gaming, online casino, and sports betting within New Jersey. Requires partnership with a land-based casino licensee for online operations.",careerImplications:"New Jersey's mature regulated market drives demand for US-compliance specialists, geolocation experts, and professionals with Atlantic City experience.",careerRoles:[{roleFamily:"Compliance & AML",description:"Navigating NJ DGE compliance requirements and BSA/AML obligations."},{roleFamily:"Geolocation & Identity",description:"Implementing geofencing and KYC solutions required for state-level licensing."}],keyRequirements:["Land-based casino partnership required","Geolocation verification","Server location within NJ or approved states","Background investigations for key employees"],linkedMarkets:[{name:"United States",slug:"united-states"}],linkedCompanies:[]},{id:"reg-7",slug:"curacao-gaming-control-board",name:"Curaçao Gaming Control Board",acronym:"GCB",country:"Curaçao",region:"Caribbean",jurisdiction:"National",sectors:["Casino","Sportsbook","Poker","Lottery"],licenseTypes:["B2C","B2B"],scopeTags:["Remote Gaming","Reform","AML"],establishedYear:2023,complianceRating:3.2,website:"https://www.gcb.cw",description:"Curaçao is undergoing major regulatory reform, transitioning from the legacy e-gaming sublicense system to a new framework under the Gaming Control Board (GCB), established in 2023.",scope:"Covers all forms of online gambling operated from Curaçao. The reform introduces stricter AML, KYC, and player protection requirements to replace the previous master-sublicense model.",careerImplications:"The regulatory reform creates new compliance roles as operators transition from legacy sublicenses to GCB-compliant frameworks. Knowledge of transitional requirements is highly valued.",careerRoles:[{roleFamily:"Compliance & AML",description:"Navigating the transition from legacy sublicenses to new GCB requirements."},{roleFamily:"Legal & Regulatory",description:"Managing re-licensing and compliance with the new ordinance."}],keyRequirements:["Transition from sublicense to GCB license","Enhanced KYC/AML obligations","Player protection measures","Local substance requirements"],linkedMarkets:[],linkedCompanies:[]},{id:"reg-8",slug:"gibraltar-gambling-commissioner",name:"Gibraltar Gambling Commissioner",acronym:"GGC",country:"Gibraltar",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino","Poker"],licenseTypes:["B2C","B2B"],scopeTags:["Remote Gaming","AML","Player Protection"],establishedYear:2005,complianceRating:4.5,isPrimary:!0,website:"https://www.gibraltar.gov.gi/gambling",description:"Gibraltar's Gambling Commissioner oversees one of the longest-established online gambling jurisdictions. Several major global operators are headquartered or licensed in Gibraltar.",scope:"Regulates remote gambling operations from Gibraltar, covering sports betting, casino, and poker. Known for a pragmatic, business-friendly but high-standard regulatory approach.",careerImplications:"Gibraltar hosts headquarters of major operators like bet365, 888, and Lottoland, creating a dense talent market for senior commercial, tech, and compliance professionals.",careerRoles:[{roleFamily:"Compliance & AML",description:"Meeting GGC requirements and managing multi-jurisdictional compliance."},{roleFamily:"Senior Leadership",description:"Many C-suite and director-level roles based in Gibraltar due to operator HQs."}],keyRequirements:["Physical presence in Gibraltar","Adequate financial resources","Fit and proper person tests","Player funds protection"],linkedMarkets:[{name:"Gibraltar",slug:"gibraltar"}],linkedCompanies:[{name:"bet365",slug:"bet365",evidenceLevel:"verified"},{name:"888 Holdings",slug:"888-holdings",evidenceLevel:"self-reported"}]},{id:"reg-9",slug:"dgoj-spain",name:"Dirección General de Ordenación del Juego",acronym:"DGOJ",country:"Spain",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino","Poker"],licenseTypes:["General","Singular"],scopeTags:["Advertising Restrictions","Player Protection","AML"],establishedYear:2011,complianceRating:4.2,website:"https://www.ordenacionjuego.es",description:"Spain's DGOJ regulates the country's online gambling market under Royal Decree 958/2020, which introduced strict advertising limitations including a near-total ban on gambling advertising.",scope:"Oversees online gambling licensing in Spain, covering general licenses (casino, sports betting, poker) and singular licenses (specific formats). Enforced strict advertising reforms in 2021.",careerImplications:"Spain's strict ad regulations require specialized marketing compliance expertise. The market's restrictions have shifted demand toward CRM, retention, and organic acquisition roles.",careerRoles:[{roleFamily:"Marketing Compliance",description:"Navigating Spain's advertising ban and permitted marketing channels."},{roleFamily:"CRM & Retention",description:"Driving growth through compliant retention strategies under ad restrictions."}],keyRequirements:["Near-complete advertising ban (post-2021)","Self-exclusion (RGIAJ) integration","Deposit limit enforcement","Session time reminders"],linkedMarkets:[{name:"Spain",slug:"spain"}],linkedCompanies:[]},{id:"reg-10",slug:"isle-of-man-gsc",name:"Isle of Man Gambling Supervision Commission",acronym:"GSC",country:"Isle of Man",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino","Poker","Lottery"],licenseTypes:["Online Gambling","Network Services","Software Supplier"],scopeTags:["Remote Gaming","E-Gaming","AML"],establishedYear:1962,complianceRating:4.4,website:"https://www.gov.im/gambling/",description:"The Isle of Man GSC is one of the oldest gambling regulators and was among the first to regulate online gambling. The island hosts several major B2B suppliers and operators.",scope:"Regulates all forms of gambling from the Isle of Man, with a strong focus on e-gaming (online). Known for a business-supportive environment with robust standards.",careerImplications:"Home to major B2B suppliers like Microgaming (now Games Global) and PokerStars, the Isle of Man offers specialized roles in game development, platform engineering, and regulatory technology.",careerRoles:[{roleFamily:"Platform Engineering",description:"Building and maintaining gaming platforms for B2B suppliers."},{roleFamily:"Game Development",description:"Creating online slots and table games for global markets."}],keyRequirements:["Comprehensive player protection","Data protection compliance","AML/CFT measures","Technical testing and certification"],linkedMarkets:[],linkedCompanies:[]},{id:"reg-11",slug:"pagcor",name:"Philippine Amusement and Gaming Corporation",acronym:"PAGCOR",country:"Philippines",region:"Asia-Pacific",jurisdiction:"National",sectors:["Casino","Sportsbook"],licenseTypes:["POGO","Domestic"],scopeTags:["Offshore Gaming","AML","POGO"],establishedYear:1976,complianceRating:3,website:"https://www.pagcor.ph",description:"PAGCOR is both a regulator and operator in the Philippines. It historically oversaw the POGO (Philippine Offshore Gaming Operator) program, though this sector faced significant reforms and restrictions.",scope:"Regulates land-based and online gambling in the Philippines. The POGO program licensed offshore operators serving Asian markets, though it has been significantly curtailed.",careerImplications:"Despite POGO restrictions, the Philippines remains a talent hub for live dealer operations, customer support, and Asian-market-facing roles.",careerRoles:[{roleFamily:"Live Dealer Operations",description:"Managing large-scale live casino studios serving Asian markets."},{roleFamily:"Customer Support",description:"Multilingual support for Asia-Pacific-facing operations."}],keyRequirements:["PAGCOR franchise/license","Local employment requirements","AML compliance","Revenue sharing with government"],linkedMarkets:[{name:"Philippines",slug:"philippines"}],linkedCompanies:[]},{id:"reg-12",slug:"kahnawake-gaming-commission",name:"Kahnawake Gaming Commission",acronym:"KGC",country:"Canada",region:"North America",jurisdiction:"Regional",sectors:["Casino","Sportsbook","Poker"],licenseTypes:["Interactive Gaming","Client Provider"],scopeTags:["First Nations","Remote Gaming","Player Protection"],establishedYear:1999,complianceRating:3.5,website:"https://www.gamingcommission.ca",description:"The Kahnawake Gaming Commission, based in the Mohawk Territory of Kahnawake near Montreal, is one of the earliest online gambling regulators. It operates under First Nations governance.",scope:"Licenses and regulates interactive gaming operations from the Mohawk Territory. Historically a major licensing jurisdiction for operators serving multiple markets.",careerImplications:"KGC-licensed operations create demand for compliance professionals familiar with both First Nations governance structures and international online gaming standards.",careerRoles:[{roleFamily:"Compliance & AML",description:"Managing KGC regulatory requirements and cross-border compliance."}],keyRequirements:["Hosting on Mohawk Internet Technologies servers","Player dispute resolution","Regular compliance auditing","Financial suitability assessments"],linkedMarkets:[],linkedCompanies:[]}],rT=t=>qM.find(a=>a.slug===t),iT=[{value:"authority",label:"Top authority"},{value:"name",label:"Name (A-Z)"},{value:"rating",label:"Highest compliance score"},{value:"established",label:"Longest standing"}],EN={region:[],country:[],jurisdiction:[],licenseTypes:[],sectors:[],scopeTags:[],signals:[]},oT=({apiUrl:t,regulatorsData:a,itemsPerPage:s=9})=>{const[r,i]=m.useState(a??[]),[o,l]=m.useState(!a),[c,h]=m.useState(1),[d,p]=m.useState(s),[g,y]=m.useState(""),[u,x]=m.useState("authority"),[v,f]=m.useState("grid"),[k,w]=m.useState(EN);m.useEffect(()=>{if(a)return;let A=!0;const C=async()=>{try{if(!t){A&&i(qM);return}const M=await fetch(t);if(!M.ok)throw new Error(`${M.status}`);const R=await M.json();A&&Array.isArray(R)&&i(R)}catch(M){console.error("Failed to fetch regulators",M),A&&i(qM)}finally{A&&l(!1)}};return l(!0),C(),()=>{A=!1}},[t,a]);const j=m.useMemo(()=>{const A=C=>Array.from(new Set(C)).sort();return[{key:"region",label:"Region",type:"checkbox",options:A(r.map(C=>C.region)).map(C=>({value:C,label:C}))},{key:"country",label:"Country",type:"searchable-select",searchable:!0,options:A(r.map(C=>C.country)).map(C=>({value:C,label:C}))},{key:"jurisdiction",label:"Jurisdiction",type:"checkbox",options:A(r.map(C=>C.jurisdiction)).map(C=>({value:C,label:C}))},{key:"licenseTypes",label:"License Types",type:"checkbox",searchable:!0,options:A(r.flatMap(C=>C.licenseTypes)).map(C=>({value:C,label:C}))},{key:"sectors",label:"Sectors",type:"checkbox",searchable:!0,options:A(r.flatMap(C=>C.sectors)).map(C=>({value:C,label:C}))},{key:"scopeTags",label:"Scope",type:"checkbox",options:A(r.flatMap(C=>C.scopeTags)).map(C=>({value:C,label:C}))},{key:"signals",label:"Signals",type:"toggle",options:[{value:"primary",label:"Primary only"}]}]},[r]),b=m.useMemo(()=>Object.entries(k).flatMap(([A,C])=>C.map(M=>({key:A,label:A.charAt(0).toUpperCase()+A.slice(1),value:M,onRemove:()=>w(R=>({...R,[A]:(R[A]??[]).filter(D=>D!==M)}))}))),[k]),T=m.useMemo(()=>{const A=g.trim().toLowerCase();return r.filter(C=>!(A&&!`${C.name} ${C.acronym} ${C.country} ${C.region}`.toLowerCase().includes(A)||k.region.length&&!k.region.includes(C.region)||k.country.length&&!k.country.includes(C.country)||k.jurisdiction.length&&!k.jurisdiction.includes(C.jurisdiction)||k.licenseTypes.length&&!k.licenseTypes.every(M=>C.licenseTypes.includes(M))||k.sectors.length&&!k.sectors.every(M=>C.sectors.includes(M))||k.scopeTags.length&&!k.scopeTags.every(M=>C.scopeTags.includes(M))||k.signals.includes("primary")&&!C.isPrimary))},[k,r,g]),S=m.useMemo(()=>{const A=[...T];return A.sort((C,M)=>{switch(u){case"name":return C.name.localeCompare(M.name);case"rating":return M.complianceRating-C.complianceRating;case"established":return C.establishedYear-M.establishedYear;default:return Number(M.isPrimary)-Number(C.isPrimary)||M.complianceRating-C.complianceRating}}),A},[T,u]);m.useEffect(()=>{h(1)},[g,k,d]);const N=Math.max(1,Math.ceil(S.length/d)),L=S.slice((c-1)*d,c*d),I=()=>w(EN);return e.jsx(ja,{title:"Regulators",description:"Review licensing authorities, jurisdictions, and regulatory scope across the global iGaming industry.",search:{value:g,onChange:y,onSubmit:y,onClear:()=>y(""),placeholder:"Search by name or acronym (e.g. MGA)"},filters:j,filterValues:k,onFilterChange:(A,C)=>w(M=>({...M,[A]:C})),onClearFilters:I,activeFilters:b,sort:{value:u,options:iT,onChange:x},viewMode:v,onViewModeChange:f,pagination:{page:c,pageSize:d,totalPages:N,totalCount:S.length,toolbarTotalCount:r.length,toolbarTitle:"Regulatory Authorities",toolbarItemLabel:"regulators",onPageChange:h,onPageSizeChange:A=>{p(A),h(1)}},resultsClassName:v==="grid"?"grid gap-4 sm:grid-cols-2 xl:grid-cols-3":"grid gap-4",children:o?e.jsx(ua,{totalColumns:d}):L.length?L.map(A=>e.jsx(nT,{id:A.id,slug:A.slug,name:A.name,acronym:A.acronym,country:A.country,region:A.region,jurisdiction:A.jurisdiction,sectors:A.sectors,licenseTypes:A.licenseTypes,scopeTags:A.scopeTags,establishedYear:A.establishedYear,complianceRating:A.complianceRating,website:A.website,isPrimary:A.isPrimary,description:A.description,viewMode:v},A.id)):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(Ta,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No regulators found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters."}),e.jsx(P,{variant:"outline",onClick:I,children:"Clear all filters"})]})})},lT={Active:"bg-gaming-success/10 text-gaming-success border-gaming-success/20",Reforming:"bg-gaming-warning/10 text-gaming-warning border-gaming-warning/20",Emerging:"bg-accent/10 text-accent border-accent/20",Restricted:"bg-destructive/10 text-destructive border-destructive/20"},cT=({slug:t,name:a,region:s,status:r,regulatorNames:i,notes:o,gamblingSectors:l,keyFacts:c,onNavigate:h})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card",children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[e.jsx(q,{variant:"secondary",children:s}),e.jsx(q,{variant:"outline",className:lT[r]??"",children:r})]}),e.jsxs("h3",{className:"mb-1 text-lg font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Te,{className:"h-4 w-4 text-accent flex-shrink-0"}),a]}),e.jsx("p",{className:"mb-3 text-xs text-muted-foreground line-clamp-2",children:o}),e.jsx("div",{className:"mb-3 space-y-1.5",children:i.map(d=>e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-foreground",children:[e.jsx(Kt,{className:"h-3.5 w-3.5 text-gaming-success flex-shrink-0"}),d]},d))}),e.jsx("div",{className:"mb-3 flex flex-wrap gap-1.5",children:l.slice(0,4).map(d=>e.jsx(q,{variant:"outline",className:"text-xs",children:d},d))}),c.length>0&&e.jsx("div",{className:"mb-3 space-y-1",children:c.slice(0,2).map(d=>e.jsxs("p",{className:"flex items-start gap-1.5 text-xs text-muted-foreground",children:[e.jsx($o,{className:"h-3 w-3 mt-0.5 flex-shrink-0 text-accent"}),d]},d))}),h&&e.jsx(P,{variant:"outline",size:"sm",className:"w-full",onClick:()=>h(t),children:"View Jurisdiction Details"})]}),dT=[{id:"jur-1",slug:"united-kingdom",name:"United Kingdom",region:"Europe",status:"Active",regulatorIds:["reg-1"],regulatorNames:["UK Gambling Commission (UKGC)"],notes:"One of the most mature and strictly regulated online gambling markets globally. The Gambling Act 2005 provides the primary legal framework.",markets:[{name:"United Kingdom",slug:"united-kingdom"}],gamblingSectors:["Casino","Sportsbook","Bingo","Lottery","Poker"],keyFacts:["Gambling Act 2005 (updated 2023 White Paper)","Mandatory affordability checks","Strict advertising standards"]},{id:"jur-2",slug:"malta",name:"Malta",region:"Europe",status:"Active",regulatorIds:["reg-2"],regulatorNames:["Malta Gaming Authority (MGA)"],notes:"Europe's primary iGaming hub with 300+ licensed companies. The Gaming Act (2018) modernized the regulatory framework.",markets:[{name:"Malta",slug:"malta"}],gamblingSectors:["Casino","Sportsbook","Poker","Fantasy Sports"],keyFacts:["300+ licensed operators","Gaming Act 2018","EU single-market passporting advantages"]},{id:"jur-3",slug:"netherlands",name:"Netherlands",region:"Europe",status:"Active",regulatorIds:["reg-3"],regulatorNames:["Kansspelautoriteit (KSA)"],notes:"Market opened October 2021 under the Remote Gambling Act (KOA). Strict advertising and bonus restrictions introduced rapidly.",markets:[{name:"Netherlands",slug:"netherlands"}],gamblingSectors:["Casino","Sportsbook"],keyFacts:["Remote Gambling Act (KOA) - 2021","CRUKS self-exclusion system","Advertising ban from 2025"]},{id:"jur-4",slug:"ontario-canada",name:"Ontario, Canada",region:"North America",status:"Active",regulatorIds:["reg-4"],regulatorNames:["AGCO / iGaming Ontario"],notes:"Canada's first provincially regulated iGaming market, launched April 2022. Rapidly became one of North America's largest markets.",markets:[{name:"Canada (Ontario)",slug:"canada-ontario"}],gamblingSectors:["Casino","Sportsbook"],keyFacts:["Launched April 2022","40+ licensed operators in year one","FINTRAC AML registration required"]},{id:"jur-5",slug:"sweden",name:"Sweden",region:"Europe",status:"Active",regulatorIds:["reg-5"],regulatorNames:["Spelinspektionen (SGA)"],notes:"Re-regulated in January 2019 with the Swedish Gambling Act. Known for restrictive bonus rules and the Spelpaus self-exclusion system.",markets:[{name:"Sweden",slug:"sweden"}],gamblingSectors:["Casino","Sportsbook"],keyFacts:["Welcome bonus only (no reload bonuses)","Spelpaus mandatory self-exclusion","3-second delay on in-play bets"]},{id:"jur-6",slug:"curacao",name:"Curaçao",region:"Caribbean",status:"Reforming",regulatorIds:["reg-7"],regulatorNames:["Curaçao Gaming Control Board (GCB)"],notes:"Undergoing major reform from the legacy sublicense system to a modern regulatory framework under the GCB. Transition period through 2025–2026.",markets:[],gamblingSectors:["Casino","Sportsbook","Poker"],keyFacts:["Reform ordinance enacted 2023","Legacy sublicenses being phased out","Enhanced KYC/AML requirements"]},{id:"jur-7",slug:"gibraltar",name:"Gibraltar",region:"Europe",status:"Active",regulatorIds:["reg-8"],regulatorNames:["Gibraltar Gambling Commissioner (GGC)"],notes:"One of the original online gambling jurisdictions. Home to major operator headquarters including bet365 and 888.",markets:[{name:"Gibraltar",slug:"gibraltar"}],gamblingSectors:["Casino","Sportsbook","Poker"],keyFacts:["Major operator HQ hub","Business-friendly regulation","Physical presence required"]},{id:"jur-8",slug:"spain",name:"Spain",region:"Europe",status:"Active",regulatorIds:["reg-9"],regulatorNames:["DGOJ"],notes:"Strict advertising restrictions introduced in 2021 under Royal Decree 958/2020 have significantly impacted operator marketing strategies.",markets:[{name:"Spain",slug:"spain"}],gamblingSectors:["Casino","Sportsbook","Poker"],keyFacts:["Near-total advertising ban since 2021","RGIAJ self-exclusion register","Strict bonus limitations"]},{id:"jur-9",slug:"isle-of-man",name:"Isle of Man",region:"Europe",status:"Active",regulatorIds:["reg-10"],regulatorNames:["Gambling Supervision Commission (GSC)"],notes:"Pioneer in e-gaming regulation. Home to major B2B suppliers and platform providers.",markets:[],gamblingSectors:["Casino","Sportsbook","Poker","Lottery"],keyFacts:["One of the first online gaming jurisdictions","Strong B2B supplier presence","Tax-efficient structure"]},{id:"jur-10",slug:"philippines",name:"Philippines",region:"Asia-Pacific",status:"Reforming",regulatorIds:["reg-11"],regulatorNames:["PAGCOR"],notes:"Historically a major hub for offshore gaming operations (POGO). Significant regulatory reforms and restrictions have been introduced.",markets:[{name:"Philippines",slug:"philippines"}],gamblingSectors:["Casino","Sportsbook"],keyFacts:["POGO sector curtailed","Major live dealer studio hub","Government ownership of PAGCOR"]},{id:"jur-11",slug:"new-jersey-us",name:"New Jersey, USA",region:"North America",status:"Active",regulatorIds:["reg-6"],regulatorNames:["NJ Division of Gaming Enforcement"],notes:"The first US state to launch legal online casino (2013) and among the first for sports betting post-PASPA repeal (2018).",markets:[{name:"United States",slug:"united-states"}],gamblingSectors:["Casino","Sportsbook"],keyFacts:["Pioneer US online gambling state","Casino partnership required","Strict geolocation requirements"]}],hT=[{value:"name",label:"Name (A-Z)"},{value:"status",label:"Status"},{value:"regulators",label:"Most regulators"}],BN={region:[],status:[],sectors:[]},mT=({jurisdictionsData:t})=>{const[a]=m.useState(t??dT),[s,r]=m.useState(!0),[i,o]=m.useState(1),[l,c]=m.useState(9),[h,d]=m.useState(""),[p,g]=m.useState("name"),[y,u]=m.useState("grid"),[x,v]=m.useState(BN);m.useEffect(()=>{const N=setTimeout(()=>r(!1),300);return()=>clearTimeout(N)},[]);const f=m.useMemo(()=>{const N=L=>Array.from(new Set(L)).sort();return[{key:"region",label:"Region",type:"checkbox",options:N(a.map(L=>L.region)).map(L=>({value:L,label:L}))},{key:"status",label:"Status",type:"checkbox",options:N(a.map(L=>L.status)).map(L=>({value:L,label:L}))},{key:"sectors",label:"Gambling Sectors",type:"checkbox",options:N(a.flatMap(L=>L.gamblingSectors)).map(L=>({value:L,label:L}))}]},[a]),k=m.useMemo(()=>Object.entries(x).flatMap(([N,L])=>L.map(I=>({key:N,label:N.charAt(0).toUpperCase()+N.slice(1),value:I,onRemove:()=>v(A=>({...A,[N]:(A[N]??[]).filter(C=>C!==I)}))}))),[x]),w=m.useMemo(()=>{const N=h.trim().toLowerCase();return a.filter(L=>!(N&&!`${L.name} ${L.region} ${L.regulatorNames.join(" ")}`.toLowerCase().includes(N)||x.region.length&&!x.region.includes(L.region)||x.status.length&&!x.status.includes(L.status)||x.sectors.length&&!x.sectors.every(I=>L.gamblingSectors.includes(I))))},[x,a,h]),j=m.useMemo(()=>{const N=[...w];return N.sort((L,I)=>{switch(p){case"status":return L.status.localeCompare(I.status);case"regulators":return I.regulatorNames.length-L.regulatorNames.length;default:return L.name.localeCompare(I.name)}}),N},[w,p]);m.useEffect(()=>{o(1)},[h,x,l]);const b=Math.max(1,Math.ceil(j.length/l)),T=j.slice((i-1)*l,i*l),S=()=>v(BN);return e.jsx(ja,{title:"Jurisdictions",description:"Explore regulated gambling jurisdictions, their status, and governing authorities.",search:{value:h,onChange:d,onSubmit:d,onClear:()=>d(""),placeholder:"Search jurisdictions"},filters:f,filterValues:x,onFilterChange:(N,L)=>v(I=>({...I,[N]:L})),onClearFilters:S,activeFilters:k,sort:{value:p,options:hT,onChange:g},viewMode:y,onViewModeChange:u,pagination:{page:i,pageSize:l,totalPages:b,totalCount:j.length,toolbarTotalCount:a.length,toolbarTitle:"Jurisdictions",toolbarItemLabel:"jurisdictions",onPageChange:o,onPageSizeChange:N=>{c(N),o(1)}},resultsClassName:y==="grid"?"grid gap-4 sm:grid-cols-2 xl:grid-cols-3":"grid gap-4",children:s?e.jsx(ua,{totalColumns:l}):T.length?T.map(N=>e.jsx(cT,{...N,viewMode:y},N.id)):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(Te,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No jurisdictions found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters."}),e.jsx(P,{variant:"outline",onClick:S,children:"Clear all filters"})]})})},uT=({open:t,onOpenChange:a,onSubmit:s})=>{const[r,i]=m.useState(""),[o,l]=m.useState(""),[c,h]=m.useState(""),[d,p]=m.useState(""),[g,y]=m.useState("EUR"),[u,x]=m.useState(""),[v,f]=m.useState(!1),[k,w]=m.useState(!1),j=r.trim().length>=2&&o.trim().length>=5&&c.trim().length>=30&&u,b=()=>{j&&(s==null||s({companyName:r.trim(),title:o.trim(),body:c.trim(),amount:d.trim()||void 0,currency:d.trim()?g:void 0,relationship:u,isAnonymous:v}),w(!0))},T=()=>{i(""),l(""),h(""),p(""),y("EUR"),x(""),f(!1),w(!1),a(!1)};return e.jsx(tt,{open:t,onOpenChange:T,children:e.jsx(Xe,{className:"sm:max-w-[520px]",children:k?e.jsxs(e.Fragment,{children:[e.jsxs(Be,{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-gaming-success/10 flex items-center justify-center mx-auto mb-4",children:e.jsx(Ct,{className:"w-8 h-8 text-gaming-success"})}),e.jsx(Ie,{children:"Complaint Submitted"}),e.jsx(nt,{className:"text-center",children:"Your complaint has been received. We will review it and notify the company. You'll receive updates on the resolution process within 48 hours."})]}),e.jsx(et,{children:e.jsx(P,{variant:"accent",onClick:T,className:"w-full",children:"Done"})})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Be,{children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-destructive/10 flex items-center justify-center mb-2",children:e.jsx(Gt,{className:"w-6 h-6 text-destructive"})}),e.jsx(Ie,{children:"Submit a Complaint"}),e.jsx(nt,{children:"File a formal complaint against an iGaming company. All complaints are reviewed before publishing and the company will be notified."})]}),e.jsxs("div",{className:"space-y-4 py-2 max-h-[60vh] overflow-y-auto",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Company Name *"}),e.jsx(ee,{placeholder:"Enter the company name",value:r,onChange:S=>i(S.target.value),maxLength:120})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Your Relationship *"}),e.jsxs(Je,{value:u,onValueChange:x,children:[e.jsx(Ue,{children:e.jsx(Ye,{placeholder:"How do you know this company?"})}),e.jsxs(_e,{children:[e.jsx(xe,{value:"affiliate",children:"Affiliate / Partner"}),e.jsx(xe,{value:"operator",children:"Operator / Client"}),e.jsx(xe,{value:"employee",children:"Current/Former Employee"}),e.jsx(xe,{value:"streamer",children:"Streamer / Influencer"}),e.jsx(xe,{value:"other",children:"Other"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Complaint Title *"}),e.jsx(ee,{placeholder:"Briefly describe the issue",value:o,onChange:S=>l(S.target.value),maxLength:150})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["Describe the Issue *"," ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(min 30 characters)"})]}),e.jsx(st,{placeholder:"Provide detailed information about your complaint, including dates, communications, and any evidence...",value:c,onChange:S=>h(S.target.value),rows:5,maxLength:3e3})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["Amount ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),e.jsx(ee,{type:"number",placeholder:"e.g. 5000",value:d,onChange:S=>p(S.target.value),min:0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Currency"}),e.jsxs(Je,{value:g,onValueChange:y,children:[e.jsx(Ue,{children:e.jsx(Ye,{})}),e.jsxs(_e,{children:[e.jsx(xe,{value:"EUR",children:"EUR"}),e.jsx(xe,{value:"USD",children:"USD"}),e.jsx(xe,{value:"GBP",children:"GBP"}),e.jsx(xe,{value:"BTC",children:"BTC"})]})]})]})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border px-4 py-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Post anonymously"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Your identity won't be revealed publicly"})]}),e.jsx(yt,{checked:v,onCheckedChange:f})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"By submitting, you confirm this complaint is based on genuine experience. False or malicious complaints may result in account action."})]}),e.jsxs(et,{children:[e.jsx(P,{variant:"outline",onClick:T,children:"Cancel"}),e.jsx(P,{variant:"destructive",onClick:b,disabled:!j,children:"Submit Complaint"})]})]})})})},pT=[{id:"cmp-1",companyId:"alpha-affiliates",companySlug:"alpha-affiliates",companyName:"Alpha Affiliates",title:"Payment Delayed",body:"I'm posting because the situation with Alpha Affiliates (ViciBet) is unacceptable. Payments have been delayed for over 3 months with no clear communication from their team despite multiple follow-ups.",amount:"884",currency:"EUR",status:"unresolved",createdAt:"2026-02-16T10:00:00Z",authorDisplayName:"Anonymous",isAnonymous:!0},{id:"cmp-2",companyId:"duelbits",companySlug:"duelbits",companyName:"Duelbits",title:"Unpaid Affiliate Commissions",body:"I am filing this complaint because Duelbits has failed to pay my affiliate commissions for the last two months. Despite providing all required documentation and following their payment process, I have received no response.",amount:"6076",currency:"USD",status:"resolved",createdAt:"2026-01-20T14:30:00Z",authorDisplayName:"Mike D.",isAnonymous:!1},{id:"cmp-3",companyId:"amigomedia",companySlug:"amigomedia",companyName:"AmigoMedia",title:"CPA Traffic Fraud Warning",body:"We are posting this as a formal, transparent complaint regarding our CPA campaign with AmigoMedia. After investigation, we found significant traffic quality issues including bot traffic and fake registrations.",amount:"4000",currency:"EUR",status:"resolved",createdAt:"2025-12-15T09:15:00Z",authorDisplayName:"Anonymous",isAnonymous:!0},{id:"cmp-4",companyId:"eurogesee",companySlug:"eurogesee",companyName:"EUrogesee",title:"Complaint against EUrogesee for not abiding by the deal's conditions",body:"On December 5th we agreed on a 5 stream deal with the streamer. After the first two streams, EUrogesee changed the terms unilaterally without our consent, violating the original agreement.",amount:"200",currency:"EUR",status:"resolved",createdAt:"2025-12-01T16:00:00Z",authorDisplayName:"StreamerPro",isAnonymous:!1},{id:"cmp-5",companyId:"chilistakes",companySlug:"chilistakes",companyName:"Chilistakes",title:"Commission not fulfilled",body:"Following our initial contact in mid-September, we formalized our partnership agreement. Despite meeting all KPIs and delivering quality traffic, Chilistakes has not paid the agreed commission structure.",amount:"2880",currency:"EUR",status:"unresolved",createdAt:"2025-11-15T11:00:00Z",authorDisplayName:"Anonymous",isAnonymous:!0},{id:"cmp-6",companyId:"streamer-rustyk",companySlug:"streamer-rustyk",companyName:"Streamer Rustyk",title:"Using fake account to boost results and taking payment but not streaming",body:"The streamer tried to boost his FTDs by creating fake accounts. After receiving the initial payment, they stopped streaming entirely and became unresponsive to all communication attempts.",amount:"770",currency:"EUR",status:"resolved",createdAt:"2025-11-10T08:30:00Z",authorDisplayName:"CasinoOps Team",isAnonymous:!1},{id:"cmp-7",companyId:"betmax-partners",companySlug:"betmax-partners",companyName:"BetMax Partners",title:"Revenue share calculation discrepancy",body:"We have discovered significant discrepancies in our revenue share calculations over the past 4 months. The reported net revenue does not match our own tracking data, resulting in underpayment of commissions.",amount:"3200",currency:"USD",status:"open",createdAt:"2026-02-05T12:00:00Z",authorDisplayName:"Anonymous",isAnonymous:!0},{id:"cmp-8",companyId:"lucky-streak",companySlug:"lucky-streak",companyName:"Lucky Streak",title:"Integration support abandoned mid-project",body:"After signing a contract and beginning integration, Lucky Streak's technical support became completely unresponsive. We've invested significant development resources and cannot proceed without their API documentation updates.",amount:"15000",currency:"EUR",status:"open",createdAt:"2026-01-28T10:00:00Z",authorDisplayName:"DevTeam Lead",isAnonymous:!1}],ZC={resolved:{label:"RESOLVED",color:"text-gaming-success",bgColor:"bg-gaming-success",icon:Ct},open:{label:"OPEN",color:"text-gaming-warning",bgColor:"bg-gaming-warning",icon:ut},unresolved:{label:"UNRESOLVED",color:"text-destructive",bgColor:"bg-destructive",icon:oa}},vM=9,xT=({complaintsData:t,onSubmitComplaint:a})=>{const[s,r]=m.useState("all"),[i,o]=m.useState("newest"),[l,c]=m.useState(1),[h,d]=m.useState(!1),p=t??pT,g=m.useCallback(f=>{a==null||a(f),console.log("[Complaints] Submit complaint:",f)},[a]),y=m.useMemo(()=>{let f=[...p];switch(s!=="all"&&(f=f.filter(k=>k.status===s)),i){case"newest":f.sort((k,w)=>new Date(w.createdAt).getTime()-new Date(k.createdAt).getTime());break;case"oldest":f.sort((k,w)=>new Date(k.createdAt).getTime()-new Date(w.createdAt).getTime());break;case"amount-high":f.sort((k,w)=>(Number(w.amount)||0)-(Number(k.amount)||0));break;case"amount-low":f.sort((k,w)=>(Number(k.amount)||0)-(Number(w.amount)||0));break}return f},[p,s,i]),u=Math.ceil(y.length/vM),x=y.slice((l-1)*vM,l*vM),v=m.useMemo(()=>{const f={resolved:0,open:0,unresolved:0};return p.forEach(k=>f[k.status]++),f},[a]);return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsxs("main",{className:"container mx-auto px-4 py-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-destructive/10 flex items-center justify-center",children:e.jsx(Gt,{className:"w-5 h-5 text-destructive"})}),e.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"iGaming Complaints"})]}),e.jsx("p",{className:"text-muted-foreground max-w-2xl",children:"Transparency matters. Browse and submit complaints about iGaming companies. We mediate disputes to help both parties reach a fair resolution."})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6",children:[e.jsxs("div",{className:"lg:col-span-3",children:[x.length===0?e.jsx(U,{children:e.jsxs(_,{className:"py-16 text-center",children:[e.jsx(Gt,{className:"w-12 h-12 text-muted-foreground/30 mx-auto mb-3"}),e.jsx("p",{className:"text-muted-foreground",children:"No complaints found matching your criteria."})]})}):e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:x.map(f=>e.jsx(yT,{complaint:f},f.id))}),u>1&&e.jsx("div",{className:"flex justify-center gap-2 mt-8",children:Array.from({length:u},(f,k)=>e.jsx(P,{variant:l===k+1?"accent":"outline",size:"sm",onClick:()=>c(k+1),children:k+1},k))})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs(P,{variant:"accent",className:"w-full gap-2",onClick:()=>d(!0),children:[e.jsx(Gt,{className:"w-4 h-4"}),"Submit Complaint"]}),e.jsx(U,{children:e.jsxs(_,{className:"p-4 space-y-3",children:[e.jsx("button",{onClick:()=>{r("all"),c(1)},className:`text-sm font-medium w-full text-left px-2 py-1 rounded ${s==="all"?"text-accent":"text-muted-foreground hover:text-foreground"}`,children:"All complaints"}),["resolved","open","unresolved"].map(f=>{const k=ZC[f];return e.jsxs("button",{onClick:()=>{r(f),c(1)},className:`flex items-center gap-2 text-sm w-full text-left px-2 py-1 rounded ${s===f?"text-accent font-medium":"text-muted-foreground hover:text-foreground"}`,children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${k.bgColor}`}),k.label," (",v[f],")"]},f)}),s!=="all"&&e.jsx(P,{variant:"outline",size:"sm",className:"w-full mt-2",onClick:()=>{r("all"),c(1)},children:"Clear filter"})]})}),e.jsx(U,{children:e.jsxs(_,{className:"p-4",children:[e.jsx("label",{className:"text-sm font-medium text-foreground mb-2 block",children:"Sort by"}),e.jsxs(Je,{value:i,onValueChange:f=>{o(f),c(1)},children:[e.jsx(Ue,{children:e.jsx(Ye,{})}),e.jsxs(_e,{children:[e.jsx(xe,{value:"newest",children:"Newest"}),e.jsx(xe,{value:"oldest",children:"Oldest"}),e.jsx(xe,{value:"amount-high",children:"Highest amount"}),e.jsx(xe,{value:"amount-low",children:"Lowest amount"})]})]})]})})]})]})]}),e.jsx(uT,{open:h,onOpenChange:d,onSubmit:g}),e.jsx(oo,{})]})},yT=({complaint:t})=>{const a=ZC[t.status],s=a.icon;return e.jsxs(U,{className:"overflow-hidden border-border/50 hover:shadow-md transition-shadow",children:[e.jsxs("div",{className:`${a.bgColor} py-6 flex flex-col items-center justify-center text-white`,children:[e.jsx(s,{className:"w-10 h-10 mb-2"}),e.jsx("span",{className:"font-bold text-sm tracking-wider",children:a.label})]}),e.jsxs(_,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold text-sm text-foreground line-clamp-2 leading-snug",children:[t.title," – ",t.companyName]}),e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-3 leading-relaxed",children:t.body}),e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-border/50",children:[t.amount&&e.jsxs("span",{className:"text-sm font-semibold text-foreground",children:[t.amount," ",t.currency]}),e.jsxs(q,{variant:"outline",className:`text-xs ${a.color} border-current`,children:["STATUS: ",a.label]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(Ft,{className:"w-3 h-3"}),eN(new Date(t.createdAt),{addSuffix:!0})]})]})]})},gT={sm:"w-3.5 h-3.5",md:"w-5 h-5",lg:"w-6 h-6"},Nl=({rating:t,maxRating:a=5,size:s="md",interactive:r=!1,onRatingChange:i})=>e.jsx("div",{className:"flex items-center gap-0.5",children:Array.from({length:a},(o,l)=>{const c=l<t;return e.jsx("button",{type:"button",disabled:!r,onClick:()=>r&&(i==null?void 0:i(l+1)),className:r?"cursor-pointer hover:scale-110 transition-transform":"cursor-default",children:e.jsx(Ze,{className:`${gT[s]} ${c?"fill-gaming-gold text-gaming-gold":"fill-transparent text-muted-foreground/30"}`})},l)})}),fT=({open:t,onOpenChange:a,onSubmit:s})=>{const[r,i]=m.useState(""),[o,l]=m.useState(0),[c,h]=m.useState(""),[d,p]=m.useState(""),[g,y]=m.useState(""),[u,x]=m.useState(""),[v,f]=m.useState(""),[k,w]=m.useState(!1),[j,b]=m.useState(!1),T=r.trim().length>=2&&o>0&&c.trim().length>=5&&d.trim().length>=20&&v,S=()=>{!T||o===0||(s==null||s({companyName:r.trim(),title:c.trim(),body:d.trim(),rating:o,pros:g.trim()||void 0,cons:u.trim()||void 0,relationship:v,isAnonymous:k}),b(!0))},N=()=>{i(""),l(0),h(""),p(""),y(""),x(""),f(""),w(!1),b(!1),a(!1)};return e.jsx(tt,{open:t,onOpenChange:N,children:e.jsx(Xe,{className:"sm:max-w-[520px]",children:j?e.jsxs(e.Fragment,{children:[e.jsxs(Be,{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-gaming-success/10 flex items-center justify-center mx-auto mb-4",children:e.jsx(Ct,{className:"w-8 h-8 text-gaming-success"})}),e.jsx(Ie,{children:"Review Submitted!"}),e.jsx(nt,{className:"text-center",children:"Thank you for your review. It will be published after moderation (usually within 24-48 hours)."})]}),e.jsx(et,{children:e.jsx(P,{variant:"accent",onClick:N,className:"w-full",children:"Done"})})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Be,{children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-accent/20 to-primary/20 flex items-center justify-center mb-2",children:e.jsx(pt,{className:"w-6 h-6 text-accent"})}),e.jsx(Ie,{children:"Write a Review"}),e.jsx(nt,{children:"Share your experience with an iGaming company. All reviews are moderated before publishing."})]}),e.jsxs("div",{className:"space-y-4 py-2 max-h-[60vh] overflow-y-auto",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Company Name *"}),e.jsx(ee,{placeholder:"Enter the company you're reviewing",value:r,onChange:L=>i(L.target.value),maxLength:120})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Overall Rating *"}),e.jsx(Nl,{rating:o,size:"lg",interactive:!0,onRatingChange:L=>l(L)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Your Relationship *"}),e.jsxs(Je,{value:v,onValueChange:f,children:[e.jsx(Ue,{children:e.jsx(Ye,{placeholder:"How do you know this company?"})}),e.jsxs(_e,{children:[e.jsx(xe,{value:"employee",children:"Current/Former Employee"}),e.jsx(xe,{value:"client",children:"Client / Customer"}),e.jsx(xe,{value:"partner",children:"Business Partner"}),e.jsx(xe,{value:"competitor",children:"Industry Peer"}),e.jsx(xe,{value:"other",children:"Other"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Review Title *"}),e.jsx(ee,{placeholder:"Summarize your experience in a few words",value:c,onChange:L=>h(L.target.value),maxLength:120})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["Your Review * ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(min 20 characters)"})]}),e.jsx(st,{placeholder:"Share details about your experience...",value:d,onChange:L=>p(L.target.value),rows:4,maxLength:2e3})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["Pros ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),e.jsx(st,{placeholder:"What did you like?",value:g,onChange:L=>y(L.target.value),rows:2,maxLength:500})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["Cons ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),e.jsx(st,{placeholder:"What could be improved?",value:u,onChange:L=>x(L.target.value),rows:2,maxLength:500})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border px-4 py-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Post anonymously"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Your name won't be shown publicly"})]}),e.jsx(yt,{checked:k,onCheckedChange:w})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"By submitting, you confirm this review is based on genuine experience and complies with our community guidelines."})]}),e.jsxs(et,{children:[e.jsx(P,{variant:"outline",onClick:N,children:"Cancel"}),e.jsx(P,{variant:"accent",onClick:S,disabled:!T,children:"Submit Review"})]})]})})})},vT=[{id:"rev-1",companyId:"evolution",companySlug:"evolution",author:{id:"u1",displayName:"Anonymous",isAnonymous:!0,relationship:"employee"},title:"Outstanding Announcement Video by Evolution",body:"Evolution delivered an outstanding announcement video for our ICE Barcelona 2026 campaign. Their attention to detail, creativity, and professionalism made the entire process seamless. Extremely smooth to work with. We couldn't be happier with the result.",rating:5,pros:"Great culture, competitive salary, innovative products",cons:"Fast-paced environment can be demanding",status:"published",reactions:{useful:12,notUseful:1},createdAt:"2026-01-15T10:00:00Z",isVerified:!0,helpfulCount:12},{id:"rev-2",companyId:"evolution",companySlug:"evolution",author:{id:"u2",displayName:"Sarah M.",isAnonymous:!1,jobTitle:"Product Manager",relationship:"client"},title:"Reliable B2B partner for live casino",body:"We've been working with Evolution for over 3 years. Their live casino platform is best-in-class and their integration support is excellent. API documentation could be improved but overall a great partner.",rating:4,pros:"Best live casino product, reliable platform, great support team",cons:"API documentation could be more detailed",status:"published",reactions:{useful:8,notUseful:2},createdAt:"2025-11-20T14:30:00Z",isVerified:!0,helpfulCount:8},{id:"rev-3",companyId:"evolution",companySlug:"evolution",author:{id:"u3",displayName:"James K.",isAnonymous:!1,jobTitle:"CTO",relationship:"partner"},title:"Solid technology but expensive",body:"The technology is world-class and their game portfolio is unmatched. However, the pricing can be prohibitive for smaller operators. Great for established brands that can afford premium rates.",rating:3,pros:"World-class technology, huge game portfolio",cons:"High pricing, long contract negotiations",status:"published",reactions:{useful:15,notUseful:3},createdAt:"2025-09-05T09:15:00Z",isVerified:!1,helpfulCount:15},{id:"rev-4",companyId:"pragmatic-play",companySlug:"pragmatic-play",author:{id:"u4",displayName:"Anonymous",isAnonymous:!0,relationship:"employee"},title:"Great place to grow your career",body:"Pragmatic Play offers incredible learning opportunities. The team is talented and the company is growing fast. Work-life balance could be better during peak release periods.",rating:4,pros:"Career growth, talented team, innovative products",cons:"Work-life balance during crunch periods",status:"published",reactions:{useful:6,notUseful:0},createdAt:"2026-02-01T11:00:00Z",isVerified:!0,helpfulCount:6},{id:"rev-5",companyId:"betsson",companySlug:"betsson",author:{id:"u5",displayName:"Maria L.",isAnonymous:!1,jobTitle:"Affiliate Manager",relationship:"partner"},title:"Excellent affiliate program",body:"Betsson's affiliate program is one of the best in the industry. Transparent reporting, timely payments, and a dedicated affiliate manager who actually responds. Highly recommended for affiliates.",rating:5,pros:"Transparent reporting, timely payments, dedicated support",cons:"Could offer more creative materials",status:"published",reactions:{useful:20,notUseful:1},createdAt:"2025-12-10T16:45:00Z",isVerified:!0,helpfulCount:20},{id:"rev-6",companyId:"softswiss",companySlug:"softswiss",author:{id:"u6",displayName:"Anonymous",isAnonymous:!0,relationship:"employee"},title:"Innovative tech company with great perks",body:"SOFTSWISS is one of the best employers in the iGaming B2B space. The engineering culture is strong, Agile is done properly, and remote work is genuinely supported. Salaries are competitive for the region. Only downside is some bureaucracy as the company scales.",rating:5,pros:"Remote-friendly, strong engineering culture, competitive pay",cons:"Growing bureaucracy, some slow decision-making",status:"published",reactions:{useful:18,notUseful:2},createdAt:"2026-02-10T09:00:00Z",isVerified:!0,helpfulCount:18},{id:"rev-7",companyId:"softswiss",companySlug:"softswiss",author:{id:"u7",displayName:"Alex R.",isAnonymous:!1,jobTitle:"Integration Manager",relationship:"client"},title:"Reliable platform, responsive support",body:"We migrated our casino to SOFTSWISS last year. The migration was smooth, the game aggregator is excellent, and their support team is very responsive. The back-office tools could use a UI refresh but functionally they're solid.",rating:4,pros:"Smooth integration, vast game aggregator, responsive support",cons:"Back-office UI feels dated",status:"published",reactions:{useful:9,notUseful:1},createdAt:"2025-10-22T13:00:00Z",isVerified:!0,helpfulCount:9},{id:"rev-8",companyId:"softswiss",companySlug:"softswiss",author:{id:"u8",displayName:"Dmitry V.",isAnonymous:!1,jobTitle:"COO",relationship:"partner"},title:"Strong crypto-first platform",body:"If you're looking for the best crypto casino platform, SOFTSWISS is the clear leader. Their crypto payment processing is seamless and they understand the regulatory nuances of crypto gambling better than anyone else in the space.",rating:5,pros:"Best-in-class crypto support, regulatory expertise, scalable infrastructure",cons:"Premium pricing for smaller operators",status:"published",reactions:{useful:14,notUseful:0},createdAt:"2025-08-15T10:30:00Z",isVerified:!1,helpfulCount:14},{id:"rev-9",companyId:"microgaming",companySlug:"microgaming",author:{id:"u9",displayName:"Anonymous",isAnonymous:!0,relationship:"employee"},title:"Legacy brand with a lot of history",body:"Microgaming has a rich history in iGaming. The brand carries a lot of weight and the game portfolio is huge. However, the company feels a bit behind on modern tech compared to newer competitors.",rating:3,pros:"Brand recognition, massive game library, stable company",cons:"Slower innovation, legacy tech stack",status:"published",reactions:{useful:7,notUseful:3},createdAt:"2025-07-20T08:00:00Z",isVerified:!0,helpfulCount:7},{id:"rev-10",companyId:"playtech",companySlug:"playtech",author:{id:"u10",displayName:"Lisa T.",isAnonymous:!1,jobTitle:"Head of Content",relationship:"client"},title:"Comprehensive omni-channel solution",body:"Playtech offers one of the most comprehensive omni-channel solutions in the market. Their IMS platform is powerful and their live casino rivals Evolution. The integration process is lengthy though and requires significant resources.",rating:4,pros:"Omni-channel platform, powerful IMS, strong live casino",cons:"Complex integration, lengthy onboarding",status:"published",reactions:{useful:11,notUseful:2},createdAt:"2026-01-05T15:00:00Z",isVerified:!0,helpfulCount:11},{id:"rev-11",companyId:"betconstruct",companySlug:"betconstruct",author:{id:"u11",displayName:"Anonymous",isAnonymous:!0,relationship:"client"},title:"Good sportsbook, needs UX work",body:"BetConstruct's sportsbook platform is feature-rich and covers a wide range of markets. The odds engine is competitive. However, the front-end templates need modernization and the documentation could be clearer.",rating:3,pros:"Feature-rich sportsbook, competitive odds, good market coverage",cons:"Outdated UX templates, unclear documentation",status:"published",reactions:{useful:5,notUseful:1},createdAt:"2025-12-28T11:00:00Z",isVerified:!1,helpfulCount:5},{id:"rev-12",companyId:"yggdrasil",companySlug:"yggdrasil",author:{id:"u12",displayName:"Tom H.",isAnonymous:!1,jobTitle:"Game Designer",relationship:"employee"},title:"Creative freedom and cutting-edge tools",body:"Working at Yggdrasil as a game designer was an amazing experience. The GATI framework gives studios real creative freedom. The company culture genuinely celebrates innovation and quality over quantity.",rating:5,pros:"Creative freedom, innovative GATI framework, quality-first culture",cons:"Smaller scale compared to the big players",status:"published",reactions:{useful:16,notUseful:0},createdAt:"2026-02-18T10:00:00Z",isVerified:!0,helpfulCount:16}],kT=()=>vT.filter(t=>t.status==="published"),kM=12,bT=({reviewsData:t,onLeaveReview:a})=>{const s=m.useMemo(()=>t??kT(),[t]),[r,i]=m.useState(""),[o,l]=m.useState("newest"),[c,h]=m.useState("all"),[d,p]=m.useState(1),[g,y]=m.useState(!1),u=m.useCallback(w=>{a==null||a(w),console.log("[Reviews] Leave review:",w)},[a]),x=m.useMemo(()=>{let w=[...s];if(r.trim()){const j=r.toLowerCase();w=w.filter(b=>b.title.toLowerCase().includes(j)||b.body.toLowerCase().includes(j)||b.companySlug.toLowerCase().includes(j))}switch(c!=="all"&&(w=w.filter(j=>j.rating===Number(c))),o){case"newest":w.sort((j,b)=>new Date(b.createdAt).getTime()-new Date(j.createdAt).getTime());break;case"oldest":w.sort((j,b)=>new Date(j.createdAt).getTime()-new Date(b.createdAt).getTime());break;case"highest":w.sort((j,b)=>b.rating-j.rating);break;case"lowest":w.sort((j,b)=>j.rating-b.rating);break;case"most-helpful":w.sort((j,b)=>b.helpfulCount-j.helpfulCount);break}return w},[s,r,o,c]),v=Math.ceil(x.length/kM),f=x.slice((d-1)*kM,d*kM),k={employee:"Employee",client:"Client",partner:"Partner",competitor:"Industry Peer",other:"Other"};return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsxs("main",{className:"container mx-auto px-4 py-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-accent/10 flex items-center justify-center",children:e.jsx(pt,{className:"w-5 h-5 text-accent"})}),e.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"iGaming Reviews"})]}),e.jsx("p",{className:"text-muted-foreground max-w-2xl",children:"See what others are saying. Read honest reviews from employees, clients, and partners across the iGaming industry. Find trusted companies and share your own experience."}),e.jsxs(P,{variant:"accent",size:"sm",className:"mt-3 gap-1.5",onClick:()=>y(!0),children:[e.jsx(pt,{className:"w-4 h-4"}),"Add review"]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 mb-6",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(ft,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(ee,{placeholder:"Search reviews by company, title, or content...",value:r,onChange:w=>{i(w.target.value),p(1)},className:"pl-10"})]}),e.jsxs(Je,{value:c,onValueChange:w=>{h(w),p(1)},children:[e.jsx(Ue,{className:"w-[150px]",children:e.jsx(Ye,{placeholder:"Rating"})}),e.jsxs(_e,{children:[e.jsx(xe,{value:"all",children:"All ratings"}),e.jsx(xe,{value:"5",children:"5 stars"}),e.jsx(xe,{value:"4",children:"4 stars"}),e.jsx(xe,{value:"3",children:"3 stars"}),e.jsx(xe,{value:"2",children:"2 stars"}),e.jsx(xe,{value:"1",children:"1 star"})]})]}),e.jsxs(Je,{value:o,onValueChange:w=>{l(w),p(1)},children:[e.jsx(Ue,{className:"w-[180px]",children:e.jsx(Ye,{})}),e.jsxs(_e,{children:[e.jsx(xe,{value:"newest",children:"Newest reviews"}),e.jsx(xe,{value:"oldest",children:"Oldest reviews"}),e.jsx(xe,{value:"highest",children:"Highest rated"}),e.jsx(xe,{value:"lowest",children:"Lowest rated"}),e.jsx(xe,{value:"most-helpful",children:"Most helpful"})]})]})]}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:[x.length," review",x.length!==1?"s":""]}),f.length===0?e.jsx(U,{children:e.jsxs(_,{className:"py-16 text-center",children:[e.jsx(pt,{className:"w-12 h-12 text-muted-foreground/30 mx-auto mb-3"}),e.jsx("p",{className:"text-muted-foreground",children:"No reviews found matching your criteria."})]})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:f.map(w=>e.jsx(jT,{review:w,relationshipLabels:k},w.id))}),v>1&&e.jsx("div",{className:"flex justify-center gap-2 mt-8",children:Array.from({length:v},(w,j)=>e.jsx(P,{variant:d===j+1?"accent":"outline",size:"sm",onClick:()=>p(j+1),children:j+1},j))})]}),e.jsx(fT,{open:g,onOpenChange:y,onSubmit:u}),e.jsx(oo,{})]})},jT=({review:t,relationshipLabels:a})=>e.jsx(U,{className:"border-border/50 hover:shadow-md transition-shadow",children:e.jsxs(_,{className:"p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-secondary flex items-center justify-center flex-shrink-0",children:e.jsx(Ra,{className:"w-5 h-5 text-muted-foreground"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-sm text-foreground",children:t.author.displayName}),t.isVerified&&e.jsx(Ee,{className:"w-3.5 h-3.5 text-gaming-success"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.author.relationship&&e.jsx("span",{children:a[t.author.relationship]??t.author.relationship}),t.author.jobTitle&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:t.author.jobTitle})]})]})]})]}),e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:eN(new Date(t.createdAt),{addSuffix:!0})})]}),e.jsx("div",{className:"flex items-center gap-2 mb-2",children:e.jsxs(q,{variant:"secondary",className:"gap-1 text-xs",children:[e.jsx(Me,{className:"w-3 h-3"}),t.companySlug.replace(/-/g," ").replace(/\b\w/g,s=>s.toUpperCase())]})}),e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("h3",{className:"font-semibold text-foreground text-sm line-clamp-1",children:t.title}),e.jsx(Nl,{rating:t.rating,size:"sm"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3 leading-relaxed line-clamp-3",children:t.body}),(t.pros||t.cons)&&e.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-3",children:[t.pros&&e.jsxs("div",{className:"text-xs",children:[e.jsx("span",{className:"font-medium text-gaming-success uppercase tracking-wide",children:"Pros"}),e.jsx("p",{className:"text-muted-foreground mt-0.5 line-clamp-2",children:t.pros})]}),t.cons&&e.jsxs("div",{className:"text-xs",children:[e.jsx("span",{className:"font-medium text-destructive uppercase tracking-wide",children:"Cons"}),e.jsx("p",{className:"text-muted-foreground mt-0.5 line-clamp-2",children:t.cons})]})]}),e.jsxs("div",{className:"flex items-center gap-3 pt-3 border-t border-border/50",children:[e.jsxs(P,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-accent gap-1.5 h-7 text-xs",children:[e.jsx(Ao,{className:"w-3 h-3"}),"Useful ",t.helpfulCount>0&&`(${t.helpfulCount})`]}),e.jsxs(P,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-accent gap-1.5 h-7 text-xs",children:[e.jsx(Pa,{className:"w-3 h-3"}),"Share"]}),e.jsx(P,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-destructive gap-1.5 h-7 text-xs ml-auto",children:e.jsx(Qi,{className:"w-3 h-3"})})]})]})}),Xt=ie.forwardRef(({className:t,value:a,...s},r)=>e.jsx(IM.Root,{ref:r,className:ne("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...s,children:e.jsx(IM.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(a||0)}%)`}})}));Xt.displayName=IM.Root.displayName;function tN(){const[t,a]=m.useState(null);return m.useEffect(()=>{const s=()=>{const i=window.location.pathname.replace(/^\/+|\/+$/g,"").split("/"),o=i.findIndex(l=>l.toLowerCase()==="jobs");return o!==-1&&i[o+1]||null};a(s());const r=()=>a(s());return window.addEventListener("popstate",r),()=>window.removeEventListener("popstate",r)},[]),t}const wT={Regulated:"bg-gaming-success/10 text-gaming-success",Restricted:"bg-destructive/10 text-destructive",Emerging:"bg-gaming-warning/10 text-gaming-warning"},MT={Low:"text-muted-foreground",Medium:"text-gaming-warning",High:"text-gaming-success"},NT=({marketData:t})=>{const a=tN(),s=m.useMemo(()=>t??(a?QP(a):void 0),[t,a]);if(!s)return e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"container mx-auto px-4 py-16 text-center",children:[e.jsx(Lt,{className:"w-16 h-16 text-muted-foreground mx-auto mb-4"}),e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Market Not Found"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"The market you're looking for doesn't exist."}),e.jsx(P,{variant:"accent",onClick:()=>window.location.replace("/markets/v2"),children:"Browse Markets"})]})});const r=o=>`/jobs?${new URLSearchParams(o).toString()}`,i=(s.news??[]).slice(0,5);return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("section",{className:"bg-gradient-to-br from-primary to-primary/80 text-primary-foreground py-10",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsxs(P,{variant:"ghost",size:"sm",className:"text-primary-foreground/70 hover:text-primary-foreground mb-4 gap-1.5",onClick:()=>window.location.replace("/markets/v2"),children:[e.jsx(la,{className:"w-4 h-4"})," All Markets"]}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-2",children:[e.jsx("h1",{className:"text-3xl font-bold",children:s.name}),e.jsx(q,{className:`text-xs ${wT[s.status]}`,children:s.status}),s.isFeatured&&e.jsx(q,{className:"bg-gaming-gold text-foreground text-xs",children:"Featured"})]}),e.jsx("p",{className:"text-primary-foreground/80 max-w-2xl mb-4",children:s.overview}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.badges.map(o=>e.jsx(q,{variant:"outline",className:"text-xs border-primary-foreground/30 text-primary-foreground/90",children:o.label},o.label))})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[e.jsx(Dl,{icon:je,label:"Active Jobs",value:s.stats.jobsCount.toLocaleString()}),e.jsx(Dl,{icon:Me,label:"Companies",value:s.stats.companiesCount.toLocaleString()}),e.jsx(Dl,{icon:so,label:"Remote Ratio",value:`${s.stats.remoteRatio}%`}),e.jsx(Dl,{icon:Oa,label:`Median (${s.salaryPulse.currency})`,value:s.salaryPulse.medianAnnual.toLocaleString()})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-3 mt-6",children:[e.jsxs(P,{variant:"secondary",size:"sm",className:"gap-1.5",children:[e.jsx(ga,{className:"w-4 h-4"})," Get alerts for this market"]}),e.jsxs(P,{variant:"secondary",size:"sm",className:"gap-1.5",children:[e.jsx(ma,{className:"w-4 h-4"})," Follow market"]}),e.jsxs(P,{variant:"secondary",size:"sm",className:"gap-1.5",children:[e.jsx(pt,{className:"w-4 h-4"})," I work here"]})]})]})}),e.jsx("main",{className:"container mx-auto px-4 py-8",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(Cs,{className:`w-5 h-5 ${MT[s.stats.hiringIntensity]}`}),"Hiring Now",e.jsxs(q,{variant:"secondary",className:"text-xs ml-auto",children:[s.stats.jobsCount," jobs"]})]})}),e.jsxs(_,{children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-3 uppercase tracking-wide",children:"Trending Role Families"}),e.jsx("div",{className:"space-y-3",children:s.trendingRoles.map(o=>e.jsx(CT,{role:o,maxCount:Math.max(...s.trendingRoles.map(l=>l.count)),href:r({department:o.roleFamily,country:s.name})},o.roleFamily))})]})]}),e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(Me,{className:"w-5 h-5 text-accent"}),"Top Employers"]})}),e.jsx(_,{children:e.jsx("div",{className:"space-y-3",children:s.topEmployers.map((o,l)=>e.jsx(ST,{employer:o,rank:l+1,href:r({company:o.name,country:s.name})},o.slug))})})]}),e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(Oa,{className:"w-5 h-5 text-gaming-gold"}),"Salary Pulse"]})}),e.jsxs(_,{children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4 mb-4 text-center",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold text-foreground",children:s.salaryPulse.rangeMin.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Min (",s.salaryPulse.currency,")"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold text-accent",children:s.salaryPulse.medianAnnual.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Median (",s.salaryPulse.currency,")"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold text-foreground",children:s.salaryPulse.rangeMax.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Max (",s.salaryPulse.currency,")"]})]})]}),e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-2 uppercase tracking-wide",children:"By Role Family"}),e.jsx("div",{className:"space-y-2",children:s.salaryPulse.topRoleFamilies.map(o=>e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-foreground",children:o.role}),e.jsxs("span",{className:"font-semibold text-foreground",children:[o.median.toLocaleString()," ",s.salaryPulse.currency]})]},o.role))}),e.jsxs(P,{variant:"outline",size:"sm",className:"mt-4 w-full gap-1.5",children:["View full Salary Guide ",e.jsx(Pt,{className:"w-3.5 h-3.5"})]})]})]}),s.regulators.length>0&&e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(Kt,{className:"w-5 h-5 text-gaming-success"}),"Regulation & Licensing"]})}),e.jsx(_,{className:"space-y-4",children:s.regulators.map(o=>e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border border-border/50",children:[e.jsx(Kt,{className:"w-5 h-5 text-gaming-success flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:o.name}),e.jsxs("p",{className:"text-xs text-muted-foreground mb-1.5",children:["Authority: ",o.authority]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:o.licenseTypes.map(l=>e.jsx(q,{variant:"outline",className:"text-xs",children:l},l))})]})]},o.slug))})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(U,{children:e.jsxs(_,{className:"p-4 space-y-3",children:[e.jsx("h3",{className:"font-semibold text-foreground",children:"Market Info"}),e.jsx(Fs,{label:"Region",value:s.region}),e.jsx(Fs,{label:"Currency",value:s.currency}),s.timezone&&e.jsx(Fs,{label:"Timezone",value:s.timezone}),e.jsx(Fs,{label:"Population",value:`${s.populationM.toLocaleString()}M`}),e.jsx(Fs,{label:"Revenue Potential",value:`$${s.revenuePotentialM.toLocaleString()}M`}),e.jsx(Fs,{label:"Languages",value:s.languages.join(", ")}),e.jsx(Fs,{label:"Verticals",value:s.verticals.join(", ")})]})}),s.upcomingEvents.length>0&&e.jsx(U,{children:e.jsxs(_,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold text-foreground flex items-center gap-2",children:[e.jsx(da,{className:"w-4 h-4 text-accent"}),"Upcoming Events"]}),s.upcomingEvents.slice(0,3).map(o=>e.jsxs("div",{className:"flex items-start gap-3 py-2 border-b border-border/50 last:border-0",children:[e.jsxs("div",{className:"w-10 h-10 rounded-lg bg-accent/10 flex flex-col items-center justify-center flex-shrink-0",children:[e.jsx("span",{className:"text-xs font-bold text-accent leading-none",children:new Date(o.date).toLocaleString("en",{month:"short"}).toUpperCase()}),e.jsx("span",{className:"text-sm font-bold text-foreground leading-none",children:new Date(o.date).getDate()})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:o.name}),e.jsx("p",{className:"text-xs text-muted-foreground",children:o.city})]})]},o.slug)),e.jsx(P,{variant:"outline",size:"sm",className:"w-full",children:"View all events"})]})}),e.jsx(U,{children:e.jsxs(_,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Ut,{className:"w-4 h-4 text-accent"}),"Latest News"]}),i.length>0?e.jsx("div",{className:"space-y-3",children:i.map(o=>e.jsxs("a",{href:o.link,target:"_blank",rel:"noopener noreferrer",className:"block rounded-md border border-border/60 p-2.5 hover:bg-secondary/40 transition-colors",children:[e.jsx("p",{className:"text-sm font-medium text-foreground line-clamp-2",children:o.title}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[o.company_name?`${o.company_name} · `:"",LT(o)]})]},`${o.link}-${o.title}`))}):e.jsxs("p",{className:"text-sm text-muted-foreground",children:['News articles tagged with "',s.name,'" will appear here once available.']}),e.jsx(P,{variant:"outline",size:"sm",className:"w-full",children:"Browse iGaming News"})]})})]})]})}),e.jsx(oo,{})]})},Dl=({icon:t,label:a,value:s})=>e.jsxs("div",{className:"bg-primary-foreground/10 rounded-lg p-3 text-center",children:[e.jsx(t,{className:"w-5 h-5 mx-auto mb-1 text-primary-foreground/70"}),e.jsx("p",{className:"text-xl font-bold text-primary-foreground",children:s}),e.jsx("p",{className:"text-xs text-primary-foreground/60",children:a})]}),CT=({role:t,maxCount:a,href:s})=>e.jsxs("a",{href:s,className:"flex items-center gap-3 rounded-md p-1 -m-1 hover:bg-secondary/50 transition-colors",children:[e.jsx("span",{className:"text-sm font-medium text-foreground w-28 flex-shrink-0",children:t.roleFamily}),e.jsx(Xt,{value:t.count/a*100,className:"h-2 flex-1"}),e.jsx("span",{className:"text-sm font-semibold text-foreground w-10 text-right",children:t.count}),e.jsxs("span",{className:`text-xs font-medium flex items-center gap-0.5 w-12 ${t.changePercent>=0?"text-gaming-success":"text-destructive"}`,children:[t.changePercent>=0?e.jsx($e,{className:"w-3 h-3"}):e.jsx(Po,{className:"w-3 h-3"}),t.changePercent>=0?"+":"",t.changePercent,"%"]})]}),ST=({employer:t,rank:a,href:s})=>e.jsxs("a",{href:s,className:"flex items-center gap-3 p-2 rounded-lg hover:bg-secondary/50 transition-colors cursor-pointer",children:[e.jsx("span",{className:"w-6 h-6 rounded-full bg-accent/10 flex items-center justify-center text-xs font-bold text-accent flex-shrink-0",children:a}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name}),t.isClaimed&&e.jsx(q,{variant:"outline",className:"text-xs text-gaming-success border-gaming-success/30",children:"Verified"})]}),t.employeeRange&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.employeeRange," employees"]})]}),e.jsxs(q,{variant:"secondary",className:"text-xs gap-1",children:[e.jsx(je,{className:"w-3 h-3"}),t.openRoles," roles"]})]}),Fs=({label:t,value:a})=>e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:t}),e.jsx("span",{className:"text-foreground font-medium text-right max-w-[60%]",children:a})]}),LT=t=>{const a=t.date??t.scraped_at;if(!a)return"Date unavailable";const s=new Date(a);return Number.isNaN(s.getTime())?"Date unavailable":s.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})},IT={verified:{label:"Verified",className:"bg-gaming-success/10 text-gaming-success border-gaming-success/20"},"self-reported":{label:"Self-reported",className:"bg-gaming-warning/10 text-gaming-warning border-gaming-warning/20"},"community-suggested":{label:"Community",className:"bg-accent/10 text-accent border-accent/20"}},AT=({regulatorData:t})=>{const a=tN(),s=m.useMemo(()=>t??(a?rT(a):void 0),[t,a]);return s?e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("section",{className:"bg-gradient-to-br from-primary to-primary/80 text-primary-foreground py-10",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsxs(P,{variant:"ghost",size:"sm",className:"text-primary-foreground/70 hover:text-primary-foreground mb-4 gap-1.5",onClick:()=>window.location.replace("/regulators"),children:[e.jsx(la,{className:"w-4 h-4"})," All Regulators"]}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-2",children:[e.jsx("h1",{className:"text-3xl font-bold",children:s.name}),e.jsx(q,{className:"bg-primary-foreground/20 text-primary-foreground border-primary-foreground/30",children:s.acronym}),s.isPrimary&&e.jsx(q,{className:"bg-gaming-gold text-foreground text-xs",children:"Primary Authority"})]}),e.jsx("p",{className:"text-primary-foreground/80 max-w-2xl mb-4",children:s.description}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(q,{variant:"outline",className:"text-xs border-primary-foreground/30 text-primary-foreground/90",children:[e.jsx(Lt,{className:"w-3 h-3 mr-1"})," ",s.country]}),e.jsxs(q,{variant:"outline",className:"text-xs border-primary-foreground/30 text-primary-foreground/90",children:[e.jsx(So,{className:"w-3 h-3 mr-1"})," ",s.jurisdiction]}),e.jsxs(q,{variant:"outline",className:"text-xs border-primary-foreground/30 text-primary-foreground/90",children:["Est. ",s.establishedYear]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[s.website&&e.jsx(P,{variant:"secondary",size:"sm",className:"gap-1.5",asChild:!0,children:e.jsxs("a",{href:s.website,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(bt,{className:"w-4 h-4"})," Official Website"]})}),s.registerUrl&&e.jsx(P,{variant:"secondary",size:"sm",className:"gap-1.5",asChild:!0,children:e.jsxs("a",{href:s.registerUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(fa,{className:"w-4 h-4"})," Licensee Register"]})})]})]})]})}),e.jsx("main",{className:"container mx-auto px-4 py-8",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(So,{className:"w-5 h-5 text-accent"})," Regulatory Scope"]})}),e.jsxs(_,{children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:s.scope}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mr-2",children:"License Types:"}),s.licenseTypes.map(r=>e.jsx(q,{variant:"secondary",className:"text-xs",children:r},r))]}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mr-2",children:"Sectors:"}),s.sectors.map(r=>e.jsx(q,{variant:"outline",className:"text-xs",children:r},r))]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mr-2",children:"Scope Tags:"}),s.scopeTags.map(r=>e.jsx(q,{variant:"accent",className:"text-xs",children:r},r))]})]})]}),e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(je,{className:"w-5 h-5 text-gaming-success"})," What This Means for Careers"]})}),e.jsxs(_,{children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:s.careerImplications}),e.jsx("h4",{className:"text-sm font-medium text-foreground mb-3 uppercase tracking-wide",children:"Common Role Families"}),e.jsx("div",{className:"space-y-3",children:s.careerRoles.map(r=>e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border border-border/50",children:[e.jsx(ze,{className:"w-4 h-4 text-accent flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:r.roleFamily}),e.jsx("p",{className:"text-xs text-muted-foreground",children:r.description})]})]},r.roleFamily))})]})]}),e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(Gt,{className:"w-5 h-5 text-gaming-warning"})," Key Requirements"]})}),e.jsxs(_,{children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"High-level themes — not legal advice. See official pages for full details."}),e.jsx("ul",{className:"space-y-2",children:s.keyRequirements.map(r=>e.jsxs("li",{className:"flex items-start gap-2 text-sm text-foreground",children:[e.jsx(Kt,{className:"w-4 h-4 text-gaming-success flex-shrink-0 mt-0.5"}),r]},r))})]})]}),s.linkedCompanies.length>0&&e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(Me,{className:"w-5 h-5 text-accent"})," Licensed Companies"]})}),e.jsxs(_,{children:[e.jsx("div",{className:"space-y-3",children:s.linkedCompanies.map(r=>{const i=IT[r.evidenceLevel];return e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Me,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:r.name})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(q,{variant:"outline",className:`text-xs ${i.className}`,children:i.label}),r.evidenceUrl&&e.jsx(P,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",asChild:!0,children:e.jsx("a",{href:r.evidenceUrl,target:"_blank",rel:"noopener noreferrer",children:e.jsx(bt,{className:"w-3 h-3"})})})]})]},r.slug)})}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-3 flex items-start gap-1.5",children:[e.jsx(Kt,{className:"w-3 h-3 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Verified"})," = found in official register. ",e.jsx("strong",{children:"Self-reported"})," = company-asserted, pending verification."]})]})]})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(U,{children:e.jsxs(_,{className:"p-4 space-y-3",children:[e.jsx("h3",{className:"font-semibold text-foreground",children:"Regulator Info"}),e.jsx(Hs,{label:"Acronym",value:s.acronym}),e.jsx(Hs,{label:"Country",value:s.country}),e.jsx(Hs,{label:"Region",value:s.region}),e.jsx(Hs,{label:"Jurisdiction",value:s.jurisdiction}),e.jsx(Hs,{label:"Established",value:String(s.establishedYear)}),e.jsx(Hs,{label:"Compliance Score",value:`${s.complianceRating.toFixed(1)} / 5.0`}),e.jsx(Hs,{label:"License Types",value:s.licenseTypes.join(", ")})]})}),s.linkedMarkets.length>0&&e.jsx(U,{children:e.jsxs(_,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Te,{className:"w-4 h-4 text-accent"})," Markets Covered"]}),s.linkedMarkets.map(r=>e.jsxs(P,{variant:"outline",size:"sm",className:"w-full justify-start gap-2",onClick:()=>window.location.replace(`/markets/${r.slug}`),children:[e.jsx(Lt,{className:"w-3.5 h-3.5"})," ",r.name]},r.slug))]})}),e.jsx(U,{children:e.jsxs(_,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold text-foreground flex items-center gap-2",children:[e.jsx(At,{className:"w-4 h-4 text-accent"})," Resources"]}),s.website&&e.jsx(P,{variant:"outline",size:"sm",className:"w-full justify-start gap-2",asChild:!0,children:e.jsxs("a",{href:s.website,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(bt,{className:"w-3.5 h-3.5"})," Official Website"]})}),s.registerUrl&&e.jsx(P,{variant:"outline",size:"sm",className:"w-full justify-start gap-2",asChild:!0,children:e.jsxs("a",{href:s.registerUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(fa,{className:"w-3.5 h-3.5"})," Licensee Register"]})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Links to official pages. We do not summarize legal text — see the regulator's website for full requirements."})]})})]})]})}),e.jsx(oo,{})]}):e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"container mx-auto px-4 py-16 text-center",children:[e.jsx(Kt,{className:"w-16 h-16 text-muted-foreground mx-auto mb-4"}),e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Regulator Not Found"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"The regulator you're looking for doesn't exist."}),e.jsx(P,{variant:"accent",onClick:()=>window.location.replace("/regulators"),children:"Browse Regulators"})]})})},Hs=({label:t,value:a})=>e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:t}),e.jsx("span",{className:"text-foreground font-medium text-right max-w-[60%]",children:a})]});function VN(t){window.location.assign(t)}function ON(t){window.history.length>1?window.history.back():window.location.assign(t)}function PT(t){const a=JC,s=t??{};return{id:s.id??a.id,title:s.title??a.title,company:s.company??a.company,companyLogo:s.companyLogo??a.companyLogo,location:s.location??a.location,salary:s.salary??void 0,jobType:s.jobType??a.jobType,experienceLevel:s.experienceLevel??a.experienceLevel,department:s.department??a.department,postedDate:s.postedDate??a.postedDate,applicationDeadline:s.applicationDeadline??void 0,description:s.description??a.description,requirements:Array.isArray(s.requirements)?s.requirements:[],responsibilities:Array.isArray(s.responsibilities)?s.responsibilities:[],benefits:Array.isArray(s.benefits)?s.benefits:[],skills:Array.isArray(s.skills)?s.skills:[],companyDescription:s.companyDescription??"",companySize:s.companySize??void 0,companyWebsite:s.companyWebsite??void 0,contactEmail:s.contactEmail??void 0,contactPhone:s.contactPhone??void 0,isRemote:s.isRemote??!1,isUrgent:s.isUrgent??!1,isFeatured:s.isFeatured??!1,applicationUrl:s.applicationUrl??void 0,viewCount:s.viewCount??void 0,applicantCount:s.applicantCount??void 0}}function TT(t){return!Array.isArray(t)||t.length===0?YC:t.map(a=>({id:a.id??"unknown",title:a.title??"Untitled",company:a.company??"",location:a.location??"",salary:a.salary??void 0,postedDate:a.postedDate??new Date().toISOString().slice(0,10)}))}const JC={id:"1",title:"Senior Game Developer",company:"Wazdan",companyLogo:"https://images.pexels.com/photos/3184291/pexels-photo-3184291.jpeg?auto=compress&cs=tinysrgb&w=100",location:"Malta",salary:"€80,000 - €120,000",jobType:"Full-time",experienceLevel:"Senior Level",department:"Engineering",postedDate:"2025-01-15",applicationDeadline:"2025-02-15",description:"We are seeking a talented Senior Game Developer to join our innovative team at Wazdan...",requirements:["5+ years of experience in game development","Strong proficiency in C# and Unity","Experience with HTML5 and JavaScript","Knowledge of casino game mechanics","Understanding of RNG and game mathematics","Experience with version control systems (Git)","Strong problem-solving skills","Excellent communication skills in English"],responsibilities:["Design and develop high-quality casino games","Implement game features and mechanics","Optimize game performance across multiple platforms","Collaborate with artists and designers on game assets","Write clean, maintainable, and well-documented code","Participate in code reviews and technical discussions","Debug and resolve technical issues","Stay updated with industry trends and technologies"],benefits:["Competitive salary and performance bonuses","Health insurance coverage","Flexible working hours","Remote work options","Professional development opportunities","25 days paid vacation","Modern office in Malta","Team building events and activities"],skills:["Unity","C#","JavaScript","HTML5","CSS3","Git","Agile","Game Design"],companyDescription:"Wazdan is a leading provider of innovative casino games...",companySize:"100-200 employees",companyWebsite:"https://wazdan.com",contactEmail:"careers@wazdan.com",contactPhone:"+356 2123 4567",isRemote:!1,isUrgent:!0,isFeatured:!0,applicationUrl:"https://wazdan.com/careers/apply",viewCount:1247,applicantCount:23},YC=[{id:"2",title:"Frontend Game Developer",company:"Pragmatic Play",location:"Malta",salary:"€60,000 - €80,000",postedDate:"2025-01-10"},{id:"3",title:"Unity Developer",company:"Evolution Gaming",location:"Remote",salary:"€70,000 - €90,000",postedDate:"2025-01-12"},{id:"4",title:"Game Developer",company:"NetEnt",location:"Stockholm",salary:"€65,000 - €85,000",postedDate:"2025-01-08"}],RT=({job:t=JC,similarJobs:a=YC,onSkillClick:s})=>{var S;const r=tN(),[i,o]=m.useState(()=>TT(a)),[l,c]=m.useState(!1),[h,d]=m.useState(null),[p,g]=m.useState(!1),[y,u]=m.useState(!1),{toggleJob:x,isSaved:v}=qC(),f=PT(t);m.useEffect(()=>{(async()=>{c(!0);try{if(await new Promise(I=>setTimeout(I,300)),!r)throw new Error("Missing slug in URL.");o(i);const L=JSON.parse(localStorage.getItem("appliedJobs")||"[]");u(L.includes(r))}catch(L){d((L==null?void 0:L.message)||"Failed to load job details")}finally{c(!1)}})()},[r]);const k=()=>{r&&x(r)},w=()=>{if(!r)return;f!=null&&f.applicationUrl?window.open(f.applicationUrl,"_blank","noopener,noreferrer"):g(!0);const N=JSON.parse(localStorage.getItem("appliedJobs")||"[]");N.includes(r)||(N.push(r),localStorage.setItem("appliedJobs",JSON.stringify(N)),u(!0))},j=async()=>{if(navigator.share)try{await navigator.share({title:f==null?void 0:f.title,text:`Check out this job opportunity: ${f==null?void 0:f.title} at ${f==null?void 0:f.company}`,url:window.location.href})}catch(N){console.log("Error sharing:",N)}else navigator.clipboard.writeText(window.location.href),alert("Job URL copied to clipboard!")},b=N=>new Date(N).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}),T=N=>{const L=new Date(N),A=Math.abs(new Date().getTime()-L.getTime());return Math.ceil(A/(1e3*60*60*24))};return l?e.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"}),e.jsx("p",{className:"mt-4 text-gray-600",children:"Loading job details..."})]})}):h||!f?e.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(Ot,{className:"h-12 w-12 text-red-500 mx-auto mb-4"}),e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Job Not Found"}),e.jsx("p",{className:"text-gray-600 mb-4",children:h||"The job you are looking for does not exist."}),e.jsx("button",{onClick:()=>ON("/jobs"),className:"bg-blue-600 text-white px-6 py-2 rounded-lg hover:bg-blue-700 transition-colors",children:"Back to Jobs"})]})}):e.jsxs("div",{className:"min-h-screen bg-gray-50",children:[e.jsx("div",{className:"bg-white border-b border-gray-200",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4",children:[e.jsxs("button",{onClick:()=>ON("/jobs"),className:"flex items-center text-gray-600 hover:text-gray-900 mb-4",children:[e.jsx(la,{className:"h-4 w-4 mr-2"}),"Back to Jobs"]}),e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-start lg:justify-between",children:[e.jsx("div",{className:"flex-1",children:e.jsxs("div",{className:"flex items-start space-x-4",children:[f.companyLogo&&e.jsx("img",{src:f.companyLogo,alt:`${f.company} logo`,className:"w-16 h-16 rounded-lg object-cover border border-gray-200"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[f.isUrgent&&e.jsx("span",{className:"bg-red-100 text-red-800 text-xs font-medium px-2 py-1 rounded-full",children:"Urgent"}),f.isFeatured&&e.jsx("span",{className:"bg-yellow-100 text-yellow-800 text-xs font-medium px-2 py-1 rounded-full",children:"Featured"})]}),e.jsx("h1",{className:"text-2xl lg:text-3xl font-bold text-gray-900 mb-2",children:f.title}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-gray-600",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(Me,{className:"h-4 w-4 mr-1"}),e.jsx("span",{className:"font-medium",children:f.company})]}),e.jsxs("div",{className:"flex items-center",children:[e.jsx(Te,{className:"h-4 w-4 mr-1"}),e.jsx("span",{children:f.location}),f.isRemote&&e.jsx("span",{className:"ml-1",children:"(Remote)"})]}),f.salary&&e.jsxs("div",{className:"flex items-center",children:[e.jsx(Oa,{className:"h-4 w-4 mr-1"}),e.jsx("span",{children:f.salary})]}),e.jsxs("div",{className:"flex items-center",children:[e.jsx(ut,{className:"h-4 w-4 mr-1"}),e.jsxs("span",{children:[T(f.postedDate)," days ago"]})]})]})]})]})}),e.jsxs("div",{className:"flex items-center space-x-3 mt-4 lg:mt-0",children:[e.jsxs("button",{onClick:k,className:`flex items-center px-4 py-2 rounded-lg border transition-colors ${v(f.id)?"bg-blue-50 border-blue-200 text-blue-700":"bg-white border-gray-300 text-gray-700 hover:bg-gray-50"}`,children:[e.jsx(ma,{className:`h-4 w-4 mr-2 ${v(f.id)?"fill-current":""}`}),v(f.id)?"Saved":"Save Job"]}),e.jsxs("button",{onClick:j,className:"flex items-center px-4 py-2 bg-white border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors",children:[e.jsx(Pa,{className:"h-4 w-4 mr-2"}),"Share"]}),e.jsx("button",{onClick:w,disabled:y,className:`flex items-center px-6 py-2 rounded-lg font-medium transition-colors ${y?"bg-green-100 text-green-800 cursor-not-allowed":"bg-blue-600 text-white hover:bg-blue-700"}`,children:y?e.jsxs(e.Fragment,{children:[e.jsx(Ct,{className:"h-4 w-4 mr-2"}),"Applied"]}):e.jsxs(e.Fragment,{children:[e.jsx(bt,{className:"h-4 w-4 mr-2"}),"Apply Now"]})})]})]})]})}),e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4 mb-6",children:[e.jsxs("div",{className:"text-center p-4 bg-gray-50 rounded-lg",children:[e.jsx(je,{className:"h-6 w-6 text-blue-600 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Job Type"}),e.jsx("p",{className:"font-medium",children:f.jobType})]}),e.jsxs("div",{className:"text-center p-4 bg-gray-50 rounded-lg",children:[e.jsx(ha,{className:"h-6 w-6 text-blue-600 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Experience"}),e.jsx("p",{className:"font-medium",children:f.experienceLevel})]}),e.jsxs("div",{className:"text-center p-4 bg-gray-50 rounded-lg",children:[e.jsx(ze,{className:"h-6 w-6 text-blue-600 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Department"}),e.jsx("p",{className:"font-medium",children:f.department})]}),e.jsxs("div",{className:"text-center p-4 bg-gray-50 rounded-lg",children:[e.jsx(Ft,{className:"h-6 w-6 text-blue-600 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Deadline"}),e.jsx("p",{className:"font-medium text-sm",children:f.applicationDeadline?b(f.applicationDeadline):"Open"})]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-gray-200",children:[e.jsxs("div",{className:"flex items-center space-x-4 text-sm text-gray-600",children:[e.jsxs("span",{children:[f.viewCount," views"]}),e.jsxs("span",{children:[f.applicantCount," applicants"]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ze,{className:"h-4 w-4 text-yellow-400 fill-current"}),e.jsx("span",{className:"text-sm text-gray-600",children:"4.8 company rating"})]})]})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Job Description"}),e.jsx("div",{className:"prose prose-gray max-w-none",children:e.jsx("p",{className:"text-gray-700 leading-relaxed whitespace-pre-line",children:f.description})})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Key Responsibilities"}),e.jsx("ul",{className:"space-y-3",children:(S=f.responsibilities)==null?void 0:S.map((N,L)=>e.jsxs("li",{className:"flex items-start",children:[e.jsx(Ct,{className:"h-5 w-5 text-green-500 mr-3 mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-gray-700",children:N})]},L))})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Requirements"}),Array.isArray(f.requirements)?e.jsx("ul",{className:"space-y-3",children:f.requirements.map((N,L)=>e.jsxs("li",{className:"flex items-start",children:[e.jsx(Ct,{className:"h-5 w-5 text-blue-500 mr-3 mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-gray-700",children:N})]},L))}):e.jsx("p",{className:"text-gray-700 whitespace-pre-line",children:f.requirements})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Required Skills"}),Array.isArray(f.skills)?e.jsx("div",{className:"flex flex-wrap gap-2",children:f.skills.map((N,L)=>e.jsx($M,{name:N,color:"#2563EB",size:"sm",onClick:s?()=>s(N):void 0},`${N}-${L}`))}):e.jsx("p",{className:"text-gray-700 whitespace-pre-line",children:f.skills})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Benefits & Perks"}),Array.isArray(f.benefits)?e.jsx("ul",{className:"space-y-3",children:f.benefits.map((N,L)=>e.jsxs("li",{className:"flex items-start",children:[e.jsx(Ct,{className:"h-5 w-5 text-green-500 mr-3 mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-gray-700",children:N})]},L))}):e.jsx("p",{className:"text-gray-700 whitespace-pre-line",children:f.benefits})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsxs("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:["About ",f.company]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-gray-700 text-sm leading-relaxed",children:f.companyDescription}),e.jsxs("div",{className:"space-y-2 text-sm",children:[f.companySize&&e.jsxs("div",{className:"flex items-center",children:[e.jsx(ze,{className:"h-4 w-4 text-gray-400 mr-2"}),e.jsx("span",{className:"text-gray-600",children:f.companySize})]}),f.companyWebsite&&e.jsxs("div",{className:"flex items-center",children:[e.jsx(Lt,{className:"h-4 w-4 text-gray-400 mr-2"}),e.jsx("a",{href:f.companyWebsite,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800",children:"Visit Website"})]})]}),e.jsxs("div",{className:"pt-4 border-t border-gray-200",children:[e.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"Contact Information"}),e.jsxs("div",{className:"space-y-2 text-sm",children:[f.contactEmail&&e.jsxs("div",{className:"flex items-center",children:[e.jsx(Yt,{className:"h-4 w-4 text-gray-400 mr-2"}),e.jsx("a",{href:`mailto:${f.contactEmail}`,className:"text-blue-600 hover:text-blue-800",children:f.contactEmail})]}),f.contactPhone&&e.jsxs("div",{className:"flex items-center",children:[e.jsx(js,{className:"h-4 w-4 text-gray-400 mr-2"}),e.jsx("a",{href:`tel:${f.contactPhone}`,className:"text-blue-600 hover:text-blue-800",children:f.contactPhone})]})]})]})]})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Ready to Apply?"}),e.jsxs("p",{className:"text-gray-600 text-sm mb-4",children:["Join ",f.company," and take your career to the next level in the exciting world of iGaming."]}),e.jsx("button",{onClick:w,disabled:y,className:`w-full flex items-center justify-center px-6 py-3 rounded-lg font-medium transition-colors ${y?"bg-green-100 text-green-800 cursor-not-allowed":"bg-blue-600 text-white hover:bg-blue-700"}`,children:y?e.jsxs(e.Fragment,{children:[e.jsx(Ct,{className:"h-5 w-5 mr-2"}),"Application Submitted"]}):e.jsxs(e.Fragment,{children:[e.jsx(bt,{className:"h-5 w-5 mr-2"}),"Apply for this Position"]})}),!y&&e.jsxs("div",{className:"mt-4 flex items-center space-x-2",children:[e.jsxs("button",{onClick:k,className:`flex-1 flex items-center justify-center px-4 py-2 rounded-lg border transition-colors ${v(f.id)?"bg-blue-50 border-blue-200 text-blue-700":"bg-white border-gray-300 text-gray-700 hover:bg-gray-50"}`,children:[e.jsx(St,{className:`h-4 w-4 mr-2 ${v(f.id)?"fill-current":""}`}),v(f.id)?"Saved":"Save"]}),e.jsx("button",{className:"flex items-center justify-center p-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors",children:e.jsx(Qi,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Similar Jobs"}),e.jsx("div",{className:"space-y-4",children:i.map(N=>e.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 hover:bg-gray-50 cursor-pointer transition-colors",onClick:()=>VN(`/jobs/${N.id}`),children:[e.jsx("h4",{className:"font-medium text-gray-900 mb-1",children:N.title}),e.jsx("p",{className:"text-sm text-gray-600 mb-2",children:N.company}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(Te,{className:"h-3 w-3 mr-1"}),e.jsx("span",{children:N.location})]}),e.jsxs("span",{children:[T(N.postedDate),"d ago"]})]}),N.salary&&e.jsx("p",{className:"text-sm font-medium text-blue-600 mt-2",children:N.salary})]},N.id))}),e.jsx("button",{onClick:()=>VN("/jobs"),className:"w-full mt-4 text-center text-blue-600 hover:text-blue-800 text-sm font-medium",children:"View All Jobs"})]})]})]})}),p&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:e.jsxs("div",{className:"bg-white rounded-lg max-w-md w-full p-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Apply for this Position"}),e.jsx("p",{className:"text-gray-600 mb-4",children:"To apply for this position, please send your CV and cover letter to:"}),e.jsx("div",{className:"bg-gray-50 p-4 rounded-lg mb-4",children:e.jsx("p",{className:"font-medium",children:f.contactEmail})}),e.jsxs("div",{className:"flex space-x-3",children:[e.jsx("button",{onClick:()=>g(!1),className:"flex-1 px-4 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors",children:"Close"}),e.jsx("button",{onClick:()=>{window.location.href=`mailto:${f.contactEmail}?subject=Application for ${f.title}&body=Dear Hiring Manager,%0D%0A%0D%0AI am interested in applying for the ${f.title} position at ${f.company}.%0D%0A%0D%0APlease find my CV attached.%0D%0A%0D%0ABest regards`,g(!1)},className:"flex-1 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:"Send Email"})]})]})})]})},DT=()=>e.jsx("div",{children:e.jsx("h2",{children:"Welcome to the Header!"})}),zT=({article:t,isBookmarked:a,onToggleBookmark:s,onShare:r,onOpenArticle:i,layout:o="card",userAccess:l,positionInList:c})=>{const[h,d]=m.useState(!1),p=v=>{const f=new Date(v),w=Math.floor((new Date().getTime()-f.getTime())/(1e3*60*60));return w<1?"Just now":w<24?`${w}h ago`:w<48?"Yesterday":f.toLocaleDateString("en-US",{month:"short",day:"numeric"})},g=v=>v>=1e3?`${(v/1e3).toFixed(1)}k`:v.toString(),y=v=>v.length>1?v[1]:v[0],u=(v,f)=>v.length<=f?v:v.substring(0,f).trim()+"...",x=o==="grid"?"flex flex-col":"flex flex-col md:flex-row md:items-center";return e.jsxs("article",{className:`
7721
+ `,children:s.map(o=>e.jsx("option",{value:o,children:o},o))}),e.jsx("span",{className:"pointer-events-none absolute right-2.5 top-1/2 -translate-y-1/2 text-gray-400",children:e.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M2 4l4 4 4-4"})})})]}),e.jsx("span",{className:"text-xs text-gray-400 hidden lg:inline-block select-none",children:"/ page"})]}),PC=({viewMode:t,onToggleViewMode:a,selectedItemsPerPage:s,onItemsPerPageChange:r,totalCount:i,startIndex:o,endIndex:l,title:c})=>e.jsx("div",{className:"lg:block hidden bg-white rounded-lg shadow-sm border border-gray-200 p-4 mb-6",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:c}),e.jsxs("p",{className:"text-sm text-gray-600",children:["Showing ",e.jsx("span",{className:"font-semibold text-gray-900",children:o}),"–",e.jsx("span",{className:"font-semibold text-gray-900",children:l})," of"," ",e.jsx("span",{className:"font-semibold text-gray-900",children:i})," articles"]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3",children:[e.jsx(aM,{viewMode:t,onToggle:a}),e.jsx(QM,{value:s,onChange:r})]})]})}),CI=({title:t,description:a,ctaText:s,ctaLink:r,bgColor:i="bg-yellow-50",textColor:o="text-yellow-800"})=>e.jsx("div",{className:`promo-card ${i} p-4 rounded-lg shadow-sm hidden md:block`,children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:`font-bold text-lg ${o}`,children:t}),e.jsx("p",{className:`text-sm mt-1 ${o} opacity-90`,children:a})]}),e.jsx("a",{href:r,className:"bg-white text-yellow-600 hover:bg-yellow-50 px-4 py-2 rounded-md text-sm font-medium shadow-sm transition-colors",children:s})]})}),SI=({items:t,cardType:a,viewMode:s,savedJobs:r,onSaveJob:i,onViewJob:o,onApplyJob:l,firstItemRef:c=null,userAccess:h})=>{const[d,p]=m.useState([]),[g,y]=m.useState(null);m.useEffect(()=>{try{if(!Array.isArray(t)){console.error("❌ Items is not an array:",t),y("Invalid data format received"),p([]);return}const x=[...t];t.length>5&&x.splice(5,0,{id:"promo-1",title:"Promo",isPromo:!0}),p(x),y(null)}catch(x){console.error("Error processing items:",x),y(`Error processing items: ${x instanceof Error?x.message:String(x)}`),p([])}},[t]);const u=(x,v)=>{const k=v===0&&!x.isPromo?{ref:c}:{};try{if(x.isPromo)return e.jsx("div",{className:"col-span-full my-4",children:e.jsx(CI,{title:"Upgrade Your Job Search",description:"Get personalized job recommendations and stand out to employers.",ctaText:"Learn More",ctaLink:"#premium-features",bgColor:"bg-yellow-50",textColor:"text-yellow-800"})},`promo-${v}`);if(!x||typeof x!="object")return console.error("❌ Invalid item detected:",x),e.jsxs("div",{className:"error-card bg-red-50 p-4 rounded-md border border-red-200",children:[e.jsx("p",{className:"text-red-800 font-medium",children:"Invalid Job Data"}),e.jsx("p",{className:"text-red-600 text-sm",children:"The job data is in an unexpected format."})]});const w=x.id?`${x._id}-${v}`:x.slug?`${x.slug}-${v}`:`item-${v}`;switch(a){case"job":return e.jsx("div",{...k,children:e.jsx(YM,{job:x,positionInList:v,onSaveJob:j=>i(j,v),onViewJob:(j,b,T)=>o(j,v,T),onApplyJob:l?(j,b,T)=>l(j,v,T):void 0,isSaved:r.includes(x.id||x.slug||x.link),userAccess:h})},w);default:return console.warn(`⚠️ Unknown cardType: ${a}`),e.jsxs("div",{className:"error-card bg-yellow-50 p-4 rounded-md border border-yellow-200",children:[e.jsx("p",{className:"text-yellow-800 font-medium",children:"Unknown Card Type"}),e.jsx("p",{className:"text-yellow-700 text-sm",children:"The specified card type is not supported."})]})}}catch(w){return console.error("Error rendering card:",w),e.jsxs("div",{className:"error-card bg-red-50 p-4 rounded-md border border-red-200",children:[e.jsx("p",{className:"text-red-800 font-medium",children:"Error Rendering Card"}),e.jsx("p",{className:"text-red-600 text-sm",children:w instanceof Error?w.message:String(w)})]})}};return g?e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-800 rounded-lg p-6",children:[e.jsx("h3",{className:"font-semibold mb-2",children:"Error Loading Items"}),e.jsx("p",{children:g})]}):d.length===0?e.jsxs("div",{className:"no-results",children:[e.jsx("h3",{children:"No items found matching your criteria"}),e.jsx("p",{children:"Try adjusting your filters or search term"})]}):e.jsx("div",{className:s==="grid"?"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4":"flex flex-col gap-4","data-view-mode":s,children:d.map((x,v)=>u(x,v))})},sM=({currentPage:t,totalPages:a,onPageChange:s})=>{if(a<=1)return null;const r=5,i=Math.max(1,t-Math.floor(r/2)),o=Math.min(a,i+r-1),l=[];for(let c=i;c<=o;c++)l.push(c);return e.jsx("div",{className:"mt-6 flex justify-center",children:e.jsxs("nav",{className:"flex items-center space-x-2",children:[e.jsx("button",{onClick:()=>s(Math.max(1,t-1)),disabled:t===1,className:"px-3 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:e.jsx(Wa,{})}),l.map(c=>e.jsx("button",{onClick:()=>s(c),className:`px-3 py-2 text-sm font-medium rounded-md ${t===c?"bg-yellow-600 text-white":"text-gray-700 bg-white border border-gray-300 hover:bg-gray-50"}`,children:c},c)),e.jsx("button",{onClick:()=>s(Math.min(a,t+1)),disabled:t===a,className:"px-3 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:e.jsx(Za,{})})]})})},jN=t=>typeof t=="string"?t:(t==null?void 0:t.name)??"Unknown company",LI=({jobs:t,onViewJob:a})=>!t||t.length===0?null:e.jsxs("div",{className:"last-visited-jobs mt-8 bg-white rounded-lg shadow p-4",children:[e.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Recently Viewed Jobs"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:t.map((s,r)=>e.jsxs("div",{className:"p-3 border rounded-md hover:shadow-md transition-shadow cursor-pointer",onClick:()=>a(s,r,"same_tab","last_visited"),children:[e.jsxs("div",{className:"flex items-center mb-2",children:[e.jsx("img",{src:s.logo||"/placeholder.svg?height=30&width=30",alt:`${jN(s.company)} logo`,className:"w-6 h-6 mr-2"}),e.jsx("h3",{className:"font-medium text-sm truncate",children:s.title})]}),e.jsx("p",{className:"text-xs text-gray-600 truncate",children:jN(s.company)}),e.jsx("p",{className:"text-xs text-gray-500 truncate",children:s.location})]},s._id||s.slug||s.link))})]}),II=(t,a,s="date")=>{if(a==="all")return t;const r=new Date,i=new Date(r.getFullYear(),r.getMonth(),r.getDate());return t.filter(o=>{const l=o[s]||o.created_at||o.published_at||o.scraped_at;if(!l)return!1;const c=new Date(l);switch(a){case"today":return c>=i;case"this_week":{const h=new Date(r);return h.setDate(r.getDate()-r.getDay()),h.setHours(0,0,0,0),c>=h}case"this_month":{const h=new Date(r.getFullYear(),r.getMonth(),1);return c>=h}case"last_30_days":{const h=new Date(r);return h.setDate(r.getDate()-30),c>=h}case"last_90_days":{const h=new Date(r);return h.setDate(r.getDate()-90),c>=h}default:return!0}})},AI=(t,a)=>t.filter(s=>{var r,i,o,l,c;if(a.jobTypes.length>0){const h=((r=s.department)==null?void 0:r.toLowerCase())||"";if(!a.jobTypes.some(d=>h.includes(d)))return!1}if(a.experienceLevels.length>0){const h=((i=s.title)==null?void 0:i.toLowerCase())||"";if(!a.experienceLevels.some(d=>!!(d==="senior"&&h.includes("senior")||d==="mid"&&(h.includes("mid")||h.includes("mid-level"))||d==="entry"&&(h.includes("junior")||h.includes("entry")))))return!1}return!(a.country&&!(((o=s.location)==null?void 0:o.toLowerCase())||((l=s.city)==null?void 0:l.toLowerCase())||"").includes(a.country.toLowerCase())||a.city&&!(((c=s.company_type)==null?void 0:c.toLowerCase())||"").includes(a.city.toLowerCase()))}),pl=(t,a)=>{const s={};for(const r of t)for(const i of a){s[i]||(s[i]=new Set);const o=r[i];Array.isArray(o)?o.forEach(l=>{typeof l=="string"&&l.trim()&&s[i].add(l.trim())}):typeof o=="string"&&o.trim()&&s[i].add(o.trim())}return Object.fromEntries(Object.entries(s).map(([r,i])=>[r,Array.from(i)]))},TC=t=>{const a=new URLSearchParams(window.location.search);t==="all"?a.delete("date_filter"):a.set("date_filter",t);const s=`${window.location.pathname}?${a.toString()}`;window.history.replaceState({},"",s)},Yi=(t,a,s,r,i="date")=>{let o=t.filter(l=>Object.entries(a).every(([c,h])=>{const d=l[c];return typeof d=="string"?d.toLowerCase()===h.toLowerCase():Array.isArray(d)?d.some(p=>typeof p=="string"&&p.toLowerCase()===h.toLowerCase()):!1}));return s.length>0&&(o=o.filter(l=>s.every(c=>{var h,d;return((h=l.title)==null?void 0:h.toLowerCase().includes(c.toLowerCase()))||((d=l.overview)==null?void 0:d.toLowerCase().includes(c.toLowerCase()))}))),o=II(o,r,i),o},Al=(t,a,s=[],r="date")=>{const i=h=>{const d=h[r]||h.created_at||h.published_at||h.scraped_at;return d?new Date(d).getTime():0},o=h=>{var p;const d=h.views??h.viewCount??((p=h.metrics)==null?void 0:p.views)??0;return typeof d=="number"?d:0},l=h=>{if(s.length===0)return 0;const d=(h.title??"").toLowerCase(),p=(h.overview??"").toLowerCase();return s.reduce((g,y)=>{const u=y.toLowerCase();let x=g;return d.includes(u)&&(x+=3),p.includes(u)&&(x+=1),x},0)},c=[...t];return c.sort((h,d)=>{switch(a){case"date_asc":return i(h)-i(d);case"views_desc":return o(d)-o(h);case"views_asc":return o(h)-o(d);case"relevance":{const p=l(d)-l(h);return p!==0?p:i(d)-i(h)}case"title_asc":{const p=(h.title??"").localeCompare(d.title??"",void 0,{sensitivity:"base"});return p!==0?p:i(d)-i(h)}case"date_desc":default:return i(d)-i(h)}}),c},RC=({dateFieldLabel:t,activeDateFilter:a,onDateFilterChange:s,filterKeys:r,searchableFilters:i,filtersData:o,activeFilters:l,handleFilterChange:c,toggleSavedJobsFilter:h,showOnlySaved:d,savedJobs:p})=>e.jsx("div",{className:"hidden lg:block lg:w-1/4 space-y-6",children:e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-5",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Filters"}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-2",children:t}),e.jsx(SC,{activeDateFilter:a,onDateFilterChange:s,dateFieldLabel:""})]}),r.map(g=>{var y;return e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-2",children:g.replace(/_/g," ").replace(/^\w/,u=>u.toUpperCase())}),i.includes(g)?e.jsx(eM,{options:o[g]||[],value:l[g]||"",onChange:u=>c(g,u),placeholder:`Select ${g.replace(/_/g," ")}`,className:"w-full"}):e.jsxs("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-yellow--500 focus:border-yellow--500 bg-white",value:l[g]||"",onChange:u=>c(g,u.target.value),children:[e.jsxs("option",{value:"",children:["Select ",g.replace(/_/g," ")]}),(y=o[g])==null?void 0:y.map(u=>e.jsx("option",{value:u,children:u},u))]})]},g)}),e.jsx("div",{className:"mt-6",children:e.jsxs("button",{onClick:h,className:`w-full px-4 py-2 rounded-lg flex items-center justify-center ${d?"bg-yellow-100 text-indigo-800":"bg-gray-100 text-gray-800 hover:bg-gray-200"}`,children:[e.jsx(St,{size:16,className:"mr-2"}),e.jsxs("span",{children:["Saved Jobs (",p.length,")"]})]})})]})}),tt=Tt.Root,DC=Tt.Trigger,PI=Tt.Portal,zC=ie.forwardRef(({className:t,...a},s)=>e.jsx(Tt.Overlay,{ref:s,className:ne("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...a}));zC.displayName=Tt.Overlay.displayName;const Xe=ie.forwardRef(({className:t,children:a,...s},r)=>e.jsxs(PI,{children:[e.jsx(zC,{}),e.jsxs(Tt.Content,{ref:r,className:ne("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...s,children:[a,e.jsxs(Tt.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(jl.Cross2Icon,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Xe.displayName=Tt.Content.displayName;const Be=({className:t,...a})=>e.jsx("div",{className:ne("flex flex-col space-y-1.5 text-center sm:text-left",t),...a});Be.displayName="DialogHeader";const et=({className:t,...a})=>e.jsx("div",{className:ne("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a});et.displayName="DialogFooter";const Ie=ie.forwardRef(({className:t,...a},s)=>e.jsx(Tt.Title,{ref:s,className:ne("text-lg font-semibold leading-none tracking-tight",t),...a}));Ie.displayName=Tt.Title.displayName;const nt=ie.forwardRef(({className:t,...a},s)=>e.jsx(Tt.Description,{ref:s,className:ne("text-sm text-muted-foreground",t),...a}));nt.displayName=Tt.Description.displayName;const TI=X8("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),V=ie.forwardRef(({className:t,...a},s)=>e.jsx(b7.Root,{ref:s,className:ne(TI(),t),...a}));V.displayName=b7.Root.displayName;const RI=1,DI=1e6;let hM=0;function zI(){return hM=(hM+1)%Number.MAX_SAFE_INTEGER,hM.toString()}const mM=new Map,wN=t=>{if(mM.has(t))return;const a=setTimeout(()=>{mM.delete(t),G8({type:"REMOVE_TOAST",toastId:t})},DI);mM.set(t,a)},qI=(t,a)=>{switch(a.type){case"ADD_TOAST":return{...t,toasts:[a.toast,...t.toasts].slice(0,RI)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(s=>s.id===a.toast.id?{...s,...a.toast}:s)};case"DISMISS_TOAST":{const{toastId:s}=a;return s?wN(s):t.toasts.forEach(r=>{wN(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===s||s===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return a.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(s=>s.id!==a.toastId)}}},FI=[];let uM={toasts:[]};function G8(t){uM=qI(uM,t),FI.forEach(a=>{a(uM)})}function MN({...t}){const a=zI(),s=i=>G8({type:"UPDATE_TOAST",toast:{...i,id:a}}),r=()=>G8({type:"DISMISS_TOAST",toastId:a});return G8({type:"ADD_TOAST",toast:{...t,id:a,open:!0,onOpenChange:i=>{i||r()}}}),{id:a,dismiss:r,update:s}}const HI=new Set([200,201,202,204]);function EI(t){return t===400?"BAD_REQUEST":t===401?"UNAUTHORIZED":t===403?"FORBIDDEN":t===404?"NOT_FOUND":t===409?"CONFLICT":t===429?"RATE_LIMITED":t>=500?"SERVER":"UNKNOWN"}function BI(t){if(t.friendly)return t.friendly;switch(t.code){case"TIMEOUT":return"The request took too long. Please try again.";case"NETWORK":return"You appear to be offline or the server can’t be reached.";case"RATE_LIMITED":return"Too many requests. Please wait a moment and try again.";case"SERVER":return"The server had an issue. Please try again shortly.";case"CONFLICT":return"This email may already be subscribed.";case"BAD_REQUEST":return"Please check your input and try again.";case"UNAUTHORIZED":return"Please sign in to continue.";default:return"Something went wrong. Please try again."}}async function VI(t,a){const{timeoutMs:s=12e3,...r}=a??{},i=new AbortController,o=setTimeout(()=>i.abort(),s);try{const l=await fetch(t,{...r,signal:i.signal});if(HI.has(l.status)){if(l.status===204)return{ok:!0,data:void 0};const p=await l.text();return{ok:!0,data:p?JSON.parse(p):void 0}}let c=null;try{c=await l.json()}catch{}return{ok:!1,error:{code:EI(l.status),status:l.status,message:(c==null?void 0:c.message)||`${l.status} ${l.statusText}`,details:c}}}catch(l){const c=(l==null?void 0:l.name)==="AbortError";return{ok:!1,error:{code:c?"TIMEOUT":"NETWORK",message:c?"Request aborted by timeout":(l==null?void 0:l.message)||"Network error"}}}finally{clearTimeout(o)}}function OI({open:t,onOpenChange:a,onSubscriptionSuccess:s,searchQuery:r,filters:i,apiUrl:o="http://localhost:5147"}){const[l,c]=m.useState(""),[h,d]=m.useState(!1),[p,g]=m.useState(null),y=async u=>{if(u.preventDefault(),g(null),!l||!l.includes("@")){g("Please enter a valid email address.");return}d(!0);try{const x=await VI(`${o}/api/leads`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:l,source:"filters_modal",utmCampaign:"jobs_filters",utmMedium:"ui",utmSource:"subscription_modal"}),timeoutMs:1e4});if(!x.ok){g(BI(x.error)),MN({title:"Subscription failed",description:x.error.message});return}localStorage.setItem("leadId",x.data.id),localStorage.setItem("email",l),MN({title:"You're subscribed",description:`We'll notify you at ${l} when new jobs match your criteria.`}),s==null||s(),c("")}finally{d(!1)}};return e.jsx(tt,{open:t,onOpenChange:a,children:e.jsxs(Xe,{className:"sm:max-w-md",children:[e.jsxs(Be,{children:[e.jsxs(Ie,{className:"flex items-center gap-2",children:[e.jsx(ga,{className:"h-5 w-5 text-orange-500"}),"Create Job Alert"]}),e.jsx(nt,{children:"Subscribe to get notified when new jobs matching your search criteria are posted."})]}),e.jsxs("form",{onSubmit:y,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{htmlFor:"email",children:"Email address"}),e.jsxs("div",{className:"relative",children:[e.jsx(Yt,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),e.jsx(ee,{id:"email",type:"email",placeholder:"Enter your email address",value:l,onChange:u=>c(u.target.value),className:"pl-10",required:!0,"aria-invalid":!!p,"aria-describedby":p?"email-error":void 0})]}),p&&e.jsx("p",{id:"email-error",role:"alert",className:"text-sm text-red-600",children:p})]}),r&&e.jsxs("div",{className:"rounded-lg bg-muted p-3 text-sm",children:[e.jsx("p",{className:"font-medium",children:"Alert criteria:"}),e.jsxs("p",{className:"text-muted-foreground",children:['"',r,'"']})]}),e.jsxs(et,{className:"gap-2 sm:gap-0",children:[e.jsx(P,{type:"button",variant:"outline",onClick:()=>a(!1),disabled:h,children:"Cancel"}),e.jsx(P,{type:"submit",disabled:h,children:h?"Creating Alert...":"Create Alert"})]})]})]})})}function qC(){const t="savedJobs",[a,s]=m.useState([]);return m.useEffect(()=>{try{const o=localStorage.getItem(t);o&&s(JSON.parse(o))}catch(o){console.error("Failed to load saved jobs:",o)}},[]),{savedJobs:a,toggleJob:o=>{s(l=>{const h=l.includes(o)?l.filter(d=>d!==o):[...l,o];try{localStorage.setItem(t,JSON.stringify(h))}catch(d){console.error("Failed to persist saved jobs:",d)}return h})},isSaved:o=>o?a.includes(o):!1}}const GI=({value:t,options:a,onChange:s})=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Order by"}),e.jsxs("div",{className:"relative",children:[e.jsx("select",{"aria-label":"Order results",value:t,onChange:r=>s(r.target.value),className:"block w-full rounded-lg border border-gray-300 bg-white px-3 py-2 pr-9 text-sm text-gray-700 shadow-sm focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-100",children:a.map(r=>e.jsx("option",{value:r.value,children:r.label},r.value))}),e.jsx("span",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 text-gray-400",children:"▼"})]})]}),UI=6,pM={jobTypes:[],experienceLevels:[],country:"",city:"",location:"",minSalary:"",maxSalary:"",industry:""},_I=({apiUrl:t,itemsPerPage:a=12,filterKeys:s,banner:r,enableMobileFilter:i=!0,cardType:o,dateField:l="created_at",dateFieldLabel:c="Published",searchableFilters:h=["companies"],notification_url:d="http://localhost:5147",userAccess:p,onEmitEvent:g,eventContext:y,onPopularTagClick:u,onPopularTagRemove:x,allowPopularTagRemoval:v=!1})=>{var cN;const[f,k]=m.useState([]),[w,j]=m.useState([]),[b,T]=m.useState([]),[S,N]=m.useState(1),[L,I]=m.useState({}),[A,C]=m.useState([]),[M,R]=m.useState({}),[D,H]=m.useState(""),[G,E]=m.useState([]),[W,J]=m.useState(!1),[Y,re]=m.useState(a),[oe,$]=m.useState("grid"),[Q,de]=m.useState(!1),[ve,he]=m.useState([]),[te,O]=m.useState(!0),[X,F]=m.useState(null),[z,B]=m.useState("all"),[ce,ue]=m.useState(!1),[Ne,xt]=m.useState(!1),[ot,me]=m.useState({...pM}),[Fe,It]=m.useState({open:!1,type:"info",message:""}),[dt,_t]=m.useState("date_desc"),{savedJobs:ta,toggleJob:zs}=qC(),jt=tM(p),rt=m.useMemo(()=>({component:"Listing",...y??{}}),[y]),ls=m.useMemo(()=>[{value:"relevance",label:"Best match (relevance)"},{value:"date_desc",label:`${c} (newest)`},{value:"date_asc",label:`${c} (oldest)`},{value:"views_desc",label:"Most viewed"},{value:"views_asc",label:"Least viewed"},{value:"title_asc",label:"Title A → Z"}],[c]),it=m.useCallback((K,pe)=>{g&&g({domain:"jobs",name:K,payload:pe,timestamp:new Date().toISOString(),context:rt})},[rt,g]),wa=m.useCallback((K,pe)=>{g&&g({domain:"newsletter",name:K,payload:pe,timestamp:new Date().toISOString(),context:rt})},[rt,g]),pa=m.useCallback(async K=>{wa("newsletter_subscribe_requested",K)},[wa]),aa=m.useCallback(()=>({filters:{...L},advancedFilters:ot,dateFilter:z}),[L,z,ot]),qa=m.useCallback(()=>({page:S,pageSize:Y,totalResults:w.length,viewMode:oe,showOnlySaved:Q}),[S,w.length,Y,Q,oe]),sa=m.useRef(!1),Ma=(K,pe)=>{It({open:!0,type:K,message:pe})};m.useEffect(()=>{try{const K=localStorage.getItem("lastVisitedJobs");K&&he(JSON.parse(K));try{localStorage.getItem("email")&&xt(!0)}catch(pe){console.error("Error checking subscription state:",pe)}}catch(K){console.error("Error loading data from localStorage:",K)}},[]),m.useEffect(()=>{const pe=new URLSearchParams(window.location.search).get("date_filter");pe&&pe!=="all"&&B(pe)},[]),m.useEffect(()=>{if(!t){F("❌ Missing API URL for Listing component!"),O(!1);return}O(!0),F(null),(async()=>{try{const pe=await fetch(t);if(!pe.ok)throw new Error(`API responded with status: ${pe.status}`);const we=await pe.json();if(!Array.isArray(we))throw new Error("Expected an array but received: "+typeof we);const qe=we.map((Ht,Na)=>({...Ht,sponsored:Na%7===0,topTag:AC(Ht.title||"")})),mt=Array.from(new Set(qe.map(Ht=>Ht.topTag).filter(Ht=>typeof Ht=="string"))).slice(0,10);T(mt);const ra=Al(qe,dt,A,l);k(qe),j(ra);const Fa=pl(qe,s);R(Fa)}catch(pe){console.error("Error fetching data:",pe),F(`Failed to load data: ${pe instanceof Error?pe.message:String(pe)}`);const we=jI(20),qe=Al(we,dt,A,l);k(we),j(qe);const mt=pl(we,s);R(mt)}finally{O(!1)}})()},[t,l,A,dt]),m.useEffect(()=>{const K=new URLSearchParams(window.location.search),pe={};s.forEach(mt=>{const ra=K.get(mt);ra&&(pe[mt]=ra)}),I(pe);const we=K.get("q")||K.get("searchTerm")||"";we&&H(we);const qe={};s.forEach(mt=>{const ra=K.get(mt);ra&&(qe[mt]=ra)}),I(qe)},[]),m.useEffect(()=>{if(Q){const K=f.filter(we=>ta.includes(we.id||we.slug||we.link)),pe=Al(K,dt,A,l);j(pe),N(1)}else Wt()},[]),m.useEffect(()=>{sa.current||te||!w.length&&!f.length||(it("jobs_listing_viewed",{...aa(),...qa()}),sa.current=!0)},[f.length,it,w.length,aa,qa,te]);const $t=m.useCallback(K=>{const pe=pl(K,s);R(pe)},[s]),Wt=m.useCallback(K=>{const pe=(K==null?void 0:K.baseItems)??f,we=(K==null?void 0:K.filters)??L,qe=(K==null?void 0:K.search)??A,mt=(K==null?void 0:K.dateFilter)??z,ra=(K==null?void 0:K.advanced)??ot;let Fa=Yi(pe,we,qe,mt,l);Fa=AI(Fa,ra);const Ht=Al(Fa,dt,qe,l);return j(Ht),((K==null?void 0:K.resetPage)??!0)&&N(1),((K==null?void 0:K.refreshFiltersData)??!0)&&$t(Ht),Ht},[z,L,ot,f,l,A,dt,$t]);m.useEffect(()=>{Wt({resetPage:!1,refreshFiltersData:!1})},[dt,Wt]);const fe=(K,pe)=>{const we={...L};pe?we[K]=pe:delete we[K],Q&&de(!1),I(we),Wt({filters:we});const qe={...aa(),filters:we};pe?it("jobs_filter_selected",{key:K,value:pe,...qe}):it("jobs_filter_cleared",{key:K,...qe})},Ae=()=>{xt(!0),be().then(()=>ue(!1))},Re=m.useRef(null),He=K=>{N(K),it("jobs_listing_page_changed",{page:K,pageSize:Y,totalResults:w.length}),setTimeout(()=>{var pe;(pe=Re.current)==null||pe.scrollIntoView({behavior:"smooth",block:"start"})},100)},Le=K=>{Q&&de(!1),B(K),Wt({dateFilter:K}),TC(K),it("jobs_date_filter_changed",{dateFilter:K})},Qe=K=>{if(H(K),K){const pe=f.map(we=>we.title).filter((we,qe,mt)=>we&&we.toLowerCase().includes(K.toLowerCase())&&mt.indexOf(we)===qe).slice(0,5);E(pe)}else E([])},lt=K=>{if(!K.trim())return;Q&&de(!1);const pe=[...A,K.trim()];C(pe),Wt({search:pe}),H(""),it("jobs_search_submitted",{searchKeywords:pe,query:K.trim(),...aa()})},ye=K=>{const pe=A.filter(we=>we!==K);C(pe),Wt({search:pe}),it("jobs_search_filter_removed",{removedKeyword:K,remainingKeywords:pe})},Z=()=>{I({}),C([]),de(!1),B("all"),me({...pM}),Wt({filters:{},search:[],dateFilter:"all",advanced:pM}),it("jobs_filters_cleared_all",{})},le=K=>{const pe=new Set,we=[];for(const qe of K){const mt=`${qe.key??""}|${qe.value.toLowerCase()}`;pe.has(mt)||(pe.add(mt),we.push(qe))}return we},ge=K=>K.replace(/\/+$/,""),be=async()=>{if(it("jobs_alert_cta_clicked",{searchKeywords:A,query:D.trim()||void 0,...aa()}),!Ne)ue(!0),it("jobs_subscription_modal_opened",{});else{const K=localStorage.getItem("email"),pe=localStorage.getItem("leadId");if(!K||!pe){Ma("info","Please subscribe first to create alerts.");return}const we="keyword",qe=(ia,Ha)=>Ha&&Ha.trim()?{key:ia.toLowerCase(),value:Ha.trim()}:null,mt=Object.entries(L).map(([ia,Ha])=>qe(ia,Ha)).filter(ia=>ia!==null),ra=A.map(ia=>qe(we,ia)).filter(ia=>ia!==null),Fa=qe(we,D),Ht=Fa?[Fa]:[],Na=le([...mt,...ra,...Ht]);if(Na.length===0){Ma("info","No filters/keywords to save.");return}try{const ia=ge(d??"http://localhost:5147"),Ha=await fetch(`${ia}/api/leads/${pe}/preferences/bulk`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Na)});if(!Ha.ok){let Sl="";try{Sl=await Ha.text()}catch{}throw new Error(`${Ha.status} ${Ha.statusText} ${Sl}`.trim())}Ma("success","Alert saved. We’ll notify you about new matching jobs."),H(""),it("jobs_alert_created",{preferences:Na.filter(Sl=>Sl!==null)})}catch(ia){console.error("Create alert failed:",ia),Ma("error","Failed to save alert.")}}},De=()=>{J(!W)},Rt=w.length===0?0:(S-1)*Y+1,We=Math.min(S*Y,w.length),ht=K=>{re(K),N(1),it("jobs_listing_items_per_page_changed",{pageSize:K})},Fo=()=>{$(K=>{const pe=K==="grid"?"list":"grid";return it("jobs_listing_viewmode_changed",{viewMode:pe}),pe})},wt=(K,pe,we="same_tab",qe="listing")=>{const mt=K.id||K.slug||K.link;mt&&(he(ra=>{const Fa=ra.filter(Na=>(Na.id||Na.slug||Na.link)!==mt),Ht=[K,...Fa].slice(0,UI);try{localStorage.setItem("lastVisitedJobs",JSON.stringify(Ht))}catch(Na){console.error("Error saving to localStorage:",Na)}return Ht}),it("job_opened",{jobId:mt,slug:K.slug,positionInList:pe,openedFrom:qe,openedIn:we}))},na=(K,pe)=>{const we=K.id||K.slug||K.link;if(!we)return;const qe=ta.includes(we);zs(we),it(qe?"job_unsaved":"job_saved",{jobId:we,slug:K.slug,positionInList:pe})},rM=(K,pe,we="external")=>{const qe=K.id||K.slug||K.link;qe&&it("job_apply_clicked",{jobId:qe,slug:K.slug,positionInList:pe,applyType:we})},lN=()=>{de(!Q)},K9=Math.ceil(w.length/Y),X9=w.slice((S-1)*Y,S*Y);return X&&!f.length?e.jsx("div",{className:"flex-grow p-8",children:e.jsx("div",{className:"max-w-7xl mx-auto",children:e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-800 rounded-lg p-6",children:[e.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Error Loading Jobs"}),e.jsx("p",{className:"mb-4",children:X}),e.jsx("button",{onClick:()=>window.location.reload(),className:"bg-red-100 hover:bg-red-200 text-red-800 font-medium py-2 px-4 rounded",children:"Retry"})]})})}):e.jsxs("div",{className:"flex flex-col min-h-screen pb-16 md:pb-0",children:[e.jsxs("div",{className:"flex-grow",children:[e.jsx(KM,{onSearchChange:Qe,searchPlaceholder:"Search jobs, companies, or keywords...",title:"Job Listings",description:"",popularTags:b,generateHref:K=>`/jobs?q=${K.toLowerCase().replace(/\s+/g,"+")}`,onTagClick:u,onTagRemove:x,allowTagRemoval:v}),e.jsxs("div",{className:"container mx-auto py-8 pb-20 md:pb-8",children:[e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"relative flex items-center gap-2 sm:my-6 my-2",children:[e.jsx(IC,{data:f.map(K=>K.title).filter(Boolean),onSelect:K=>{lt(K)},onTyping:K=>{H(K),Qe(K)},placeholder:"Search for jobs, companies, or keywords...",className:"w-full",showSubmitButton:!0}),e.jsx("button",{className:"block md:hidden flex items-center justify-center p-3 bg-white border-2 border-gray-200 text-gray-700 rounded-xl hover:border-gray-300 hover:bg-gray-50 transition-all duration-200 focus:ring-4 focus:ring-gray-200 focus:outline-none hover:scale-105",onClick:De,children:e.jsx(ws,{size:16,className:"mr-1.5"})})]}),e.jsx("div",{className:"relative flex items-center gap-2 sm:my-6 my-2",children:e.jsx(XM,{filters:[...z!=="all"?[{key:"date",label:c,value:z.replace(/_/g," "),onRemove:()=>Le("all")}]:[],...A.map(K=>({key:"search",label:"",value:K,onRemove:()=>ye(K)})),...Object.entries(L).map(([K,pe])=>({key:K,label:K.replace(/_/g," "),value:pe,onRemove:()=>fe(K,"")}))],onClearAll:Z,handleCreateAlert:be})})]}),i&&e.jsxs("button",{className:"md:hidden w-full mb-6 px-4 py-3 bg-yellow-600 text-white rounded-lg flex items-center justify-center",onClick:De,"aria-expanded":W,children:[e.jsx(ws,{className:"w-4 h-4 mr-2"}),W?"Close Filters":"Filters"]}),e.jsxs("div",{className:"flex flex-col lg:flex-row lg:gap-6",children:[e.jsx(RC,{dateFieldLabel:"Date",activeDateFilter:z,onDateFilterChange:Le,filterKeys:s,searchableFilters:h,filtersData:M,activeFilters:L,handleFilterChange:fe,toggleSavedJobsFilter:lN,showOnlySaved:Q,savedJobs:ta}),te?e.jsx(ua,{}):e.jsxs("div",{className:"lg:gap-6 w-fit",children:[e.jsx(PC,{viewMode:oe,onToggleViewMode:Fo,selectedItemsPerPage:Y,onItemsPerPageChange:ht,totalCount:w.length,startIndex:Rt,endIndex:We,title:"Latest Jobs"}),e.jsxs("div",{className:"",children:[e.jsx("div",{className:"mb-6",children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("h3",{className:"text-xl font-semibold text-gray-900 flex items-center",children:[Q?"Saved Jobs":"Open Positions",z!=="all"&&!Q&&e.jsxs("span",{className:"text-sm font-normal text-gray-500 ml-2",children:["(",z.replace(/_/g," "),")"]})]}),e.jsxs("p",{className:"text-sm text-gray-600",children:[e.jsx("span",{className:"font-semibold text-gray-900",children:w.length})," found"]})]}),e.jsx(GI,{value:dt,options:ls,onChange:_t})]})}),e.jsx(SI,{items:X9,cardType:o,viewMode:oe,savedJobs:ta,onSaveJob:na,onViewJob:wt,onApplyJob:rM,firstItemRef:Re,userAccess:jt}),w.length>0&&e.jsx("div",{className:"mt-6",children:e.jsx(sM,{currentPage:S,totalPages:K9,onPageChange:He})})]}),ve.length>0&&e.jsx("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-5",children:e.jsx(LI,{jobs:ve,onViewJob:wt})})]}),e.jsx("div",{className:"hidden lg:block lg:w-1/4 space-y-6",children:((cN=r==null?void 0:r.sidebar)==null?void 0:cN.enabled)&&e.jsxs("div",{className:"sticky top-4",children:[e.jsx(Do,{position:"sidebar",url:r.sidebar.url,link:r.sidebar.link,alt:r.sidebar.alt}),e.jsx(Q8,{onSubscribe:pa}),e.jsxs("div",{className:"mt-6 bg-white rounded-lg shadow-sm border border-gray-200 p-5",children:[e.jsx("h3",{className:"font-semibold text-lg mb-3",children:"Featured Employers"}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:[...Array(6)].map((K,pe)=>e.jsx("div",{className:"flex items-center justify-center p-2 bg-gray-50 rounded-md",children:e.jsx("img",{src:`/placeholder.svg?height=40&width=40&text=${String.fromCharCode(65+pe)}`,alt:`Featured employer ${pe+1}`,className:"w-10 h-10 object-contain"})},pe))})]})]})})]})]})]}),e.jsx(LC,{activeDateFilter:z,handleDateFilterChange:Le,filterKeys:s,searchableFilters:h,dateFieldLabel:c,activeFilters:L,handleFilterChange:fe,toggleSavedJobsFilter:lN,filtersData:M,savedJobs:ta,showOnlySaved:Q,isMobileFilterOpen:W,toggleMobileFilter:De}),e.jsx(oo,{}),e.jsx(NC,{open:Fe.open,type:Fe.type,message:Fe.message,onClose:()=>It(K=>({...K,open:!1}))}),e.jsx(OI,{open:ce,onOpenChange:ue,onSubscriptionSuccess:Ae,apiUrl:d})]})},FC=ie.forwardRef(({className:t,...a},s)=>e.jsxs(_o.Root,{ref:s,className:ne("relative flex w-full touch-none select-none items-center",t),...a,children:[e.jsx(_o.Track,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:e.jsx(_o.Range,{className:"absolute h-full bg-primary"})}),e.jsx(_o.Thumb,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));FC.displayName=_o.Root.displayName;const HC=({title:t="Filters",sections:a,onFilterChange:s,onClearAll:r,activeFiltersCount:i,maxVisible:o=5,rangeConfig:l,savedCount:c=0,showSavedOnly:h=!1,onToggleSavedOnly:d,savedLabel:p="Saved Items",className:g=""})=>e.jsxs("div",{className:`bg-card rounded-lg shadow-sm border border-border sticky top-24 max-h-[calc(100vh-7rem)] overflow-y-auto scrollbar-thin ${g}`,children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Xa,{className:"w-5 h-5 text-accent"}),e.jsx("h2",{className:"font-semibold text-foreground",children:t}),i>0&&e.jsx("span",{className:"bg-accent text-accent-foreground text-xs font-bold px-2 py-0.5 rounded-full",children:i})]}),i>0&&e.jsx("button",{onClick:r,className:"text-sm text-accent hover:underline",children:"Clear all"})]}),e.jsxs("div",{className:"p-4 space-y-4",children:[a.map(y=>e.jsx($I,{section:y,onFilterChange:s,maxVisible:o,rangeConfig:l},y.key)),d&&e.jsx("div",{className:"pt-4 border-t border-border",children:e.jsxs("button",{onClick:d,className:`w-full px-4 py-2.5 rounded-lg flex items-center justify-center gap-2 transition-colors ${h?"bg-accent text-accent-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,children:[e.jsx(St,{className:"w-4 h-4"}),e.jsxs("span",{className:"font-medium",children:[p," (",c,")"]})]})})]})]}),$I=({section:t,onFilterChange:a,maxVisible:s,rangeConfig:r})=>{var b,T,S;const[i,o]=m.useState(t.defaultExpanded??!0),[l,c]=m.useState(""),[h,d]=m.useState(!1),p=t.maxVisible??s,g=m.useMemo(()=>{var A;const N=((A=t.options)==null?void 0:A.filter(C=>C.label.toLowerCase().includes(l.toLowerCase())))||[],L=N.filter(C=>t.selectedValues.includes(C.value)),I=N.filter(C=>!t.selectedValues.includes(C.value));return[...L,...I]},[t.options,l,t.selectedValues]),y=m.useMemo(()=>h||p>=g.length?g:g.slice(0,p),[g,h,p]),u=g.length>p,x=t.searchable!==!1&&(((b=t.options)==null?void 0:b.length)||0)>6,v=N=>{const L=t.selectedValues.includes(N)?t.selectedValues.filter(I=>I!==N):[...t.selectedValues,N];a(t.key,L)},f=N=>{a(t.key,N?[N]:[])},k=t.rangeConfig??r,w=t.selectedValues.length===2?t.selectedValues.map(Number):k?[k.min,k.max]:[0,100],j=N=>{if(k!=null&&k.formatLabel)return k.formatLabel(N);const L=(k==null?void 0:k.unit)||"";return((k==null?void 0:k.unitPosition)||"prefix")==="prefix"?`${L}${N.toLocaleString()}`:`${N.toLocaleString()}${L}`};return e.jsxs("div",{className:"border-b border-border pb-4 last:border-b-0 last:pb-0",children:[t.collapsible!==!1?e.jsxs("button",{onClick:()=>o(!i),className:"flex items-center justify-between w-full py-2 text-left",children:[e.jsx("h3",{className:"text-sm font-medium text-foreground",children:t.label}),i?e.jsx(bs,{className:"w-4 h-4 text-muted-foreground"}):e.jsx(Pt,{className:"w-4 h-4 text-muted-foreground"})]}):e.jsx("h3",{className:"text-sm font-medium text-foreground py-2",children:t.label}),i&&e.jsxs("div",{className:"mt-2 space-y-2",children:[x&&t.type==="checkbox"&&e.jsxs("div",{className:"relative mb-3",children:[e.jsx(ft,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx("input",{type:"text",value:l,onChange:N=>c(N.target.value),placeholder:`Search ${t.label.toLowerCase()}...`,className:"w-full h-8 pl-8 pr-8 text-sm rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),l&&e.jsx("button",{onClick:()=>c(""),className:"absolute right-2 top-1/2 -translate-y-1/2",children:e.jsx(Oe,{className:"w-4 h-4 text-muted-foreground hover:text-foreground"})})]}),t.type==="checkbox"&&e.jsxs("div",{className:"space-y-2",children:[y.map(N=>e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer group",children:[e.jsx("input",{type:"checkbox",checked:t.selectedValues.includes(N.value),onChange:()=>v(N.value),className:"h-4 w-4 rounded border-input text-accent focus:ring-accent"}),e.jsx("span",{className:"text-sm text-foreground group-hover:text-accent transition-colors flex-1 truncate",children:N.label}),N.count!==void 0&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",N.count,")"]})]},N.value)),g.length===0&&l&&e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No matching options"}),u&&!l&&e.jsx("button",{onClick:()=>d(N=>!N),className:"text-sm text-accent hover:underline font-medium mt-1",children:h?"View less":`View more (${g.length-p})`})]}),(t.type==="select"||t.type==="searchable-select")&&e.jsxs("select",{value:t.selectedValues[0]||"",onChange:N=>f(N.target.value),className:"w-full h-9 px-3 rounded-md border border-input bg-background text-sm focus:outline-none focus:ring-2 focus:ring-ring",children:[e.jsxs("option",{value:"",children:["All ",t.label]}),(T=t.options)==null?void 0:T.map(N=>e.jsxs("option",{value:N.value,children:[N.label,N.count!==void 0&&` (${N.count})`]},N.value))]}),t.type==="range"&&k&&e.jsxs("div",{className:"space-y-3 px-1",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[e.jsx("span",{children:j(w[0])}),e.jsx("span",{children:j(w[1])})]}),e.jsx(FC,{min:k.min,max:k.max,step:k.step??1,value:w,onValueChange:N=>{a(t.key,N.map(String))},className:"w-full"}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[e.jsx("span",{children:j(k.min)}),e.jsx("span",{children:j(k.max)})]})]}),t.type==="toggle"&&((S=t.options)==null?void 0:S.map(N=>e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:t.selectedValues.includes(N.value),onChange:()=>v(N.value),className:"h-4 w-4 rounded border-input text-accent focus:ring-accent"}),e.jsx("span",{className:"text-sm text-foreground",children:N.label})]},N.value)))]})]})},WI=({isOpen:t,onClose:a,title:s="Filters",children:r})=>t?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 bg-gray-600 bg-opacity-75 z-40",onClick:a}),e.jsxs("div",{className:"fixed inset-y-0 right-0 max-w-xs w-full bg-white shadow-xl z-50 overflow-y-auto",children:[e.jsxs("div",{className:"px-4 py-2 border-b border-gray-200 flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:s}),e.jsx("button",{onClick:a,className:"p-2 rounded-full hover:bg-gray-100","aria-label":"Close filters",children:e.jsx("svg",{className:"h-6 w-6 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsx("div",{className:"p-4",children:r})]})]}):null,EC=({sort:t,viewMode:a,onViewModeChange:s,itemsPerPage:r,onItemsPerPageChange:i,itemsPerPageOptions:o,showItemsPerPage:l=!0,trailingSlot:c,className:h="",summaryTitle:d,startIndex:p,endIndex:g,totalCount:y,itemLabel:u="items"})=>{var k;const[x,v]=m.useState(!1);m.useEffect(()=>{var b;if(typeof window>"u"||typeof window.matchMedia!="function")return;const w=window.matchMedia("(max-width: 767px)"),j=()=>v(w.matches);return j(),(b=w.addEventListener)==null||b.call(w,"change",j),()=>{var T;return(T=w.removeEventListener)==null?void 0:T.call(w,"change",j)}},[]);const f=d&&typeof y=="number"&&typeof p=="number"&&typeof g=="number";return e.jsx("div",{className:`rounded-lg border border-gray-200 bg-white p-4 ${h}`,children:e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row items-center lg:justify-between",children:[e.jsx("div",{className:"flex-1 min-w-0 hidden lg:inline-block",children:f&&e.jsxs("div",{className:"mb-3 hidden lg:block",children:[e.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:d}),e.jsxs("p",{className:"text-sm text-gray-600",children:["Showing ",e.jsx("span",{className:"font-semibold text-gray-900",children:p}),"–",e.jsx("span",{className:"font-semibold text-gray-900",children:g})," of"," ",e.jsx("span",{className:"font-semibold text-gray-900",children:y})," ",u]})]})}),e.jsx("div",{className:"w-full lg:w-auto",children:e.jsxs("div",{className:"flex w-full flex-nowrap items-center gap-1.5 lg:w-auto lg:justify-end",children:[f&&e.jsxs("div",{className:"min-w-0 flex-1 truncate whitespace-nowrap text-xs text-gray-600 lg:hidden",children:[e.jsx("span",{className:"font-semibold text-gray-900",children:p}),"–",e.jsx("span",{className:"font-semibold text-gray-900",children:g})," of"," ",e.jsx("span",{className:"font-semibold text-gray-900",children:y})," ",u]}),t&&((k=t.options)==null?void 0:k.length)>0&&e.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[e.jsx("span",{className:"text-xs text-gray-500 whitespace-nowrap hidden lg:inline-block cursor-pointer select-none",children:t.label??"Order"}),e.jsx("select",{value:t.value,onChange:w=>t.onChange(w.target.value),className:"h-8 w-[7.5rem] pl-3 pr-8 rounded-lg border border-gray-200 bg-gray-50 text-xs lg:w-auto lg:text-sm focus:outline-none focus:ring-2 focus:ring-yellow-500",children:t.options.map(w=>e.jsx("option",{value:w.value,children:w.label},w.value))})]}),a&&s&&!x&&e.jsx(aM,{viewMode:a,onViewModeChange:s}),l&&r!==void 0&&i&&e.jsx(QM,{value:r,onChange:i,options:o,className:"shrink-0",selectClassName:"w-[4rem] lg:w-auto"}),c]})})]})})},BC=({value:t,onChange:a,onSubmit:s,onClear:r,onFilterClick:i,placeholder:o="Search...",suggestions:l=[],onSuggestionSelect:c,showFilterButton:h=!0,filterCount:d=0,className:p=""})=>{const[g,y]=m.useState(!1),u=x=>{x.key==="Enter"&&t.trim()&&(s(t.trim()),y(!1)),x.key==="Escape"&&y(!1)};return e.jsxs("div",{className:`relative ${p}`,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(ft,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-muted-foreground"}),e.jsx("input",{type:"text",value:t,onChange:x=>{a(x.target.value),y(x.target.value.length>0)},onKeyDown:u,onFocus:()=>y(t.length>0&&l.length>0),onBlur:()=>setTimeout(()=>y(!1),200),placeholder:o,className:"w-full h-12 pl-10 pr-20 rounded-lg border border-input bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2"}),t&&r&&e.jsx("button",{onClick:r,"aria-label":"Clear search",className:"absolute right-14 top-1/2 -translate-y-1/2 p-1 hover:bg-muted rounded",children:e.jsx(Oe,{className:"h-4 w-4 text-muted-foreground"})}),e.jsx("button",{onClick:()=>t.trim()&&s(t.trim()),className:"absolute right-2 top-1/2 -translate-y-1/2 bg-accent hover:bg-accent-hover text-accent-foreground p-2 rounded-md transition-colors",children:e.jsx(ft,{className:"h-4 w-4"})})]}),h&&i&&e.jsxs("button",{onClick:i,className:"lg:hidden flex items-center justify-center h-12 w-12 rounded-lg border border-input bg-background hover:bg-muted transition-colors relative",children:[e.jsx(ws,{className:"h-5 w-5 text-muted-foreground"}),d>0&&e.jsx("span",{className:"absolute -top-1 -right-1 bg-accent text-accent-foreground text-xs font-bold w-5 h-5 rounded-full flex items-center justify-center",children:d})]})]}),g&&l.length>0&&e.jsx("ul",{className:"absolute z-20 mt-1 w-full bg-card border border-border rounded-lg shadow-lg max-h-60 overflow-y-auto",children:l.map((x,v)=>e.jsx("li",{children:e.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-foreground hover:bg-muted flex items-center gap-2",onClick:()=>{c==null||c(x),y(!1)},children:[e.jsx(ft,{className:"h-4 w-4 text-muted-foreground"}),x]})},v))})]})},xM=({config:t,className:a=""})=>{const s=t.url.match(/\.(mp4|webm|ogg)$/i),r={sidebar:"w-full max-w-[300px] h-[250px]",top:"w-full h-[48px] md:h-[90px]",bottom:"w-full h-[48px] md:h-[90px]"};return e.jsx("div",{className:`flex justify-center items-center rounded-lg overflow-hidden bg-muted ${a}`,children:e.jsx("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",className:"block",children:s?e.jsxs("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:`${r[t.position]} object-cover`,children:[e.jsx("source",{src:t.url,type:"video/mp4"}),"Your browser does not support the video tag."]}):e.jsx("img",{src:t.url,alt:t.alt??"Advertisement",className:`${r[t.position]} object-cover`})})})},ja=({title:t,description:a,headerPopularTags:s=[],sponsoredSlot:r,sidebarSlot:i,filtersPanel:o,mobileFiltersPanel:l,filters:c,filterValues:h,onFilterChange:d,onClearFilters:p,activeFilters:g,search:y,sort:u,viewMode:x,onViewModeChange:v,pagination:f,showToolbar:k=!0,toolbarTrailingSlot:w,resultsClassName:j="",banner:b,headerActions:T,children:S,maxFiltersVisible:N=5})=>{const[L,I]=m.useState(!1),[A,C]=m.useState(""),M=()=>I(!0);m.useEffect(()=>{if(typeof window>"u")return;const $=new URLSearchParams(window.location.search),Q=$.get("searchTerm")??$.get("q")??"";y&&Q&&(C(Q),y.onChange(Q),y.onSubmit&&y.onSubmit!==y.onChange&&y.onSubmit(Q)),!(!c||!d)&&c.forEach(de=>{const ve=[...$.getAll(de.key),...$.getAll(`filters[${de.key}]`)],he=Array.from(new Set(ve.flatMap(te=>te.split(",")).map(te=>te.trim()).filter(Boolean)));he.length>0&&d(de.key,he)})},[]);const R=!!(o||c&&c.length>0),D=m.useMemo(()=>c?c.map($=>({...$,selectedValues:(h==null?void 0:h[$.key])??[]})):[],[c,h]),H=m.useMemo(()=>h?Object.values(h).reduce(($,Q)=>$+Q.length,0):g?g.length:0,[h,g]),G=(f==null?void 0:f.toolbarTotalCount)??(f==null?void 0:f.totalCount)??0,E=f&&G>0?(f.page-1)*f.pageSize+1:0,W=f&&G>0?Math.min(f.page*f.pageSize,G):0,J=m.useMemo(()=>o||(c&&d&&p?e.jsx(HC,{sections:D,onFilterChange:d,onClearAll:p,activeFiltersCount:H,maxVisible:N}):null),[o,c,d,p,D,H]),Y=l??J,re=m.useMemo(()=>{const $=g?[...g]:[],Q=A.trim();return Q&&!$.some(de=>de.key==="searchTerm"&&de.value===Q)&&$.unshift({key:"searchTerm",label:"Search",value:Q,onRemove:()=>{C(""),y!=null&&y.onClear?y.onClear():y!=null&&y.onChange&&y.onChange("")}}),$},[g,y,A]),oe=()=>{p==null||p(),C(""),y!=null&&y.onClear?y.onClear():y!=null&&y.onChange&&y.onChange("")};return e.jsxs("div",{className:"bg-gray-50",children:[e.jsx(KM,{onSearchChange:()=>{},title:t,description:a,sponsoredSlot:r,popularTags:s}),T&&e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-4 flex justify-end",children:T}),e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6",children:[y&&e.jsx("div",{className:"mb-4",children:e.jsx(BC,{value:y.value,onChange:y.onChange,onSubmit:$=>{const Q=$.trim();Q&&C(Q),y.onSubmit($)},onClear:()=>{C(""),y.onClear?y.onClear():y.onChange("")},placeholder:y.placeholder,suggestions:y.suggestions,onSuggestionSelect:y.onSuggestionSelect,onFilterClick:R?M:void 0,filterCount:H,showFilterButton:R})}),k&&e.jsx(EC,{sort:u,viewMode:x,onViewModeChange:v,itemsPerPage:f==null?void 0:f.pageSize,onItemsPerPageChange:f==null?void 0:f.onPageSizeChange,itemsPerPageOptions:f==null?void 0:f.pageSizeOptions,showItemsPerPage:(f==null?void 0:f.showItemsPerPage)!==!1,trailingSlot:w,summaryTitle:(f==null?void 0:f.toolbarTitle)??t,totalCount:G,startIndex:E,endIndex:W,itemLabel:(f==null?void 0:f.toolbarItemLabel)??"items"}),re.length>0&&e.jsx("div",{className:"mt-4",children:e.jsx(XM,{filters:re,onClearAll:oe})}),e.jsxs("div",{className:"mt-6 flex flex-col gap-6 lg:flex-row",children:[J&&e.jsxs("aside",{className:"hidden lg:block lg:w-72 space-y-4",children:[J,b&&b.position==="sidebar"&&e.jsx(xM,{config:b})]}),e.jsxs("div",{className:`flex-1 ${j}`,children:[b&&b.position==="top"&&e.jsx("div",{className:"mb-4",children:e.jsx(xM,{config:b})}),S,b&&b.position==="bottom"&&e.jsx("div",{className:"mt-4",children:e.jsx(xM,{config:b})}),f&&f.enabled!==!1&&e.jsx(sM,{currentPage:f.page,totalPages:f.totalPages,onPageChange:f.onPageChange})]}),i&&e.jsx("aside",{className:"lg:w-72",children:i})]})]}),Y&&e.jsx(WI,{isOpen:L,onClose:()=>I(!1),children:Y})]})},xl=["categories","jobType","salaryRange","created","company","country","city","department","workplace","companySize"],ZI={created_at:"created",createdAt:"created",published_at:"created",publishedAt:"created",job_type:"jobType",company_size:"companySize",deparment:"department"},NN=t=>{const a=[];return t.forEach(s=>{const r=ZI[s]??s;xl.includes(r)&&!a.includes(r)&&a.push(r)}),a.length>0?a:[...xl]},JI=[{value:"full-time",label:"Full-time"},{value:"part-time",label:"Part-time"},{value:"intern",label:"Intern"},{value:"seasonal",label:"Seasonal"},{value:"contract",label:"Contract"}],YI=[{value:"today",label:"Today"},{value:"this_week",label:"This week"},{value:"last_week",label:"Last week"},{value:"this_month",label:"This month"},{value:"last_3_months",label:"Last 3 months"},{value:"this_year",label:"This year"}],KI=[{value:"remote",label:"Remote"},{value:"hybrid",label:"Hybrid"},{value:"onsite",label:"On-site"}],XI=["company","country","city"],U8=(t,a)=>{if(typeof t=="string"){const s=t.trim();if(!s)return"";const r=s.match(new RegExp(`['"]${a}['"]\\s*:\\s*['"]([^'"]+)['"]`,"i"));if(r!=null&&r[1])return r[1].trim();if(s.startsWith("{")&&s.endsWith("}")){const i=s.replace(/([{,]\s*)'([^']+)'\s*:/g,'$1"$2":').replace(/:\s*'([^']*)'/g,': "$1"');try{const o=JSON.parse(i);return U8(o,a)}catch{return s}}return s}if(Array.isArray(t))return t.map(s=>U8(s,a)).find(Boolean)??"";if(t&&typeof t=="object"){const s=t,r=[a,"name","label","value","title"];for(const i of r){const o=s[i],l=U8(o,a);if(l)return l}}return""},Ro=(t,a)=>{const s=t[a];return U8(s,a)},QI=t=>{const a=Ro(t,"workplace")||Ro(t,"workplace_type");if(a)return a.toLowerCase();const s=(t.location??"").toLowerCase();return s.includes("remote")?"remote":s.includes("hybrid")?"hybrid":"onsite"},eA=(t,{optionSort:a="alphabetical",showOptionCounts:s=!0})=>{const r=t.reduce((i,o)=>{const l=o.trim();return l&&i.set(l,(i.get(l)??0)+1),i},new Map);return Array.from(r.entries()).sort(([i,o],[l,c])=>a==="count_desc"?c-o||i.localeCompare(l):a==="count_asc"&&o-c||i.localeCompare(l)).map(([i,o])=>({value:i,label:i,...s?{count:o}:{}}))},tA=(t,a,s={})=>{const r=s.multiSelectKeys??XI;return a.map(i=>{if(i==="jobType")return{key:i,label:"Job Type",type:"checkbox",options:JI};if(i==="salaryRange"){const p=Math.max(1e5,...t.flatMap(g=>[Number(g.min_salary??0),Number(g.max_salary??0)]));return{key:i,label:"Salary Range",type:"range",rangeConfig:{min:0,max:p,step:1e3,unit:"$",unitPosition:"prefix"}}}if(i==="created")return{key:i,label:"Created",type:"checkbox",options:YI};if(i==="workplace")return{key:i,label:"Remote / Hybrid / On-site",type:"checkbox",options:KI};const o={categories:"Categories",company:"Company",country:"Country",city:"City",department:"Department",companySize:"Company Size"},l={categories:"category",company:"company",country:"country",city:"city",department:"department",companySize:"company_size"},c=eA(t.map(p=>Ro(p,l[i])),s),h=r.includes(i),d=["company","country","city"].includes(i);return{key:i,label:o[i],type:d&&!h?"searchable-select":"checkbox",searchable:i==="categories"||i==="department"||d&&h,options:c}})},aA=t=>new Date(t.created_at??t.published_at??t.scraped_at??0),sA=(t,a)=>{const s=new Date,r=aA(t);if(Number.isNaN(r.getTime()))return!1;const i=24*60*60*1e3,o=s.getTime()-r.getTime();switch(a){case"today":return r.toDateString()===s.toDateString();case"this_week":return o<=7*i;case"last_week":return o>7*i&&o<=14*i;case"this_month":return r.getMonth()===s.getMonth()&&r.getFullYear()===s.getFullYear();case"last_3_months":return o<=90*i;case"this_year":return r.getFullYear()===s.getFullYear();default:return!0}},nA=(t,a,s)=>{if(s.length===0)return!0;if(a==="salaryRange"){if(s.length<2)return!0;const[l,c]=s.map(Number),h=Number(t.min_salary??0),d=Number(t.max_salary??h);return!Number.isNaN(l)&&!Number.isNaN(c)&&d>=l&&h<=c}if(a==="created")return s.some(l=>sA(t,l));if(a==="jobType"){const l=Ro(t,"job_type")||Ro(t,"type");return s.includes(l.toLowerCase())}if(a==="workplace")return s.includes(QI(t));const i=Ro(t,{categories:"category",company:"company",country:"country",city:"city",department:"department",companySize:"company_size"}[a]).toLowerCase();return s.map(l=>l.toLowerCase()).includes(i)},rA=[{value:"date_desc",label:"Newest"},{value:"date_asc",label:"Oldest"},{value:"title_asc",label:"Title (A-Z)"},{value:"company_asc",label:"Company (A-Z)"}],CN="savedJobs",iA=["vip","casino","marketing","sportsbook","compliance","money laundering","igaming","payments","crm","ai"],Pl=t=>new Date(t.created_at??t.published_at??t.scraped_at??0).getTime(),yM=t=>{if(typeof t=="string")return t;if(t&&typeof t=="object"){const a=t,s=a.name??a.label??a.value;return typeof s=="string"?s:""}return""},oA=({apiUrl:t,itemsPerPage:a=12,filterKeys:s,filterOptions:r,enablePagination:i=!0,enableMobileFilter:o=!0,searchableFilters:l=["company"],filterDisplayConfig:c,banner:h,cardType:d="job",userAccess:p,onEmitEvent:g,eventContext:y,initialJobs:u})=>{var X;const[x,v]=m.useState(u??[]),[f,k]=m.useState(!u),[w,j]=m.useState(""),[b,T]=m.useState({}),[S,N]=m.useState(1),[L,I]=m.useState(a),[A,C]=m.useState("date_desc"),[M,R]=m.useState("grid"),[D,H]=m.useState([]),G=tM(p),E=m.useMemo(()=>{const F=r??s??[...xl];return NN(F)},[s,r]),W=m.useMemo(()=>({...c,multiSelectKeys:c!=null&&c.multiSelectKeys?NN(c.multiSelectKeys):void 0}),[c]);m.useEffect(()=>{try{const F=localStorage.getItem(CN);if(F){const z=JSON.parse(F);Array.isArray(z)&&H(z.filter(B=>typeof B=="string"))}}catch(F){console.error("Failed to load saved jobs",F)}},[]),m.useEffect(()=>{try{localStorage.setItem(CN,JSON.stringify(D))}catch(F){console.error("Failed to persist saved jobs",F)}},[D]),m.useEffect(()=>{if(u)return;let F=!0;const z=async()=>{try{const B=await fetch(t);if(!B.ok)throw new Error("Could not load jobs");const ce=await B.json();F&&Array.isArray(ce)&&v(ce)}catch(B){console.error("Failed to fetch jobs",B),F&&v([])}finally{F&&k(!1)}};return k(!0),z(),()=>{F=!1}},[t,u]),m.useEffect(()=>{if(typeof window>"u")return;const F=new URLSearchParams(window.location.search),z=F.get("searchTerm")??F.get("q")??F.get("skill")??F.get("skills")??"";z&&j(z);const B={};E.forEach(ue=>{const Ne=[...F.getAll(ue),...F.getAll(`filters[${ue}]`),...ue==="created"?F.getAll("created_at"):[],...ue==="created"?F.getAll("filters[created_at]"):[]].flatMap(xt=>xt.split(",")).map(xt=>xt.trim()).filter(Boolean);Ne.length&&(B[ue]=Array.from(new Set(Ne)))});const ce=[...F.getAll("market"),...F.getAll("markets")].flatMap(ue=>ue.split(",")).map(ue=>ue.trim()).filter(Boolean);ce.length>0&&(B.country=Array.from(new Set([...B.country??[],...ce]))),Object.keys(B).length>0&&T(ue=>({...ue,...B}))},[E]);const J=m.useMemo(()=>tA(x,E,W).map(F=>({...F,searchable:F.searchable??l.includes(F.key)})),[x,W,E,l]),Y=m.useMemo(()=>{const F=w.trim().toLowerCase();return x.filter(z=>{const B=yM(z.company);return!F||`${z.title} ${B} ${z.location??""}`.toLowerCase().includes(F)?Object.entries(b).every(([ue,Ne])=>Ne.length===0||!xl.includes(ue)?!0:nA(z,ue,Ne)):!1})},[x,w,b]),re=m.useMemo(()=>{const F=[...Y];return F.sort((z,B)=>{switch(A){case"date_asc":return Pl(z)-Pl(B);case"title_asc":return(z.title??"").localeCompare(B.title??"");case"company_asc":return yM(z.company).localeCompare(yM(B.company));case"date_desc":default:return Pl(B)-Pl(z)}}),F},[Y,A]),oe=m.useMemo(()=>{const F=(S-1)*L;return re.slice(F,F+L)},[S,L,re]),$=Math.max(1,Math.ceil(re.length/L));m.useEffect(()=>{N(1)},[w,b,L]);const Q=m.useMemo(()=>{const F={categories:"Categories",jobType:"Job Type",salaryRange:"Salary Range",created:"Created",company:"Company",country:"Country",city:"City",department:"Department",workplace:"Remote / Hybrid / On-site",companySize:"Company Size"},z=(B,ce)=>{var xt;const ue=J.find(ot=>ot.key===B),Ne=(xt=ue==null?void 0:ue.options)==null?void 0:xt.find(ot=>ot.value.toLowerCase()===ce.toLowerCase());return Ne!=null&&Ne.label?Ne.label:ce.split(/\s+/).filter(Boolean).map(ot=>ot.charAt(0).toUpperCase()+ot.slice(1)).join(" ")};return Object.entries(b).flatMap(([B,ce])=>ce.map(ue=>({key:B,value:z(B,ue),label:xl.includes(B)?F[B]:B,onRemove:()=>{T(Ne=>({...Ne,[B]:(Ne[B]??[]).filter(xt=>xt!==ue)}))}})))},[J,b]),de=F=>{const z=String(F.id??F._id??"");z&&H(B=>B.includes(z)?B.filter(ce=>ce!==z):[...B,z])},ve=()=>{},he=m.useCallback((F,z)=>{g&&g({domain:"newsletter",name:F,payload:z,timestamp:new Date().toISOString(),context:{component:"Listing",...y??{}}})},[y,g]),te=m.useCallback(F=>{he(F.name,F.payload)},[he]),O=(X=h==null?void 0:h.sidebar)!=null&&X.enabled?e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"sticky top-4 space-y-6",children:[e.jsx(Do,{position:"sidebar",url:h.sidebar.url,link:h.sidebar.link,alt:h.sidebar.alt}),e.jsx(Q8,{onEmitEvent:te,isAuthenticated:p==null?void 0:p.registered,userEmail:p==null?void 0:p.email}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-5",children:[e.jsx("h3",{className:"font-semibold text-lg mb-3",children:"Featured Employers"}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:[...Array(6)].map((F,z)=>e.jsx("div",{className:"flex items-center justify-center p-2 bg-gray-50 rounded-md",children:e.jsx("img",{src:`/placeholder.svg?height=40&width=40&text=${String.fromCharCode(65+z)}`,alt:`Featured employer ${z+1}`,className:"w-10 h-10 object-contain"})},z))})]})]})}):void 0;return e.jsx(e.Fragment,{children:e.jsx(ja,{title:"Jobs",description:"Discover fresh opportunities across iGaming teams.",headerPopularTags:iA,search:{value:w,onChange:j,onSubmit:j,onClear:()=>j(""),placeholder:"Search jobs"},filters:J,filterValues:b,onFilterChange:(F,z)=>T(B=>({...B,[F]:z})),onClearFilters:()=>T({}),activeFilters:Q,sort:{value:A,options:rA,onChange:C},viewMode:M,onViewModeChange:R,pagination:{enabled:i,page:S,pageSize:L,totalPages:$,totalCount:re.length,toolbarTotalCount:re.length,toolbarTitle:"Latest Jobs",toolbarItemLabel:"jobs",onPageChange:N,onPageSizeChange:I},sidebarSlot:O,resultsClassName:M==="grid"?"grid gap-4 sm:grid-cols-2":"space-y-4",children:f?e.jsx(ua,{totalColumns:L}):oe.length>0?oe.map((F,z)=>{const B=String(F.id??F._id??"");return e.jsx(YM,{job:F,positionInList:(S-1)*L+z,onSaveJob:de,onViewJob:ve,isSaved:!!(B&&D.includes(B)),layout:M==="grid"?"grid":"list",userAccess:G},B||`${F.title}-${z}`)}):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(je,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No jobs found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters."}),e.jsx(P,{variant:"outline",onClick:()=>T({}),children:"Clear all filters"})]})})})},lA=t=>{const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})},cA=t=>t>=1e3?`${(t/1e3).toFixed(1)}k`:t.toString(),dA=({title:t,organizer:a,category:s,format:r,city:i,country:o,date:l,attendeeCount:c,tags:h=[],isFeatured:d=!1,isFree:p=!1,link:g})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card",children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[d&&e.jsx(q,{className:"bg-primary text-primary-foreground",children:"Featured"}),p&&e.jsx(q,{className:"bg-emerald-500/10 text-emerald-600",children:"Free"}),e.jsx(q,{variant:"outline",children:s}),e.jsx(q,{variant:"secondary",children:r})]}),e.jsx("h3",{className:"mb-2 line-clamp-2 text-lg font-semibold text-foreground",children:t}),e.jsxs("p",{className:"mb-3 text-sm text-muted-foreground",children:["by ",a]}),e.jsxs("div",{className:"mb-3 flex flex-wrap gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(da,{className:"h-3.5 w-3.5"}),lA(l)]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Te,{className:"h-3.5 w-3.5"}),i,", ",o]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ze,{className:"h-3.5 w-3.5"}),cA(c)," attendees"]})]}),h.length>0&&e.jsx("div",{className:"mb-4 flex flex-wrap gap-1.5",children:h.slice(0,3).map(y=>e.jsx(q,{variant:"outline",className:"text-xs",children:y},y))}),g&&e.jsx(P,{variant:"outline",size:"sm",className:"w-full",asChild:!0,children:e.jsxs("a",{href:g,target:"_blank",rel:"noopener noreferrer",children:["View Event",e.jsx(bt,{className:"ml-2 h-3.5 w-3.5"})]})})]}),SN=[{id:"event-1",title:"European iGaming Leadership Summit",organizer:"iGaming Career",category:"Conference",format:"In-person",country:"Malta",city:"Valletta",date:"2026-05-12",attendeeCount:1200,tags:["leadership","strategy"],isFeatured:!0,link:"https://example.com/events/leadership-summit"},{id:"event-2",title:"AML Compliance Masterclass",organizer:"Compliance Academy",category:"Workshop",format:"Online",country:"Remote",city:"Remote",date:"2026-04-04",attendeeCount:380,tags:["compliance","aml"],isFree:!0,link:"https://example.com/events/aml-masterclass"},{id:"event-3",title:"Sportsbook Product Roundtable",organizer:"Bet Product Guild",category:"Roundtable",format:"Hybrid",country:"United Kingdom",city:"London",date:"2026-06-19",attendeeCount:540,tags:["sportsbook","product"],link:"https://example.com/events/sportsbook-roundtable"},{id:"event-4",title:"Affiliate Growth Forum",organizer:"Affiliate Network EU",category:"Forum",format:"In-person",country:"Spain",city:"Barcelona",date:"2026-03-21",attendeeCount:750,tags:["affiliate","marketing"],link:"https://example.com/events/affiliate-growth-forum"},{id:"event-5",title:"Responsible Gaming Webinar",organizer:"RG Alliance",category:"Webinar",format:"Online",country:"Remote",city:"Remote",date:"2026-02-28",attendeeCount:910,tags:["responsible-gaming","policy"],isFree:!0,link:"https://example.com/events/rg-webinar"},{id:"event-6",title:"Payments and Fraud Prevention Expo",organizer:"Fintech iGaming Expo",category:"Expo",format:"In-person",country:"Cyprus",city:"Limassol",date:"2026-07-10",attendeeCount:660,tags:["payments","fraud"],isFeatured:!0,link:"https://example.com/events/payments-fraud-expo"}],yt=ie.forwardRef(({className:t,...a},s)=>e.jsx(LM.Root,{className:ne("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",t),...a,ref:s,children:e.jsx(LM.Thumb,{className:ne("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));yt.displayName=LM.Root.displayName;const Je=gt.Root,Ye=gt.Value,Ue=ie.forwardRef(({className:t,children:a,...s},r)=>e.jsxs(gt.Trigger,{ref:r,className:ne("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...s,children:[a,e.jsx(gt.Icon,{asChild:!0,children:e.jsx(jl.ChevronDownIcon,{className:"h-4 w-4 opacity-50"})})]}));Ue.displayName=gt.Trigger.displayName;const VC=ie.forwardRef(({className:t,...a},s)=>e.jsx(gt.ScrollUpButton,{ref:s,className:ne("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(jl.ChevronUpIcon,{className:"h-4 w-4"})}));VC.displayName=gt.ScrollUpButton.displayName;const OC=ie.forwardRef(({className:t,...a},s)=>e.jsx(gt.ScrollDownButton,{ref:s,className:ne("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(jl.ChevronDownIcon,{className:"h-4 w-4"})}));OC.displayName=gt.ScrollDownButton.displayName;const _e=ie.forwardRef(({className:t,children:a,position:s="popper",...r},i)=>e.jsx(gt.Portal,{children:e.jsxs(gt.Content,{ref:i,className:ne("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:s,...r,children:[e.jsx(VC,{}),e.jsx(gt.Viewport,{className:ne("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:a}),e.jsx(OC,{})]})}));_e.displayName=gt.Content.displayName;const hA=ie.forwardRef(({className:t,...a},s)=>e.jsx(gt.Label,{ref:s,className:ne("px-2 py-1.5 text-sm font-semibold",t),...a}));hA.displayName=gt.Label.displayName;const xe=ie.forwardRef(({className:t,children:a,...s},r)=>e.jsxs(gt.Item,{ref:r,className:ne("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...s,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(gt.ItemIndicator,{children:e.jsx(jl.CheckIcon,{className:"h-4 w-4"})})}),e.jsx(gt.ItemText,{children:a})]}));xe.displayName=gt.Item.displayName;const mA=ie.forwardRef(({className:t,...a},s)=>e.jsx(gt.Separator,{ref:s,className:ne("-mx-1 my-1 h-px bg-muted",t),...a}));mA.displayName=gt.Separator.displayName;const uA=["C-level","B2B","Regulators","Affiliates","Tech","Operators","Providers","General"],pA=["In-person","Online","Hybrid"],xA=["Conference","Summit","Expo","Webinar","Meetup","Awards","Hackathon"],yA=({open:t,onOpenChange:a,onSubmit:s})=>{const[r,i]=m.useState(""),[o,l]=m.useState(""),[c,h]=m.useState(""),[d,p]=m.useState(""),[g,y]=m.useState(""),[u,x]=m.useState(""),[v,f]=m.useState(""),[k,w]=m.useState(""),[j,b]=m.useState(""),[T,S]=m.useState(""),[N,L]=m.useState([]),[I,A]=m.useState(!1),[C,M]=m.useState(!1),R=r.trim().length>=3&&o.trim().length>=2&&c&&d&&g.trim().length>=2&&u.trim().length>=2&&v&&j.trim().length>=20,D=E=>{L(W=>W.includes(E)?W.filter(J=>J!==E):[...W,E])},H=()=>{!R||!d||(s==null||s({title:r.trim(),organizer:o.trim(),category:c,format:d,country:g.trim(),city:u.trim(),date:v,endDate:k||void 0,description:j.trim(),link:T.trim()||void 0,audience:N,isFree:I}),M(!0))},G=()=>{i(""),l(""),h(""),p(""),y(""),x(""),f(""),w(""),b(""),S(""),L([]),A(!1),M(!1),a(!1)};return e.jsx(tt,{open:t,onOpenChange:G,children:e.jsx(Xe,{className:"sm:max-w-[560px]",children:C?e.jsxs(e.Fragment,{children:[e.jsxs(Be,{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-gaming-success/10 flex items-center justify-center mx-auto mb-4",children:e.jsx(Ct,{className:"w-8 h-8 text-gaming-success"})}),e.jsx(Ie,{children:"Event Submitted!"}),e.jsx(nt,{className:"text-center",children:"Thank you for submitting your event. It will appear on the calendar after review (usually within 24-48 hours)."})]}),e.jsx(et,{children:e.jsx(P,{variant:"accent",onClick:G,className:"w-full",children:"Done"})})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Be,{children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-accent/10 flex items-center justify-center mb-2",children:e.jsx(da,{className:"w-6 h-6 text-accent"})}),e.jsx(Ie,{children:"Submit an Event"}),e.jsx(nt,{children:"Add your iGaming event to our calendar. All submissions are reviewed before publishing."})]}),e.jsxs("div",{className:"space-y-4 py-2 max-h-[60vh] overflow-y-auto",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Event Name *"}),e.jsx(ee,{placeholder:"e.g. ICE London 2026",value:r,onChange:E=>i(E.target.value),maxLength:150})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Organizer *"}),e.jsx(ee,{placeholder:"e.g. Clarion Gaming",value:o,onChange:E=>l(E.target.value),maxLength:100})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Event Type *"}),e.jsxs(Je,{value:c,onValueChange:h,children:[e.jsx(Ue,{children:e.jsx(Ye,{placeholder:"Select type"})}),e.jsx(_e,{children:xA.map(E=>e.jsx(xe,{value:E,children:E},E))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Format *"}),e.jsxs(Je,{value:d,onValueChange:E=>p(E),children:[e.jsx(Ue,{children:e.jsx(Ye,{placeholder:"Select format"})}),e.jsx(_e,{children:pA.map(E=>e.jsx(xe,{value:E,children:E},E))})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Country *"}),e.jsx(ee,{placeholder:"e.g. United Kingdom",value:g,onChange:E=>y(E.target.value),maxLength:60})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"City *"}),e.jsx(ee,{placeholder:"e.g. London",value:u,onChange:E=>x(E.target.value),maxLength:60})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Start Date *"}),e.jsx(ee,{type:"date",value:v,onChange:E=>f(E.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["End Date ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),e.jsx(ee,{type:"date",value:k,onChange:E=>w(E.target.value)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["Description *"," ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(min 20 characters)"})]}),e.jsx(st,{placeholder:"Describe the event, topics covered, who should attend...",value:j,onChange:E=>b(E.target.value),rows:3,maxLength:2e3})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["Event Website ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),e.jsx(ee,{type:"url",placeholder:"https://...",value:T,onChange:E=>S(E.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["Target Audience ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(select all that apply)"})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:uA.map(E=>e.jsx("button",{type:"button",onClick:()=>D(E),className:`px-3 py-1.5 rounded-full text-xs font-medium border transition-colors ${N.includes(E)?"bg-accent text-accent-foreground border-accent":"bg-secondary text-muted-foreground border-border hover:border-accent/50"}`,children:E},E))})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border px-4 py-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Free event"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This event is free to attend"})]}),e.jsx(yt,{checked:I,onCheckedChange:A})]})]}),e.jsxs(et,{children:[e.jsx(P,{variant:"outline",onClick:G,children:"Cancel"}),e.jsx(P,{variant:"accent",onClick:H,disabled:!R,children:"Submit Event"})]})]})})})};function Ke(t){const a=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&a==="[object Date]"?new t.constructor(+t):typeof t=="number"||a==="[object Number]"||typeof t=="string"||a==="[object String]"?new Date(t):new Date(NaN)}function Ps(t,a){return t instanceof Date?new t.constructor(a):new Date(a)}const GC=6048e5,gA=864e5,Tl=43200,LN=1440;let fA={};function Ml(){return fA}function vl(t,a){var c,h,d,p;const s=Ml(),r=(a==null?void 0:a.weekStartsOn)??((h=(c=a==null?void 0:a.locale)==null?void 0:c.options)==null?void 0:h.weekStartsOn)??s.weekStartsOn??((p=(d=s.locale)==null?void 0:d.options)==null?void 0:p.weekStartsOn)??0,i=Ke(t),o=i.getDay(),l=(o<r?7:0)+o-r;return i.setDate(i.getDate()-l),i.setHours(0,0,0,0),i}function J8(t){return vl(t,{weekStartsOn:1})}function UC(t){const a=Ke(t),s=a.getFullYear(),r=Ps(t,0);r.setFullYear(s+1,0,4),r.setHours(0,0,0,0);const i=J8(r),o=Ps(t,0);o.setFullYear(s,0,4),o.setHours(0,0,0,0);const l=J8(o);return a.getTime()>=i.getTime()?s+1:a.getTime()>=l.getTime()?s:s-1}function IN(t){const a=Ke(t);return a.setHours(0,0,0,0),a}function Y8(t){const a=Ke(t),s=new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()));return s.setUTCFullYear(a.getFullYear()),+t-+s}function vA(t,a){const s=IN(t),r=IN(a),i=+s-Y8(s),o=+r-Y8(r);return Math.round((i-o)/gA)}function kA(t){const a=UC(t),s=Ps(t,0);return s.setFullYear(a,0,4),s.setHours(0,0,0,0),J8(s)}function _8(t,a){const s=Ke(t),r=Ke(a),i=s.getTime()-r.getTime();return i<0?-1:i>0?1:i}function bA(t){return Ps(t,Date.now())}function jA(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function wA(t){if(!jA(t)&&typeof t!="number")return!1;const a=Ke(t);return!isNaN(Number(a))}function MA(t,a){const s=Ke(t),r=Ke(a),i=s.getFullYear()-r.getFullYear(),o=s.getMonth()-r.getMonth();return i*12+o}function NA(t){return a=>{const r=(t?Math[t]:Math.trunc)(a);return r===0?0:r}}function CA(t,a){return+Ke(t)-+Ke(a)}function SA(t){const a=Ke(t);return a.setHours(23,59,59,999),a}function LA(t){const a=Ke(t),s=a.getMonth();return a.setFullYear(a.getFullYear(),s+1,0),a.setHours(23,59,59,999),a}function IA(t){const a=Ke(t);return+SA(a)==+LA(a)}function AA(t,a){const s=Ke(t),r=Ke(a),i=_8(s,r),o=Math.abs(MA(s,r));let l;if(o<1)l=0;else{s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-i*o);let c=_8(s,r)===-i;IA(Ke(t))&&o===1&&_8(t,r)===1&&(c=!1),l=i*(o-Number(c))}return l===0?0:l}function PA(t,a,s){const r=CA(t,a)/1e3;return NA(s==null?void 0:s.roundingMethod)(r)}function TA(t){const a=Ke(t),s=Ps(t,0);return s.setFullYear(a.getFullYear(),0,1),s.setHours(0,0,0,0),s}const RA={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},DA=(t,a,s)=>{let r;const i=RA[t];return typeof i=="string"?r=i:a===1?r=i.one:r=i.other.replace("{{count}}",a.toString()),s!=null&&s.addSuffix?s.comparison&&s.comparison>0?"in "+r:r+" ago":r};function gM(t){return(a={})=>{const s=a.width?String(a.width):t.defaultWidth;return t.formats[s]||t.formats[t.defaultWidth]}}const zA={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},qA={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},FA={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},HA={date:gM({formats:zA,defaultWidth:"full"}),time:gM({formats:qA,defaultWidth:"full"}),dateTime:gM({formats:FA,defaultWidth:"full"})},EA={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},BA=(t,a,s,r)=>EA[t];function Oo(t){return(a,s)=>{const r=s!=null&&s.context?String(s.context):"standalone";let i;if(r==="formatting"&&t.formattingValues){const l=t.defaultFormattingWidth||t.defaultWidth,c=s!=null&&s.width?String(s.width):l;i=t.formattingValues[c]||t.formattingValues[l]}else{const l=t.defaultWidth,c=s!=null&&s.width?String(s.width):t.defaultWidth;i=t.values[c]||t.values[l]}const o=t.argumentCallback?t.argumentCallback(a):a;return i[o]}}const VA={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},OA={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},GA={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},UA={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},_A={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},$A={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},WA=(t,a)=>{const s=Number(t),r=s%100;if(r>20||r<10)switch(r%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},ZA={ordinalNumber:WA,era:Oo({values:VA,defaultWidth:"wide"}),quarter:Oo({values:OA,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Oo({values:GA,defaultWidth:"wide"}),day:Oo({values:UA,defaultWidth:"wide"}),dayPeriod:Oo({values:_A,defaultWidth:"wide",formattingValues:$A,defaultFormattingWidth:"wide"})};function Go(t){return(a,s={})=>{const r=s.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=a.match(i);if(!o)return null;const l=o[0],c=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],h=Array.isArray(c)?YA(c,g=>g.test(l)):JA(c,g=>g.test(l));let d;d=t.valueCallback?t.valueCallback(h):h,d=s.valueCallback?s.valueCallback(d):d;const p=a.slice(l.length);return{value:d,rest:p}}}function JA(t,a){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&a(t[s]))return s}function YA(t,a){for(let s=0;s<t.length;s++)if(a(t[s]))return s}function KA(t){return(a,s={})=>{const r=a.match(t.matchPattern);if(!r)return null;const i=r[0],o=a.match(t.parsePattern);if(!o)return null;let l=t.valueCallback?t.valueCallback(o[0]):o[0];l=s.valueCallback?s.valueCallback(l):l;const c=a.slice(i.length);return{value:l,rest:c}}}const XA=/^(\d+)(th|st|nd|rd)?/i,QA=/\d+/i,eP={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},tP={any:[/^b/i,/^(a|c)/i]},aP={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},sP={any:[/1/i,/2/i,/3/i,/4/i]},nP={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},rP={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},iP={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},oP={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},lP={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},cP={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},dP={ordinalNumber:KA({matchPattern:XA,parsePattern:QA,valueCallback:t=>parseInt(t,10)}),era:Go({matchPatterns:eP,defaultMatchWidth:"wide",parsePatterns:tP,defaultParseWidth:"any"}),quarter:Go({matchPatterns:aP,defaultMatchWidth:"wide",parsePatterns:sP,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Go({matchPatterns:nP,defaultMatchWidth:"wide",parsePatterns:rP,defaultParseWidth:"any"}),day:Go({matchPatterns:iP,defaultMatchWidth:"wide",parsePatterns:oP,defaultParseWidth:"any"}),dayPeriod:Go({matchPatterns:lP,defaultMatchWidth:"any",parsePatterns:cP,defaultParseWidth:"any"})},_C={code:"en-US",formatDistance:DA,formatLong:HA,formatRelative:BA,localize:ZA,match:dP,options:{weekStartsOn:0,firstWeekContainsDate:1}};function hP(t){const a=Ke(t);return vA(a,TA(a))+1}function mP(t){const a=Ke(t),s=+J8(a)-+kA(a);return Math.round(s/GC)+1}function $C(t,a){var p,g,y,u;const s=Ke(t),r=s.getFullYear(),i=Ml(),o=(a==null?void 0:a.firstWeekContainsDate)??((g=(p=a==null?void 0:a.locale)==null?void 0:p.options)==null?void 0:g.firstWeekContainsDate)??i.firstWeekContainsDate??((u=(y=i.locale)==null?void 0:y.options)==null?void 0:u.firstWeekContainsDate)??1,l=Ps(t,0);l.setFullYear(r+1,0,o),l.setHours(0,0,0,0);const c=vl(l,a),h=Ps(t,0);h.setFullYear(r,0,o),h.setHours(0,0,0,0);const d=vl(h,a);return s.getTime()>=c.getTime()?r+1:s.getTime()>=d.getTime()?r:r-1}function uP(t,a){var c,h,d,p;const s=Ml(),r=(a==null?void 0:a.firstWeekContainsDate)??((h=(c=a==null?void 0:a.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??s.firstWeekContainsDate??((p=(d=s.locale)==null?void 0:d.options)==null?void 0:p.firstWeekContainsDate)??1,i=$C(t,a),o=Ps(t,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),vl(o,a)}function pP(t,a){const s=Ke(t),r=+vl(s,a)-+uP(s,a);return Math.round(r/GC)+1}function Ve(t,a){const s=t<0?"-":"",r=Math.abs(t).toString().padStart(a,"0");return s+r}const ms={y(t,a){const s=t.getFullYear(),r=s>0?s:1-s;return Ve(a==="yy"?r%100:r,a.length)},M(t,a){const s=t.getMonth();return a==="M"?String(s+1):Ve(s+1,2)},d(t,a){return Ve(t.getDate(),a.length)},a(t,a){const s=t.getHours()/12>=1?"pm":"am";switch(a){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];case"aaaa":default:return s==="am"?"a.m.":"p.m."}},h(t,a){return Ve(t.getHours()%12||12,a.length)},H(t,a){return Ve(t.getHours(),a.length)},m(t,a){return Ve(t.getMinutes(),a.length)},s(t,a){return Ve(t.getSeconds(),a.length)},S(t,a){const s=a.length,r=t.getMilliseconds(),i=Math.trunc(r*Math.pow(10,s-3));return Ve(i,a.length)}},lo={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},AN={G:function(t,a,s){const r=t.getFullYear()>0?1:0;switch(a){case"G":case"GG":case"GGG":return s.era(r,{width:"abbreviated"});case"GGGGG":return s.era(r,{width:"narrow"});case"GGGG":default:return s.era(r,{width:"wide"})}},y:function(t,a,s){if(a==="yo"){const r=t.getFullYear(),i=r>0?r:1-r;return s.ordinalNumber(i,{unit:"year"})}return ms.y(t,a)},Y:function(t,a,s,r){const i=$C(t,r),o=i>0?i:1-i;if(a==="YY"){const l=o%100;return Ve(l,2)}return a==="Yo"?s.ordinalNumber(o,{unit:"year"}):Ve(o,a.length)},R:function(t,a){const s=UC(t);return Ve(s,a.length)},u:function(t,a){const s=t.getFullYear();return Ve(s,a.length)},Q:function(t,a,s){const r=Math.ceil((t.getMonth()+1)/3);switch(a){case"Q":return String(r);case"QQ":return Ve(r,2);case"Qo":return s.ordinalNumber(r,{unit:"quarter"});case"QQQ":return s.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,a,s){const r=Math.ceil((t.getMonth()+1)/3);switch(a){case"q":return String(r);case"qq":return Ve(r,2);case"qo":return s.ordinalNumber(r,{unit:"quarter"});case"qqq":return s.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,a,s){const r=t.getMonth();switch(a){case"M":case"MM":return ms.M(t,a);case"Mo":return s.ordinalNumber(r+1,{unit:"month"});case"MMM":return s.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(r,{width:"wide",context:"formatting"})}},L:function(t,a,s){const r=t.getMonth();switch(a){case"L":return String(r+1);case"LL":return Ve(r+1,2);case"Lo":return s.ordinalNumber(r+1,{unit:"month"});case"LLL":return s.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(r,{width:"wide",context:"standalone"})}},w:function(t,a,s,r){const i=pP(t,r);return a==="wo"?s.ordinalNumber(i,{unit:"week"}):Ve(i,a.length)},I:function(t,a,s){const r=mP(t);return a==="Io"?s.ordinalNumber(r,{unit:"week"}):Ve(r,a.length)},d:function(t,a,s){return a==="do"?s.ordinalNumber(t.getDate(),{unit:"date"}):ms.d(t,a)},D:function(t,a,s){const r=hP(t);return a==="Do"?s.ordinalNumber(r,{unit:"dayOfYear"}):Ve(r,a.length)},E:function(t,a,s){const r=t.getDay();switch(a){case"E":case"EE":case"EEE":return s.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(r,{width:"short",context:"formatting"});case"EEEE":default:return s.day(r,{width:"wide",context:"formatting"})}},e:function(t,a,s,r){const i=t.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(a){case"e":return String(o);case"ee":return Ve(o,2);case"eo":return s.ordinalNumber(o,{unit:"day"});case"eee":return s.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(i,{width:"short",context:"formatting"});case"eeee":default:return s.day(i,{width:"wide",context:"formatting"})}},c:function(t,a,s,r){const i=t.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(a){case"c":return String(o);case"cc":return Ve(o,a.length);case"co":return s.ordinalNumber(o,{unit:"day"});case"ccc":return s.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(i,{width:"narrow",context:"standalone"});case"cccccc":return s.day(i,{width:"short",context:"standalone"});case"cccc":default:return s.day(i,{width:"wide",context:"standalone"})}},i:function(t,a,s){const r=t.getDay(),i=r===0?7:r;switch(a){case"i":return String(i);case"ii":return Ve(i,a.length);case"io":return s.ordinalNumber(i,{unit:"day"});case"iii":return s.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(r,{width:"short",context:"formatting"});case"iiii":default:return s.day(r,{width:"wide",context:"formatting"})}},a:function(t,a,s){const i=t.getHours()/12>=1?"pm":"am";switch(a){case"a":case"aa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,a,s){const r=t.getHours();let i;switch(r===12?i=lo.noon:r===0?i=lo.midnight:i=r/12>=1?"pm":"am",a){case"b":case"bb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,a,s){const r=t.getHours();let i;switch(r>=17?i=lo.evening:r>=12?i=lo.afternoon:r>=4?i=lo.morning:i=lo.night,a){case"B":case"BB":case"BBB":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,a,s){if(a==="ho"){let r=t.getHours()%12;return r===0&&(r=12),s.ordinalNumber(r,{unit:"hour"})}return ms.h(t,a)},H:function(t,a,s){return a==="Ho"?s.ordinalNumber(t.getHours(),{unit:"hour"}):ms.H(t,a)},K:function(t,a,s){const r=t.getHours()%12;return a==="Ko"?s.ordinalNumber(r,{unit:"hour"}):Ve(r,a.length)},k:function(t,a,s){let r=t.getHours();return r===0&&(r=24),a==="ko"?s.ordinalNumber(r,{unit:"hour"}):Ve(r,a.length)},m:function(t,a,s){return a==="mo"?s.ordinalNumber(t.getMinutes(),{unit:"minute"}):ms.m(t,a)},s:function(t,a,s){return a==="so"?s.ordinalNumber(t.getSeconds(),{unit:"second"}):ms.s(t,a)},S:function(t,a){return ms.S(t,a)},X:function(t,a,s){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(a){case"X":return TN(r);case"XXXX":case"XX":return Ki(r);case"XXXXX":case"XXX":default:return Ki(r,":")}},x:function(t,a,s){const r=t.getTimezoneOffset();switch(a){case"x":return TN(r);case"xxxx":case"xx":return Ki(r);case"xxxxx":case"xxx":default:return Ki(r,":")}},O:function(t,a,s){const r=t.getTimezoneOffset();switch(a){case"O":case"OO":case"OOO":return"GMT"+PN(r,":");case"OOOO":default:return"GMT"+Ki(r,":")}},z:function(t,a,s){const r=t.getTimezoneOffset();switch(a){case"z":case"zz":case"zzz":return"GMT"+PN(r,":");case"zzzz":default:return"GMT"+Ki(r,":")}},t:function(t,a,s){const r=Math.trunc(t.getTime()/1e3);return Ve(r,a.length)},T:function(t,a,s){const r=t.getTime();return Ve(r,a.length)}};function PN(t,a=""){const s=t>0?"-":"+",r=Math.abs(t),i=Math.trunc(r/60),o=r%60;return o===0?s+String(i):s+String(i)+a+Ve(o,2)}function TN(t,a){return t%60===0?(t>0?"-":"+")+Ve(Math.abs(t)/60,2):Ki(t,a)}function Ki(t,a=""){const s=t>0?"-":"+",r=Math.abs(t),i=Ve(Math.trunc(r/60),2),o=Ve(r%60,2);return s+i+a+o}const RN=(t,a)=>{switch(t){case"P":return a.date({width:"short"});case"PP":return a.date({width:"medium"});case"PPP":return a.date({width:"long"});case"PPPP":default:return a.date({width:"full"})}},WC=(t,a)=>{switch(t){case"p":return a.time({width:"short"});case"pp":return a.time({width:"medium"});case"ppp":return a.time({width:"long"});case"pppp":default:return a.time({width:"full"})}},xP=(t,a)=>{const s=t.match(/(P+)(p+)?/)||[],r=s[1],i=s[2];if(!i)return RN(t,a);let o;switch(r){case"P":o=a.dateTime({width:"short"});break;case"PP":o=a.dateTime({width:"medium"});break;case"PPP":o=a.dateTime({width:"long"});break;case"PPPP":default:o=a.dateTime({width:"full"});break}return o.replace("{{date}}",RN(r,a)).replace("{{time}}",WC(i,a))},yP={p:WC,P:xP},gP=/^D+$/,fP=/^Y+$/,vP=["D","DD","YY","YYYY"];function kP(t){return gP.test(t)}function bP(t){return fP.test(t)}function jP(t,a,s){const r=wP(t,a,s);if(console.warn(r),vP.includes(t))throw new RangeError(r)}function wP(t,a,s){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${a}\`) for formatting ${r} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const MP=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,NP=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,CP=/^'([^]*?)'?$/,SP=/''/g,LP=/[a-zA-Z]/;function IP(t,a,s){var p,g,y,u;const r=Ml(),i=r.locale??_C,o=r.firstWeekContainsDate??((g=(p=r.locale)==null?void 0:p.options)==null?void 0:g.firstWeekContainsDate)??1,l=r.weekStartsOn??((u=(y=r.locale)==null?void 0:y.options)==null?void 0:u.weekStartsOn)??0,c=Ke(t);if(!wA(c))throw new RangeError("Invalid time value");let h=a.match(NP).map(x=>{const v=x[0];if(v==="p"||v==="P"){const f=yP[v];return f(x,i.formatLong)}return x}).join("").match(MP).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const v=x[0];if(v==="'")return{isToken:!1,value:AP(x)};if(AN[v])return{isToken:!0,value:x};if(v.match(LP))throw new RangeError("Format string contains an unescaped latin alphabet character `"+v+"`");return{isToken:!1,value:x}});i.localize.preprocessor&&(h=i.localize.preprocessor(c,h));const d={firstWeekContainsDate:o,weekStartsOn:l,locale:i};return h.map(x=>{if(!x.isToken)return x.value;const v=x.value;(bP(v)||kP(v))&&jP(v,a,String(t));const f=AN[v[0]];return f(c,v,i.localize,d)}).join("")}function AP(t){const a=t.match(CP);return a?a[1].replace(SP,"'"):t}function PP(t,a,s){const r=Ml(),i=(s==null?void 0:s.locale)??r.locale??_C,o=2520,l=_8(t,a);if(isNaN(l))throw new RangeError("Invalid time value");const c=Object.assign({},s,{addSuffix:s==null?void 0:s.addSuffix,comparison:l});let h,d;l>0?(h=Ke(a),d=Ke(t)):(h=Ke(t),d=Ke(a));const p=PA(d,h),g=(Y8(d)-Y8(h))/1e3,y=Math.round((p-g)/60);let u;if(y<2)return s!=null&&s.includeSeconds?p<5?i.formatDistance("lessThanXSeconds",5,c):p<10?i.formatDistance("lessThanXSeconds",10,c):p<20?i.formatDistance("lessThanXSeconds",20,c):p<40?i.formatDistance("halfAMinute",0,c):p<60?i.formatDistance("lessThanXMinutes",1,c):i.formatDistance("xMinutes",1,c):y===0?i.formatDistance("lessThanXMinutes",1,c):i.formatDistance("xMinutes",y,c);if(y<45)return i.formatDistance("xMinutes",y,c);if(y<90)return i.formatDistance("aboutXHours",1,c);if(y<LN){const x=Math.round(y/60);return i.formatDistance("aboutXHours",x,c)}else{if(y<o)return i.formatDistance("xDays",1,c);if(y<Tl){const x=Math.round(y/LN);return i.formatDistance("xDays",x,c)}else if(y<Tl*2)return u=Math.round(y/Tl),i.formatDistance("aboutXMonths",u,c)}if(u=AA(d,h),u<12){const x=Math.round(y/Tl);return i.formatDistance("xMonths",x,c)}else{const x=u%12,v=Math.trunc(u/12);return x<3?i.formatDistance("aboutXYears",v,c):x<9?i.formatDistance("overXYears",v,c):i.formatDistance("almostXYears",v+1,c)}}function eN(t,a){return PP(t,bA(t),a)}const TP=t=>{const a=new Date(t);return{day:a.getDate(),month:a.toLocaleDateString("en-US",{month:"short"}).toUpperCase()}},RP=(t,a)=>{const s=new Date(t),r={month:"short",day:"numeric"};if(!a)return s.toLocaleDateString("en-US",{...r,year:"numeric"});const i=new Date(a);return s.getMonth()===i.getMonth()?`${s.toLocaleDateString("en-US",r)} - ${i.getDate()}, ${i.getFullYear()}`:`${s.toLocaleDateString("en-US",r)} - ${i.toLocaleDateString("en-US",{...r,year:"numeric"})}`},DP=t=>t>=1e3?`${(t/1e3).toFixed(t>=1e4?0:1)}k`:t.toString(),zP=({event:t})=>{const{day:a,month:s}=TP(t.date),r=t.isFeatured;return e.jsxs("div",{className:`group relative flex gap-4 rounded-lg border bg-card p-4 transition-all duration-200 hover:shadow-card ${r?"border-accent/30 bg-accent/[0.02]":"border-border"}`,children:[e.jsxs("div",{className:`flex h-16 w-16 flex-shrink-0 flex-col items-center justify-center rounded-lg ${r?"bg-accent text-accent-foreground":"bg-primary text-primary-foreground"}`,children:[e.jsx("span",{className:"text-[10px] font-bold uppercase leading-none tracking-wider",children:s}),e.jsx("span",{className:"text-2xl font-bold leading-tight",children:a})]}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsxs("div",{className:"mb-1 flex flex-wrap items-center gap-1.5",children:[r&&e.jsx(q,{className:"bg-accent/10 text-accent text-[10px] px-1.5 py-0 font-semibold uppercase",children:"Recommended"}),t.isFree&&e.jsx(q,{className:"bg-gaming-success/10 text-gaming-success text-[10px] px-1.5 py-0 font-semibold uppercase",children:"Free"}),e.jsx(q,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:t.category}),e.jsx(q,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:t.format})]}),e.jsx("h3",{className:"mb-1 text-base font-semibold leading-snug text-foreground group-hover:text-accent transition-colors",children:t.title}),t.description&&e.jsx("p",{className:"mb-2 line-clamp-2 text-sm text-muted-foreground leading-relaxed",children:t.description}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(da,{className:"h-3.5 w-3.5"}),RP(t.date,t.endDate)]}),e.jsxs("span",{className:"flex items-center gap-1",children:[t.format==="Online"?e.jsx(Lt,{className:"h-3.5 w-3.5"}):e.jsx(Te,{className:"h-3.5 w-3.5"}),t.format==="Online"?"Online":`${t.city}, ${t.country}`]}),t.attendeeCount>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ze,{className:"h-3.5 w-3.5"}),DP(t.attendeeCount)," attendees"]}),e.jsxs("span",{className:"text-muted-foreground/60",children:["by ",t.organizer]})]}),t.audience&&t.audience.length>0&&e.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:t.audience.map(i=>e.jsx("span",{className:"rounded bg-secondary px-1.5 py-0.5 text-[10px] font-medium text-secondary-foreground",children:i},i))})]}),e.jsx("div",{className:"flex flex-shrink-0 flex-col items-end justify-between",children:t.link&&e.jsx(P,{variant:"outline",size:"sm",className:"text-xs",asChild:!0,children:e.jsxs("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",children:["Event Info",e.jsx(bt,{className:"ml-1.5 h-3 w-3"})]})})})]})},qP=[{value:"upcoming",label:"Upcoming"},{value:"newest",label:"Newest added"},{value:"popular",label:"Most attendees"},{value:"name",label:"Name (A-Z)"}],FP=[{value:"01",label:"January"},{value:"02",label:"February"},{value:"03",label:"March"},{value:"04",label:"April"},{value:"05",label:"May"},{value:"06",label:"June"},{value:"07",label:"July"},{value:"08",label:"August"},{value:"09",label:"September"},{value:"10",label:"October"},{value:"11",label:"November"},{value:"12",label:"December"}],HP=[{value:"C-level",label:"C-level"},{value:"B2B",label:"B2B"},{value:"Regulators",label:"Regulators"},{value:"Affiliates",label:"Affiliates"},{value:"Tech",label:"Tech"},{value:"Operators",label:"Operators"},{value:"Providers",label:"Providers"},{value:"General",label:"General"}],EP=({apiUrl:t,eventsData:a,itemsPerPage:s=20,enableMobileFilter:r=!0,onSubmitEvent:i})=>{const[o,l]=m.useState(!1),[c,h]=m.useState(a??[]),[d,p]=m.useState(!a),[g,y]=m.useState(1),[u,x]=m.useState(s),[v,f]=m.useState(""),[k,w]=m.useState("upcoming"),[j,b]=m.useState("list"),[T,S]=m.useState({category:[],format:[],country:[],month:[],audience:[],organizer:[],signals:[]});m.useEffect(()=>{if(a)return;let H=!0;const G=async()=>{try{if(!t){H&&h(SN);return}const E=await fetch(t);if(!E.ok)throw new Error(`Failed loading events: ${E.status}`);const W=await E.json();H&&Array.isArray(W)&&h(W)}catch(E){console.error("Failed to fetch events list",E),H&&h(SN)}finally{H&&p(!1)}};return p(!0),G(),()=>{H=!1}},[t,a]);const N=m.useMemo(()=>{const H=Array.from(new Set(c.map(J=>J.category))).sort(),G=Array.from(new Set(c.map(J=>J.format))).sort(),E=Array.from(new Set(c.map(J=>J.country).filter(J=>J!=="Remote"))).sort(),W=Array.from(new Set(c.map(J=>J.organizer))).sort();return[{key:"month",label:"Month",type:"checkbox",options:FP},{key:"audience",label:"Audience",type:"checkbox",options:HP},{key:"category",label:"Event Type",type:"checkbox",options:H.map(J=>({value:J,label:J}))},{key:"format",label:"Format",type:"checkbox",options:G.map(J=>({value:J,label:J}))},{key:"country",label:"Country",type:"searchable-select",searchable:!0,options:E.map(J=>({value:J,label:J}))},{key:"organizer",label:"Organizer",type:"searchable-select",searchable:!0,options:W.map(J=>({value:J,label:J}))},{key:"signals",label:"Signals",type:"toggle",options:[{value:"featured",label:"Featured only"},{value:"free",label:"Free events only"}]}]},[c]),L=m.useMemo(()=>Object.entries(T).flatMap(([H,G])=>G.map(E=>({key:H,label:H.charAt(0).toUpperCase()+H.slice(1),value:E,onRemove:()=>S(W=>({...W,[H]:(W[H]??[]).filter(J=>J!==E)}))}))),[T]),I=m.useMemo(()=>{const H=v.trim().toLowerCase();return c.filter(G=>{if(H&&!`${G.title} ${G.organizer} ${G.city} ${G.country} ${G.description??""}`.toLowerCase().includes(H)||T.category.length&&!T.category.includes(G.category)||T.format.length&&!T.format.includes(G.format)||T.country.length&&!T.country.includes(G.country)||T.organizer.length&&!T.organizer.includes(G.organizer))return!1;if(T.month.length){const E=new Date(G.date).toISOString().slice(5,7);if(!T.month.includes(E))return!1}return!(T.audience.length&&(!G.audience||!T.audience.some(E=>G.audience.includes(E)))||T.signals.includes("featured")&&!G.isFeatured||T.signals.includes("free")&&!G.isFree)})},[c,T,v]),A=m.useMemo(()=>{const H=[...I];return H.sort((G,E)=>{switch(k){case"newest":return new Date(E.date).getTime()-new Date(G.date).getTime();case"popular":return E.attendeeCount-G.attendeeCount;case"name":return G.title.localeCompare(E.title);case"upcoming":default:return new Date(G.date).getTime()-new Date(E.date).getTime()}}),H},[I,k]);m.useEffect(()=>{y(1)},[v,T,u]);const C=Math.max(1,Math.ceil(A.length/u)),M=A.slice((g-1)*u,g*u),R=m.useMemo(()=>{if(j!=="list")return null;const H={};for(const G of M){const E=IP(new Date(G.date),"MMMM yyyy");H[E]||(H[E]=[]),H[E].push(G)}return H},[M,j]),D={category:[],format:[],country:[],month:[],audience:[],organizer:[],signals:[]};return e.jsxs(e.Fragment,{children:[e.jsx(ja,{title:"iGaming Events & Conferences Calendar",description:"Discover the most important iGaming conferences, expos, webinars, and networking events worldwide. Filter by region, audience, and event type.",headerActions:e.jsxs(P,{variant:"accent",size:"sm",className:"gap-1.5",onClick:()=>l(!0),children:[e.jsx(da,{className:"w-4 h-4"}),"Submit Event"]}),search:{value:v,onChange:f,onSubmit:f,onClear:()=>f(""),placeholder:"Search events by name, organizer, or location..."},filters:N,filterValues:T,onFilterChange:(H,G)=>S(E=>({...E,[H]:G})),onClearFilters:()=>S(D),activeFilters:L,sort:{value:k,options:qP,onChange:w},viewMode:j,onViewModeChange:b,pagination:{page:g,pageSize:u,totalPages:C,totalCount:A.length,toolbarTotalCount:c.length,toolbarTitle:"Events Calendar",toolbarItemLabel:"events",onPageChange:y,onPageSizeChange:H=>{x(H),y(1)},pageSizeOptions:[10,20,50]},resultsClassName:j==="grid"?"grid gap-4 sm:grid-cols-2 xl:grid-cols-3":"",children:d?e.jsx(ua,{totalColumns:6}):M.length?j==="list"&&R?e.jsx("div",{className:"space-y-8",children:Object.entries(R).map(([H,G])=>e.jsxs("div",{children:[e.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[e.jsx("span",{className:"inline-flex items-center rounded-md bg-accent px-3 py-1.5 text-sm font-bold text-accent-foreground uppercase tracking-wide",children:H}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),e.jsx("div",{className:"space-y-3",children:G.map(E=>e.jsx(zP,{event:E},E.id))})]},H))}):M.map(H=>e.jsx(dA,{id:H.id,title:H.title,organizer:H.organizer,category:H.category,format:H.format,city:H.city,country:H.country,date:H.date,attendeeCount:H.attendeeCount,tags:H.tags,isFeatured:H.isFeatured,isFree:H.isFree,link:H.link,viewMode:j},H.id)):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(da,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No events found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters or search."}),e.jsx(P,{variant:"outline",onClick:()=>S(D),children:"Clear all filters"})]})}),e.jsx(yA,{open:o,onOpenChange:l,onSubmit:H=>{i==null||i(H),console.log("[EventsList] Submit event:",H)}})]})},BP=t=>t>=1e3?`${(t/1e3).toFixed(1)}k`:t.toString(),VP=({name:t,type:a,city:s,country:r,shortDescription:i,services:o,tags:l=[],rating:c,reviewCount:h,website:d,isFeatured:p=!1})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsx(q,{variant:"secondary",children:a}),p&&e.jsx(q,{className:"bg-primary text-primary-foreground",children:"Featured"})]}),e.jsx("h3",{className:"mb-2 text-lg font-semibold text-foreground",children:t}),e.jsx("p",{className:"mb-2 line-clamp-2 text-sm text-muted-foreground",children:i}),e.jsxs("div",{className:"mb-3 flex flex-wrap gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Te,{className:"h-3.5 w-3.5"}),s,", ",r]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ze,{className:"h-3.5 w-3.5 fill-gaming-gold text-gaming-gold"}),c.toFixed(1)," (",BP(h),")"]})]}),e.jsx("div",{className:"mb-3 flex flex-wrap gap-1.5",children:o.slice(0,3).map(g=>e.jsx(q,{variant:"outline",className:"text-xs",children:g},g))}),l.length>0&&e.jsx("div",{className:"mb-4 flex flex-wrap gap-1.5",children:l.slice(0,2).map(g=>e.jsx(q,{variant:"outline",className:"text-xs",children:g},g))}),d&&e.jsx(P,{variant:"outline",size:"sm",className:"w-full",asChild:!0,children:e.jsxs("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:["Visit Place",e.jsx(bt,{className:"ml-2 h-3.5 w-3.5"})]})})]}),DN=[{id:"place-1",name:"Valletta Gaming Campus",type:"Innovation Hub",city:"Valletta",country:"Malta",shortDescription:"Innovation campus focused on sportsbook and casino startups.",services:["Events","Mentorship","Recruitment"],tags:["startup","community"],rating:4.8,reviewCount:132,isFeatured:!0,website:"https://example.com/places/valletta-campus"},{id:"place-2",name:"Barcelona Betting Labs",type:"Coworking",city:"Barcelona",country:"Spain",shortDescription:"Flexible workspaces for game, risk, and analytics teams.",services:["Coworking","Meeting Rooms","Events"],tags:["analytics","product"],rating:4.5,reviewCount:89,website:"https://example.com/places/barcelona-labs"},{id:"place-3",name:"Tallinn Compliance Center",type:"Office",city:"Tallinn",country:"Estonia",shortDescription:"Specialized compliance hub for regulated operators.",services:["Compliance Advisory","Training"],tags:["compliance","regulation"],rating:4.6,reviewCount:64,website:"https://example.com/places/tallinn-compliance-center"},{id:"place-4",name:"London iGaming Forum Hall",type:"Conference Venue",city:"London",country:"United Kingdom",shortDescription:"Large conference venue for iGaming networking and expos.",services:["Conferences","Streaming","Booths"],tags:["conference","networking"],rating:4.4,reviewCount:210,website:"https://example.com/places/london-forum-hall"},{id:"place-5",name:"Sofia Product Studio",type:"Office",city:"Sofia",country:"Bulgaria",shortDescription:"Product-focused office optimized for agile delivery teams.",services:["Product Sprints","Hiring Support"],tags:["product","engineering"],rating:4.3,reviewCount:48,website:"https://example.com/places/sofia-product-studio"},{id:"place-6",name:"Riga Talent House",type:"Coworking",city:"Riga",country:"Latvia",shortDescription:"Coworking location with hiring events and mentorship sessions.",services:["Coworking","Recruitment","Mentorship"],tags:["talent","recruitment"],rating:4.7,reviewCount:73,isFeatured:!0,website:"https://example.com/places/riga-talent-house"}],OP=[{value:"relevance",label:"Most relevant"},{value:"rating",label:"Highest rated"},{value:"reviews",label:"Most reviews"},{value:"name",label:"Name (A-Z)"}],GP=({apiUrl:t,itemsPerPage:a=9,enableMobileFilter:s=!0})=>{const[r,i]=m.useState([]),[o,l]=m.useState(!0),[c,h]=m.useState(1),[d,p]=m.useState(a),[g,y]=m.useState(""),[u,x]=m.useState("relevance"),[v,f]=m.useState("grid"),[k,w]=m.useState({type:[],country:[],city:[],services:[],tags:[],signals:[]});m.useEffect(()=>{let I=!0;const A=async()=>{try{if(!t){I&&i(DN);return}const C=await fetch(t);if(!C.ok)throw new Error(`Failed loading places: ${C.status}`);const M=await C.json();I&&Array.isArray(M)&&i(M)}catch(C){console.error("Failed to fetch places list",C),I&&i(DN)}finally{I&&l(!1)}};return l(!0),A(),()=>{I=!1}},[t]);const j=m.useMemo(()=>{const I=Array.from(new Set(r.map(D=>D.type))).sort(),A=Array.from(new Set(r.map(D=>D.country))).sort(),C=Array.from(new Set(r.map(D=>D.city))).sort(),M=Array.from(new Set(r.flatMap(D=>D.services))).sort(),R=Array.from(new Set(r.flatMap(D=>D.tags))).sort();return[{key:"type",label:"Type",type:"checkbox",options:I.map(D=>({value:D,label:D}))},{key:"country",label:"Country",type:"searchable-select",searchable:!0,options:A.map(D=>({value:D,label:D}))},{key:"city",label:"City",type:"searchable-select",searchable:!0,options:C.map(D=>({value:D,label:D}))},{key:"services",label:"Services",type:"checkbox",searchable:!0,options:M.map(D=>({value:D,label:D}))},{key:"tags",label:"Tags",type:"checkbox",searchable:!0,options:R.map(D=>({value:D,label:D}))},{key:"signals",label:"Signals",type:"toggle",options:[{value:"featured",label:"Featured only"}]}]},[r]),b=m.useMemo(()=>Object.entries(k).flatMap(([I,A])=>A.map(C=>({key:I,label:I.charAt(0).toUpperCase()+I.slice(1),value:C,onRemove:()=>{w(M=>({...M,[I]:(M[I]??[]).filter(R=>R!==C)}))}}))),[k]),T=m.useMemo(()=>{const I=g.trim().toLowerCase();return r.filter(A=>!(I&&!`${A.name} ${A.shortDescription} ${A.city} ${A.country}`.toLowerCase().includes(I)||k.type.length&&!k.type.includes(A.type)||k.country.length&&!k.country.includes(A.country)||k.city.length&&!k.city.includes(A.city)||k.services.length&&!k.services.every(C=>A.services.includes(C))||k.tags.length&&!k.tags.every(C=>A.tags.includes(C))||k.signals.includes("featured")&&!A.isFeatured))},[k,r,g]),S=m.useMemo(()=>{const I=[...T];return I.sort((A,C)=>{switch(u){case"rating":return C.rating-A.rating;case"reviews":return C.reviewCount-A.reviewCount;case"name":return A.name.localeCompare(C.name);case"relevance":default:return Number(C.isFeatured)-Number(A.isFeatured)||C.rating-A.rating}}),I},[T,u]);m.useEffect(()=>{h(1)},[g,k,d]);const N=Math.max(1,Math.ceil(S.length/d)),L=S.slice((c-1)*d,c*d);return e.jsx(ja,{title:"Places",description:"Browse offices, venues, and hubs where iGaming teams work and connect.",search:{value:g,onChange:y,onSubmit:y,onClear:()=>y(""),placeholder:"Search places"},filters:j,filterValues:k,onFilterChange:(I,A)=>w(C=>({...C,[I]:A})),onClearFilters:()=>w({type:[],country:[],city:[],services:[],tags:[],signals:[]}),activeFilters:b,sort:{value:u,options:OP,onChange:x},viewMode:v,onViewModeChange:f,pagination:{page:c,pageSize:d,totalPages:N,totalCount:S.length,toolbarTotalCount:r.length,toolbarTitle:"Popular Places",toolbarItemLabel:"places",onPageChange:h,onPageSizeChange:I=>{p(I),h(1)}},resultsClassName:v==="grid"?"grid gap-4 sm:grid-cols-2 xl:grid-cols-3":"grid gap-4",children:o?e.jsx(ua,{totalColumns:d}):L.length?L.map(I=>e.jsx(VP,{id:I.id,name:I.name,type:I.type,city:I.city,country:I.country,shortDescription:I.shortDescription,services:I.services,tags:I.tags,rating:I.rating,reviewCount:I.reviewCount,website:I.website,isFeatured:I.isFeatured,viewMode:v},I.id)):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(Te,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No places found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters."}),e.jsx(P,{variant:"outline",onClick:()=>w({type:[],country:[],city:[],services:[],tags:[],signals:[]}),children:"Clear all filters"})]})})},UP={Low:"bg-gaming-success/10 text-gaming-success",Medium:"bg-gaming-warning/10 text-gaming-warning",High:"bg-destructive/10 text-destructive"},_P=({slug:t,name:a,parentCategory:s,description:r,vendorCount:i,productCount:o,jobCount:l,complianceLevel:c,tags:h=[],isFeatured:d=!1,isTrending:p=!1,subcategories:g=[],topCompanies:y=[]})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card cursor-pointer",onClick:()=>window.location.replace(`/product-categories/${t}`),children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[e.jsx(q,{variant:"secondary",children:s}),e.jsxs(q,{className:UP[c],children:[c," Compliance"]}),d&&e.jsx(q,{className:"bg-primary text-primary-foreground",children:"Featured"}),p&&e.jsx(q,{variant:"accent",children:"Trending"})]}),e.jsx("h3",{className:"mb-2 text-lg font-semibold text-foreground",children:a}),e.jsx("p",{className:"mb-3 line-clamp-2 text-sm text-muted-foreground",children:r}),e.jsxs("div",{className:"mb-3 flex flex-wrap gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Me,{className:"h-3.5 w-3.5"}),i," vendors"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(No,{className:"h-3.5 w-3.5"}),o," products"]}),l!==void 0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(je,{className:"h-3.5 w-3.5"}),l," jobs"]})]}),g.length>0&&e.jsxs("div",{className:"mb-3 flex flex-wrap gap-1.5",children:[g.slice(0,3).map(u=>e.jsx(q,{variant:"outline",className:"text-xs",children:u.name},u.slug)),g.length>3&&e.jsxs(q,{variant:"outline",className:"text-xs text-muted-foreground",children:["+",g.length-3]})]}),y.length>0&&e.jsxs("div",{className:"mb-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Top vendors:"}),e.jsxs("p",{className:"text-xs font-medium text-foreground",children:[y.slice(0,3).map(u=>u.name).join(", "),y.length>3&&` +${y.length-3} more`]})]}),e.jsxs(P,{variant:"outline",size:"sm",className:"w-full",onClick:u=>{u.stopPropagation(),window.location.replace(`/product-categories/${t}`)},children:[e.jsx(fa,{className:"mr-1.5 h-3.5 w-3.5"})," Explore Category"]})]}),zN=[{id:"pc-1",slug:"platform-pam",name:"Platform (PAM)",parentCategory:"Core Platform",description:"Player Account Management — the operating system for online gambling businesses.",longDescription:"A PAM (Player Account Management) platform is the core backend system that powers an online gambling operation. It manages player registration, wallets, KYC, game integrations, bonus engines, and regulatory reporting. PAM providers are the backbone of the iGaming B2B stack, enabling operators to launch and run their businesses across multiple jurisdictions.",synonyms:["Player Account Management","PAM","iGaming Platform","Operator Platform"],subcategories:[{name:"Full-Stack PAM",slug:"full-stack-pam",description:"End-to-end platform covering all operator needs"},{name:"White-Label Solutions",slug:"white-label",description:"Turnkey operator launch packages"},{name:"Modular PAM",slug:"modular-pam",description:"Component-based platforms for custom builds"}],vendorCount:38,productCount:52,jobCount:245,complianceLevel:"High",tags:["platform","pam","operator","backend"],lastUpdated:"2026-02-15",isFeatured:!0,topCompanies:[{name:"SOFTSWISS",slug:"softswiss",offeringsStrength:"core"},{name:"EveryMatrix",slug:"everymatrix",offeringsStrength:"core"},{name:"Aspire Global",slug:"aspire-global",offeringsStrength:"core"},{name:"GiG",slug:"gig",offeringsStrength:"core"}],sampleJobs:[{title:"Platform Engineer",company:"SOFTSWISS",location:"Malta",slug:"platform-engineer-softswiss"},{title:"Integration Manager",company:"EveryMatrix",location:"Remote",slug:"integration-manager-everymatrix"}],keySkills:[{name:"Microservices Architecture",demandLevel:"High"},{name:"API Design",demandLevel:"High"},{name:"Multi-tenancy",demandLevel:"Medium"},{name:"Regulatory Compliance",demandLevel:"High"}],relatedCategories:[{name:"Sportsbook",slug:"sportsbook"},{name:"Payments",slug:"payments"},{name:"Casino Games / Studios",slug:"casino-games"}]},{id:"pc-2",slug:"sportsbook",name:"Sportsbook",parentCategory:"Core Platform",description:"Odds, trading, risk management, and real-time bet settlement stack.",longDescription:"Sportsbook platforms power the sports betting vertical, handling odds compilation, live trading, risk management, bet settlement, and feed integrations. The category spans full sportsbook solutions, odds feed providers, and specialized trading tools used by operators to manage their sports betting products.",synonyms:["Sports Betting Platform","Betting Engine","Trading Platform"],subcategories:[{name:"Full Sportsbook",slug:"full-sportsbook",description:"End-to-end sports betting solution"},{name:"Odds Feed",slug:"odds-feed",description:"Data feeds for pre-match and live odds"},{name:"Trading Tools",slug:"trading-tools",description:"Risk and liability management systems"},{name:"Bet Builder",slug:"bet-builder",description:"Same-game multi and custom bet construction"}],vendorCount:42,productCount:68,jobCount:312,complianceLevel:"High",tags:["sportsbook","risk","trading","odds"],lastUpdated:"2026-01-22",isTrending:!0,isFeatured:!0,topCompanies:[{name:"Kambi",slug:"kambi",offeringsStrength:"core"},{name:"Sportradar",slug:"sportradar",offeringsStrength:"core"},{name:"Betgenius",slug:"betgenius",offeringsStrength:"core"}],sampleJobs:[{title:"Sportsbook Trader",company:"Kambi",location:"Malta",slug:"sportsbook-trader-kambi"},{title:"Sports Data Analyst",company:"Sportradar",location:"London",slug:"sports-data-analyst"}],keySkills:[{name:"Odds Compilation",demandLevel:"High"},{name:"Risk Management",demandLevel:"High"},{name:"Real-time Data Processing",demandLevel:"High"},{name:"Sports Knowledge",demandLevel:"Medium"}],relatedCategories:[{name:"Platform (PAM)",slug:"platform-pam"},{name:"Data / Analytics",slug:"data-analytics"},{name:"Fraud / Risk",slug:"fraud-risk"}]},{id:"pc-3",slug:"casino-games",name:"Casino Games / Studios",parentCategory:"Content",description:"Slots, table games, and specialty game development studios.",longDescription:"Casino game studios create the content that drives the online casino vertical — slots, table games, crash games, and specialty titles. This category encompasses both large studios producing hundreds of titles annually and boutique studios focused on innovative mechanics and premium experiences.",synonyms:["Game Provider","Slot Studio","RNG Games","Casino Content"],subcategories:[{name:"Slots",slug:"slots",description:"Online slot machine games"},{name:"Table Games",slug:"table-games",description:"Digital versions of casino table games"},{name:"Crash / Instant Games",slug:"crash-games",description:"Fast-paced multiplier games"}],vendorCount:85,productCount:420,jobCount:580,complianceLevel:"Medium",tags:["casino","games","slots","studio"],lastUpdated:"2026-02-18",isFeatured:!0,isTrending:!0,topCompanies:[{name:"Evolution",slug:"evolution",offeringsStrength:"core"},{name:"Pragmatic Play",slug:"pragmatic-play",offeringsStrength:"core"},{name:"Play'n GO",slug:"playngo",offeringsStrength:"core"},{name:"Push Gaming",slug:"push-gaming",offeringsStrength:"core"}],sampleJobs:[{title:"Game Mathematician",company:"Pragmatic Play",location:"Malta",slug:"game-mathematician"},{title:"2D Game Artist",company:"Push Gaming",location:"London",slug:"game-artist"}],keySkills:[{name:"Game Mathematics",demandLevel:"High"},{name:"2D/3D Art & Animation",demandLevel:"High"},{name:"Unity / HTML5",demandLevel:"High"},{name:"Game Design",demandLevel:"Medium"}],relatedCategories:[{name:"Live Casino",slug:"live-casino"},{name:"Aggregation",slug:"aggregation"}]},{id:"pc-4",slug:"live-casino",name:"Live Casino",parentCategory:"Content",description:"Real-time streamed dealer games with studio operations and streaming tech.",longDescription:"Live casino providers operate physical studios with real dealers, streaming table games (blackjack, roulette, baccarat, game shows) to players in real-time. This combines broadcast technology, studio operations, dealer management, and specialized game mechanics.",synonyms:["Live Dealer","Live Gaming","Live Streaming Casino"],subcategories:[{name:"Live Table Games",slug:"live-tables",description:"Classic dealer-operated table games"},{name:"Game Shows",slug:"game-shows",description:"Entertainment-style live games"},{name:"Studio Technology",slug:"studio-tech",description:"Streaming and studio infrastructure"}],vendorCount:18,productCount:95,jobCount:890,complianceLevel:"Medium",tags:["live-casino","streaming","dealers"],lastUpdated:"2026-02-12",isTrending:!0,topCompanies:[{name:"Evolution",slug:"evolution",offeringsStrength:"core"},{name:"Pragmatic Play Live",slug:"pragmatic-play",offeringsStrength:"core"},{name:"Playtech Live",slug:"playtech",offeringsStrength:"core"}],sampleJobs:[{title:"Live Casino Dealer",company:"Evolution",location:"Riga",slug:"live-dealer-riga"},{title:"Studio Manager",company:"Evolution",location:"Malta",slug:"studio-manager"}],keySkills:[{name:"Broadcast Operations",demandLevel:"High"},{name:"Studio Management",demandLevel:"Medium"},{name:"Customer Interaction",demandLevel:"High"}],relatedCategories:[{name:"Casino Games / Studios",slug:"casino-games"},{name:"Aggregation",slug:"aggregation"}]},{id:"pc-5",slug:"aggregation",name:"Aggregation",parentCategory:"Content",description:"Unified API layer for slots, live casino, and jackpots from multiple studios.",longDescription:"Game aggregators provide a single API integration point that gives operators access to thousands of games from hundreds of studios. They handle content management, regulatory filtering, wallet transactions, and promotional tools across the entire game portfolio.",synonyms:["Casino Aggregator","Content Aggregator","Game Hub","GAP"],subcategories:[{name:"Game Aggregation Platform",slug:"gap",description:"Multi-provider API hub"},{name:"Content Management",slug:"content-mgmt",description:"Game portfolio curation tools"}],vendorCount:35,productCount:77,jobCount:120,complianceLevel:"Medium",tags:["aggregation","api","content"],lastUpdated:"2026-02-05",topCompanies:[{name:"SoftSwiss",slug:"softswiss",offeringsStrength:"core"},{name:"EveryMatrix",slug:"everymatrix",offeringsStrength:"core"},{name:"Pariplay",slug:"pariplay",offeringsStrength:"core"}],sampleJobs:[{title:"Integration Engineer",company:"Pariplay",location:"Gibraltar",slug:"integration-engineer"}],keySkills:[{name:"API Integration",demandLevel:"High"},{name:"Multi-vendor Management",demandLevel:"Medium"}],relatedCategories:[{name:"Casino Games / Studios",slug:"casino-games"},{name:"Platform (PAM)",slug:"platform-pam"}]},{id:"pc-6",slug:"payments",name:"Payments",parentCategory:"Operations",description:"Payment processing, payouts, crypto, and chargeback management for iGaming.",longDescription:"Payment solutions for iGaming cover the full lifecycle from deposit to withdrawal — PSPs, payment orchestration, crypto processing, payout automation, and chargeback management. The category is heavily regulated and requires deep knowledge of jurisdiction-specific payment method preferences.",synonyms:["PSP","Payment Service Provider","Payment Gateway","Cashier"],subcategories:[{name:"PSP",slug:"psp",description:"Payment service providers for deposit/withdrawal"},{name:"Payout Solutions",slug:"payouts",description:"Automated withdrawal and cashout systems"},{name:"Crypto Payments",slug:"crypto",description:"Cryptocurrency deposit and withdrawal"},{name:"Chargebacks",slug:"chargebacks",description:"Fraud-related payment dispute management"}],vendorCount:55,productCount:82,jobCount:195,complianceLevel:"High",tags:["payments","psp","crypto","fintech"],lastUpdated:"2026-02-08",isFeatured:!0,topCompanies:[{name:"Nuvei",slug:"nuvei",offeringsStrength:"core"},{name:"Trustly",slug:"trustly",offeringsStrength:"core"},{name:"Praxis Tech",slug:"praxis-tech",offeringsStrength:"core"}],sampleJobs:[{title:"Payments Manager",company:"Entain",location:"London",slug:"payments-manager"},{title:"Payment Integration Developer",company:"Nuvei",location:"Remote",slug:"payment-dev"}],keySkills:[{name:"Payment Processing",demandLevel:"High"},{name:"PCI DSS",demandLevel:"High"},{name:"Anti-fraud",demandLevel:"High"},{name:"Crypto/Blockchain",demandLevel:"Medium"}],relatedCategories:[{name:"Fraud / Risk",slug:"fraud-risk"},{name:"KYC / AML",slug:"kyc-aml"},{name:"Platform (PAM)",slug:"platform-pam"}]},{id:"pc-7",slug:"kyc-aml",name:"KYC / AML",parentCategory:"Compliance",description:"Identity verification, sanctions screening, and ongoing AML monitoring.",longDescription:"KYC (Know Your Customer) and AML (Anti-Money Laundering) solutions are critical for regulatory compliance in iGaming. They cover identity verification, document checking, sanctions/PEP screening, source of funds/wealth checks, and ongoing transaction monitoring.",synonyms:["Know Your Customer","Anti-Money Laundering","Identity Verification","IDV"],subcategories:[{name:"Identity Verification",slug:"idv",description:"Document and biometric identity checks"},{name:"Screening",slug:"screening",description:"Sanctions, PEP, and adverse media screening"},{name:"Transaction Monitoring",slug:"transaction-monitoring",description:"Ongoing AML surveillance"}],vendorCount:28,productCount:41,jobCount:310,complianceLevel:"High",tags:["kyc","aml","compliance","verification"],lastUpdated:"2025-12-11",isFeatured:!0,topCompanies:[{name:"Sumsub",slug:"sumsub",offeringsStrength:"core"},{name:"Jumio",slug:"jumio",offeringsStrength:"core"},{name:"GBG",slug:"gbg",offeringsStrength:"core"}],sampleJobs:[{title:"AML Analyst",company:"Entain",location:"London",slug:"aml-analyst-entain"},{title:"KYC Operations Lead",company:"Betsson",location:"Malta",slug:"kyc-lead"}],keySkills:[{name:"AML Regulations",demandLevel:"High"},{name:"Risk Assessment",demandLevel:"High"},{name:"Document Verification",demandLevel:"Medium"},{name:"SAR/STR Reporting",demandLevel:"High"}],relatedCategories:[{name:"Fraud / Risk",slug:"fraud-risk"},{name:"Compliance / Legal Tech",slug:"compliance-legaltech"}]},{id:"pc-8",slug:"fraud-risk",name:"Fraud / Risk",parentCategory:"Compliance",description:"Fraud prevention, bonus abuse detection, and real-time risk scoring.",longDescription:"Fraud and risk management solutions protect iGaming operators from financial losses due to fraudulent activity, multi-accounting, bonus abuse, collusion, and match-fixing. They employ machine learning, behavioral analytics, and device fingerprinting to detect and prevent threats in real-time.",synonyms:["Fraud Prevention","Risk Management","Anti-Fraud"],subcategories:[{name:"Fraud Detection",slug:"fraud-detection",description:"Real-time fraud scoring and alerts"},{name:"Bonus Abuse Prevention",slug:"bonus-abuse",description:"Multi-account and promo abuse detection"},{name:"Device Fingerprinting",slug:"device-fingerprint",description:"Device and browser identification"}],vendorCount:22,productCount:34,jobCount:185,complianceLevel:"High",tags:["fraud","risk","security","ml"],lastUpdated:"2026-01-28",topCompanies:[{name:"Featurespace",slug:"featurespace",offeringsStrength:"core"},{name:"SEON",slug:"seon",offeringsStrength:"core"}],sampleJobs:[{title:"Fraud Analyst",company:"Flutter",location:"Dublin",slug:"fraud-analyst"}],keySkills:[{name:"Machine Learning",demandLevel:"High"},{name:"Behavioral Analytics",demandLevel:"High"},{name:"Pattern Recognition",demandLevel:"Medium"}],relatedCategories:[{name:"KYC / AML",slug:"kyc-aml"},{name:"Payments",slug:"payments"}]},{id:"pc-9",slug:"crm-cdp",name:"CRM / CDP",parentCategory:"Operations",description:"Player lifecycle messaging, segmentation, bonuses, and personalization.",longDescription:"CRM (Customer Relationship Management) and CDP (Customer Data Platform) solutions for iGaming manage the entire player lifecycle — from acquisition through retention. They handle segmentation, automated campaigns, bonus management, real-time personalization, and churn prediction.",synonyms:["Customer Relationship Management","Customer Data Platform","Player CRM","Retention Platform"],subcategories:[{name:"Segmentation",slug:"segmentation",description:"Player cohort and behavior analysis"},{name:"Bonus Engine",slug:"bonus-engine",description:"Promotion and bonus management"},{name:"Messaging",slug:"messaging",description:"Omnichannel player communications"},{name:"Personalization",slug:"personalization",description:"Real-time content and offer personalization"}],vendorCount:39,productCount:59,jobCount:280,complianceLevel:"Low",tags:["crm","retention","personalization","bonuses"],lastUpdated:"2026-02-10",topCompanies:[{name:"Optimove",slug:"optimove",offeringsStrength:"core"},{name:"Fast Track",slug:"fast-track",offeringsStrength:"core"}],sampleJobs:[{title:"CRM Manager",company:"Betsson",location:"Malta",slug:"crm-manager"},{title:"Retention Specialist",company:"LeoVegas",location:"Stockholm",slug:"retention-specialist"}],keySkills:[{name:"Player Segmentation",demandLevel:"High"},{name:"Campaign Automation",demandLevel:"High"},{name:"Data Analysis",demandLevel:"High"},{name:"A/B Testing",demandLevel:"Medium"}],relatedCategories:[{name:"Data / Analytics",slug:"data-analytics"},{name:"Affiliates",slug:"affiliates"}]},{id:"pc-10",slug:"affiliates",name:"Affiliates",parentCategory:"Marketing",description:"Performance attribution, affiliate management, and campaign analytics.",longDescription:"Affiliate platforms and networks connect iGaming operators with marketing affiliates who drive player traffic. The category covers tracking platforms, affiliate management systems, reporting tools, and compliance monitoring for affiliate marketing activities.",synonyms:["Affiliate Marketing","Affiliate Tracking","Partner Management"],subcategories:[{name:"Tracking Platform",slug:"tracking",description:"Click and conversion attribution"},{name:"Affiliate Network",slug:"affiliate-network",description:"Marketplace connecting affiliates and operators"},{name:"Compliance Monitoring",slug:"affiliate-compliance",description:"Regulatory compliance for affiliate content"}],vendorCount:31,productCount:52,jobCount:220,complianceLevel:"Medium",tags:["affiliate","analytics","marketing","performance"],lastUpdated:"2025-11-29",topCompanies:[{name:"Income Access",slug:"income-access",offeringsStrength:"core"},{name:"Affilka by SOFTSWISS",slug:"softswiss",offeringsStrength:"secondary"}],sampleJobs:[{title:"Affiliate Manager",company:"Entain",location:"London",slug:"affiliate-manager"}],keySkills:[{name:"Affiliate Management",demandLevel:"High"},{name:"Performance Marketing",demandLevel:"High"},{name:"Negotiation",demandLevel:"Medium"}],relatedCategories:[{name:"CRM / CDP",slug:"crm-cdp"},{name:"Data / Analytics",slug:"data-analytics"}]},{id:"pc-11",slug:"data-analytics",name:"Data / Analytics",parentCategory:"Operations",description:"Business intelligence, player analytics, and data warehousing for iGaming.",longDescription:"Data and analytics solutions provide iGaming operators with business intelligence, player behavior analysis, real-time dashboards, and data infrastructure. This includes BI tools, data warehouses, predictive analytics, and specialized gaming analytics platforms.",synonyms:["Business Intelligence","BI","Player Analytics","Data Platform"],subcategories:[{name:"BI & Dashboards",slug:"bi-dashboards",description:"Reporting and visualization tools"},{name:"Player Analytics",slug:"player-analytics",description:"Behavioral analysis and segmentation"},{name:"Data Infrastructure",slug:"data-infra",description:"Warehousing and pipeline tools"}],vendorCount:26,productCount:38,jobCount:340,complianceLevel:"Low",tags:["analytics","data","bi","ml"],lastUpdated:"2026-02-01",topCompanies:[{name:"Sportradar",slug:"sportradar",offeringsStrength:"secondary"}],sampleJobs:[{title:"Data Engineer",company:"Flutter",location:"Dublin",slug:"data-engineer"},{title:"BI Analyst",company:"Kindred",location:"Malta",slug:"bi-analyst"}],keySkills:[{name:"SQL",demandLevel:"High"},{name:"Python",demandLevel:"High"},{name:"Data Modeling",demandLevel:"High"},{name:"Visualization (Tableau/Looker)",demandLevel:"Medium"}],relatedCategories:[{name:"CRM / CDP",slug:"crm-cdp"},{name:"Fraud / Risk",slug:"fraud-risk"}]},{id:"pc-12",slug:"compliance-legaltech",name:"Compliance / Legal Tech",parentCategory:"Compliance",description:"Regulatory reporting, responsible gaming tools, and compliance automation.",longDescription:"Compliance and legal technology solutions help iGaming operators meet regulatory requirements across jurisdictions. This includes responsible gaming tools (affordability checks, self-exclusion), regulatory reporting automation, license management, and compliance workflow platforms.",synonyms:["RegTech","Responsible Gaming","Compliance Automation"],subcategories:[{name:"Responsible Gaming",slug:"responsible-gaming",description:"Player protection and intervention tools"},{name:"Regulatory Reporting",slug:"reg-reporting",description:"Automated regulatory submission systems"},{name:"License Management",slug:"license-mgmt",description:"Multi-jurisdiction license tracking"}],vendorCount:24,productCount:36,jobCount:290,complianceLevel:"High",tags:["compliance","responsible-gaming","regtech"],lastUpdated:"2026-01-31",isTrending:!0,topCompanies:[{name:"Neccton",slug:"neccton",offeringsStrength:"core"},{name:"BetBuddy",slug:"betbuddy",offeringsStrength:"core"}],sampleJobs:[{title:"Compliance Officer",company:"Entain",location:"London",slug:"compliance-officer"},{title:"Responsible Gaming Analyst",company:"Flutter",location:"Dublin",slug:"rg-analyst"}],keySkills:[{name:"Regulatory Knowledge",demandLevel:"High"},{name:"Risk Assessment",demandLevel:"High"},{name:"Reporting & Documentation",demandLevel:"Medium"}],relatedCategories:[{name:"KYC / AML",slug:"kyc-aml"},{name:"Fraud / Risk",slug:"fraud-risk"}]},{id:"pc-13",slug:"hosting-infrastructure",name:"Hosting / Infrastructure",parentCategory:"Infrastructure",description:"Cloud hosting, CDN, and managed infrastructure for regulated iGaming workloads.",longDescription:"Hosting and infrastructure providers offer cloud, co-location, and managed services specifically designed for the iGaming industry's requirements — including data residency compliance, DDoS protection, low-latency game delivery, and regulatory-approved hosting environments.",synonyms:["Cloud Hosting","iGaming Hosting","Managed Infrastructure"],subcategories:[{name:"Cloud Hosting",slug:"cloud-hosting",description:"Regulated cloud environments"},{name:"CDN",slug:"cdn",description:"Content delivery for game assets and streaming"},{name:"DDoS Protection",slug:"ddos",description:"Security against denial-of-service attacks"}],vendorCount:15,productCount:22,jobCount:85,complianceLevel:"Medium",tags:["hosting","cloud","infrastructure","devops"],lastUpdated:"2026-01-15",topCompanies:[{name:"Continent 8",slug:"continent-8",offeringsStrength:"core"}],sampleJobs:[{title:"DevOps Engineer",company:"Continent 8",location:"London",slug:"devops-engineer"}],keySkills:[{name:"Cloud Architecture (AWS/GCP)",demandLevel:"High"},{name:"Kubernetes",demandLevel:"High"},{name:"Network Security",demandLevel:"Medium"}],relatedCategories:[{name:"Platform (PAM)",slug:"platform-pam"}]}],$P=[{value:"popularity",label:"Most popular"},{value:"vendors",label:"Most vendors"},{value:"jobs",label:"Most jobs"},{value:"name",label:"Name (A-Z)"}],WP=["Payments","KYC / AML","Platform (PAM)","Sportsbook","Casino Games / Studios","CRM / CDP","Affiliates","Fraud / Risk"],qN={parentCategory:[],complianceLevel:[],tags:[],signals:[]},ZP=({apiUrl:t,categoriesData:a,productCategoriesData:s,itemsPerPage:r=9})=>{const[i,o]=m.useState(a??s??[]),[l,c]=m.useState(!(a??s)),[h,d]=m.useState(1),[p,g]=m.useState(r),[y,u]=m.useState(""),[x,v]=m.useState("popularity"),[f,k]=m.useState("grid"),[w,j]=m.useState(qN);m.useEffect(()=>{if(a||s){o(a??s??[]),c(!1);return}let C=!0;const M=async()=>{try{if(!t){C&&o(zN);return}const R=await fetch(t);if(!R.ok)throw new Error(`${R.status}`);const D=await R.json();C&&Array.isArray(D)&&o(D)}catch{C&&o(zN)}finally{C&&c(!1)}};return c(!0),M(),()=>{C=!1}},[t,a,s]);const b=m.useMemo(function(){const C=M=>Array.from(new Set(M)).sort();return[{key:"parentCategory",label:"Pillar",type:"checkbox",options:C(i.map(M=>M.parentCategory)).map(M=>({value:M,label:M}))},{key:"complianceLevel",label:"Compliance Level",type:"checkbox",options:C(i.map(M=>M.complianceLevel)).map(M=>({value:M,label:M}))},{key:"tags",label:"Tags",type:"checkbox",searchable:!0,options:C(i.flatMap(M=>M.tags)).map(M=>({value:M,label:M}))},{key:"signals",label:"Signals",type:"toggle",options:[{value:"featured",label:"Featured only"},{value:"trending",label:"Trending only"}]}]},[i]),T=m.useMemo(()=>Object.entries(w).flatMap(([C,M])=>M.map(R=>({key:C,label:C.charAt(0).toUpperCase()+C.slice(1),value:R,onRemove:()=>j(D=>({...D,[C]:(D[C]??[]).filter(H=>H!==R)}))}))),[w]),S=m.useMemo(()=>{const C=y.trim().toLowerCase();return i.filter(M=>!(C&&!`${M.name} ${M.description} ${M.parentCategory} ${M.synonyms.join(" ")}`.toLowerCase().includes(C)||w.parentCategory.length&&!w.parentCategory.includes(M.parentCategory)||w.complianceLevel.length&&!w.complianceLevel.includes(M.complianceLevel)||w.tags.length&&!w.tags.every(R=>M.tags.includes(R))||w.signals.includes("featured")&&!M.isFeatured||w.signals.includes("trending")&&!M.isTrending))},[i,w,y]),N=m.useMemo(()=>{const C=[...S];return C.sort((M,R)=>{switch(x){case"vendors":return R.vendorCount-M.vendorCount;case"jobs":return R.jobCount-M.jobCount;case"name":return M.name.localeCompare(R.name);default:return R.vendorCount+R.productCount-(M.vendorCount+M.productCount)}}),C},[S,x]);m.useEffect(()=>{d(1)},[y,w,p]);const L=Math.max(1,Math.ceil(N.length/p)),I=N.slice((h-1)*p,h*p),A=()=>j(qN);return e.jsx(ja,{title:"Product Categories",description:"Explore the iGaming B2B technology stack — platforms, content, payments, compliance, and more.",headerPopularTags:WP,search:{value:y,onChange:u,onSubmit:u,onClear:()=>u(""),placeholder:"Search categories or synonyms (e.g. PAM, PSP)"},filters:b,filterValues:w,onFilterChange:(C,M)=>j(R=>({...R,[C]:M})),onClearFilters:A,activeFilters:T,sort:{value:x,options:$P,onChange:v},viewMode:f,onViewModeChange:k,pagination:{page:h,pageSize:p,totalPages:L,totalCount:N.length,toolbarTotalCount:i.length,toolbarTitle:"B2B Stack Categories",toolbarItemLabel:"categories",onPageChange:d,onPageSizeChange:C=>{g(C),d(1)}},resultsClassName:f==="grid"?"grid gap-4 sm:grid-cols-2 xl:grid-cols-3":"grid gap-4",children:l?e.jsx(ua,{totalColumns:p}):I.length?I.map(C=>e.jsx(_P,{id:C.id,slug:C.slug,name:C.name,parentCategory:C.parentCategory,description:C.description,vendorCount:C.vendorCount,productCount:C.productCount,jobCount:C.jobCount,complianceLevel:C.complianceLevel,tags:C.tags,isFeatured:C.isFeatured,isTrending:C.isTrending,subcategories:C.subcategories,topCompanies:C.topCompanies,viewMode:f},C.id)):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(mo,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No categories found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters."}),e.jsx(P,{variant:"outline",onClick:A,children:"Clear all filters"})]})})},JP={core:"bg-gaming-success/10 text-gaming-success border-gaming-success/20",secondary:"bg-gaming-warning/10 text-gaming-warning border-gaming-warning/20",emerging:"bg-accent/10 text-accent border-accent/20"},YP={High:"text-gaming-success",Medium:"text-gaming-warning",Low:"text-muted-foreground"},KP=({category:t,onNavigate:a})=>e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(At,{className:"w-5 h-5 text-accent"})," What is ",t.name,"?"]})}),e.jsx(_,{children:e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:t.longDescription})})]}),t.subcategories.length>0&&e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(fo,{className:"w-5 h-5 text-accent"})," Subcategories"]})}),e.jsx(_,{children:e.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:t.subcategories.map(s=>e.jsxs("div",{className:"p-3 rounded-lg border border-border/50",children:[e.jsx("p",{className:"text-sm font-medium text-foreground mb-1",children:s.name}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s.description})]},s.slug))})})]}),t.topCompanies.length>0&&e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(Me,{className:"w-5 h-5 text-accent"})," Top Companies Offering ",t.name]})}),e.jsxs(_,{children:[e.jsx("div",{className:"space-y-3",children:t.topCompanies.map((s,r)=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border border-border/50 hover:bg-secondary/50 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"w-6 h-6 rounded-full bg-accent/10 flex items-center justify-center text-xs font-bold text-accent",children:r+1}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:s.name})]}),e.jsx(q,{variant:"outline",className:`text-xs ${JP[s.offeringsStrength]}`,children:s.offeringsStrength})]},s.slug))}),e.jsxs(P,{variant:"outline",size:"sm",className:"w-full mt-4 gap-1.5",onClick:()=>a("/companies"),children:["View all ",t.name," companies ",e.jsx(qt,{className:"w-3.5 h-3.5"})]})]})]}),t.sampleJobs.length>0&&e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(je,{className:"w-5 h-5 text-gaming-success"})," Jobs Hiring in ",t.name,e.jsxs(q,{variant:"secondary",className:"text-xs ml-auto",children:[t.jobCount," total"]})]})}),e.jsxs(_,{children:[e.jsx("div",{className:"space-y-3",children:t.sampleJobs.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border border-border/50",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:s.title}),e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-2",children:[e.jsx(Me,{className:"w-3 h-3"})," ",s.company,e.jsx(Te,{className:"w-3 h-3 ml-1"})," ",s.location]})]}),e.jsx(P,{variant:"ghost",size:"sm",className:"text-accent",children:"View →"})]},s.slug))}),e.jsxs(P,{variant:"outline",size:"sm",className:"w-full mt-4 gap-1.5",onClick:()=>a("/jobs"),children:["Browse all ",t.name," jobs ",e.jsx(qt,{className:"w-3.5 h-3.5"})]})]})]}),t.keySkills.length>0&&e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(ha,{className:"w-5 h-5 text-gaming-gold"})," Skills to Work in ",t.name]})}),e.jsxs(_,{children:[e.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:t.keySkills.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border border-border/50",children:[e.jsx("span",{className:"text-sm font-medium text-foreground",children:s.name}),e.jsxs("span",{className:`text-xs font-medium ${YP[s.demandLevel]}`,children:[e.jsx(Cs,{className:"w-3 h-3 inline mr-0.5"}),s.demandLevel," demand"]})]},s.name))}),e.jsxs(P,{variant:"outline",size:"sm",className:"w-full mt-4 gap-1.5",onClick:()=>a("/courses"),children:["Browse related courses ",e.jsx(qt,{className:"w-3.5 h-3.5"})]})]})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(U,{children:e.jsxs(_,{className:"p-4 space-y-3",children:[e.jsx("h3",{className:"font-semibold text-foreground",children:"Category Info"}),e.jsx(co,{label:"Pillar",value:t.parentCategory}),e.jsx(co,{label:"Vendors",value:t.vendorCount.toString()}),e.jsx(co,{label:"Products",value:t.productCount.toString()}),e.jsx(co,{label:"Active Jobs",value:t.jobCount.toString()}),e.jsx(co,{label:"Compliance",value:t.complianceLevel}),e.jsx(co,{label:"Last Updated",value:t.lastUpdated}),t.synonyms.length>0&&e.jsxs("div",{className:"pt-2 border-t border-border/50",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Synonyms"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:t.synonyms.map(s=>e.jsx(q,{variant:"outline",className:"text-xs",children:s},s))})]})]})}),t.relatedCategories.length>0&&e.jsx(U,{children:e.jsxs(_,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold text-foreground flex items-center gap-2",children:[e.jsx(fo,{className:"w-4 h-4 text-accent"})," Related Categories"]}),t.relatedCategories.map(s=>e.jsxs(P,{variant:"outline",size:"sm",className:"w-full justify-start gap-2",onClick:()=>a(`/product-categories/${s.slug}`),children:[e.jsx(mo,{className:"w-3.5 h-3.5"})," ",s.name]},s.slug))]})}),e.jsx(U,{children:e.jsxs(_,{className:"p-4 space-y-3",children:[e.jsx("h3",{className:"font-semibold text-foreground",children:"Tags"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.tags.map(s=>e.jsxs(q,{variant:"secondary",className:"text-xs",children:["#",s]},s))})]})})]})]})}),co=({label:t,value:a})=>e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:t}),e.jsx("span",{className:"text-foreground font-medium text-right max-w-[60%]",children:a})]}),FN={Regulated:"bg-gaming-success/10 text-gaming-success",Restricted:"bg-destructive/10 text-destructive",Emerging:"bg-gaming-warning/10 text-gaming-warning"},HN={positive:"bg-gaming-success/10 text-gaming-success border-gaming-success/20",neutral:"bg-secondary text-muted-foreground border-border",warning:"bg-gaming-warning/10 text-gaming-warning border-gaming-warning/20"},Rl={Low:"text-muted-foreground",Medium:"text-gaming-warning",High:"text-gaming-success"},XP=({market:t,viewMode:a="grid"})=>a==="list"?e.jsx(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card cursor-pointer",onClick:()=>window.location.replace(`/markets/${t.slug}`),children:e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-1",children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground",children:t.name}),e.jsx(q,{variant:"secondary",className:"text-xs",children:t.region}),e.jsx(q,{className:`text-xs ${FN[t.status]}`,children:t.status}),t.isFeatured&&e.jsx(q,{className:"bg-primary text-primary-foreground text-xs",children:"Featured"})]}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mb-2",children:t.overview}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.badges.map(s=>e.jsx(q,{variant:"outline",className:`text-xs ${HN[s.type]}`,children:s.label},s.label))})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4 text-center sm:min-w-[280px]",children:[e.jsx(fM,{icon:je,label:"Jobs",value:t.stats.jobsCount.toLocaleString()}),e.jsx(fM,{icon:Me,label:"Companies",value:t.stats.companiesCount.toLocaleString()}),e.jsx(fM,{icon:so,label:"Remote",value:`${t.stats.remoteRatio}%`})]})]})}):e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card cursor-pointer group",onClick:()=>window.location.replace(`/markets/${t.slug}`),children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[e.jsx(q,{variant:"secondary",className:"text-xs",children:t.region}),e.jsx(q,{className:`text-xs ${FN[t.status]}`,children:t.status}),t.isFeatured&&e.jsx(q,{className:"bg-primary text-primary-foreground text-xs",children:"Featured"})]}),e.jsx("h3",{className:"mb-1 text-lg font-semibold text-foreground group-hover:text-accent transition-colors",children:t.name}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 mb-3 py-2 border-y border-border/50",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-bold text-foreground",children:t.stats.jobsCount.toLocaleString()}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Jobs"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-bold text-foreground",children:t.stats.companiesCount.toLocaleString()}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Companies"})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-lg font-bold text-foreground",children:[t.stats.remoteRatio,"%"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Remote"})]})]}),e.jsxs("div",{className:"flex gap-4 mb-3 text-xs",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Cs,{className:`h-3.5 w-3.5 ${Rl[t.stats.hiringIntensity]}`}),e.jsx("span",{className:"text-muted-foreground",children:"Hiring:"}),e.jsx("span",{className:`font-medium ${Rl[t.stats.hiringIntensity]}`,children:t.stats.hiringIntensity})]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Kt,{className:`h-3.5 w-3.5 ${Rl[t.stats.complianceIntensity]}`}),e.jsx("span",{className:"text-muted-foreground",children:"Compliance:"}),e.jsx("span",{className:`font-medium ${Rl[t.stats.complianceIntensity]}`,children:t.stats.complianceIntensity})]})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-3",children:t.badges.slice(0,3).map(s=>e.jsx(q,{variant:"outline",className:`text-xs ${HN[s.type]}`,children:s.label},s.label))}),t.trendingRoles[0]&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx($e,{className:"h-3 w-3 text-gaming-success"}),e.jsxs("span",{children:["Trending: ",e.jsx("strong",{className:"text-foreground",children:t.trendingRoles[0].roleFamily})]}),e.jsxs("span",{className:"text-gaming-success",children:["+",t.trendingRoles[0].changePercent,"%"]})]})]}),fM=({icon:t,label:a,value:s})=>e.jsxs("div",{children:[e.jsx(t,{className:"h-4 w-4 mx-auto mb-0.5 text-muted-foreground"}),e.jsx("p",{className:"text-sm font-bold text-foreground",children:s}),e.jsx("p",{className:"text-xs text-muted-foreground",children:a})]}),zM=[{id:"mk-malta",slug:"malta",name:"Malta",region:"Europe",countries:["Malta"],cities:["Sliema","St. Julian's","Birkirkara"],status:"Regulated",verticals:["Casino","Sportsbook","Poker","Live Casino"],languages:["English","Maltese"],currency:"EUR",timezone:"CET",populationM:.5,revenuePotentialM:2200,licensesRequired:4,isFeatured:!0,overview:"Malta is the undisputed hub of European iGaming, home to 300+ licensed operators and suppliers. The Malta Gaming Authority (MGA) provides one of the most recognized regulatory frameworks globally, making it the jurisdiction of choice for B2B and B2C companies.",badges:[{label:"Remote-friendly",type:"positive"},{label:"High hiring",type:"positive"},{label:"High compliance",type:"neutral"}],stats:{jobsCount:842,companiesCount:312,remoteRatio:62,complianceIntensity:"High",hiringIntensity:"High"},topEmployers:[{name:"Evolution",slug:"evolution",openRoles:45,employeeRange:"10,000+",isClaimed:!0},{name:"Betsson",slug:"betsson",openRoles:32,employeeRange:"1,001-5,000",isClaimed:!0},{name:"Kindred Group",slug:"kindred-group",openRoles:28,employeeRange:"1,001-5,000",isClaimed:!0},{name:"SOFTSWISS",slug:"softswiss",openRoles:24,employeeRange:"501-1,000",isClaimed:!0},{name:"Yggdrasil",slug:"yggdrasil",openRoles:15,employeeRange:"201-500"}],trendingRoles:[{roleFamily:"Engineering",count:210,changePercent:12},{roleFamily:"Compliance",count:95,changePercent:18},{roleFamily:"Product",count:78,changePercent:8},{roleFamily:"Payments",count:52,changePercent:22},{roleFamily:"Marketing",count:68,changePercent:-3}],salaryPulse:{currency:"EUR",medianAnnual:52e3,rangeMin:28e3,rangeMax:12e4,topRoleFamilies:[{role:"Engineering",median:62e3},{role:"Product",median:58e3},{role:"Compliance",median:48e3},{role:"Marketing",median:45e3}]},regulators:[{name:"Malta Gaming Authority",slug:"mga",authority:"MGA",licenseTypes:["B2B","B2C","Type 1","Type 2","Type 3","Type 4"]}],upcomingEvents:[{name:"SiGMA Europe",slug:"sigma-europe",date:"2026-11-11",city:"Valletta"},{name:"Malta iGaming Seminar",slug:"migs-2026",date:"2026-06-15",city:"St. Julian's"}],news:[{title:"iGB@ICE 2026: The context behind Malta’s success as an iGaming hub",link:"https://igamingbusiness.com/igb-ice/context-malta-success-igaming-hub",scraped_at:"2026-03-01T10:22:30.746000",company_name:"iGaming Business"},{title:"Make it in Malta: Supporting operators every step of the way on their Malta success story",link:"https://igamingbusiness.com/finance/make-it-in-malta-supporting-operators-every-step-of-the-way/",scraped_at:"2026-03-01T10:22:30.743000",company_name:"iGaming Business"},{title:"Responsible innovation: The MGA’s vision for AI in iGaming",link:"https://igamingbusiness.com/legal-compliance/regulation/responsible-innovation-the-mgas-vision-for-ai-in-igaming/",scraped_at:"2026-03-01T10:22:30.740000",company_name:"iGaming Business"},{title:"Super Technologies to acquire Maxbet Romania and Malta operations",link:"https://igamingbusiness.com/strategy/super-technologies-acquire-maxbet-romania-malta/",scraped_at:"2026-03-01T10:22:30.735000",company_name:"iGaming Business"},{title:"Deloitte Malta and Fieldstream collaborate to elevate iGaming performance through AI-powered analytics",link:"https://igamingbusiness.com/company-news/deloitte-malta-and-fieldstream-collaborate-to-elevate-igaming-performance-through-ai-powered-analytics/",scraped_at:"2026-03-01T10:22:30.721000",company_name:"iGaming Business"}]},{id:"mk-uk",slug:"united-kingdom",name:"United Kingdom",region:"Europe",countries:["United Kingdom"],cities:["London","Manchester","Leeds","Edinburgh"],status:"Regulated",verticals:["Sportsbook","Casino","Poker","Bingo"],languages:["English"],currency:"GBP",timezone:"GMT",populationM:67,revenuePotentialM:5800,licensesRequired:3,isFeatured:!0,overview:"The UK is the world's most mature and tightly regulated iGaming market. The UK Gambling Commission (UKGC) sets global standards for player protection and responsible gambling. London is a key hub for iGaming headquarters and talent.",badges:[{label:"High compliance",type:"warning"},{label:"High hiring",type:"positive"}],stats:{jobsCount:1250,companiesCount:420,remoteRatio:45,complianceIntensity:"High",hiringIntensity:"High"},topEmployers:[{name:"Flutter Entertainment",slug:"flutter",openRoles:68,employeeRange:"10,000+",isClaimed:!0},{name:"Entain",slug:"entain",openRoles:55,employeeRange:"10,000+",isClaimed:!0},{name:"Playtech",slug:"playtech",openRoles:42,employeeRange:"5,001-10,000",isClaimed:!0},{name:"bet365",slug:"bet365",openRoles:38,employeeRange:"5,001-10,000"}],trendingRoles:[{roleFamily:"Compliance",count:185,changePercent:25},{roleFamily:"Engineering",count:320,changePercent:8},{roleFamily:"Data Science",count:120,changePercent:15},{roleFamily:"Responsible Gambling",count:65,changePercent:30}],salaryPulse:{currency:"GBP",medianAnnual:58e3,rangeMin:3e4,rangeMax:15e4,topRoleFamilies:[{role:"Engineering",median:72e3},{role:"Data Science",median:68e3},{role:"Product",median:65e3},{role:"Compliance",median:55e3}]},regulators:[{name:"UK Gambling Commission",slug:"ukgc",authority:"UKGC",licenseTypes:["Remote","Non-remote","Software"]}],upcomingEvents:[{name:"ICE London",slug:"ice-london-2026",date:"2026-02-10",city:"London"},{name:"Betting on Sports",slug:"bos-2026",date:"2026-09-15",city:"London"}]},{id:"mk-gibraltar",slug:"gibraltar",name:"Gibraltar",region:"Europe",countries:["Gibraltar"],cities:["Gibraltar"],status:"Regulated",verticals:["Sportsbook","Casino","Poker"],languages:["English"],currency:"GBP",timezone:"CET",populationM:.03,revenuePotentialM:1800,licensesRequired:2,isFeatured:!1,overview:"Gibraltar has long been a premium jurisdiction for iGaming, offering favorable tax rates and a well-established regulatory framework. Despite its small size, it hosts some of the industry's biggest names.",badges:[{label:"Tax-friendly",type:"positive"},{label:"High compliance",type:"neutral"}],stats:{jobsCount:280,companiesCount:65,remoteRatio:30,complianceIntensity:"High",hiringIntensity:"Medium"},topEmployers:[{name:"bet365",slug:"bet365",openRoles:22,employeeRange:"1,001-5,000"},{name:"888 Holdings",slug:"888",openRoles:18,employeeRange:"1,001-5,000",isClaimed:!0},{name:"Lottoland",slug:"lottoland",openRoles:8,employeeRange:"201-500"}],trendingRoles:[{roleFamily:"Engineering",count:65,changePercent:5},{roleFamily:"Finance",count:40,changePercent:10},{roleFamily:"Compliance",count:35,changePercent:12}],salaryPulse:{currency:"GBP",medianAnnual:55e3,rangeMin:32e3,rangeMax:13e4,topRoleFamilies:[{role:"Engineering",median:68e3},{role:"Finance",median:6e4},{role:"Compliance",median:52e3}]},regulators:[{name:"Gibraltar Gambling Commissioner",slug:"ggc",authority:"GGC",licenseTypes:["B2B","B2C"]}],upcomingEvents:[]},{id:"mk-spain",slug:"spain",name:"Spain",region:"Europe",countries:["Spain"],cities:["Madrid","Barcelona","Valencia"],status:"Regulated",verticals:["Sportsbook","Casino","Poker"],languages:["Spanish"],currency:"EUR",timezone:"CET",populationM:47,revenuePotentialM:1400,licensesRequired:2,isFeatured:!1,overview:"Spain's regulated market under the DGOJ provides a structured framework for online gambling. The market is competitive with strong brand presence from local and international operators.",badges:[{label:"Growing market",type:"positive"}],stats:{jobsCount:185,companiesCount:78,remoteRatio:40,complianceIntensity:"Medium",hiringIntensity:"Medium"},topEmployers:[{name:"Codere",slug:"codere",openRoles:15,employeeRange:"1,001-5,000"},{name:"Luckia",slug:"luckia",openRoles:8,employeeRange:"501-1,000"}],trendingRoles:[{roleFamily:"Marketing",count:45,changePercent:15},{roleFamily:"Engineering",count:38,changePercent:6}],salaryPulse:{currency:"EUR",medianAnnual:42e3,rangeMin:25e3,rangeMax:9e4,topRoleFamilies:[{role:"Engineering",median:48e3},{role:"Marketing",median:38e3}]},regulators:[{name:"DGOJ",slug:"dgoj",authority:"DGOJ",licenseTypes:["General","Sports Betting"]}],upcomingEvents:[{name:"SBC Summit Barcelona",slug:"sbc-barcelona",date:"2026-09-16",city:"Barcelona"}]},{id:"mk-sweden",slug:"sweden",name:"Sweden",region:"Europe",countries:["Sweden"],cities:["Stockholm","Gothenburg","Malmö"],status:"Regulated",verticals:["Sportsbook","Casino"],languages:["Swedish","English"],currency:"SEK",timezone:"CET",populationM:10,revenuePotentialM:1800,licensesRequired:2,isFeatured:!1,overview:"Sweden's re-regulated market under Spelinspektionen has created a structured competitive environment. Stockholm is a thriving tech hub with a strong gaming talent pipeline.",badges:[{label:"Remote-friendly",type:"positive"},{label:"High compliance",type:"neutral"}],stats:{jobsCount:320,companiesCount:95,remoteRatio:65,complianceIntensity:"High",hiringIntensity:"Medium"},topEmployers:[{name:"Betsson",slug:"betsson",openRoles:28,employeeRange:"1,001-5,000",isClaimed:!0},{name:"LeoVegas",slug:"leovegas",openRoles:15,employeeRange:"501-1,000"},{name:"NetEnt (Evolution)",slug:"netent",openRoles:20,employeeRange:"1,001-5,000"}],trendingRoles:[{roleFamily:"Engineering",count:95,changePercent:10},{roleFamily:"Product",count:42,changePercent:7}],salaryPulse:{currency:"SEK",medianAnnual:54e4,rangeMin:32e4,rangeMax:11e5,topRoleFamilies:[{role:"Engineering",median:62e4},{role:"Product",median:58e4}]},regulators:[{name:"Spelinspektionen",slug:"spelinspektionen",authority:"SGA",licenseTypes:["Online Gambling","Land-based"]}],upcomingEvents:[]},{id:"mk-cyprus",slug:"cyprus",name:"Cyprus",region:"Europe",countries:["Cyprus"],cities:["Limassol","Nicosia","Larnaca"],status:"Regulated",verticals:["Casino","Sportsbook"],languages:["Greek","English"],currency:"EUR",timezone:"EET",populationM:1.2,revenuePotentialM:600,licensesRequired:2,isFeatured:!1,overview:"Cyprus has emerged as a popular alternative to Malta for iGaming companies, offering EU membership, favorable taxes, and a growing talent pool attracted by the Mediterranean lifestyle.",badges:[{label:"Growing hub",type:"positive"},{label:"Tax-friendly",type:"positive"}],stats:{jobsCount:220,companiesCount:85,remoteRatio:50,complianceIntensity:"Medium",hiringIntensity:"High"},topEmployers:[{name:"EveryMatrix",slug:"everymatrix",openRoles:18,employeeRange:"501-1,000"},{name:"Pragmatic Play",slug:"pragmatic-play",openRoles:22,employeeRange:"1,001-5,000",isClaimed:!0}],trendingRoles:[{roleFamily:"Engineering",count:55,changePercent:20},{roleFamily:"Customer Support",count:40,changePercent:15}],salaryPulse:{currency:"EUR",medianAnnual:38e3,rangeMin:22e3,rangeMax:85e3,topRoleFamilies:[{role:"Engineering",median:45e3},{role:"Customer Support",median:28e3}]},regulators:[{name:"National Betting Authority",slug:"nba-cyprus",authority:"NBA",licenseTypes:["Class A","Class B"]}],upcomingEvents:[]},{id:"mk-brazil",slug:"brazil",name:"Brazil",region:"Latin America",countries:["Brazil"],cities:["São Paulo","Rio de Janeiro","Curitiba"],status:"Emerging",verticals:["Sportsbook","Casino"],languages:["Portuguese"],currency:"BRL",timezone:"BRT",populationM:214,revenuePotentialM:3500,licensesRequired:1,isFeatured:!0,overview:"Brazil represents the largest untapped iGaming opportunity in Latin America. With regulatory frameworks taking shape, international operators are racing to establish presence in this massive market.",badges:[{label:"High growth",type:"positive"},{label:"Emerging regulation",type:"neutral"}],stats:{jobsCount:145,companiesCount:42,remoteRatio:55,complianceIntensity:"Low",hiringIntensity:"High"},topEmployers:[{name:"Betano",slug:"betano",openRoles:20,employeeRange:"201-500"},{name:"Bet365 Brazil",slug:"bet365-brazil",openRoles:15,employeeRange:"51-200"}],trendingRoles:[{roleFamily:"Marketing",count:42,changePercent:35},{roleFamily:"Engineering",count:35,changePercent:28},{roleFamily:"Compliance",count:25,changePercent:40}],salaryPulse:{currency:"BRL",medianAnnual:18e4,rangeMin:8e4,rangeMax:45e4,topRoleFamilies:[{role:"Engineering",median:22e4},{role:"Marketing",median:16e4}]},regulators:[{name:"SPA/MF",slug:"spa-brazil",authority:"SPA",licenseTypes:["Sports Betting","Online Casino"]}],upcomingEvents:[{name:"BiS - Brazilian iGaming Summit",slug:"bis-2026",date:"2026-06-25",city:"São Paulo"}]},{id:"mk-canada",slug:"canada-ontario",name:"Canada (Ontario)",region:"North America",countries:["Canada"],cities:["Toronto","Ottawa"],status:"Regulated",verticals:["Sportsbook","Casino","Poker"],languages:["English","French"],currency:"CAD",timezone:"EST",populationM:15,revenuePotentialM:2800,licensesRequired:2,isFeatured:!0,overview:"Ontario's regulated iGaming market launched in 2022 and has rapidly become one of North America's most competitive markets, attracting major international operators.",badges:[{label:"Fast-growing",type:"positive"},{label:"High compliance",type:"neutral"}],stats:{jobsCount:380,companiesCount:55,remoteRatio:70,complianceIntensity:"High",hiringIntensity:"High"},topEmployers:[{name:"BetMGM",slug:"betmgm",openRoles:25,employeeRange:"501-1,000"},{name:"theScore",slug:"thescore",openRoles:18,employeeRange:"201-500"},{name:"PointsBet",slug:"pointsbet",openRoles:12,employeeRange:"201-500"}],trendingRoles:[{roleFamily:"Engineering",count:95,changePercent:18},{roleFamily:"Marketing",count:65,changePercent:22},{roleFamily:"Compliance",count:55,changePercent:30}],salaryPulse:{currency:"CAD",medianAnnual:85e3,rangeMin:5e4,rangeMax:18e4,topRoleFamilies:[{role:"Engineering",median:105e3},{role:"Product",median:95e3},{role:"Compliance",median:78e3}]},regulators:[{name:"AGCO (iGO)",slug:"agco",authority:"AGCO",licenseTypes:["Operator","Supplier"]}],upcomingEvents:[{name:"Canadian Gaming Summit",slug:"cgs-2026",date:"2026-06-10",city:"Toronto"}]},{id:"mk-us",slug:"united-states",name:"United States",region:"North America",countries:["United States"],cities:["New York","New Jersey","Las Vegas","Chicago"],status:"Restricted",verticals:["Sportsbook","Casino","Poker","DFS"],languages:["English"],currency:"USD",timezone:"EST",populationM:330,revenuePotentialM:9500,licensesRequired:6,isFeatured:!0,overview:"The US iGaming market is expanding state-by-state, creating massive opportunities but also regulatory complexity. Sports betting is legal in 30+ states, while iCasino remains limited to a handful of jurisdictions.",badges:[{label:"Highest revenue potential",type:"positive"},{label:"Complex regulation",type:"warning"}],stats:{jobsCount:1800,companiesCount:280,remoteRatio:55,complianceIntensity:"High",hiringIntensity:"High"},topEmployers:[{name:"DraftKings",slug:"draftkings",openRoles:85,employeeRange:"5,001-10,000",isClaimed:!0},{name:"FanDuel",slug:"fanduel",openRoles:72,employeeRange:"5,001-10,000"},{name:"BetMGM",slug:"betmgm",openRoles:55,employeeRange:"1,001-5,000"},{name:"Caesars Digital",slug:"caesars",openRoles:40,employeeRange:"10,000+"}],trendingRoles:[{roleFamily:"Engineering",count:420,changePercent:14},{roleFamily:"Compliance",count:280,changePercent:32},{roleFamily:"Data Science",count:195,changePercent:20},{roleFamily:"Marketing",count:310,changePercent:8}],salaryPulse:{currency:"USD",medianAnnual:95e3,rangeMin:5e4,rangeMax:22e4,topRoleFamilies:[{role:"Engineering",median:125e3},{role:"Data Science",median:115e3},{role:"Product",median:11e4},{role:"Compliance",median:9e4}]},regulators:[{name:"NJ DGE",slug:"nj-dge",authority:"DGE",licenseTypes:["Casino","Sports Wagering"]},{name:"PGCB (Pennsylvania)",slug:"pgcb",authority:"PGCB",licenseTypes:["Interactive Gaming","Sports Wagering"]}],upcomingEvents:[{name:"G2E Las Vegas",slug:"g2e-2026",date:"2026-10-06",city:"Las Vegas"},{name:"SBC Summit North America",slug:"sbc-na-2026",date:"2026-05-13",city:"New York"}]},{id:"mk-philippines",slug:"philippines",name:"Philippines",region:"Asia-Pacific",countries:["Philippines"],cities:["Manila","Cebu","Clark"],status:"Regulated",verticals:["Casino","Sportsbook","Poker"],languages:["Filipino","English"],currency:"PHP",timezone:"PHT",populationM:115,revenuePotentialM:1200,licensesRequired:2,isFeatured:!1,overview:"The Philippines is a major hub for offshore gaming operations (POGOs) and has a growing domestic market regulated by PAGCOR. It offers cost-effective operations and a large English-speaking talent pool.",badges:[{label:"Cost-effective",type:"positive"},{label:"Offshore hub",type:"neutral"}],stats:{jobsCount:420,companiesCount:95,remoteRatio:35,complianceIntensity:"Medium",hiringIntensity:"Medium"},topEmployers:[{name:"PAGCOR",slug:"pagcor",openRoles:15,employeeRange:"5,001-10,000"},{name:"Philweb",slug:"philweb",openRoles:10,employeeRange:"201-500"}],trendingRoles:[{roleFamily:"Customer Support",count:120,changePercent:5},{roleFamily:"Engineering",count:65,changePercent:12}],salaryPulse:{currency:"PHP",medianAnnual:85e4,rangeMin:4e5,rangeMax:25e5,topRoleFamilies:[{role:"Engineering",median:12e5},{role:"Customer Support",median:55e4}]},regulators:[{name:"PAGCOR",slug:"pagcor-reg",authority:"PAGCOR",licenseTypes:["POGO","Domestic"]}],upcomingEvents:[]},{id:"mk-india",slug:"india",name:"India",region:"Asia-Pacific",countries:["India"],cities:["Bangalore","Mumbai","Goa","Hyderabad"],status:"Emerging",verticals:["Sportsbook","Fantasy Sports","Rummy"],languages:["Hindi","English"],currency:"INR",timezone:"IST",populationM:1400,revenuePotentialM:2e3,licensesRequired:1,isFeatured:!1,overview:"India is one of the world's most promising iGaming markets, driven by massive mobile adoption and a young population. Fantasy sports and real-money gaming are growing rapidly despite regulatory uncertainty.",badges:[{label:"Massive TAM",type:"positive"},{label:"Regulatory uncertainty",type:"warning"}],stats:{jobsCount:180,companiesCount:65,remoteRatio:60,complianceIntensity:"Low",hiringIntensity:"Medium"},topEmployers:[{name:"Dream11",slug:"dream11",openRoles:25,employeeRange:"1,001-5,000"},{name:"Games24x7",slug:"games24x7",openRoles:15,employeeRange:"501-1,000"}],trendingRoles:[{roleFamily:"Engineering",count:55,changePercent:25},{roleFamily:"Product",count:30,changePercent:18}],salaryPulse:{currency:"INR",medianAnnual:18e5,rangeMin:8e5,rangeMax:5e6,topRoleFamilies:[{role:"Engineering",median:22e5},{role:"Product",median:2e6}]},regulators:[],upcomingEvents:[{name:"SPiCE India",slug:"spice-india",date:"2026-03-18",city:"Goa"}]},{id:"mk-nigeria",slug:"nigeria",name:"Nigeria",region:"Africa",countries:["Nigeria"],cities:["Lagos","Abuja"],status:"Emerging",verticals:["Sportsbook"],languages:["English"],currency:"NGN",timezone:"WAT",populationM:220,revenuePotentialM:800,licensesRequired:1,isFeatured:!1,overview:"Nigeria is Africa's largest iGaming market, driven by sports betting popularity and mobile-first consumer behavior. The regulatory environment is evolving with state-level licensing.",badges:[{label:"Mobile-first",type:"positive"},{label:"Emerging regulation",type:"neutral"}],stats:{jobsCount:85,companiesCount:30,remoteRatio:40,complianceIntensity:"Low",hiringIntensity:"Medium"},topEmployers:[{name:"Bet9ja",slug:"bet9ja",openRoles:12,employeeRange:"501-1,000"},{name:"BetKing",slug:"betking",openRoles:8,employeeRange:"201-500"}],trendingRoles:[{roleFamily:"Marketing",count:25,changePercent:30},{roleFamily:"Engineering",count:18,changePercent:20}],salaryPulse:{currency:"NGN",medianAnnual:12e6,rangeMin:5e6,rangeMax:35e6,topRoleFamilies:[{role:"Engineering",median:15e6},{role:"Marketing",median:1e7}]},regulators:[{name:"National Lottery Regulatory Commission",slug:"nlrc",authority:"NLRC",licenseTypes:["Sports Betting"]}],upcomingEvents:[]},{id:"mk-germany",slug:"germany",name:"Germany",region:"Europe",countries:["Germany"],cities:["Berlin","Hamburg","Munich","Frankfurt"],status:"Regulated",verticals:["Sportsbook","Casino"],languages:["German"],currency:"EUR",timezone:"CET",populationM:84,revenuePotentialM:2800,licensesRequired:3,isFeatured:!1,overview:"Germany's regulated market under the GGL has strict requirements including deposit limits and mandatory pauses. Despite restrictions, the market size makes it essential for European operators.",badges:[{label:"Strict regulation",type:"warning"},{label:"Large market",type:"positive"}],stats:{jobsCount:290,companiesCount:110,remoteRatio:50,complianceIntensity:"High",hiringIntensity:"Medium"},topEmployers:[{name:"Tipico",slug:"tipico",openRoles:22,employeeRange:"1,001-5,000"},{name:"bwin",slug:"bwin",openRoles:15,employeeRange:"501-1,000"}],trendingRoles:[{roleFamily:"Compliance",count:65,changePercent:28},{roleFamily:"Engineering",count:72,changePercent:6}],salaryPulse:{currency:"EUR",medianAnnual:6e4,rangeMin:35e3,rangeMax:13e4,topRoleFamilies:[{role:"Engineering",median:72e3},{role:"Compliance",median:58e3}]},regulators:[{name:"GGL",slug:"ggl",authority:"GGL",licenseTypes:["Virtual Slots","Poker","Sports Betting"]}],upcomingEvents:[]},{id:"mk-colombia",slug:"colombia",name:"Colombia",region:"Latin America",countries:["Colombia"],cities:["Bogotá","Medellín"],status:"Regulated",verticals:["Sportsbook","Casino"],languages:["Spanish"],currency:"COP",timezone:"COT",populationM:51,revenuePotentialM:600,licensesRequired:2,isFeatured:!1,overview:"Colombia was the first Latin American country to regulate online gambling, creating a model for the region. Coljuegos oversees licensing and the market continues to attract international operators.",badges:[{label:"LatAm pioneer",type:"positive"}],stats:{jobsCount:65,companiesCount:28,remoteRatio:45,complianceIntensity:"Medium",hiringIntensity:"Low"},topEmployers:[{name:"Betplay",slug:"betplay",openRoles:8,employeeRange:"201-500"},{name:"Wplay",slug:"wplay",openRoles:5,employeeRange:"51-200"}],trendingRoles:[{roleFamily:"Marketing",count:18,changePercent:12},{roleFamily:"Engineering",count:12,changePercent:8}],salaryPulse:{currency:"COP",medianAnnual:72e6,rangeMin:36e6,rangeMax:18e7,topRoleFamilies:[{role:"Engineering",median:9e7},{role:"Marketing",median:6e7}]},regulators:[{name:"Coljuegos",slug:"coljuegos",authority:"Coljuegos",licenseTypes:["Online Gambling"]}],upcomingEvents:[]}],QP=t=>zM.find(a=>a.slug===t),eT=["Europe","North America","Latin America","Asia-Pacific","Africa","Middle East"],tT=({open:t,onOpenChange:a,onSubmit:s})=>{const[r,i]=m.useState(""),[o,l]=m.useState(""),[c,h]=m.useState(""),[d,p]=m.useState(""),[g,y]=m.useState(!1),u=r.trim().length>=2&&o&&c.trim().length>=10,x=()=>{u&&(s==null||s({marketName:r.trim(),region:o,description:c.trim(),contactEmail:d.trim()||void 0}),y(!0))},v=()=>{i(""),l(""),h(""),p(""),y(!1),a(!1)};return e.jsx(tt,{open:t,onOpenChange:v,children:e.jsx(Xe,{className:"sm:max-w-[480px]",children:g?e.jsxs(e.Fragment,{children:[e.jsxs(Be,{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-gaming-success/10 flex items-center justify-center mx-auto mb-4",children:e.jsx(Ct,{className:"w-8 h-8 text-gaming-success"})}),e.jsx(Ie,{children:"Suggestion Received!"}),e.jsx(nt,{className:"text-center",children:"Thank you! We'll review your suggestion and add it to the directory if applicable."})]}),e.jsx(et,{children:e.jsx(P,{variant:"accent",onClick:v,className:"w-full",children:"Done"})})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Be,{children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-accent/10 flex items-center justify-center mb-2",children:e.jsx(Lt,{className:"w-6 h-6 text-accent"})}),e.jsx(Ie,{children:"Suggest a Market"}),e.jsx(nt,{children:"Can't find a market you're interested in? Suggest it and we'll research and add it to the directory."})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Market / Country Name *"}),e.jsx(ee,{placeholder:"e.g. Peru, South Korea, Kenya",value:r,onChange:f=>i(f.target.value),maxLength:80})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Region *"}),e.jsxs(Je,{value:o,onValueChange:l,children:[e.jsx(Ue,{children:e.jsx(Ye,{placeholder:"Select region"})}),e.jsx(_e,{children:eT.map(f=>e.jsx(xe,{value:f,children:f},f))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Why should we add this market? *"}),e.jsx(st,{placeholder:"Tell us about the iGaming activity in this market...",value:c,onChange:f=>h(f.target.value),rows:3,maxLength:500})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["Your Email ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional — for updates)"})]}),e.jsx(ee,{type:"email",placeholder:"you@example.com",value:d,onChange:f=>p(f.target.value)})]})]}),e.jsxs(et,{children:[e.jsx(P,{variant:"outline",onClick:v,children:"Cancel"}),e.jsx(P,{variant:"accent",onClick:x,disabled:!u,children:"Submit Suggestion"})]})]})})})},aT=[{value:"hiring",label:"Hiring now"},{value:"revenue",label:"Revenue potential"},{value:"salary",label:"Salary (median)"},{value:"remote",label:"Remote friendliness"},{value:"compliance",label:"Compliance intensity"},{value:"name",label:"Name (A-Z)"}],sT=({apiUrl:t,marketsData:a,itemsPerPage:s=12,onSuggestMarket:r})=>{const[i,o]=m.useState([]),[l,c]=m.useState(!0),[h,d]=m.useState(1),[p,g]=m.useState(s),[y,u]=m.useState(""),[x,v]=m.useState("hiring"),[f,k]=m.useState("grid"),[w,j]=m.useState(!1),[b,T]=m.useState({region:[],status:[],verticals:[],hiringIntensity:[],signals:[]});m.useEffect(()=>{let D=!0;const H=async()=>{try{if(!t){D&&o(a??zM);return}const G=await fetch(t);if(!G.ok)throw new Error(`${G.status}`);const E=await G.json();D&&Array.isArray(E)&&o(E)}catch{D&&o(a??zM)}finally{D&&c(!1)}};return c(!0),H(),()=>{D=!1}},[t,a]);const S=m.useMemo(()=>{const D=Array.from(new Set(i.map(E=>E.region))).sort(),H=Array.from(new Set(i.map(E=>E.status))).sort(),G=Array.from(new Set(i.flatMap(E=>E.verticals))).sort();return[{key:"region",label:"Region",type:"checkbox",options:D.map(E=>({value:E,label:E}))},{key:"status",label:"Market Status",type:"checkbox",options:H.map(E=>({value:E,label:E}))},{key:"hiringIntensity",label:"Hiring Intensity",type:"checkbox",options:[{value:"High",label:"High"},{value:"Medium",label:"Medium"},{value:"Low",label:"Low"}]},{key:"verticals",label:"Verticals",type:"checkbox",searchable:!0,options:G.map(E=>({value:E,label:E}))},{key:"signals",label:"Signals",type:"toggle",options:[{value:"featured",label:"Featured only"},{value:"remote-friendly",label:"Remote-friendly (50%+)"}]}]},[i]),N=m.useMemo(()=>Object.entries(b).flatMap(([D,H])=>H.map(G=>({key:D,label:D.charAt(0).toUpperCase()+D.slice(1),value:G,onRemove:()=>T(E=>({...E,[D]:(E[D]??[]).filter(W=>W!==G)}))}))),[b]),L=m.useMemo(()=>{const D=y.trim().toLowerCase();return i.filter(H=>{var G;return!(D&&!`${H.name} ${H.region} ${((G=H.countries)==null?void 0:G.join(" "))??""}`.toLowerCase().includes(D)||b.region.length&&!b.region.includes(H.region)||b.status.length&&!b.status.includes(H.status)||b.hiringIntensity.length&&!b.hiringIntensity.includes(H.stats.hiringIntensity)||b.verticals.length&&!b.verticals.some(E=>H.verticals.includes(E))||b.signals.includes("featured")&&!H.isFeatured||b.signals.includes("remote-friendly")&&H.stats.remoteRatio<50)})},[i,b,y]),I=m.useMemo(()=>{const D=[...L];return D.sort((H,G)=>{switch(x){case"hiring":return G.stats.jobsCount-H.stats.jobsCount;case"revenue":return G.revenuePotentialM-H.revenuePotentialM;case"salary":return G.salaryPulse.medianAnnual-H.salaryPulse.medianAnnual;case"remote":return G.stats.remoteRatio-H.stats.remoteRatio;case"compliance":{const E={High:3,Medium:2,Low:1};return E[G.stats.complianceIntensity]-E[H.stats.complianceIntensity]}case"name":return H.name.localeCompare(G.name);default:return 0}}),D},[L,x]);m.useEffect(()=>{d(1)},[y,b,p]);const A=Math.max(1,Math.ceil(I.length/p)),C=I.slice((h-1)*p,h*p),M=()=>T({region:[],status:[],verticals:[],hiringIntensity:[],signals:[]}),R=m.useCallback(D=>{r==null||r(D),console.log("[MarketsList] Suggest market:",D)},[r]);return e.jsxs(e.Fragment,{children:[e.jsx(ja,{title:"iGaming Markets — Career Intelligence",description:"Explore global iGaming markets by hiring intensity, salary levels, regulatory complexity, and remote-friendliness. Find where the opportunities are.",headerActions:e.jsxs(P,{variant:"accent",size:"sm",className:"gap-1.5",onClick:()=>j(!0),children:[e.jsx(kt,{className:"w-4 h-4"}),"Suggest a Market"]}),search:{value:y,onChange:u,onSubmit:u,onClear:()=>u(""),placeholder:"Search markets (e.g. Brazil, Malta, Ontario...)"},filters:S,filterValues:b,onFilterChange:(D,H)=>T(G=>({...G,[D]:H})),onClearFilters:M,activeFilters:N,sort:{value:x,options:aT,onChange:v},viewMode:f,onViewModeChange:k,pagination:{page:h,pageSize:p,totalPages:A,totalCount:I.length,toolbarTotalCount:i.length,toolbarTitle:"Global Markets",toolbarItemLabel:"markets",onPageChange:d,onPageSizeChange:D=>{g(D),d(1)},pageSizeOptions:[6,12,24]},resultsClassName:f==="grid"?"grid gap-4 sm:grid-cols-2 xl:grid-cols-3":"grid gap-4",children:l?e.jsx(ua,{totalColumns:p>6?6:p}):C.length?C.map(D=>e.jsx(XP,{market:D,viewMode:f},D.id)):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(Lt,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No markets found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters or search."}),e.jsxs("div",{className:"flex gap-3 justify-center",children:[e.jsx(P,{variant:"outline",onClick:M,children:"Clear all filters"}),e.jsx(P,{variant:"accent",onClick:()=>j(!0),children:"Suggest a market"})]})]})}),e.jsx(tT,{open:w,onOpenChange:j,onSubmit:R})]})},nT=({slug:t,name:a,acronym:s,country:r,region:i,jurisdiction:o,sectors:l,licenseTypes:c,scopeTags:h=[],establishedYear:d,complianceRating:p,website:g,isPrimary:y=!1,description:u,viewMode:x})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card cursor-pointer",onClick:()=>window.location.replace(`/regulators/${t}`),children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[e.jsx(q,{variant:"secondary",children:i}),e.jsx(q,{variant:"outline",children:o}),y&&e.jsx(q,{className:"bg-primary text-primary-foreground",children:"Primary"})]}),e.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground",children:a}),e.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["(",s,")"]})]}),e.jsx("p",{className:"mb-2 text-sm text-muted-foreground",children:r}),u&&e.jsx("p",{className:"mb-3 text-xs text-muted-foreground line-clamp-2",children:u}),e.jsxs("div",{className:"mb-3 flex flex-wrap gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ze,{className:"h-3.5 w-3.5 fill-gaming-gold text-gaming-gold"}),p.toFixed(1)," compliance"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ta,{className:"h-3.5 w-3.5"}),"Since ",d]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ul,{className:"h-3.5 w-3.5"}),c.length," license types"]})]}),e.jsxs("div",{className:"mb-3 flex flex-wrap gap-1.5",children:[l.slice(0,3).map(v=>e.jsx(q,{variant:"outline",className:"text-xs",children:v},v)),h.slice(0,2).map(v=>e.jsx(q,{variant:"accent",className:"text-xs",children:v},v))]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(P,{variant:"outline",size:"sm",className:"flex-1",onClick:v=>{v.stopPropagation(),window.location.replace(`/regulators/${t}`)},children:[e.jsx(fa,{className:"mr-1.5 h-3.5 w-3.5"})," Details"]}),g&&e.jsx(P,{variant:"outline",size:"sm",asChild:!0,onClick:v=>v.stopPropagation(),children:e.jsx("a",{href:g,target:"_blank",rel:"noopener noreferrer",children:e.jsx(bt,{className:"h-3.5 w-3.5"})})})]})]}),qM=[{id:"reg-1",slug:"uk-gambling-commission",name:"UK Gambling Commission",acronym:"UKGC",country:"United Kingdom",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino","Bingo","Lottery"],licenseTypes:["B2C","B2B","Remote"],scopeTags:["Player Protection","AML","Advertising Standards"],establishedYear:2007,complianceRating:4.8,isPrimary:!0,website:"https://www.gamblingcommission.gov.uk",registerUrl:"https://www.gamblingcommission.gov.uk/public-register",description:"The UK Gambling Commission regulates all commercial gambling in Great Britain, ensuring fairness, preventing crime, and protecting vulnerable players. It is widely regarded as one of the most stringent regulators globally.",scope:"Covers all forms of remote and land-based gambling including casinos, betting, bingo, lotteries, and gaming machines. Applies to both B2C operators and B2B suppliers serving the UK market.",careerImplications:"UKGC regulation creates high demand for compliance professionals, responsible gaming specialists, and AML analysts. Companies operating under UKGC licenses typically maintain dedicated UK compliance teams.",careerRoles:[{roleFamily:"Compliance & AML",description:"Ensuring adherence to LCCP conditions and AML/CTF requirements."},{roleFamily:"Responsible Gaming",description:"Implementing player protection measures, self-exclusion systems, and affordability checks."},{roleFamily:"Legal & Regulatory",description:"Monitoring regulatory changes and managing license conditions."},{roleFamily:"Risk & Fraud",description:"Identifying and mitigating fraud, money laundering, and match-fixing risks."}],keyRequirements:["Player protection & affordability checks","Anti-money laundering controls","Advertising & marketing compliance","Regular regulatory returns & reporting","Customer interaction and social responsibility"],linkedMarkets:[{name:"United Kingdom",slug:"united-kingdom"}],linkedCompanies:[{name:"Entain",slug:"entain",evidenceLevel:"verified",evidenceUrl:"https://www.gamblingcommission.gov.uk/public-register",licenseId:"001-042579-R"},{name:"Flutter Entertainment",slug:"flutter-entertainment",evidenceLevel:"verified"},{name:"bet365",slug:"bet365",evidenceLevel:"self-reported"}]},{id:"reg-2",slug:"malta-gaming-authority",name:"Malta Gaming Authority",acronym:"MGA",country:"Malta",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino","Poker","Lottery","Fantasy Sports"],licenseTypes:["B2C","B2B"],scopeTags:["Remote Gaming","AML","Player Protection","Responsible Gaming"],establishedYear:2015,complianceRating:4.7,isPrimary:!0,website:"https://www.mga.org.mt",registerUrl:"https://www.mga.org.mt/licensee-register/",description:"The Malta Gaming Authority is one of the world's most respected online gaming regulators. Its licensing framework has made Malta the European hub for iGaming, hosting hundreds of licensed operators and suppliers.",scope:"Regulates all forms of remote gaming from Malta, including casino, sports betting, poker, and skill games. Covers both B2C operations and B2B critical supply.",careerImplications:"Malta's MGA licensing has created one of the largest iGaming talent markets globally. The concentration of licensed operators drives massive demand for compliance, tech, and commercial roles.",careerRoles:[{roleFamily:"Compliance & AML",description:"Managing MGA license compliance, player fund protection, and AML obligations."},{roleFamily:"Legal & Regulatory",description:"Navigating multi-jurisdictional licensing requirements with MGA as the primary license."},{roleFamily:"Product & Technology",description:"Building compliant gaming platforms that meet MGA technical standards."},{roleFamily:"Payments",description:"Managing payment processing within MGA regulatory frameworks."}],keyRequirements:["Player fund protection (segregated accounts)","Responsible gaming tools","AML/CFT compliance","Fit and proper assessments","Regular auditing and reporting"],linkedMarkets:[{name:"Malta",slug:"malta"}],linkedCompanies:[{name:"Betsson Group",slug:"betsson-group",evidenceLevel:"verified",evidenceUrl:"https://www.mga.org.mt/licensee-register/"},{name:"Kindred Group",slug:"kindred-group",evidenceLevel:"verified"},{name:"LeoVegas",slug:"leovegas",evidenceLevel:"self-reported"}]},{id:"reg-3",slug:"kansspelautoriteit",name:"Kansspelautoriteit",acronym:"KSA",country:"Netherlands",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino"],licenseTypes:["Remote"],scopeTags:["Player Protection","Advertising Restrictions","AML"],establishedYear:2012,complianceRating:4.5,website:"https://kansspelautoriteit.nl",description:"The Dutch Gaming Authority oversees the regulated online gambling market in the Netherlands, which opened in October 2021 under the Remote Gambling Act (KOA).",scope:"Regulates online casino and sports betting operators serving Dutch consumers. Known for strict advertising and bonus restrictions.",careerImplications:"The relatively new Dutch market creates demand for compliance experts who understand KSA-specific advertising restrictions and player protection requirements.",careerRoles:[{roleFamily:"Compliance & AML",description:"Ensuring compliance with Dutch Remote Gambling Act requirements."},{roleFamily:"Marketing Compliance",description:"Managing strict advertising limitations and bonus restrictions."}],keyRequirements:["Strict advertising limitations","Cooling-off period enforcement","Centraal Register Uitsluiting Kansspelen (CRUKS)","Player loss limits"],linkedMarkets:[{name:"Netherlands",slug:"netherlands"}],linkedCompanies:[{name:"Kindred Group",slug:"kindred-group",evidenceLevel:"self-reported"}]},{id:"reg-4",slug:"agco-ontario",name:"Alcohol and Gaming Commission of Ontario",acronym:"AGCO",country:"Canada",region:"North America",jurisdiction:"State",sectors:["Sportsbook","Casino"],licenseTypes:["Operator","Supplier"],scopeTags:["Player Protection","Responsible Gaming","AML"],establishedYear:1998,complianceRating:4.4,isPrimary:!0,website:"https://www.agco.ca",description:"AGCO regulates Ontario's iGaming market through iGaming Ontario (iGO), which opened in April 2022 as Canada's first regulated province-level online gaming market.",scope:"Oversees online sports betting and casino gaming in Ontario through the iGaming Ontario subsidiary. Covers both operators and gaming-related suppliers.",careerImplications:"Ontario's market opening created North America's fastest-growing iGaming talent pool, with demand for professionals experienced in both North American and European regulatory frameworks.",careerRoles:[{roleFamily:"Compliance & AML",description:"Meeting AGCO standards and FINTRAC reporting requirements."},{roleFamily:"Responsible Gaming",description:"Implementing Ontario-specific player protection measures."}],keyRequirements:["FINTRAC AML registration","Responsible gaming commitments","Play-management tools","Advertising standards compliance"],linkedMarkets:[{name:"Canada (Ontario)",slug:"canada-ontario"}],linkedCompanies:[{name:"theScore",slug:"thescore",evidenceLevel:"self-reported"}]},{id:"reg-5",slug:"spelinspektionen",name:"Spelinspektionen",acronym:"SGA",country:"Sweden",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino"],licenseTypes:["Commercial Online Gaming"],scopeTags:["Player Protection","Bonus Restrictions","AML"],establishedYear:2019,complianceRating:4.3,website:"https://www.spelinspektionen.se",description:"The Swedish Gambling Authority supervises the regulated online gambling market under the Gambling Act (2018:1138), which re-regulated the Swedish market in January 2019.",scope:"Regulates commercial online gaming licenses in Sweden, covering sports betting and casino. Known for strict bonus limitations (first deposit only).",careerImplications:"Sweden's strict regulatory environment requires deep compliance expertise, particularly around bonus restrictions and responsible gaming mandates.",careerRoles:[{roleFamily:"Compliance & AML",description:"Managing Swedish Gambling Act compliance and Spelpaus integration."},{roleFamily:"Responsible Gaming",description:"Implementing mandatory deposit limits and self-exclusion (Spelpaus)."}],keyRequirements:["Bonus restrictions (welcome bonus only)","Spelpaus self-exclusion system","Moderate gambling messaging","SEK 3-second delay on in-play betting"],linkedMarkets:[{name:"Sweden",slug:"sweden"}],linkedCompanies:[]},{id:"reg-6",slug:"njdge",name:"New Jersey Division of Gaming Enforcement",acronym:"NJDGE",country:"United States",region:"North America",jurisdiction:"State",sectors:["Casino","Sportsbook"],licenseTypes:["Casino Service Industry","Online Sports Wagering"],scopeTags:["Licensing","Testing","AML","Geolocation"],establishedYear:1977,complianceRating:4.6,website:"https://www.njoag.gov/about/divisions-and-offices/division-of-gaming-enforcement-home/",description:"The NJDGE oversees all legal gambling activity in New Jersey, including Atlantic City casinos and the pioneering online gaming market launched in 2013.",scope:"Regulates casino gaming, online casino, and sports betting within New Jersey. Requires partnership with a land-based casino licensee for online operations.",careerImplications:"New Jersey's mature regulated market drives demand for US-compliance specialists, geolocation experts, and professionals with Atlantic City experience.",careerRoles:[{roleFamily:"Compliance & AML",description:"Navigating NJ DGE compliance requirements and BSA/AML obligations."},{roleFamily:"Geolocation & Identity",description:"Implementing geofencing and KYC solutions required for state-level licensing."}],keyRequirements:["Land-based casino partnership required","Geolocation verification","Server location within NJ or approved states","Background investigations for key employees"],linkedMarkets:[{name:"United States",slug:"united-states"}],linkedCompanies:[]},{id:"reg-7",slug:"curacao-gaming-control-board",name:"Curaçao Gaming Control Board",acronym:"GCB",country:"Curaçao",region:"Caribbean",jurisdiction:"National",sectors:["Casino","Sportsbook","Poker","Lottery"],licenseTypes:["B2C","B2B"],scopeTags:["Remote Gaming","Reform","AML"],establishedYear:2023,complianceRating:3.2,website:"https://www.gcb.cw",description:"Curaçao is undergoing major regulatory reform, transitioning from the legacy e-gaming sublicense system to a new framework under the Gaming Control Board (GCB), established in 2023.",scope:"Covers all forms of online gambling operated from Curaçao. The reform introduces stricter AML, KYC, and player protection requirements to replace the previous master-sublicense model.",careerImplications:"The regulatory reform creates new compliance roles as operators transition from legacy sublicenses to GCB-compliant frameworks. Knowledge of transitional requirements is highly valued.",careerRoles:[{roleFamily:"Compliance & AML",description:"Navigating the transition from legacy sublicenses to new GCB requirements."},{roleFamily:"Legal & Regulatory",description:"Managing re-licensing and compliance with the new ordinance."}],keyRequirements:["Transition from sublicense to GCB license","Enhanced KYC/AML obligations","Player protection measures","Local substance requirements"],linkedMarkets:[],linkedCompanies:[]},{id:"reg-8",slug:"gibraltar-gambling-commissioner",name:"Gibraltar Gambling Commissioner",acronym:"GGC",country:"Gibraltar",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino","Poker"],licenseTypes:["B2C","B2B"],scopeTags:["Remote Gaming","AML","Player Protection"],establishedYear:2005,complianceRating:4.5,isPrimary:!0,website:"https://www.gibraltar.gov.gi/gambling",description:"Gibraltar's Gambling Commissioner oversees one of the longest-established online gambling jurisdictions. Several major global operators are headquartered or licensed in Gibraltar.",scope:"Regulates remote gambling operations from Gibraltar, covering sports betting, casino, and poker. Known for a pragmatic, business-friendly but high-standard regulatory approach.",careerImplications:"Gibraltar hosts headquarters of major operators like bet365, 888, and Lottoland, creating a dense talent market for senior commercial, tech, and compliance professionals.",careerRoles:[{roleFamily:"Compliance & AML",description:"Meeting GGC requirements and managing multi-jurisdictional compliance."},{roleFamily:"Senior Leadership",description:"Many C-suite and director-level roles based in Gibraltar due to operator HQs."}],keyRequirements:["Physical presence in Gibraltar","Adequate financial resources","Fit and proper person tests","Player funds protection"],linkedMarkets:[{name:"Gibraltar",slug:"gibraltar"}],linkedCompanies:[{name:"bet365",slug:"bet365",evidenceLevel:"verified"},{name:"888 Holdings",slug:"888-holdings",evidenceLevel:"self-reported"}]},{id:"reg-9",slug:"dgoj-spain",name:"Dirección General de Ordenación del Juego",acronym:"DGOJ",country:"Spain",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino","Poker"],licenseTypes:["General","Singular"],scopeTags:["Advertising Restrictions","Player Protection","AML"],establishedYear:2011,complianceRating:4.2,website:"https://www.ordenacionjuego.es",description:"Spain's DGOJ regulates the country's online gambling market under Royal Decree 958/2020, which introduced strict advertising limitations including a near-total ban on gambling advertising.",scope:"Oversees online gambling licensing in Spain, covering general licenses (casino, sports betting, poker) and singular licenses (specific formats). Enforced strict advertising reforms in 2021.",careerImplications:"Spain's strict ad regulations require specialized marketing compliance expertise. The market's restrictions have shifted demand toward CRM, retention, and organic acquisition roles.",careerRoles:[{roleFamily:"Marketing Compliance",description:"Navigating Spain's advertising ban and permitted marketing channels."},{roleFamily:"CRM & Retention",description:"Driving growth through compliant retention strategies under ad restrictions."}],keyRequirements:["Near-complete advertising ban (post-2021)","Self-exclusion (RGIAJ) integration","Deposit limit enforcement","Session time reminders"],linkedMarkets:[{name:"Spain",slug:"spain"}],linkedCompanies:[]},{id:"reg-10",slug:"isle-of-man-gsc",name:"Isle of Man Gambling Supervision Commission",acronym:"GSC",country:"Isle of Man",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino","Poker","Lottery"],licenseTypes:["Online Gambling","Network Services","Software Supplier"],scopeTags:["Remote Gaming","E-Gaming","AML"],establishedYear:1962,complianceRating:4.4,website:"https://www.gov.im/gambling/",description:"The Isle of Man GSC is one of the oldest gambling regulators and was among the first to regulate online gambling. The island hosts several major B2B suppliers and operators.",scope:"Regulates all forms of gambling from the Isle of Man, with a strong focus on e-gaming (online). Known for a business-supportive environment with robust standards.",careerImplications:"Home to major B2B suppliers like Microgaming (now Games Global) and PokerStars, the Isle of Man offers specialized roles in game development, platform engineering, and regulatory technology.",careerRoles:[{roleFamily:"Platform Engineering",description:"Building and maintaining gaming platforms for B2B suppliers."},{roleFamily:"Game Development",description:"Creating online slots and table games for global markets."}],keyRequirements:["Comprehensive player protection","Data protection compliance","AML/CFT measures","Technical testing and certification"],linkedMarkets:[],linkedCompanies:[]},{id:"reg-11",slug:"pagcor",name:"Philippine Amusement and Gaming Corporation",acronym:"PAGCOR",country:"Philippines",region:"Asia-Pacific",jurisdiction:"National",sectors:["Casino","Sportsbook"],licenseTypes:["POGO","Domestic"],scopeTags:["Offshore Gaming","AML","POGO"],establishedYear:1976,complianceRating:3,website:"https://www.pagcor.ph",description:"PAGCOR is both a regulator and operator in the Philippines. It historically oversaw the POGO (Philippine Offshore Gaming Operator) program, though this sector faced significant reforms and restrictions.",scope:"Regulates land-based and online gambling in the Philippines. The POGO program licensed offshore operators serving Asian markets, though it has been significantly curtailed.",careerImplications:"Despite POGO restrictions, the Philippines remains a talent hub for live dealer operations, customer support, and Asian-market-facing roles.",careerRoles:[{roleFamily:"Live Dealer Operations",description:"Managing large-scale live casino studios serving Asian markets."},{roleFamily:"Customer Support",description:"Multilingual support for Asia-Pacific-facing operations."}],keyRequirements:["PAGCOR franchise/license","Local employment requirements","AML compliance","Revenue sharing with government"],linkedMarkets:[{name:"Philippines",slug:"philippines"}],linkedCompanies:[]},{id:"reg-12",slug:"kahnawake-gaming-commission",name:"Kahnawake Gaming Commission",acronym:"KGC",country:"Canada",region:"North America",jurisdiction:"Regional",sectors:["Casino","Sportsbook","Poker"],licenseTypes:["Interactive Gaming","Client Provider"],scopeTags:["First Nations","Remote Gaming","Player Protection"],establishedYear:1999,complianceRating:3.5,website:"https://www.gamingcommission.ca",description:"The Kahnawake Gaming Commission, based in the Mohawk Territory of Kahnawake near Montreal, is one of the earliest online gambling regulators. It operates under First Nations governance.",scope:"Licenses and regulates interactive gaming operations from the Mohawk Territory. Historically a major licensing jurisdiction for operators serving multiple markets.",careerImplications:"KGC-licensed operations create demand for compliance professionals familiar with both First Nations governance structures and international online gaming standards.",careerRoles:[{roleFamily:"Compliance & AML",description:"Managing KGC regulatory requirements and cross-border compliance."}],keyRequirements:["Hosting on Mohawk Internet Technologies servers","Player dispute resolution","Regular compliance auditing","Financial suitability assessments"],linkedMarkets:[],linkedCompanies:[]}],rT=t=>qM.find(a=>a.slug===t),iT=[{value:"authority",label:"Top authority"},{value:"name",label:"Name (A-Z)"},{value:"rating",label:"Highest compliance score"},{value:"established",label:"Longest standing"}],EN={region:[],country:[],jurisdiction:[],licenseTypes:[],sectors:[],scopeTags:[],signals:[]},oT=({apiUrl:t,regulatorsData:a,itemsPerPage:s=9})=>{const[r,i]=m.useState(a??[]),[o,l]=m.useState(!a),[c,h]=m.useState(1),[d,p]=m.useState(s),[g,y]=m.useState(""),[u,x]=m.useState("authority"),[v,f]=m.useState("grid"),[k,w]=m.useState(EN);m.useEffect(()=>{if(a)return;let A=!0;const C=async()=>{try{if(!t){A&&i(qM);return}const M=await fetch(t);if(!M.ok)throw new Error(`${M.status}`);const R=await M.json();A&&Array.isArray(R)&&i(R)}catch(M){console.error("Failed to fetch regulators",M),A&&i(qM)}finally{A&&l(!1)}};return l(!0),C(),()=>{A=!1}},[t,a]);const j=m.useMemo(()=>{const A=C=>Array.from(new Set(C)).sort();return[{key:"region",label:"Region",type:"checkbox",options:A(r.map(C=>C.region)).map(C=>({value:C,label:C}))},{key:"country",label:"Country",type:"searchable-select",searchable:!0,options:A(r.map(C=>C.country)).map(C=>({value:C,label:C}))},{key:"jurisdiction",label:"Jurisdiction",type:"checkbox",options:A(r.map(C=>C.jurisdiction)).map(C=>({value:C,label:C}))},{key:"licenseTypes",label:"License Types",type:"checkbox",searchable:!0,options:A(r.flatMap(C=>C.licenseTypes)).map(C=>({value:C,label:C}))},{key:"sectors",label:"Sectors",type:"checkbox",searchable:!0,options:A(r.flatMap(C=>C.sectors)).map(C=>({value:C,label:C}))},{key:"scopeTags",label:"Scope",type:"checkbox",options:A(r.flatMap(C=>C.scopeTags)).map(C=>({value:C,label:C}))},{key:"signals",label:"Signals",type:"toggle",options:[{value:"primary",label:"Primary only"}]}]},[r]),b=m.useMemo(()=>Object.entries(k).flatMap(([A,C])=>C.map(M=>({key:A,label:A.charAt(0).toUpperCase()+A.slice(1),value:M,onRemove:()=>w(R=>({...R,[A]:(R[A]??[]).filter(D=>D!==M)}))}))),[k]),T=m.useMemo(()=>{const A=g.trim().toLowerCase();return r.filter(C=>!(A&&!`${C.name} ${C.acronym} ${C.country} ${C.region}`.toLowerCase().includes(A)||k.region.length&&!k.region.includes(C.region)||k.country.length&&!k.country.includes(C.country)||k.jurisdiction.length&&!k.jurisdiction.includes(C.jurisdiction)||k.licenseTypes.length&&!k.licenseTypes.every(M=>C.licenseTypes.includes(M))||k.sectors.length&&!k.sectors.every(M=>C.sectors.includes(M))||k.scopeTags.length&&!k.scopeTags.every(M=>C.scopeTags.includes(M))||k.signals.includes("primary")&&!C.isPrimary))},[k,r,g]),S=m.useMemo(()=>{const A=[...T];return A.sort((C,M)=>{switch(u){case"name":return C.name.localeCompare(M.name);case"rating":return M.complianceRating-C.complianceRating;case"established":return C.establishedYear-M.establishedYear;default:return Number(M.isPrimary)-Number(C.isPrimary)||M.complianceRating-C.complianceRating}}),A},[T,u]);m.useEffect(()=>{h(1)},[g,k,d]);const N=Math.max(1,Math.ceil(S.length/d)),L=S.slice((c-1)*d,c*d),I=()=>w(EN);return e.jsx(ja,{title:"Regulators",description:"Review licensing authorities, jurisdictions, and regulatory scope across the global iGaming industry.",search:{value:g,onChange:y,onSubmit:y,onClear:()=>y(""),placeholder:"Search by name or acronym (e.g. MGA)"},filters:j,filterValues:k,onFilterChange:(A,C)=>w(M=>({...M,[A]:C})),onClearFilters:I,activeFilters:b,sort:{value:u,options:iT,onChange:x},viewMode:v,onViewModeChange:f,pagination:{page:c,pageSize:d,totalPages:N,totalCount:S.length,toolbarTotalCount:r.length,toolbarTitle:"Regulatory Authorities",toolbarItemLabel:"regulators",onPageChange:h,onPageSizeChange:A=>{p(A),h(1)}},resultsClassName:v==="grid"?"grid gap-4 sm:grid-cols-2 xl:grid-cols-3":"grid gap-4",children:o?e.jsx(ua,{totalColumns:d}):L.length?L.map(A=>e.jsx(nT,{id:A.id,slug:A.slug,name:A.name,acronym:A.acronym,country:A.country,region:A.region,jurisdiction:A.jurisdiction,sectors:A.sectors,licenseTypes:A.licenseTypes,scopeTags:A.scopeTags,establishedYear:A.establishedYear,complianceRating:A.complianceRating,website:A.website,isPrimary:A.isPrimary,description:A.description,viewMode:v},A.id)):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(Ta,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No regulators found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters."}),e.jsx(P,{variant:"outline",onClick:I,children:"Clear all filters"})]})})},lT={Active:"bg-gaming-success/10 text-gaming-success border-gaming-success/20",Reforming:"bg-gaming-warning/10 text-gaming-warning border-gaming-warning/20",Emerging:"bg-accent/10 text-accent border-accent/20",Restricted:"bg-destructive/10 text-destructive border-destructive/20"},cT=({slug:t,name:a,region:s,status:r,regulatorNames:i,notes:o,gamblingSectors:l,keyFacts:c,onNavigate:h})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card",children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[e.jsx(q,{variant:"secondary",children:s}),e.jsx(q,{variant:"outline",className:lT[r]??"",children:r})]}),e.jsxs("h3",{className:"mb-1 text-lg font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Te,{className:"h-4 w-4 text-accent flex-shrink-0"}),a]}),e.jsx("p",{className:"mb-3 text-xs text-muted-foreground line-clamp-2",children:o}),e.jsx("div",{className:"mb-3 space-y-1.5",children:i.map(d=>e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-foreground",children:[e.jsx(Kt,{className:"h-3.5 w-3.5 text-gaming-success flex-shrink-0"}),d]},d))}),e.jsx("div",{className:"mb-3 flex flex-wrap gap-1.5",children:l.slice(0,4).map(d=>e.jsx(q,{variant:"outline",className:"text-xs",children:d},d))}),c.length>0&&e.jsx("div",{className:"mb-3 space-y-1",children:c.slice(0,2).map(d=>e.jsxs("p",{className:"flex items-start gap-1.5 text-xs text-muted-foreground",children:[e.jsx($o,{className:"h-3 w-3 mt-0.5 flex-shrink-0 text-accent"}),d]},d))}),h&&e.jsx(P,{variant:"outline",size:"sm",className:"w-full",onClick:()=>h(t),children:"View Jurisdiction Details"})]}),dT=[{id:"jur-1",slug:"united-kingdom",name:"United Kingdom",region:"Europe",status:"Active",regulatorIds:["reg-1"],regulatorNames:["UK Gambling Commission (UKGC)"],notes:"One of the most mature and strictly regulated online gambling markets globally. The Gambling Act 2005 provides the primary legal framework.",markets:[{name:"United Kingdom",slug:"united-kingdom"}],gamblingSectors:["Casino","Sportsbook","Bingo","Lottery","Poker"],keyFacts:["Gambling Act 2005 (updated 2023 White Paper)","Mandatory affordability checks","Strict advertising standards"]},{id:"jur-2",slug:"malta",name:"Malta",region:"Europe",status:"Active",regulatorIds:["reg-2"],regulatorNames:["Malta Gaming Authority (MGA)"],notes:"Europe's primary iGaming hub with 300+ licensed companies. The Gaming Act (2018) modernized the regulatory framework.",markets:[{name:"Malta",slug:"malta"}],gamblingSectors:["Casino","Sportsbook","Poker","Fantasy Sports"],keyFacts:["300+ licensed operators","Gaming Act 2018","EU single-market passporting advantages"]},{id:"jur-3",slug:"netherlands",name:"Netherlands",region:"Europe",status:"Active",regulatorIds:["reg-3"],regulatorNames:["Kansspelautoriteit (KSA)"],notes:"Market opened October 2021 under the Remote Gambling Act (KOA). Strict advertising and bonus restrictions introduced rapidly.",markets:[{name:"Netherlands",slug:"netherlands"}],gamblingSectors:["Casino","Sportsbook"],keyFacts:["Remote Gambling Act (KOA) - 2021","CRUKS self-exclusion system","Advertising ban from 2025"]},{id:"jur-4",slug:"ontario-canada",name:"Ontario, Canada",region:"North America",status:"Active",regulatorIds:["reg-4"],regulatorNames:["AGCO / iGaming Ontario"],notes:"Canada's first provincially regulated iGaming market, launched April 2022. Rapidly became one of North America's largest markets.",markets:[{name:"Canada (Ontario)",slug:"canada-ontario"}],gamblingSectors:["Casino","Sportsbook"],keyFacts:["Launched April 2022","40+ licensed operators in year one","FINTRAC AML registration required"]},{id:"jur-5",slug:"sweden",name:"Sweden",region:"Europe",status:"Active",regulatorIds:["reg-5"],regulatorNames:["Spelinspektionen (SGA)"],notes:"Re-regulated in January 2019 with the Swedish Gambling Act. Known for restrictive bonus rules and the Spelpaus self-exclusion system.",markets:[{name:"Sweden",slug:"sweden"}],gamblingSectors:["Casino","Sportsbook"],keyFacts:["Welcome bonus only (no reload bonuses)","Spelpaus mandatory self-exclusion","3-second delay on in-play bets"]},{id:"jur-6",slug:"curacao",name:"Curaçao",region:"Caribbean",status:"Reforming",regulatorIds:["reg-7"],regulatorNames:["Curaçao Gaming Control Board (GCB)"],notes:"Undergoing major reform from the legacy sublicense system to a modern regulatory framework under the GCB. Transition period through 2025–2026.",markets:[],gamblingSectors:["Casino","Sportsbook","Poker"],keyFacts:["Reform ordinance enacted 2023","Legacy sublicenses being phased out","Enhanced KYC/AML requirements"]},{id:"jur-7",slug:"gibraltar",name:"Gibraltar",region:"Europe",status:"Active",regulatorIds:["reg-8"],regulatorNames:["Gibraltar Gambling Commissioner (GGC)"],notes:"One of the original online gambling jurisdictions. Home to major operator headquarters including bet365 and 888.",markets:[{name:"Gibraltar",slug:"gibraltar"}],gamblingSectors:["Casino","Sportsbook","Poker"],keyFacts:["Major operator HQ hub","Business-friendly regulation","Physical presence required"]},{id:"jur-8",slug:"spain",name:"Spain",region:"Europe",status:"Active",regulatorIds:["reg-9"],regulatorNames:["DGOJ"],notes:"Strict advertising restrictions introduced in 2021 under Royal Decree 958/2020 have significantly impacted operator marketing strategies.",markets:[{name:"Spain",slug:"spain"}],gamblingSectors:["Casino","Sportsbook","Poker"],keyFacts:["Near-total advertising ban since 2021","RGIAJ self-exclusion register","Strict bonus limitations"]},{id:"jur-9",slug:"isle-of-man",name:"Isle of Man",region:"Europe",status:"Active",regulatorIds:["reg-10"],regulatorNames:["Gambling Supervision Commission (GSC)"],notes:"Pioneer in e-gaming regulation. Home to major B2B suppliers and platform providers.",markets:[],gamblingSectors:["Casino","Sportsbook","Poker","Lottery"],keyFacts:["One of the first online gaming jurisdictions","Strong B2B supplier presence","Tax-efficient structure"]},{id:"jur-10",slug:"philippines",name:"Philippines",region:"Asia-Pacific",status:"Reforming",regulatorIds:["reg-11"],regulatorNames:["PAGCOR"],notes:"Historically a major hub for offshore gaming operations (POGO). Significant regulatory reforms and restrictions have been introduced.",markets:[{name:"Philippines",slug:"philippines"}],gamblingSectors:["Casino","Sportsbook"],keyFacts:["POGO sector curtailed","Major live dealer studio hub","Government ownership of PAGCOR"]},{id:"jur-11",slug:"new-jersey-us",name:"New Jersey, USA",region:"North America",status:"Active",regulatorIds:["reg-6"],regulatorNames:["NJ Division of Gaming Enforcement"],notes:"The first US state to launch legal online casino (2013) and among the first for sports betting post-PASPA repeal (2018).",markets:[{name:"United States",slug:"united-states"}],gamblingSectors:["Casino","Sportsbook"],keyFacts:["Pioneer US online gambling state","Casino partnership required","Strict geolocation requirements"]}],hT=[{value:"name",label:"Name (A-Z)"},{value:"status",label:"Status"},{value:"regulators",label:"Most regulators"}],BN={region:[],status:[],sectors:[]},mT=({jurisdictionsData:t})=>{const[a]=m.useState(t??dT),[s,r]=m.useState(!0),[i,o]=m.useState(1),[l,c]=m.useState(9),[h,d]=m.useState(""),[p,g]=m.useState("name"),[y,u]=m.useState("grid"),[x,v]=m.useState(BN);m.useEffect(()=>{const N=setTimeout(()=>r(!1),300);return()=>clearTimeout(N)},[]);const f=m.useMemo(()=>{const N=L=>Array.from(new Set(L)).sort();return[{key:"region",label:"Region",type:"checkbox",options:N(a.map(L=>L.region)).map(L=>({value:L,label:L}))},{key:"status",label:"Status",type:"checkbox",options:N(a.map(L=>L.status)).map(L=>({value:L,label:L}))},{key:"sectors",label:"Gambling Sectors",type:"checkbox",options:N(a.flatMap(L=>L.gamblingSectors)).map(L=>({value:L,label:L}))}]},[a]),k=m.useMemo(()=>Object.entries(x).flatMap(([N,L])=>L.map(I=>({key:N,label:N.charAt(0).toUpperCase()+N.slice(1),value:I,onRemove:()=>v(A=>({...A,[N]:(A[N]??[]).filter(C=>C!==I)}))}))),[x]),w=m.useMemo(()=>{const N=h.trim().toLowerCase();return a.filter(L=>!(N&&!`${L.name} ${L.region} ${L.regulatorNames.join(" ")}`.toLowerCase().includes(N)||x.region.length&&!x.region.includes(L.region)||x.status.length&&!x.status.includes(L.status)||x.sectors.length&&!x.sectors.every(I=>L.gamblingSectors.includes(I))))},[x,a,h]),j=m.useMemo(()=>{const N=[...w];return N.sort((L,I)=>{switch(p){case"status":return L.status.localeCompare(I.status);case"regulators":return I.regulatorNames.length-L.regulatorNames.length;default:return L.name.localeCompare(I.name)}}),N},[w,p]);m.useEffect(()=>{o(1)},[h,x,l]);const b=Math.max(1,Math.ceil(j.length/l)),T=j.slice((i-1)*l,i*l),S=()=>v(BN);return e.jsx(ja,{title:"Jurisdictions",description:"Explore regulated gambling jurisdictions, their status, and governing authorities.",search:{value:h,onChange:d,onSubmit:d,onClear:()=>d(""),placeholder:"Search jurisdictions"},filters:f,filterValues:x,onFilterChange:(N,L)=>v(I=>({...I,[N]:L})),onClearFilters:S,activeFilters:k,sort:{value:p,options:hT,onChange:g},viewMode:y,onViewModeChange:u,pagination:{page:i,pageSize:l,totalPages:b,totalCount:j.length,toolbarTotalCount:a.length,toolbarTitle:"Jurisdictions",toolbarItemLabel:"jurisdictions",onPageChange:o,onPageSizeChange:N=>{c(N),o(1)}},resultsClassName:y==="grid"?"grid gap-4 sm:grid-cols-2 xl:grid-cols-3":"grid gap-4",children:s?e.jsx(ua,{totalColumns:l}):T.length?T.map(N=>e.jsx(cT,{...N,viewMode:y},N.id)):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(Te,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No jurisdictions found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters."}),e.jsx(P,{variant:"outline",onClick:S,children:"Clear all filters"})]})})},uT=({open:t,onOpenChange:a,onSubmit:s})=>{const[r,i]=m.useState(""),[o,l]=m.useState(""),[c,h]=m.useState(""),[d,p]=m.useState(""),[g,y]=m.useState("EUR"),[u,x]=m.useState(""),[v,f]=m.useState(!1),[k,w]=m.useState(!1),j=r.trim().length>=2&&o.trim().length>=5&&c.trim().length>=30&&u,b=()=>{j&&(s==null||s({companyName:r.trim(),title:o.trim(),body:c.trim(),amount:d.trim()||void 0,currency:d.trim()?g:void 0,relationship:u,isAnonymous:v}),w(!0))},T=()=>{i(""),l(""),h(""),p(""),y("EUR"),x(""),f(!1),w(!1),a(!1)};return e.jsx(tt,{open:t,onOpenChange:T,children:e.jsx(Xe,{className:"sm:max-w-[520px]",children:k?e.jsxs(e.Fragment,{children:[e.jsxs(Be,{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-gaming-success/10 flex items-center justify-center mx-auto mb-4",children:e.jsx(Ct,{className:"w-8 h-8 text-gaming-success"})}),e.jsx(Ie,{children:"Complaint Submitted"}),e.jsx(nt,{className:"text-center",children:"Your complaint has been received. We will review it and notify the company. You'll receive updates on the resolution process within 48 hours."})]}),e.jsx(et,{children:e.jsx(P,{variant:"accent",onClick:T,className:"w-full",children:"Done"})})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Be,{children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-destructive/10 flex items-center justify-center mb-2",children:e.jsx(Gt,{className:"w-6 h-6 text-destructive"})}),e.jsx(Ie,{children:"Submit a Complaint"}),e.jsx(nt,{children:"File a formal complaint against an iGaming company. All complaints are reviewed before publishing and the company will be notified."})]}),e.jsxs("div",{className:"space-y-4 py-2 max-h-[60vh] overflow-y-auto",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Company Name *"}),e.jsx(ee,{placeholder:"Enter the company name",value:r,onChange:S=>i(S.target.value),maxLength:120})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Your Relationship *"}),e.jsxs(Je,{value:u,onValueChange:x,children:[e.jsx(Ue,{children:e.jsx(Ye,{placeholder:"How do you know this company?"})}),e.jsxs(_e,{children:[e.jsx(xe,{value:"affiliate",children:"Affiliate / Partner"}),e.jsx(xe,{value:"operator",children:"Operator / Client"}),e.jsx(xe,{value:"employee",children:"Current/Former Employee"}),e.jsx(xe,{value:"streamer",children:"Streamer / Influencer"}),e.jsx(xe,{value:"other",children:"Other"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Complaint Title *"}),e.jsx(ee,{placeholder:"Briefly describe the issue",value:o,onChange:S=>l(S.target.value),maxLength:150})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["Describe the Issue *"," ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(min 30 characters)"})]}),e.jsx(st,{placeholder:"Provide detailed information about your complaint, including dates, communications, and any evidence...",value:c,onChange:S=>h(S.target.value),rows:5,maxLength:3e3})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["Amount ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),e.jsx(ee,{type:"number",placeholder:"e.g. 5000",value:d,onChange:S=>p(S.target.value),min:0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Currency"}),e.jsxs(Je,{value:g,onValueChange:y,children:[e.jsx(Ue,{children:e.jsx(Ye,{})}),e.jsxs(_e,{children:[e.jsx(xe,{value:"EUR",children:"EUR"}),e.jsx(xe,{value:"USD",children:"USD"}),e.jsx(xe,{value:"GBP",children:"GBP"}),e.jsx(xe,{value:"BTC",children:"BTC"})]})]})]})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border px-4 py-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Post anonymously"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Your identity won't be revealed publicly"})]}),e.jsx(yt,{checked:v,onCheckedChange:f})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"By submitting, you confirm this complaint is based on genuine experience. False or malicious complaints may result in account action."})]}),e.jsxs(et,{children:[e.jsx(P,{variant:"outline",onClick:T,children:"Cancel"}),e.jsx(P,{variant:"destructive",onClick:b,disabled:!j,children:"Submit Complaint"})]})]})})})},pT=[{id:"cmp-1",companyId:"alpha-affiliates",companySlug:"alpha-affiliates",companyName:"Alpha Affiliates",title:"Payment Delayed",body:"I'm posting because the situation with Alpha Affiliates (ViciBet) is unacceptable. Payments have been delayed for over 3 months with no clear communication from their team despite multiple follow-ups.",amount:"884",currency:"EUR",status:"unresolved",createdAt:"2026-02-16T10:00:00Z",authorDisplayName:"Anonymous",isAnonymous:!0},{id:"cmp-2",companyId:"duelbits",companySlug:"duelbits",companyName:"Duelbits",title:"Unpaid Affiliate Commissions",body:"I am filing this complaint because Duelbits has failed to pay my affiliate commissions for the last two months. Despite providing all required documentation and following their payment process, I have received no response.",amount:"6076",currency:"USD",status:"resolved",createdAt:"2026-01-20T14:30:00Z",authorDisplayName:"Mike D.",isAnonymous:!1},{id:"cmp-3",companyId:"amigomedia",companySlug:"amigomedia",companyName:"AmigoMedia",title:"CPA Traffic Fraud Warning",body:"We are posting this as a formal, transparent complaint regarding our CPA campaign with AmigoMedia. After investigation, we found significant traffic quality issues including bot traffic and fake registrations.",amount:"4000",currency:"EUR",status:"resolved",createdAt:"2025-12-15T09:15:00Z",authorDisplayName:"Anonymous",isAnonymous:!0},{id:"cmp-4",companyId:"eurogesee",companySlug:"eurogesee",companyName:"EUrogesee",title:"Complaint against EUrogesee for not abiding by the deal's conditions",body:"On December 5th we agreed on a 5 stream deal with the streamer. After the first two streams, EUrogesee changed the terms unilaterally without our consent, violating the original agreement.",amount:"200",currency:"EUR",status:"resolved",createdAt:"2025-12-01T16:00:00Z",authorDisplayName:"StreamerPro",isAnonymous:!1},{id:"cmp-5",companyId:"chilistakes",companySlug:"chilistakes",companyName:"Chilistakes",title:"Commission not fulfilled",body:"Following our initial contact in mid-September, we formalized our partnership agreement. Despite meeting all KPIs and delivering quality traffic, Chilistakes has not paid the agreed commission structure.",amount:"2880",currency:"EUR",status:"unresolved",createdAt:"2025-11-15T11:00:00Z",authorDisplayName:"Anonymous",isAnonymous:!0},{id:"cmp-6",companyId:"streamer-rustyk",companySlug:"streamer-rustyk",companyName:"Streamer Rustyk",title:"Using fake account to boost results and taking payment but not streaming",body:"The streamer tried to boost his FTDs by creating fake accounts. After receiving the initial payment, they stopped streaming entirely and became unresponsive to all communication attempts.",amount:"770",currency:"EUR",status:"resolved",createdAt:"2025-11-10T08:30:00Z",authorDisplayName:"CasinoOps Team",isAnonymous:!1},{id:"cmp-7",companyId:"betmax-partners",companySlug:"betmax-partners",companyName:"BetMax Partners",title:"Revenue share calculation discrepancy",body:"We have discovered significant discrepancies in our revenue share calculations over the past 4 months. The reported net revenue does not match our own tracking data, resulting in underpayment of commissions.",amount:"3200",currency:"USD",status:"open",createdAt:"2026-02-05T12:00:00Z",authorDisplayName:"Anonymous",isAnonymous:!0},{id:"cmp-8",companyId:"lucky-streak",companySlug:"lucky-streak",companyName:"Lucky Streak",title:"Integration support abandoned mid-project",body:"After signing a contract and beginning integration, Lucky Streak's technical support became completely unresponsive. We've invested significant development resources and cannot proceed without their API documentation updates.",amount:"15000",currency:"EUR",status:"open",createdAt:"2026-01-28T10:00:00Z",authorDisplayName:"DevTeam Lead",isAnonymous:!1}],ZC={resolved:{label:"RESOLVED",color:"text-gaming-success",bgColor:"bg-gaming-success",icon:Ct},open:{label:"OPEN",color:"text-gaming-warning",bgColor:"bg-gaming-warning",icon:ut},unresolved:{label:"UNRESOLVED",color:"text-destructive",bgColor:"bg-destructive",icon:oa}},vM=9,xT=({complaintsData:t,onSubmitComplaint:a})=>{const[s,r]=m.useState("all"),[i,o]=m.useState("newest"),[l,c]=m.useState(1),[h,d]=m.useState(!1),p=t??pT,g=m.useCallback(f=>{a==null||a(f),console.log("[Complaints] Submit complaint:",f)},[a]),y=m.useMemo(()=>{let f=[...p];switch(s!=="all"&&(f=f.filter(k=>k.status===s)),i){case"newest":f.sort((k,w)=>new Date(w.createdAt).getTime()-new Date(k.createdAt).getTime());break;case"oldest":f.sort((k,w)=>new Date(k.createdAt).getTime()-new Date(w.createdAt).getTime());break;case"amount-high":f.sort((k,w)=>(Number(w.amount)||0)-(Number(k.amount)||0));break;case"amount-low":f.sort((k,w)=>(Number(k.amount)||0)-(Number(w.amount)||0));break}return f},[p,s,i]),u=Math.ceil(y.length/vM),x=y.slice((l-1)*vM,l*vM),v=m.useMemo(()=>{const f={resolved:0,open:0,unresolved:0};return p.forEach(k=>f[k.status]++),f},[a]);return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsxs("main",{className:"container mx-auto px-4 py-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-destructive/10 flex items-center justify-center",children:e.jsx(Gt,{className:"w-5 h-5 text-destructive"})}),e.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"iGaming Complaints"})]}),e.jsx("p",{className:"text-muted-foreground max-w-2xl",children:"Transparency matters. Browse and submit complaints about iGaming companies. We mediate disputes to help both parties reach a fair resolution."})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6",children:[e.jsxs("div",{className:"lg:col-span-3",children:[x.length===0?e.jsx(U,{children:e.jsxs(_,{className:"py-16 text-center",children:[e.jsx(Gt,{className:"w-12 h-12 text-muted-foreground/30 mx-auto mb-3"}),e.jsx("p",{className:"text-muted-foreground",children:"No complaints found matching your criteria."})]})}):e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:x.map(f=>e.jsx(yT,{complaint:f},f.id))}),u>1&&e.jsx("div",{className:"flex justify-center gap-2 mt-8",children:Array.from({length:u},(f,k)=>e.jsx(P,{variant:l===k+1?"accent":"outline",size:"sm",onClick:()=>c(k+1),children:k+1},k))})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs(P,{variant:"accent",className:"w-full gap-2",onClick:()=>d(!0),children:[e.jsx(Gt,{className:"w-4 h-4"}),"Submit Complaint"]}),e.jsx(U,{children:e.jsxs(_,{className:"p-4 space-y-3",children:[e.jsx("button",{onClick:()=>{r("all"),c(1)},className:`text-sm font-medium w-full text-left px-2 py-1 rounded ${s==="all"?"text-accent":"text-muted-foreground hover:text-foreground"}`,children:"All complaints"}),["resolved","open","unresolved"].map(f=>{const k=ZC[f];return e.jsxs("button",{onClick:()=>{r(f),c(1)},className:`flex items-center gap-2 text-sm w-full text-left px-2 py-1 rounded ${s===f?"text-accent font-medium":"text-muted-foreground hover:text-foreground"}`,children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${k.bgColor}`}),k.label," (",v[f],")"]},f)}),s!=="all"&&e.jsx(P,{variant:"outline",size:"sm",className:"w-full mt-2",onClick:()=>{r("all"),c(1)},children:"Clear filter"})]})}),e.jsx(U,{children:e.jsxs(_,{className:"p-4",children:[e.jsx("label",{className:"text-sm font-medium text-foreground mb-2 block",children:"Sort by"}),e.jsxs(Je,{value:i,onValueChange:f=>{o(f),c(1)},children:[e.jsx(Ue,{children:e.jsx(Ye,{})}),e.jsxs(_e,{children:[e.jsx(xe,{value:"newest",children:"Newest"}),e.jsx(xe,{value:"oldest",children:"Oldest"}),e.jsx(xe,{value:"amount-high",children:"Highest amount"}),e.jsx(xe,{value:"amount-low",children:"Lowest amount"})]})]})]})})]})]})]}),e.jsx(uT,{open:h,onOpenChange:d,onSubmit:g}),e.jsx(oo,{})]})},yT=({complaint:t})=>{const a=ZC[t.status],s=a.icon;return e.jsxs(U,{className:"overflow-hidden border-border/50 hover:shadow-md transition-shadow",children:[e.jsxs("div",{className:`${a.bgColor} py-6 flex flex-col items-center justify-center text-white`,children:[e.jsx(s,{className:"w-10 h-10 mb-2"}),e.jsx("span",{className:"font-bold text-sm tracking-wider",children:a.label})]}),e.jsxs(_,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold text-sm text-foreground line-clamp-2 leading-snug",children:[t.title," – ",t.companyName]}),e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-3 leading-relaxed",children:t.body}),e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-border/50",children:[t.amount&&e.jsxs("span",{className:"text-sm font-semibold text-foreground",children:[t.amount," ",t.currency]}),e.jsxs(q,{variant:"outline",className:`text-xs ${a.color} border-current`,children:["STATUS: ",a.label]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(Ft,{className:"w-3 h-3"}),eN(new Date(t.createdAt),{addSuffix:!0})]})]})]})},gT={sm:"w-3.5 h-3.5",md:"w-5 h-5",lg:"w-6 h-6"},Nl=({rating:t,maxRating:a=5,size:s="md",interactive:r=!1,onRatingChange:i})=>e.jsx("div",{className:"flex items-center gap-0.5",children:Array.from({length:a},(o,l)=>{const c=l<t;return e.jsx("button",{type:"button",disabled:!r,onClick:()=>r&&(i==null?void 0:i(l+1)),className:r?"cursor-pointer hover:scale-110 transition-transform":"cursor-default",children:e.jsx(Ze,{className:`${gT[s]} ${c?"fill-gaming-gold text-gaming-gold":"fill-transparent text-muted-foreground/30"}`})},l)})}),fT=({open:t,onOpenChange:a,onSubmit:s})=>{const[r,i]=m.useState(""),[o,l]=m.useState(0),[c,h]=m.useState(""),[d,p]=m.useState(""),[g,y]=m.useState(""),[u,x]=m.useState(""),[v,f]=m.useState(""),[k,w]=m.useState(!1),[j,b]=m.useState(!1),T=r.trim().length>=2&&o>0&&c.trim().length>=5&&d.trim().length>=20&&v,S=()=>{!T||o===0||(s==null||s({companyName:r.trim(),title:c.trim(),body:d.trim(),rating:o,pros:g.trim()||void 0,cons:u.trim()||void 0,relationship:v,isAnonymous:k}),b(!0))},N=()=>{i(""),l(0),h(""),p(""),y(""),x(""),f(""),w(!1),b(!1),a(!1)};return e.jsx(tt,{open:t,onOpenChange:N,children:e.jsx(Xe,{className:"sm:max-w-[520px]",children:j?e.jsxs(e.Fragment,{children:[e.jsxs(Be,{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-gaming-success/10 flex items-center justify-center mx-auto mb-4",children:e.jsx(Ct,{className:"w-8 h-8 text-gaming-success"})}),e.jsx(Ie,{children:"Review Submitted!"}),e.jsx(nt,{className:"text-center",children:"Thank you for your review. It will be published after moderation (usually within 24-48 hours)."})]}),e.jsx(et,{children:e.jsx(P,{variant:"accent",onClick:N,className:"w-full",children:"Done"})})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Be,{children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-accent/20 to-primary/20 flex items-center justify-center mb-2",children:e.jsx(pt,{className:"w-6 h-6 text-accent"})}),e.jsx(Ie,{children:"Write a Review"}),e.jsx(nt,{children:"Share your experience with an iGaming company. All reviews are moderated before publishing."})]}),e.jsxs("div",{className:"space-y-4 py-2 max-h-[60vh] overflow-y-auto",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Company Name *"}),e.jsx(ee,{placeholder:"Enter the company you're reviewing",value:r,onChange:L=>i(L.target.value),maxLength:120})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Overall Rating *"}),e.jsx(Nl,{rating:o,size:"lg",interactive:!0,onRatingChange:L=>l(L)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Your Relationship *"}),e.jsxs(Je,{value:v,onValueChange:f,children:[e.jsx(Ue,{children:e.jsx(Ye,{placeholder:"How do you know this company?"})}),e.jsxs(_e,{children:[e.jsx(xe,{value:"employee",children:"Current/Former Employee"}),e.jsx(xe,{value:"client",children:"Client / Customer"}),e.jsx(xe,{value:"partner",children:"Business Partner"}),e.jsx(xe,{value:"competitor",children:"Industry Peer"}),e.jsx(xe,{value:"other",children:"Other"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Review Title *"}),e.jsx(ee,{placeholder:"Summarize your experience in a few words",value:c,onChange:L=>h(L.target.value),maxLength:120})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["Your Review * ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(min 20 characters)"})]}),e.jsx(st,{placeholder:"Share details about your experience...",value:d,onChange:L=>p(L.target.value),rows:4,maxLength:2e3})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["Pros ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),e.jsx(st,{placeholder:"What did you like?",value:g,onChange:L=>y(L.target.value),rows:2,maxLength:500})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["Cons ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),e.jsx(st,{placeholder:"What could be improved?",value:u,onChange:L=>x(L.target.value),rows:2,maxLength:500})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border px-4 py-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Post anonymously"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Your name won't be shown publicly"})]}),e.jsx(yt,{checked:k,onCheckedChange:w})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"By submitting, you confirm this review is based on genuine experience and complies with our community guidelines."})]}),e.jsxs(et,{children:[e.jsx(P,{variant:"outline",onClick:N,children:"Cancel"}),e.jsx(P,{variant:"accent",onClick:S,disabled:!T,children:"Submit Review"})]})]})})})},vT=[{id:"rev-1",companyId:"evolution",companySlug:"evolution",author:{id:"u1",displayName:"Anonymous",isAnonymous:!0,relationship:"employee"},title:"Outstanding Announcement Video by Evolution",body:"Evolution delivered an outstanding announcement video for our ICE Barcelona 2026 campaign. Their attention to detail, creativity, and professionalism made the entire process seamless. Extremely smooth to work with. We couldn't be happier with the result.",rating:5,pros:"Great culture, competitive salary, innovative products",cons:"Fast-paced environment can be demanding",status:"published",reactions:{useful:12,notUseful:1},createdAt:"2026-01-15T10:00:00Z",isVerified:!0,helpfulCount:12},{id:"rev-2",companyId:"evolution",companySlug:"evolution",author:{id:"u2",displayName:"Sarah M.",isAnonymous:!1,jobTitle:"Product Manager",relationship:"client"},title:"Reliable B2B partner for live casino",body:"We've been working with Evolution for over 3 years. Their live casino platform is best-in-class and their integration support is excellent. API documentation could be improved but overall a great partner.",rating:4,pros:"Best live casino product, reliable platform, great support team",cons:"API documentation could be more detailed",status:"published",reactions:{useful:8,notUseful:2},createdAt:"2025-11-20T14:30:00Z",isVerified:!0,helpfulCount:8},{id:"rev-3",companyId:"evolution",companySlug:"evolution",author:{id:"u3",displayName:"James K.",isAnonymous:!1,jobTitle:"CTO",relationship:"partner"},title:"Solid technology but expensive",body:"The technology is world-class and their game portfolio is unmatched. However, the pricing can be prohibitive for smaller operators. Great for established brands that can afford premium rates.",rating:3,pros:"World-class technology, huge game portfolio",cons:"High pricing, long contract negotiations",status:"published",reactions:{useful:15,notUseful:3},createdAt:"2025-09-05T09:15:00Z",isVerified:!1,helpfulCount:15},{id:"rev-4",companyId:"pragmatic-play",companySlug:"pragmatic-play",author:{id:"u4",displayName:"Anonymous",isAnonymous:!0,relationship:"employee"},title:"Great place to grow your career",body:"Pragmatic Play offers incredible learning opportunities. The team is talented and the company is growing fast. Work-life balance could be better during peak release periods.",rating:4,pros:"Career growth, talented team, innovative products",cons:"Work-life balance during crunch periods",status:"published",reactions:{useful:6,notUseful:0},createdAt:"2026-02-01T11:00:00Z",isVerified:!0,helpfulCount:6},{id:"rev-5",companyId:"betsson",companySlug:"betsson",author:{id:"u5",displayName:"Maria L.",isAnonymous:!1,jobTitle:"Affiliate Manager",relationship:"partner"},title:"Excellent affiliate program",body:"Betsson's affiliate program is one of the best in the industry. Transparent reporting, timely payments, and a dedicated affiliate manager who actually responds. Highly recommended for affiliates.",rating:5,pros:"Transparent reporting, timely payments, dedicated support",cons:"Could offer more creative materials",status:"published",reactions:{useful:20,notUseful:1},createdAt:"2025-12-10T16:45:00Z",isVerified:!0,helpfulCount:20},{id:"rev-6",companyId:"softswiss",companySlug:"softswiss",author:{id:"u6",displayName:"Anonymous",isAnonymous:!0,relationship:"employee"},title:"Innovative tech company with great perks",body:"SOFTSWISS is one of the best employers in the iGaming B2B space. The engineering culture is strong, Agile is done properly, and remote work is genuinely supported. Salaries are competitive for the region. Only downside is some bureaucracy as the company scales.",rating:5,pros:"Remote-friendly, strong engineering culture, competitive pay",cons:"Growing bureaucracy, some slow decision-making",status:"published",reactions:{useful:18,notUseful:2},createdAt:"2026-02-10T09:00:00Z",isVerified:!0,helpfulCount:18},{id:"rev-7",companyId:"softswiss",companySlug:"softswiss",author:{id:"u7",displayName:"Alex R.",isAnonymous:!1,jobTitle:"Integration Manager",relationship:"client"},title:"Reliable platform, responsive support",body:"We migrated our casino to SOFTSWISS last year. The migration was smooth, the game aggregator is excellent, and their support team is very responsive. The back-office tools could use a UI refresh but functionally they're solid.",rating:4,pros:"Smooth integration, vast game aggregator, responsive support",cons:"Back-office UI feels dated",status:"published",reactions:{useful:9,notUseful:1},createdAt:"2025-10-22T13:00:00Z",isVerified:!0,helpfulCount:9},{id:"rev-8",companyId:"softswiss",companySlug:"softswiss",author:{id:"u8",displayName:"Dmitry V.",isAnonymous:!1,jobTitle:"COO",relationship:"partner"},title:"Strong crypto-first platform",body:"If you're looking for the best crypto casino platform, SOFTSWISS is the clear leader. Their crypto payment processing is seamless and they understand the regulatory nuances of crypto gambling better than anyone else in the space.",rating:5,pros:"Best-in-class crypto support, regulatory expertise, scalable infrastructure",cons:"Premium pricing for smaller operators",status:"published",reactions:{useful:14,notUseful:0},createdAt:"2025-08-15T10:30:00Z",isVerified:!1,helpfulCount:14},{id:"rev-9",companyId:"microgaming",companySlug:"microgaming",author:{id:"u9",displayName:"Anonymous",isAnonymous:!0,relationship:"employee"},title:"Legacy brand with a lot of history",body:"Microgaming has a rich history in iGaming. The brand carries a lot of weight and the game portfolio is huge. However, the company feels a bit behind on modern tech compared to newer competitors.",rating:3,pros:"Brand recognition, massive game library, stable company",cons:"Slower innovation, legacy tech stack",status:"published",reactions:{useful:7,notUseful:3},createdAt:"2025-07-20T08:00:00Z",isVerified:!0,helpfulCount:7},{id:"rev-10",companyId:"playtech",companySlug:"playtech",author:{id:"u10",displayName:"Lisa T.",isAnonymous:!1,jobTitle:"Head of Content",relationship:"client"},title:"Comprehensive omni-channel solution",body:"Playtech offers one of the most comprehensive omni-channel solutions in the market. Their IMS platform is powerful and their live casino rivals Evolution. The integration process is lengthy though and requires significant resources.",rating:4,pros:"Omni-channel platform, powerful IMS, strong live casino",cons:"Complex integration, lengthy onboarding",status:"published",reactions:{useful:11,notUseful:2},createdAt:"2026-01-05T15:00:00Z",isVerified:!0,helpfulCount:11},{id:"rev-11",companyId:"betconstruct",companySlug:"betconstruct",author:{id:"u11",displayName:"Anonymous",isAnonymous:!0,relationship:"client"},title:"Good sportsbook, needs UX work",body:"BetConstruct's sportsbook platform is feature-rich and covers a wide range of markets. The odds engine is competitive. However, the front-end templates need modernization and the documentation could be clearer.",rating:3,pros:"Feature-rich sportsbook, competitive odds, good market coverage",cons:"Outdated UX templates, unclear documentation",status:"published",reactions:{useful:5,notUseful:1},createdAt:"2025-12-28T11:00:00Z",isVerified:!1,helpfulCount:5},{id:"rev-12",companyId:"yggdrasil",companySlug:"yggdrasil",author:{id:"u12",displayName:"Tom H.",isAnonymous:!1,jobTitle:"Game Designer",relationship:"employee"},title:"Creative freedom and cutting-edge tools",body:"Working at Yggdrasil as a game designer was an amazing experience. The GATI framework gives studios real creative freedom. The company culture genuinely celebrates innovation and quality over quantity.",rating:5,pros:"Creative freedom, innovative GATI framework, quality-first culture",cons:"Smaller scale compared to the big players",status:"published",reactions:{useful:16,notUseful:0},createdAt:"2026-02-18T10:00:00Z",isVerified:!0,helpfulCount:16}],kT=()=>vT.filter(t=>t.status==="published"),kM=12,bT=({reviewsData:t,onLeaveReview:a})=>{const s=m.useMemo(()=>t??kT(),[t]),[r,i]=m.useState(""),[o,l]=m.useState("newest"),[c,h]=m.useState("all"),[d,p]=m.useState(1),[g,y]=m.useState(!1),u=m.useCallback(w=>{a==null||a(w),console.log("[Reviews] Leave review:",w)},[a]),x=m.useMemo(()=>{let w=[...s];if(r.trim()){const j=r.toLowerCase();w=w.filter(b=>b.title.toLowerCase().includes(j)||b.body.toLowerCase().includes(j)||b.companySlug.toLowerCase().includes(j))}switch(c!=="all"&&(w=w.filter(j=>j.rating===Number(c))),o){case"newest":w.sort((j,b)=>new Date(b.createdAt).getTime()-new Date(j.createdAt).getTime());break;case"oldest":w.sort((j,b)=>new Date(j.createdAt).getTime()-new Date(b.createdAt).getTime());break;case"highest":w.sort((j,b)=>b.rating-j.rating);break;case"lowest":w.sort((j,b)=>j.rating-b.rating);break;case"most-helpful":w.sort((j,b)=>b.helpfulCount-j.helpfulCount);break}return w},[s,r,o,c]),v=Math.ceil(x.length/kM),f=x.slice((d-1)*kM,d*kM),k={employee:"Employee",client:"Client",partner:"Partner",competitor:"Industry Peer",other:"Other"};return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsxs("main",{className:"container mx-auto px-4 py-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-accent/10 flex items-center justify-center",children:e.jsx(pt,{className:"w-5 h-5 text-accent"})}),e.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"iGaming Reviews"})]}),e.jsx("p",{className:"text-muted-foreground max-w-2xl",children:"See what others are saying. Read honest reviews from employees, clients, and partners across the iGaming industry. Find trusted companies and share your own experience."}),e.jsxs(P,{variant:"accent",size:"sm",className:"mt-3 gap-1.5",onClick:()=>y(!0),children:[e.jsx(pt,{className:"w-4 h-4"}),"Add review"]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 mb-6",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(ft,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(ee,{placeholder:"Search reviews by company, title, or content...",value:r,onChange:w=>{i(w.target.value),p(1)},className:"pl-10"})]}),e.jsxs(Je,{value:c,onValueChange:w=>{h(w),p(1)},children:[e.jsx(Ue,{className:"w-[150px]",children:e.jsx(Ye,{placeholder:"Rating"})}),e.jsxs(_e,{children:[e.jsx(xe,{value:"all",children:"All ratings"}),e.jsx(xe,{value:"5",children:"5 stars"}),e.jsx(xe,{value:"4",children:"4 stars"}),e.jsx(xe,{value:"3",children:"3 stars"}),e.jsx(xe,{value:"2",children:"2 stars"}),e.jsx(xe,{value:"1",children:"1 star"})]})]}),e.jsxs(Je,{value:o,onValueChange:w=>{l(w),p(1)},children:[e.jsx(Ue,{className:"w-[180px]",children:e.jsx(Ye,{})}),e.jsxs(_e,{children:[e.jsx(xe,{value:"newest",children:"Newest reviews"}),e.jsx(xe,{value:"oldest",children:"Oldest reviews"}),e.jsx(xe,{value:"highest",children:"Highest rated"}),e.jsx(xe,{value:"lowest",children:"Lowest rated"}),e.jsx(xe,{value:"most-helpful",children:"Most helpful"})]})]})]}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:[x.length," review",x.length!==1?"s":""]}),f.length===0?e.jsx(U,{children:e.jsxs(_,{className:"py-16 text-center",children:[e.jsx(pt,{className:"w-12 h-12 text-muted-foreground/30 mx-auto mb-3"}),e.jsx("p",{className:"text-muted-foreground",children:"No reviews found matching your criteria."})]})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:f.map(w=>e.jsx(jT,{review:w,relationshipLabels:k},w.id))}),v>1&&e.jsx("div",{className:"flex justify-center gap-2 mt-8",children:Array.from({length:v},(w,j)=>e.jsx(P,{variant:d===j+1?"accent":"outline",size:"sm",onClick:()=>p(j+1),children:j+1},j))})]}),e.jsx(fT,{open:g,onOpenChange:y,onSubmit:u}),e.jsx(oo,{})]})},jT=({review:t,relationshipLabels:a})=>e.jsx(U,{className:"border-border/50 hover:shadow-md transition-shadow",children:e.jsxs(_,{className:"p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-secondary flex items-center justify-center flex-shrink-0",children:e.jsx(Ra,{className:"w-5 h-5 text-muted-foreground"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-sm text-foreground",children:t.author.displayName}),t.isVerified&&e.jsx(Ee,{className:"w-3.5 h-3.5 text-gaming-success"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.author.relationship&&e.jsx("span",{children:a[t.author.relationship]??t.author.relationship}),t.author.jobTitle&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:t.author.jobTitle})]})]})]})]}),e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:eN(new Date(t.createdAt),{addSuffix:!0})})]}),e.jsx("div",{className:"flex items-center gap-2 mb-2",children:e.jsxs(q,{variant:"secondary",className:"gap-1 text-xs",children:[e.jsx(Me,{className:"w-3 h-3"}),t.companySlug.replace(/-/g," ").replace(/\b\w/g,s=>s.toUpperCase())]})}),e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("h3",{className:"font-semibold text-foreground text-sm line-clamp-1",children:t.title}),e.jsx(Nl,{rating:t.rating,size:"sm"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3 leading-relaxed line-clamp-3",children:t.body}),(t.pros||t.cons)&&e.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-3",children:[t.pros&&e.jsxs("div",{className:"text-xs",children:[e.jsx("span",{className:"font-medium text-gaming-success uppercase tracking-wide",children:"Pros"}),e.jsx("p",{className:"text-muted-foreground mt-0.5 line-clamp-2",children:t.pros})]}),t.cons&&e.jsxs("div",{className:"text-xs",children:[e.jsx("span",{className:"font-medium text-destructive uppercase tracking-wide",children:"Cons"}),e.jsx("p",{className:"text-muted-foreground mt-0.5 line-clamp-2",children:t.cons})]})]}),e.jsxs("div",{className:"flex items-center gap-3 pt-3 border-t border-border/50",children:[e.jsxs(P,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-accent gap-1.5 h-7 text-xs",children:[e.jsx(Ao,{className:"w-3 h-3"}),"Useful ",t.helpfulCount>0&&`(${t.helpfulCount})`]}),e.jsxs(P,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-accent gap-1.5 h-7 text-xs",children:[e.jsx(Pa,{className:"w-3 h-3"}),"Share"]}),e.jsx(P,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-destructive gap-1.5 h-7 text-xs ml-auto",children:e.jsx(Qi,{className:"w-3 h-3"})})]})]})}),Xt=ie.forwardRef(({className:t,value:a,...s},r)=>e.jsx(IM.Root,{ref:r,className:ne("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...s,children:e.jsx(IM.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(a||0)}%)`}})}));Xt.displayName=IM.Root.displayName;function tN(){const[t,a]=m.useState(null);return m.useEffect(()=>{const s=()=>{const i=window.location.pathname.replace(/^\/+|\/+$/g,"").split("/"),o=i.findIndex(l=>l.toLowerCase()==="jobs");return o!==-1&&i[o+1]||null};a(s());const r=()=>a(s());return window.addEventListener("popstate",r),()=>window.removeEventListener("popstate",r)},[]),t}const wT={Regulated:"bg-gaming-success/10 text-gaming-success",Restricted:"bg-destructive/10 text-destructive",Emerging:"bg-gaming-warning/10 text-gaming-warning"},MT={Low:"text-muted-foreground",Medium:"text-gaming-warning",High:"text-gaming-success"},NT=({marketData:t})=>{const a=tN(),s=m.useMemo(()=>t??(a?QP(a):void 0),[t,a]);if(!s)return e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"container mx-auto px-4 py-16 text-center",children:[e.jsx(Lt,{className:"w-16 h-16 text-muted-foreground mx-auto mb-4"}),e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Market Not Found"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"The market you're looking for doesn't exist."}),e.jsx(P,{variant:"accent",onClick:()=>window.location.replace("/markets"),children:"Browse Markets"})]})});const r=o=>`/jobs?${new URLSearchParams(o).toString()}`,i=(s.news??[]).slice(0,5);return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("section",{className:"bg-gradient-to-br from-primary to-primary/80 text-primary-foreground py-10",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsxs(P,{variant:"ghost",size:"sm",className:"text-primary-foreground/70 hover:text-primary-foreground mb-4 gap-1.5",onClick:()=>window.location.replace("/markets"),children:[e.jsx(la,{className:"w-4 h-4"})," All Markets"]}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-2",children:[e.jsx("h1",{className:"text-3xl font-bold",children:s.name}),e.jsx(q,{className:`text-xs ${wT[s.status]}`,children:s.status}),s.isFeatured&&e.jsx(q,{className:"bg-gaming-gold text-foreground text-xs",children:"Featured"})]}),e.jsx("p",{className:"text-primary-foreground/80 max-w-2xl mb-4",children:s.overview}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.badges.map(o=>e.jsx(q,{variant:"outline",className:"text-xs border-primary-foreground/30 text-primary-foreground/90",children:o.label},o.label))})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[e.jsx(Dl,{icon:je,label:"Active Jobs",value:s.stats.jobsCount.toLocaleString()}),e.jsx(Dl,{icon:Me,label:"Companies",value:s.stats.companiesCount.toLocaleString()}),e.jsx(Dl,{icon:so,label:"Remote Ratio",value:`${s.stats.remoteRatio}%`}),e.jsx(Dl,{icon:Oa,label:`Median (${s.salaryPulse.currency})`,value:s.salaryPulse.medianAnnual.toLocaleString()})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-3 mt-6",children:[e.jsxs(P,{variant:"secondary",size:"sm",className:"gap-1.5",children:[e.jsx(ga,{className:"w-4 h-4"})," Get alerts for this market"]}),e.jsxs(P,{variant:"secondary",size:"sm",className:"gap-1.5",children:[e.jsx(ma,{className:"w-4 h-4"})," Follow market"]}),e.jsxs(P,{variant:"secondary",size:"sm",className:"gap-1.5",children:[e.jsx(pt,{className:"w-4 h-4"})," I work here"]})]})]})}),e.jsx("main",{className:"container mx-auto px-4 py-8",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(Cs,{className:`w-5 h-5 ${MT[s.stats.hiringIntensity]}`}),"Hiring Now",e.jsxs(q,{variant:"secondary",className:"text-xs ml-auto",children:[s.stats.jobsCount," jobs"]})]})}),e.jsxs(_,{children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-3 uppercase tracking-wide",children:"Trending Role Families"}),e.jsx("div",{className:"space-y-3",children:s.trendingRoles.map(o=>e.jsx(CT,{role:o,maxCount:Math.max(...s.trendingRoles.map(l=>l.count)),href:r({department:o.roleFamily,country:s.name})},o.roleFamily))})]})]}),e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(Me,{className:"w-5 h-5 text-accent"}),"Top Employers"]})}),e.jsx(_,{children:e.jsx("div",{className:"space-y-3",children:s.topEmployers.map((o,l)=>e.jsx(ST,{employer:o,rank:l+1,href:r({company:o.name,country:s.name})},o.slug))})})]}),e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(Oa,{className:"w-5 h-5 text-gaming-gold"}),"Salary Pulse"]})}),e.jsxs(_,{children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4 mb-4 text-center",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold text-foreground",children:s.salaryPulse.rangeMin.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Min (",s.salaryPulse.currency,")"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold text-accent",children:s.salaryPulse.medianAnnual.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Median (",s.salaryPulse.currency,")"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold text-foreground",children:s.salaryPulse.rangeMax.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Max (",s.salaryPulse.currency,")"]})]})]}),e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-2 uppercase tracking-wide",children:"By Role Family"}),e.jsx("div",{className:"space-y-2",children:s.salaryPulse.topRoleFamilies.map(o=>e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-foreground",children:o.role}),e.jsxs("span",{className:"font-semibold text-foreground",children:[o.median.toLocaleString()," ",s.salaryPulse.currency]})]},o.role))}),e.jsxs(P,{variant:"outline",size:"sm",className:"mt-4 w-full gap-1.5",children:["View full Salary Guide ",e.jsx(Pt,{className:"w-3.5 h-3.5"})]})]})]}),s.regulators.length>0&&e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(Kt,{className:"w-5 h-5 text-gaming-success"}),"Regulation & Licensing"]})}),e.jsx(_,{className:"space-y-4",children:s.regulators.map(o=>e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border border-border/50",children:[e.jsx(Kt,{className:"w-5 h-5 text-gaming-success flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:o.name}),e.jsxs("p",{className:"text-xs text-muted-foreground mb-1.5",children:["Authority: ",o.authority]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:o.licenseTypes.map(l=>e.jsx(q,{variant:"outline",className:"text-xs",children:l},l))})]})]},o.slug))})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(U,{children:e.jsxs(_,{className:"p-4 space-y-3",children:[e.jsx("h3",{className:"font-semibold text-foreground",children:"Market Info"}),e.jsx(Fs,{label:"Region",value:s.region}),e.jsx(Fs,{label:"Currency",value:s.currency}),s.timezone&&e.jsx(Fs,{label:"Timezone",value:s.timezone}),e.jsx(Fs,{label:"Population",value:`${s.populationM.toLocaleString()}M`}),e.jsx(Fs,{label:"Revenue Potential",value:`$${s.revenuePotentialM.toLocaleString()}M`}),e.jsx(Fs,{label:"Languages",value:s.languages.join(", ")}),e.jsx(Fs,{label:"Verticals",value:s.verticals.join(", ")})]})}),s.upcomingEvents.length>0&&e.jsx(U,{children:e.jsxs(_,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold text-foreground flex items-center gap-2",children:[e.jsx(da,{className:"w-4 h-4 text-accent"}),"Upcoming Events"]}),s.upcomingEvents.slice(0,3).map(o=>e.jsxs("div",{className:"flex items-start gap-3 py-2 border-b border-border/50 last:border-0",children:[e.jsxs("div",{className:"w-10 h-10 rounded-lg bg-accent/10 flex flex-col items-center justify-center flex-shrink-0",children:[e.jsx("span",{className:"text-xs font-bold text-accent leading-none",children:new Date(o.date).toLocaleString("en",{month:"short"}).toUpperCase()}),e.jsx("span",{className:"text-sm font-bold text-foreground leading-none",children:new Date(o.date).getDate()})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:o.name}),e.jsx("p",{className:"text-xs text-muted-foreground",children:o.city})]})]},o.slug)),e.jsx(P,{variant:"outline",size:"sm",className:"w-full",children:"View all events"})]})}),e.jsx(U,{children:e.jsxs(_,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Ut,{className:"w-4 h-4 text-accent"}),"Latest News"]}),i.length>0?e.jsx("div",{className:"space-y-3",children:i.map(o=>e.jsxs("a",{href:o.link,target:"_blank",rel:"noopener noreferrer",className:"block rounded-md border border-border/60 p-2.5 hover:bg-secondary/40 transition-colors",children:[e.jsx("p",{className:"text-sm font-medium text-foreground line-clamp-2",children:o.title}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[o.company_name?`${o.company_name} · `:"",LT(o)]})]},`${o.link}-${o.title}`))}):e.jsxs("p",{className:"text-sm text-muted-foreground",children:['News articles tagged with "',s.name,'" will appear here once available.']}),e.jsx(P,{variant:"outline",size:"sm",className:"w-full",children:"Browse iGaming News"})]})})]})]})}),e.jsx(oo,{})]})},Dl=({icon:t,label:a,value:s})=>e.jsxs("div",{className:"bg-primary-foreground/10 rounded-lg p-3 text-center",children:[e.jsx(t,{className:"w-5 h-5 mx-auto mb-1 text-primary-foreground/70"}),e.jsx("p",{className:"text-xl font-bold text-primary-foreground",children:s}),e.jsx("p",{className:"text-xs text-primary-foreground/60",children:a})]}),CT=({role:t,maxCount:a,href:s})=>e.jsxs("a",{href:s,className:"flex items-center gap-3 rounded-md p-1 -m-1 hover:bg-secondary/50 transition-colors",children:[e.jsx("span",{className:"text-sm font-medium text-foreground w-28 flex-shrink-0",children:t.roleFamily}),e.jsx(Xt,{value:t.count/a*100,className:"h-2 flex-1"}),e.jsx("span",{className:"text-sm font-semibold text-foreground w-10 text-right",children:t.count}),e.jsxs("span",{className:`text-xs font-medium flex items-center gap-0.5 w-12 ${t.changePercent>=0?"text-gaming-success":"text-destructive"}`,children:[t.changePercent>=0?e.jsx($e,{className:"w-3 h-3"}):e.jsx(Po,{className:"w-3 h-3"}),t.changePercent>=0?"+":"",t.changePercent,"%"]})]}),ST=({employer:t,rank:a,href:s})=>e.jsxs("a",{href:s,className:"flex items-center gap-3 p-2 rounded-lg hover:bg-secondary/50 transition-colors cursor-pointer",children:[e.jsx("span",{className:"w-6 h-6 rounded-full bg-accent/10 flex items-center justify-center text-xs font-bold text-accent flex-shrink-0",children:a}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name}),t.isClaimed&&e.jsx(q,{variant:"outline",className:"text-xs text-gaming-success border-gaming-success/30",children:"Verified"})]}),t.employeeRange&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.employeeRange," employees"]})]}),e.jsxs(q,{variant:"secondary",className:"text-xs gap-1",children:[e.jsx(je,{className:"w-3 h-3"}),t.openRoles," roles"]})]}),Fs=({label:t,value:a})=>e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:t}),e.jsx("span",{className:"text-foreground font-medium text-right max-w-[60%]",children:a})]}),LT=t=>{const a=t.date??t.scraped_at;if(!a)return"Date unavailable";const s=new Date(a);return Number.isNaN(s.getTime())?"Date unavailable":s.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})},IT={verified:{label:"Verified",className:"bg-gaming-success/10 text-gaming-success border-gaming-success/20"},"self-reported":{label:"Self-reported",className:"bg-gaming-warning/10 text-gaming-warning border-gaming-warning/20"},"community-suggested":{label:"Community",className:"bg-accent/10 text-accent border-accent/20"}},AT=({regulatorData:t})=>{const a=tN(),s=m.useMemo(()=>t??(a?rT(a):void 0),[t,a]);return s?e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("section",{className:"bg-gradient-to-br from-primary to-primary/80 text-primary-foreground py-10",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsxs(P,{variant:"ghost",size:"sm",className:"text-primary-foreground/70 hover:text-primary-foreground mb-4 gap-1.5",onClick:()=>window.location.replace("/regulators"),children:[e.jsx(la,{className:"w-4 h-4"})," All Regulators"]}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-2",children:[e.jsx("h1",{className:"text-3xl font-bold",children:s.name}),e.jsx(q,{className:"bg-primary-foreground/20 text-primary-foreground border-primary-foreground/30",children:s.acronym}),s.isPrimary&&e.jsx(q,{className:"bg-gaming-gold text-foreground text-xs",children:"Primary Authority"})]}),e.jsx("p",{className:"text-primary-foreground/80 max-w-2xl mb-4",children:s.description}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(q,{variant:"outline",className:"text-xs border-primary-foreground/30 text-primary-foreground/90",children:[e.jsx(Lt,{className:"w-3 h-3 mr-1"})," ",s.country]}),e.jsxs(q,{variant:"outline",className:"text-xs border-primary-foreground/30 text-primary-foreground/90",children:[e.jsx(So,{className:"w-3 h-3 mr-1"})," ",s.jurisdiction]}),e.jsxs(q,{variant:"outline",className:"text-xs border-primary-foreground/30 text-primary-foreground/90",children:["Est. ",s.establishedYear]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[s.website&&e.jsx(P,{variant:"secondary",size:"sm",className:"gap-1.5",asChild:!0,children:e.jsxs("a",{href:s.website,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(bt,{className:"w-4 h-4"})," Official Website"]})}),s.registerUrl&&e.jsx(P,{variant:"secondary",size:"sm",className:"gap-1.5",asChild:!0,children:e.jsxs("a",{href:s.registerUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(fa,{className:"w-4 h-4"})," Licensee Register"]})})]})]})]})}),e.jsx("main",{className:"container mx-auto px-4 py-8",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(So,{className:"w-5 h-5 text-accent"})," Regulatory Scope"]})}),e.jsxs(_,{children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:s.scope}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mr-2",children:"License Types:"}),s.licenseTypes.map(r=>e.jsx(q,{variant:"secondary",className:"text-xs",children:r},r))]}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mr-2",children:"Sectors:"}),s.sectors.map(r=>e.jsx(q,{variant:"outline",className:"text-xs",children:r},r))]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mr-2",children:"Scope Tags:"}),s.scopeTags.map(r=>e.jsx(q,{variant:"accent",className:"text-xs",children:r},r))]})]})]}),e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(je,{className:"w-5 h-5 text-gaming-success"})," What This Means for Careers"]})}),e.jsxs(_,{children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:s.careerImplications}),e.jsx("h4",{className:"text-sm font-medium text-foreground mb-3 uppercase tracking-wide",children:"Common Role Families"}),e.jsx("div",{className:"space-y-3",children:s.careerRoles.map(r=>e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border border-border/50",children:[e.jsx(ze,{className:"w-4 h-4 text-accent flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:r.roleFamily}),e.jsx("p",{className:"text-xs text-muted-foreground",children:r.description})]})]},r.roleFamily))})]})]}),e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(Gt,{className:"w-5 h-5 text-gaming-warning"})," Key Requirements"]})}),e.jsxs(_,{children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"High-level themes — not legal advice. See official pages for full details."}),e.jsx("ul",{className:"space-y-2",children:s.keyRequirements.map(r=>e.jsxs("li",{className:"flex items-start gap-2 text-sm text-foreground",children:[e.jsx(Kt,{className:"w-4 h-4 text-gaming-success flex-shrink-0 mt-0.5"}),r]},r))})]})]}),s.linkedCompanies.length>0&&e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs(se,{className:"flex items-center gap-2",children:[e.jsx(Me,{className:"w-5 h-5 text-accent"})," Licensed Companies"]})}),e.jsxs(_,{children:[e.jsx("div",{className:"space-y-3",children:s.linkedCompanies.map(r=>{const i=IT[r.evidenceLevel];return e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Me,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:r.name})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(q,{variant:"outline",className:`text-xs ${i.className}`,children:i.label}),r.evidenceUrl&&e.jsx(P,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",asChild:!0,children:e.jsx("a",{href:r.evidenceUrl,target:"_blank",rel:"noopener noreferrer",children:e.jsx(bt,{className:"w-3 h-3"})})})]})]},r.slug)})}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-3 flex items-start gap-1.5",children:[e.jsx(Kt,{className:"w-3 h-3 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Verified"})," = found in official register. ",e.jsx("strong",{children:"Self-reported"})," = company-asserted, pending verification."]})]})]})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(U,{children:e.jsxs(_,{className:"p-4 space-y-3",children:[e.jsx("h3",{className:"font-semibold text-foreground",children:"Regulator Info"}),e.jsx(Hs,{label:"Acronym",value:s.acronym}),e.jsx(Hs,{label:"Country",value:s.country}),e.jsx(Hs,{label:"Region",value:s.region}),e.jsx(Hs,{label:"Jurisdiction",value:s.jurisdiction}),e.jsx(Hs,{label:"Established",value:String(s.establishedYear)}),e.jsx(Hs,{label:"Compliance Score",value:`${s.complianceRating.toFixed(1)} / 5.0`}),e.jsx(Hs,{label:"License Types",value:s.licenseTypes.join(", ")})]})}),s.linkedMarkets.length>0&&e.jsx(U,{children:e.jsxs(_,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Te,{className:"w-4 h-4 text-accent"})," Markets Covered"]}),s.linkedMarkets.map(r=>e.jsxs(P,{variant:"outline",size:"sm",className:"w-full justify-start gap-2",onClick:()=>window.location.replace(`/markets/${r.slug}`),children:[e.jsx(Lt,{className:"w-3.5 h-3.5"})," ",r.name]},r.slug))]})}),e.jsx(U,{children:e.jsxs(_,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold text-foreground flex items-center gap-2",children:[e.jsx(At,{className:"w-4 h-4 text-accent"})," Resources"]}),s.website&&e.jsx(P,{variant:"outline",size:"sm",className:"w-full justify-start gap-2",asChild:!0,children:e.jsxs("a",{href:s.website,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(bt,{className:"w-3.5 h-3.5"})," Official Website"]})}),s.registerUrl&&e.jsx(P,{variant:"outline",size:"sm",className:"w-full justify-start gap-2",asChild:!0,children:e.jsxs("a",{href:s.registerUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(fa,{className:"w-3.5 h-3.5"})," Licensee Register"]})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Links to official pages. We do not summarize legal text — see the regulator's website for full requirements."})]})})]})]})}),e.jsx(oo,{})]}):e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"container mx-auto px-4 py-16 text-center",children:[e.jsx(Kt,{className:"w-16 h-16 text-muted-foreground mx-auto mb-4"}),e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Regulator Not Found"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"The regulator you're looking for doesn't exist."}),e.jsx(P,{variant:"accent",onClick:()=>window.location.replace("/regulators"),children:"Browse Regulators"})]})})},Hs=({label:t,value:a})=>e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:t}),e.jsx("span",{className:"text-foreground font-medium text-right max-w-[60%]",children:a})]});function VN(t){window.location.assign(t)}function ON(t){window.history.length>1?window.history.back():window.location.assign(t)}function PT(t){const a=JC,s=t??{};return{id:s.id??a.id,title:s.title??a.title,company:s.company??a.company,companyLogo:s.companyLogo??a.companyLogo,location:s.location??a.location,salary:s.salary??void 0,jobType:s.jobType??a.jobType,experienceLevel:s.experienceLevel??a.experienceLevel,department:s.department??a.department,postedDate:s.postedDate??a.postedDate,applicationDeadline:s.applicationDeadline??void 0,description:s.description??a.description,requirements:Array.isArray(s.requirements)?s.requirements:[],responsibilities:Array.isArray(s.responsibilities)?s.responsibilities:[],benefits:Array.isArray(s.benefits)?s.benefits:[],skills:Array.isArray(s.skills)?s.skills:[],companyDescription:s.companyDescription??"",companySize:s.companySize??void 0,companyWebsite:s.companyWebsite??void 0,contactEmail:s.contactEmail??void 0,contactPhone:s.contactPhone??void 0,isRemote:s.isRemote??!1,isUrgent:s.isUrgent??!1,isFeatured:s.isFeatured??!1,applicationUrl:s.applicationUrl??void 0,viewCount:s.viewCount??void 0,applicantCount:s.applicantCount??void 0}}function TT(t){return!Array.isArray(t)||t.length===0?YC:t.map(a=>({id:a.id??"unknown",title:a.title??"Untitled",company:a.company??"",location:a.location??"",salary:a.salary??void 0,postedDate:a.postedDate??new Date().toISOString().slice(0,10)}))}const JC={id:"1",title:"Senior Game Developer",company:"Wazdan",companyLogo:"https://images.pexels.com/photos/3184291/pexels-photo-3184291.jpeg?auto=compress&cs=tinysrgb&w=100",location:"Malta",salary:"€80,000 - €120,000",jobType:"Full-time",experienceLevel:"Senior Level",department:"Engineering",postedDate:"2025-01-15",applicationDeadline:"2025-02-15",description:"We are seeking a talented Senior Game Developer to join our innovative team at Wazdan...",requirements:["5+ years of experience in game development","Strong proficiency in C# and Unity","Experience with HTML5 and JavaScript","Knowledge of casino game mechanics","Understanding of RNG and game mathematics","Experience with version control systems (Git)","Strong problem-solving skills","Excellent communication skills in English"],responsibilities:["Design and develop high-quality casino games","Implement game features and mechanics","Optimize game performance across multiple platforms","Collaborate with artists and designers on game assets","Write clean, maintainable, and well-documented code","Participate in code reviews and technical discussions","Debug and resolve technical issues","Stay updated with industry trends and technologies"],benefits:["Competitive salary and performance bonuses","Health insurance coverage","Flexible working hours","Remote work options","Professional development opportunities","25 days paid vacation","Modern office in Malta","Team building events and activities"],skills:["Unity","C#","JavaScript","HTML5","CSS3","Git","Agile","Game Design"],companyDescription:"Wazdan is a leading provider of innovative casino games...",companySize:"100-200 employees",companyWebsite:"https://wazdan.com",contactEmail:"careers@wazdan.com",contactPhone:"+356 2123 4567",isRemote:!1,isUrgent:!0,isFeatured:!0,applicationUrl:"https://wazdan.com/careers/apply",viewCount:1247,applicantCount:23},YC=[{id:"2",title:"Frontend Game Developer",company:"Pragmatic Play",location:"Malta",salary:"€60,000 - €80,000",postedDate:"2025-01-10"},{id:"3",title:"Unity Developer",company:"Evolution Gaming",location:"Remote",salary:"€70,000 - €90,000",postedDate:"2025-01-12"},{id:"4",title:"Game Developer",company:"NetEnt",location:"Stockholm",salary:"€65,000 - €85,000",postedDate:"2025-01-08"}],RT=({job:t=JC,similarJobs:a=YC,onSkillClick:s})=>{var S;const r=tN(),[i,o]=m.useState(()=>TT(a)),[l,c]=m.useState(!1),[h,d]=m.useState(null),[p,g]=m.useState(!1),[y,u]=m.useState(!1),{toggleJob:x,isSaved:v}=qC(),f=PT(t);m.useEffect(()=>{(async()=>{c(!0);try{if(await new Promise(I=>setTimeout(I,300)),!r)throw new Error("Missing slug in URL.");o(i);const L=JSON.parse(localStorage.getItem("appliedJobs")||"[]");u(L.includes(r))}catch(L){d((L==null?void 0:L.message)||"Failed to load job details")}finally{c(!1)}})()},[r]);const k=()=>{r&&x(r)},w=()=>{if(!r)return;f!=null&&f.applicationUrl?window.open(f.applicationUrl,"_blank","noopener,noreferrer"):g(!0);const N=JSON.parse(localStorage.getItem("appliedJobs")||"[]");N.includes(r)||(N.push(r),localStorage.setItem("appliedJobs",JSON.stringify(N)),u(!0))},j=async()=>{if(navigator.share)try{await navigator.share({title:f==null?void 0:f.title,text:`Check out this job opportunity: ${f==null?void 0:f.title} at ${f==null?void 0:f.company}`,url:window.location.href})}catch(N){console.log("Error sharing:",N)}else navigator.clipboard.writeText(window.location.href),alert("Job URL copied to clipboard!")},b=N=>new Date(N).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}),T=N=>{const L=new Date(N),A=Math.abs(new Date().getTime()-L.getTime());return Math.ceil(A/(1e3*60*60*24))};return l?e.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"}),e.jsx("p",{className:"mt-4 text-gray-600",children:"Loading job details..."})]})}):h||!f?e.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(Ot,{className:"h-12 w-12 text-red-500 mx-auto mb-4"}),e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Job Not Found"}),e.jsx("p",{className:"text-gray-600 mb-4",children:h||"The job you are looking for does not exist."}),e.jsx("button",{onClick:()=>ON("/jobs"),className:"bg-blue-600 text-white px-6 py-2 rounded-lg hover:bg-blue-700 transition-colors",children:"Back to Jobs"})]})}):e.jsxs("div",{className:"min-h-screen bg-gray-50",children:[e.jsx("div",{className:"bg-white border-b border-gray-200",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4",children:[e.jsxs("button",{onClick:()=>ON("/jobs"),className:"flex items-center text-gray-600 hover:text-gray-900 mb-4",children:[e.jsx(la,{className:"h-4 w-4 mr-2"}),"Back to Jobs"]}),e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-start lg:justify-between",children:[e.jsx("div",{className:"flex-1",children:e.jsxs("div",{className:"flex items-start space-x-4",children:[f.companyLogo&&e.jsx("img",{src:f.companyLogo,alt:`${f.company} logo`,className:"w-16 h-16 rounded-lg object-cover border border-gray-200"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[f.isUrgent&&e.jsx("span",{className:"bg-red-100 text-red-800 text-xs font-medium px-2 py-1 rounded-full",children:"Urgent"}),f.isFeatured&&e.jsx("span",{className:"bg-yellow-100 text-yellow-800 text-xs font-medium px-2 py-1 rounded-full",children:"Featured"})]}),e.jsx("h1",{className:"text-2xl lg:text-3xl font-bold text-gray-900 mb-2",children:f.title}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-gray-600",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(Me,{className:"h-4 w-4 mr-1"}),e.jsx("span",{className:"font-medium",children:f.company})]}),e.jsxs("div",{className:"flex items-center",children:[e.jsx(Te,{className:"h-4 w-4 mr-1"}),e.jsx("span",{children:f.location}),f.isRemote&&e.jsx("span",{className:"ml-1",children:"(Remote)"})]}),f.salary&&e.jsxs("div",{className:"flex items-center",children:[e.jsx(Oa,{className:"h-4 w-4 mr-1"}),e.jsx("span",{children:f.salary})]}),e.jsxs("div",{className:"flex items-center",children:[e.jsx(ut,{className:"h-4 w-4 mr-1"}),e.jsxs("span",{children:[T(f.postedDate)," days ago"]})]})]})]})]})}),e.jsxs("div",{className:"flex items-center space-x-3 mt-4 lg:mt-0",children:[e.jsxs("button",{onClick:k,className:`flex items-center px-4 py-2 rounded-lg border transition-colors ${v(f.id)?"bg-blue-50 border-blue-200 text-blue-700":"bg-white border-gray-300 text-gray-700 hover:bg-gray-50"}`,children:[e.jsx(ma,{className:`h-4 w-4 mr-2 ${v(f.id)?"fill-current":""}`}),v(f.id)?"Saved":"Save Job"]}),e.jsxs("button",{onClick:j,className:"flex items-center px-4 py-2 bg-white border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors",children:[e.jsx(Pa,{className:"h-4 w-4 mr-2"}),"Share"]}),e.jsx("button",{onClick:w,disabled:y,className:`flex items-center px-6 py-2 rounded-lg font-medium transition-colors ${y?"bg-green-100 text-green-800 cursor-not-allowed":"bg-blue-600 text-white hover:bg-blue-700"}`,children:y?e.jsxs(e.Fragment,{children:[e.jsx(Ct,{className:"h-4 w-4 mr-2"}),"Applied"]}):e.jsxs(e.Fragment,{children:[e.jsx(bt,{className:"h-4 w-4 mr-2"}),"Apply Now"]})})]})]})]})}),e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4 mb-6",children:[e.jsxs("div",{className:"text-center p-4 bg-gray-50 rounded-lg",children:[e.jsx(je,{className:"h-6 w-6 text-blue-600 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Job Type"}),e.jsx("p",{className:"font-medium",children:f.jobType})]}),e.jsxs("div",{className:"text-center p-4 bg-gray-50 rounded-lg",children:[e.jsx(ha,{className:"h-6 w-6 text-blue-600 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Experience"}),e.jsx("p",{className:"font-medium",children:f.experienceLevel})]}),e.jsxs("div",{className:"text-center p-4 bg-gray-50 rounded-lg",children:[e.jsx(ze,{className:"h-6 w-6 text-blue-600 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Department"}),e.jsx("p",{className:"font-medium",children:f.department})]}),e.jsxs("div",{className:"text-center p-4 bg-gray-50 rounded-lg",children:[e.jsx(Ft,{className:"h-6 w-6 text-blue-600 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Deadline"}),e.jsx("p",{className:"font-medium text-sm",children:f.applicationDeadline?b(f.applicationDeadline):"Open"})]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-gray-200",children:[e.jsxs("div",{className:"flex items-center space-x-4 text-sm text-gray-600",children:[e.jsxs("span",{children:[f.viewCount," views"]}),e.jsxs("span",{children:[f.applicantCount," applicants"]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ze,{className:"h-4 w-4 text-yellow-400 fill-current"}),e.jsx("span",{className:"text-sm text-gray-600",children:"4.8 company rating"})]})]})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Job Description"}),e.jsx("div",{className:"prose prose-gray max-w-none",children:e.jsx("p",{className:"text-gray-700 leading-relaxed whitespace-pre-line",children:f.description})})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Key Responsibilities"}),e.jsx("ul",{className:"space-y-3",children:(S=f.responsibilities)==null?void 0:S.map((N,L)=>e.jsxs("li",{className:"flex items-start",children:[e.jsx(Ct,{className:"h-5 w-5 text-green-500 mr-3 mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-gray-700",children:N})]},L))})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Requirements"}),Array.isArray(f.requirements)?e.jsx("ul",{className:"space-y-3",children:f.requirements.map((N,L)=>e.jsxs("li",{className:"flex items-start",children:[e.jsx(Ct,{className:"h-5 w-5 text-blue-500 mr-3 mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-gray-700",children:N})]},L))}):e.jsx("p",{className:"text-gray-700 whitespace-pre-line",children:f.requirements})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Required Skills"}),Array.isArray(f.skills)?e.jsx("div",{className:"flex flex-wrap gap-2",children:f.skills.map((N,L)=>e.jsx($M,{name:N,color:"#2563EB",size:"sm",onClick:s?()=>s(N):void 0},`${N}-${L}`))}):e.jsx("p",{className:"text-gray-700 whitespace-pre-line",children:f.skills})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Benefits & Perks"}),Array.isArray(f.benefits)?e.jsx("ul",{className:"space-y-3",children:f.benefits.map((N,L)=>e.jsxs("li",{className:"flex items-start",children:[e.jsx(Ct,{className:"h-5 w-5 text-green-500 mr-3 mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-gray-700",children:N})]},L))}):e.jsx("p",{className:"text-gray-700 whitespace-pre-line",children:f.benefits})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsxs("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:["About ",f.company]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-gray-700 text-sm leading-relaxed",children:f.companyDescription}),e.jsxs("div",{className:"space-y-2 text-sm",children:[f.companySize&&e.jsxs("div",{className:"flex items-center",children:[e.jsx(ze,{className:"h-4 w-4 text-gray-400 mr-2"}),e.jsx("span",{className:"text-gray-600",children:f.companySize})]}),f.companyWebsite&&e.jsxs("div",{className:"flex items-center",children:[e.jsx(Lt,{className:"h-4 w-4 text-gray-400 mr-2"}),e.jsx("a",{href:f.companyWebsite,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800",children:"Visit Website"})]})]}),e.jsxs("div",{className:"pt-4 border-t border-gray-200",children:[e.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"Contact Information"}),e.jsxs("div",{className:"space-y-2 text-sm",children:[f.contactEmail&&e.jsxs("div",{className:"flex items-center",children:[e.jsx(Yt,{className:"h-4 w-4 text-gray-400 mr-2"}),e.jsx("a",{href:`mailto:${f.contactEmail}`,className:"text-blue-600 hover:text-blue-800",children:f.contactEmail})]}),f.contactPhone&&e.jsxs("div",{className:"flex items-center",children:[e.jsx(js,{className:"h-4 w-4 text-gray-400 mr-2"}),e.jsx("a",{href:`tel:${f.contactPhone}`,className:"text-blue-600 hover:text-blue-800",children:f.contactPhone})]})]})]})]})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Ready to Apply?"}),e.jsxs("p",{className:"text-gray-600 text-sm mb-4",children:["Join ",f.company," and take your career to the next level in the exciting world of iGaming."]}),e.jsx("button",{onClick:w,disabled:y,className:`w-full flex items-center justify-center px-6 py-3 rounded-lg font-medium transition-colors ${y?"bg-green-100 text-green-800 cursor-not-allowed":"bg-blue-600 text-white hover:bg-blue-700"}`,children:y?e.jsxs(e.Fragment,{children:[e.jsx(Ct,{className:"h-5 w-5 mr-2"}),"Application Submitted"]}):e.jsxs(e.Fragment,{children:[e.jsx(bt,{className:"h-5 w-5 mr-2"}),"Apply for this Position"]})}),!y&&e.jsxs("div",{className:"mt-4 flex items-center space-x-2",children:[e.jsxs("button",{onClick:k,className:`flex-1 flex items-center justify-center px-4 py-2 rounded-lg border transition-colors ${v(f.id)?"bg-blue-50 border-blue-200 text-blue-700":"bg-white border-gray-300 text-gray-700 hover:bg-gray-50"}`,children:[e.jsx(St,{className:`h-4 w-4 mr-2 ${v(f.id)?"fill-current":""}`}),v(f.id)?"Saved":"Save"]}),e.jsx("button",{className:"flex items-center justify-center p-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors",children:e.jsx(Qi,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Similar Jobs"}),e.jsx("div",{className:"space-y-4",children:i.map(N=>e.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 hover:bg-gray-50 cursor-pointer transition-colors",onClick:()=>VN(`/jobs/${N.id}`),children:[e.jsx("h4",{className:"font-medium text-gray-900 mb-1",children:N.title}),e.jsx("p",{className:"text-sm text-gray-600 mb-2",children:N.company}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(Te,{className:"h-3 w-3 mr-1"}),e.jsx("span",{children:N.location})]}),e.jsxs("span",{children:[T(N.postedDate),"d ago"]})]}),N.salary&&e.jsx("p",{className:"text-sm font-medium text-blue-600 mt-2",children:N.salary})]},N.id))}),e.jsx("button",{onClick:()=>VN("/jobs"),className:"w-full mt-4 text-center text-blue-600 hover:text-blue-800 text-sm font-medium",children:"View All Jobs"})]})]})]})}),p&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:e.jsxs("div",{className:"bg-white rounded-lg max-w-md w-full p-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Apply for this Position"}),e.jsx("p",{className:"text-gray-600 mb-4",children:"To apply for this position, please send your CV and cover letter to:"}),e.jsx("div",{className:"bg-gray-50 p-4 rounded-lg mb-4",children:e.jsx("p",{className:"font-medium",children:f.contactEmail})}),e.jsxs("div",{className:"flex space-x-3",children:[e.jsx("button",{onClick:()=>g(!1),className:"flex-1 px-4 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors",children:"Close"}),e.jsx("button",{onClick:()=>{window.location.href=`mailto:${f.contactEmail}?subject=Application for ${f.title}&body=Dear Hiring Manager,%0D%0A%0D%0AI am interested in applying for the ${f.title} position at ${f.company}.%0D%0A%0D%0APlease find my CV attached.%0D%0A%0D%0ABest regards`,g(!1)},className:"flex-1 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:"Send Email"})]})]})})]})},DT=()=>e.jsx("div",{children:e.jsx("h2",{children:"Welcome to the Header!"})}),zT=({article:t,isBookmarked:a,onToggleBookmark:s,onShare:r,onOpenArticle:i,layout:o="card",userAccess:l,positionInList:c})=>{const[h,d]=m.useState(!1),p=v=>{const f=new Date(v),w=Math.floor((new Date().getTime()-f.getTime())/(1e3*60*60));return w<1?"Just now":w<24?`${w}h ago`:w<48?"Yesterday":f.toLocaleDateString("en-US",{month:"short",day:"numeric"})},g=v=>v>=1e3?`${(v/1e3).toFixed(1)}k`:v.toString(),y=v=>v.length>1?v[1]:v[0],u=(v,f)=>v.length<=f?v:v.substring(0,f).trim()+"...",x=o==="grid"?"flex flex-col":"flex flex-col md:flex-row md:items-center";return e.jsxs("article",{className:`
7722
7722
  news-grid bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden
7723
7723
  hover:shadow-md transition-shadow duration-300 ${x}
7724
7724
  `,children:[e.jsxs("div",{className:`relative ${o==="list"?"md:w-1/3 md:flex-shrink-0":""}`,children:[e.jsx("img",{src:t.image||"/placeholder.svg?height=200&width=400&text=News",alt:t.title,className:`w-full h-48 object-cover transition-opacity duration-300 ${h?"opacity-100":"opacity-0"} ${o==="list"?"md:h-32":""}`,onLoad:()=>d(!0)}),!h&&e.jsx("div",{className:"absolute inset-0 bg-gray-200 animate-pulse flex items-center justify-center",children:e.jsx("div",{className:"w-12 h-12 text-gray-400",children:"📰"})}),e.jsxs("div",{className:"absolute top-3 left-3 flex flex-wrap gap-1",children:[t.isBreaking&&e.jsx("span",{className:"px-2 py-1 bg-red-500 text-white text-xs font-semibold rounded animate-pulse",children:"BREAKING"}),t.isTrending&&e.jsxs("span",{className:"px-2 py-1 bg-orange-500 text-white text-xs font-semibold rounded flex items-center",children:[e.jsx($e,{className:"w-3 h-3 mr-1"}),"TRENDING"]})]}),e.jsx("button",{onClick:()=>s(t._id,c),className:`absolute top-3 right-3 p-2 rounded-full transition-colors ${a?"bg-yellow-500 text-white":"bg-white text-gray-600 hover:bg-gray-100"} ${l.allowSaving?"":"opacity-60 cursor-not-allowed"}`,"aria-label":a?"Remove bookmark":"Add bookmark",disabled:!l.allowSaving,title:l.allowSaving?void 0:"Sign in to save articles",children:e.jsx(St,{className:`w-4 h-4 ${a?"fill-current":""}`})})]}),e.jsxs("div",{className:`p-4 ${o==="list"?"md:w-2/3":""}`,children:[e.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:t.categories.slice(0,2).map((v,f)=>e.jsx("a",{href:`?category=${v}`,children:e.jsx("span",{className:"px-2 py-1 bg-yellow-100 text-yellow-800 text-xs font-medium rounded-full",children:v},f)}))}),e.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-2 line-clamp-2 hover:text-yellow-600 transition-colors",children:l.maskExternalLinks?e.jsx("button",{className:"text-left w-full text-gray-700 cursor-not-allowed","aria-label":"Sign in to view article",title:"Sign in to view external article",children:t.title}):e.jsx("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",onClick:()=>i==null?void 0:i(t,c,"new_tab",t.isTrending?"trending":t.isBreaking?"breaking":"listing"),children:t.title})}),e.jsx("p",{className:"text-sm text-gray-700 mb-3 line-clamp-3",children:u(t.content,o==="list"?150:200)}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500 mb-3",children:[e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxs("span",{children:["By ",y(t.author)]}),e.jsx("span",{children:t.company})]}),e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(ut,{className:"w-4 h-4 mr-1"}),e.jsxs("span",{children:[t.readTime,"m read"]})]}),e.jsxs("div",{className:"flex items-center",children:[e.jsx(Aa,{className:"w-4 h-4 mr-1"}),e.jsx("span",{children:g(t.viewCount||0)})]})]})]}),e.jsx("div",{className:"flex flex-wrap gap-1 mb-3",children:t.tags.slice(0,3).map((v,f)=>e.jsxs("span",{className:"px-2 py-1 bg-gray-100 text-gray-600 text-xs rounded",children:["#",v]},f))}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-gray-500",children:p(t.date)}),e.jsx("span",{className:"inline-flex items-center rounded-full bg-gray-100 px-2.5 py-0.5 text-xs font-medium text-gray-700",children:CC[l.status]}),l.note&&e.jsx("span",{className:"text-xs text-gray-500",children:l.note})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("button",{onClick:()=>r(t,c),className:"p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full transition-colors","aria-label":"Share article",children:e.jsx(Pa,{className:"w-4 h-4"})}),l.maskExternalLinks?e.jsx("button",{className:"flex items-center px-3 py-1.5 bg-gray-200 text-gray-600 text-sm font-medium rounded-lg cursor-not-allowed","aria-label":"Sign in to read",children:"Sign in to read"}):e.jsxs("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",className:"flex items-center px-3 py-1.5 bg-yellow-600 text-white text-sm font-medium rounded-lg hover:bg-yellow-700 transition-colors",onClick:()=>i==null?void 0:i(t,c,"new_tab",t.isTrending?"trending":t.isBreaking?"breaking":"listing"),children:["Read More",e.jsx(bt,{className:"w-3 h-3 ml-1"})]})]})]})]})]})},qT=({apiUrl:t="http://localhost:5000/api/news",filterKeys:a=["categories","author","company"],searchableFilters:s=["company","author","categories"],defaultFilters:r={categories:[],tags:[],authors:[],companies:[],dateRange:["",""],readTime:[0,999]},defaultSort:i="latest",bookmarkStorageKey:o="news-bookmarks",itemsPerPage:l=12,dateFieldLabel:c="Published",userAccess:h,onEmitEvent:d,eventContext:p})=>{const[g,y]=m.useState([]),[u,x]=m.useState([]),[v,f]=m.useState([]),[k,w]=m.useState({}),[j,b]=m.useState(""),[T,S]=m.useState({}),[N,L]=m.useState(!1),[I,A]=m.useState(l),[C,M]=m.useState(new Set),[R,D]=m.useState(i),[H,G]=m.useState("grid"),[E,W]=m.useState(1),[J,Y]=m.useState([]),[re,oe]=m.useState(!1),[$,Q]=m.useState([]),[de,ve]=m.useState([]),[he,te]=m.useState(!0),[O,X]=m.useState("all"),[F,z]=m.useState(""),B=Z=>Z.trim().toLowerCase().replace(/\s+/g,"-"),[ce,ue]=m.useState(r),[Ne,xt]=m.useState(null),ot=tM(h),me=m.useMemo(()=>({component:"NewsPage",...p??{}}),[p]),Fe=m.useCallback((Z,le)=>{d&&d({domain:"news",name:Z,payload:le,timestamp:new Date().toISOString(),context:me})},[me,d]),It=m.useCallback(()=>({filters:{...T},categories:ce.categories.length?ce.categories:T.categories?[T.categories]:[],tags:ce.tags,authors:ce.authors.length?ce.authors:T.author?[T.author]:[],companies:ce.companies.length?ce.companies:T.company?[T.company]:[],dateFilter:O,readTimeRange:ce.readTime}),[O,T,ce]),dt=m.useCallback(()=>({page:E,pageSize:I,totalResults:u.length,sortBy:R,viewMode:H}),[E,u.length,I,R,H]),_t=m.useRef(!1),ta=m.useCallback((Z,le)=>{d&&d({domain:"newsletter",name:Z,payload:le,timestamp:new Date().toISOString(),context:me})},[me,d]),zs=m.useCallback(async Z=>{ta("newsletter_subscribe_requested",Z)},[ta]);m.useEffect(()=>{const Z=localStorage.getItem(o);Z&&M(new Set(JSON.parse(Z)))},[o]),m.useEffect(()=>{const Z=new URLSearchParams(window.location.search),le={};a.forEach(We=>{const ht=Z.get(We);ht&&(le[We]=ht)}),S(le);const ge=Z.get("q"),be=Z.get("categories");let De=[...g];if(ge&&(De=De.filter(We=>We.title.toLowerCase().includes(ge.toLowerCase())),b(ge),jt(ge)),be){const We=be.trim().toLowerCase().replace(/\s+/g,"-");ue(ht=>({...ht,categories:[We]})),De=De.filter(ht=>ht.categories.some(Fo=>B(Fo)===We))}f(De);const Rt={};a.forEach(We=>{const ht=Z.get(We);ht&&(Rt[We]=ht)}),S(Rt)},[g]),m.useEffect(()=>{const le=new URLSearchParams(window.location.search).get("date_filter");if(le&&le!=="all"){X(le);const ge=Yi(g,T,$,le);x(ge),W(1),rt(ge)}},[g]);const jt=Z=>{if(!Z.trim())return;const le=[...$,Z.trim()];Q(le);const ge=Yi(g,T,le,O);x(ge),W(1),rt(ge),b(""),Fe("news_search_submitted",{query:Z,searchFilters:le,...It()})},rt=Z=>{const le=pl(Z,a);w(le)},ls=Z=>{X(Z),it(Z),TC(Z)},it=Z=>{const le=Yi(g,T,$,Z);x(le),W(1),rt(le)};m.useEffect(()=>{localStorage.setItem(o,JSON.stringify(Array.from(C)))},[C,o]),m.useEffect(()=>{te(!0),xt(null),(async()=>{try{const le=await fetch(t);if(!le.ok)throw new Error(`API responded with status: ${le.status}`);const ge=await le.json();if(!Array.isArray(ge))throw new Error("Expected an array but received: "+typeof ge);const be=ge.map(wt=>({...wt,categories:Array.isArray(wt.categories)?wt.categories:[],topTag:MI(wt.title||"")})),De={};for(const wt of be){const na=wt.topTag;na&&(De[na]=(De[na]||0)+1)}const Rt=Object.entries(De).sort((wt,na)=>na[1]-wt[1]).slice(0,10).map(([wt])=>wt);ve(Rt);const We=new Set;be.forEach(wt=>{wt.categories.forEach(na=>{We.add(B(na))})});const ht=Array.from(We).map(wt=>({id:wt,name:wt.replace(/-/g," ").replace(/\b\w/g,na=>na.toUpperCase()),icon:"📰",count:be.filter(na=>na.categories.some(rM=>B(rM)===wt)).length,color:"bg-gray-100 text-gray-800"}));y(be),x(be),f(be),Y(ht);const Fo=pl(be,a);w(Fo)}catch(le){console.error("Failed to fetch articles",le)}finally{te(!1)}})()},[t]);const wa=()=>{G(Z=>{const le=Z==="grid"?"list":"grid";return Fe("news_listing_viewmode_changed",{viewMode:le}),le})};m.useMemo(()=>g.filter(Z=>Z.isTrending).slice(0,6),[g]),m.useMemo(()=>g.filter(Z=>Z.isBreaking),[g]);const pa=Math.ceil(u.length/I),aa=u.slice((E-1)*I,E*I),qa=(Z,le)=>{ot.allowSaving&&M(ge=>{const be=new Set(ge),De=be.has(Z);return De?be.delete(Z):be.add(Z),Fe(De?"news_article_unbookmarked":"news_article_bookmarked",{articleId:Z,positionInList:le}),be})},sa=(Z,le)=>{navigator.share?navigator.share({title:Z.title,text:Z.title,url:Z.link}):(navigator.clipboard.writeText(Z.link),alert("Article link copied to clipboard!")),Fe("news_article_shared",{articleId:Z._id,channel:"copy_link"})},Ma=(Z,le,ge="new_tab",be="listing")=>{Fe("news_article_opened",{articleId:Z._id,slug:Z.slug,positionInList:le,openedFrom:be,openedIn:ge})},$t=()=>{oe(!re)},Wt=u.length===0?0:(E-1)*I+1,fe=Math.min(E*I,u.length),Ae=()=>{ue({categories:[],tags:[],authors:[],companies:[],dateRange:["",""],readTime:[0,999]}),W(1);const Z=Yi(g,T,$,O);x(Z),W(1),rt(Z)},Re=()=>{S({}),Q([]),X("all"),Ae(),x(g),W(1),rt(g),Fe("news_filters_cleared_all",{})},He=m.useRef(null),Le=Z=>{W(Z),Fe("news_listing_page_changed",{page:Z,pageSize:I,totalResults:u.length}),setTimeout(()=>{var le;(le=He.current)==null||le.scrollIntoView({behavior:"smooth",block:"start"})},100)},Qe=Z=>{A(Z),W(1),Fe("news_listing_items_per_page_changed",{pageSize:Z})},lt=(Z,le)=>{const ge={...T};le?ge[Z]=le:delete ge[Z];const be=Yi(g,ge,$,O);S(ge),x(be),W(1),rt(be);const De=It();le?Fe("news_filter_selected",{key:Z,value:le,...De}):Fe("news_filter_cleared",{key:Z,...De})},ye=Z=>{const le=$.filter(be=>be!==Z);Q(le);const ge=Yi(g,T,le,O);x(ge),W(1),rt(ge),Fe("news_search_filter_removed",{removedKeyword:Z,remainingKeywords:le})};return m.useEffect(()=>{_t.current||he||!u.length&&!g.length||(Fe("news_listing_viewed",{...It(),...dt()}),_t.current=!0)},[g.length,Fe,u.length,It,dt,he]),e.jsxs("div",{className:"flex flex-col min-h-screen pb-16 md:pb-0",children:[e.jsxs("div",{className:"flex-grow",children:[e.jsx(KM,{onSearchChange:Z=>{const le=g.filter(ge=>ge.title.toLowerCase().includes(Z.toLowerCase()));f(le),b(Z)},title:"Latest News",popularTags:de,generateHref:Z=>`/news?q=${Z.replace(/\s+/g,"+")}`}),e.jsxs("div",{className:"container mx-auto py-8 pb-20 md:pb-8",children:[e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"relative flex items-center gap-2 sm:my-6 my-2",children:[e.jsx(IC,{data:g.map(Z=>Z.title),onSelect:Z=>{jt(Z)},onTyping:Z=>{L(!!Z),Z||(f(g),b(""))},placeholder:"Search news, topics, or authors...",showSubmitButton:!0,className:"w-full"}),e.jsx("button",{className:"block md:hidden flex items-center justify-center p-3 bg-white border-2 border-gray-200 text-gray-700 rounded-xl hover:border-gray-300 hover:bg-gray-50 transition-all duration-200 focus:ring-4 focus:ring-gray-200 focus:outline-none hover:scale-105",onClick:$t,children:e.jsx(ws,{size:16,className:"mr-1.5"})}),j&&e.jsxs("div",{className:"flex gap-2 mt-3 px-4 sm:px-6 lg:px-8",children:[e.jsxs("span",{className:"bg-yellow-100 text-indigo-800 rounded-full px-3 py-1 text-sm flex items-center",children:[j,e.jsx("button",{onClick:()=>{f(g),b("")},className:"ml-2 text-indigo-600 hover:text-indigo-800",children:"×"})]}),e.jsx("button",{className:"text-sm text-gray-600 hover:underline",onClick:()=>{f(g),b("")},children:"Clear Search"})]})]}),e.jsx("div",{className:"max-w-7xl mx-auto md:pb-8",children:e.jsx("div",{className:"block w-full",children:e.jsx("div",{className:"relative flex items-center gap-2 sm:my-6 my-2",children:e.jsx(XM,{filters:[...F?[{key:"categories",label:"Categories",value:F.replace(/-/g," "),onRemove:()=>z("")}]:[],...$.map(Z=>({key:"search",label:"",value:Z,onRemove:()=>ye(Z)})),...Object.entries(T).map(([Z,le])=>({key:Z,label:Z.replace(/_/g," "),value:le,onRemove:()=>lt(Z,"")}))],onClearAll:Re})})})})]}),e.jsx("main",{className:"max-w-7xl mx-auto px-4 pb-8 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"flex flex-col lg:flex-row lg:gap-6",children:[e.jsx(RC,{dateFieldLabel:"Date",activeDateFilter:O,onDateFilterChange:ls,filterKeys:a,searchableFilters:s,filtersData:k,activeFilters:T,handleFilterChange:lt,toggleSavedJobsFilter:()=>console.log("toggle saved jobs filter"),showOnlySaved:!1,savedJobs:[]}),he?e.jsx(ua,{}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"lg:w-2/4",children:[e.jsx(PC,{viewMode:H,onToggleViewMode:wa,selectedItemsPerPage:I,onItemsPerPageChange:Qe,totalCount:u.length,startIndex:Wt,endIndex:fe,title:"Latest News"}),u.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:H==="grid"?"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-2 gap-6":"space-y-6",children:aa.map((Z,le)=>e.jsx("div",{ref:le===0?He:null,children:e.jsx(zT,{article:Z,isBookmarked:C.has(Z._id),positionInList:le,onToggleBookmark:ge=>qa(ge,le),onShare:ge=>sa(ge),onOpenArticle:Ma,layout:H,userAccess:ot})},Z._id))}),pa>1&&e.jsx("div",{className:"mt-8 flex justify-center",children:e.jsx(sM,{currentPage:E,totalPages:pa,onPageChange:Le})})]}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Ut,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No articles found"}),e.jsx("p",{className:"text-gray-600 mb-4",children:"Try adjusting your search criteria or filters to find more articles."}),e.jsx("button",{onClick:Re,className:"px-4 py-2 bg-yellow-600 text-white rounded-lg hover:bg-yellow-700 transition-colors",children:"Clear All Filters"})]})]})}),e.jsx("div",{className:"hidden lg:block lg:w-1/4 space-y-6",children:e.jsxs("div",{className:"sticky top-4",children:[e.jsx(Do,{position:"sidebar",url:"https://video-previews.elements.envatousercontent.com/h264-video-previews/e08912ad-6856-4e36-89b5-cf1465cc79cb/32651312.mp4",link:"",alt:""}),e.jsx(Q8,{onSubscribe:zs}),e.jsxs("div",{className:"mt-6 bg-white rounded-lg shadow-sm border border-gray-200 p-5",children:[e.jsx("h3",{className:"font-semibold text-lg mb-3",children:"Featured Employers"}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:[...Array(6)].map((Z,le)=>e.jsx("div",{className:"flex items-center justify-center p-2 bg-gray-50 rounded-md",children:e.jsx("img",{src:`/placeholder.svg?height=40&width=40&text=${String.fromCharCode(65+le)}`,alt:`Featured employer ${le+1}`,className:"w-10 h-10 object-contain"})},le))})]})]})})]})})]})]}),e.jsx(LC,{activeDateFilter:O,handleDateFilterChange:ls,filterKeys:a,searchableFilters:s,dateFieldLabel:c,activeFilters:T,handleFilterChange:lt,filtersData:k,isMobileFilterOpen:re,toggleMobileFilter:$t})]})},FT=({id:t,title:a,excerpt:s,image:r,category:i,author:o,company:l,companyLogo:c,companySlug:h,publishedAt:d,readTime:p,viewCount:g,isBreaking:y=!1,isTrending:u=!1,isBookmarked:x=!1,link:v,onBookmark:f,onShare:k,onCompanyClick:w,viewMode:j="grid"})=>{const b=T=>T?T>=1e3?`${(T/1e3).toFixed(1)}k`:T.toString():null;return e.jsxs(U,{className:"overflow-hidden hover:shadow-card transition-all duration-200 border border-transparent hover:border-accent/20 group",children:[e.jsxs("div",{className:"relative aspect-[16/9] overflow-hidden",children:[e.jsx("img",{src:r||"/placeholder.svg",alt:a,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"}),e.jsxs("div",{className:"absolute top-3 left-3 flex flex-wrap gap-1.5",children:[y&&e.jsx(q,{className:"bg-red-500 text-white animate-pulse",children:"BREAKING"}),u&&e.jsxs(q,{className:"bg-orange-500 text-white flex items-center gap-1",children:[e.jsx($e,{className:"w-3 h-3"}),"TRENDING"]})]}),e.jsx("div",{className:"absolute bottom-3 left-3",children:e.jsx(q,{variant:"secondary",className:"bg-background/90 backdrop-blur-sm",children:i})})]}),e.jsxs("div",{className:"p-4",children:[l&&e.jsxs("button",{onClick:()=>h&&(w==null?void 0:w(h)),className:"flex items-center gap-2 mb-3 group/company",children:[e.jsx("div",{className:"w-6 h-6 rounded-full bg-secondary flex items-center justify-center overflow-hidden",children:c?e.jsx("img",{src:c,alt:l,className:"w-full h-full object-cover"}):e.jsx(Me,{className:"w-3 h-3 text-muted-foreground"})}),e.jsx("span",{className:"text-sm text-muted-foreground group-hover/company:text-accent transition-colors",children:l}),h&&e.jsx("span",{className:"text-xs text-accent opacity-0 group-hover/company:opacity-100 transition-opacity",children:"View profile →"})]}),e.jsx("h3",{className:"text-lg font-bold text-foreground line-clamp-2 mb-2 group-hover:text-accent transition-colors cursor-pointer",children:a}),s&&j==="list"&&e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mb-3 hidden lg:block",children:s}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[e.jsx("span",{children:d}),p&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ut,{className:"w-3 h-3"}),p," min"]}),g&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Aa,{className:"w-3 h-3"}),b(g)]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(P,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>f==null?void 0:f(t),children:e.jsx(St,{className:`w-4 h-4 ${x?"fill-accent text-accent":""}`})}),e.jsx(P,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>k==null?void 0:k(t),children:e.jsx(Pa,{className:"w-4 h-4"})}),v&&e.jsx(P,{variant:"ghost",size:"icon",className:"h-8 w-8",asChild:!0,children:e.jsx("a",{href:v,target:"_blank",rel:"noopener noreferrer",children:e.jsx(bt,{className:"w-4 h-4"})})})]})]})]})]})},GN=[{_id:"68374b58e8908d9dbd8d927d",author:["marjoriepreston","Marjorie Preston"],categories:["Integrated resorts","Land-based casino regulation","Tourism"],company:"iGaming Business",content:`Prime Minister Paetongtarn Shinawatra laid out Thailand's proposed 3.78 trillion baht ($168.3 billion) budget on Wednesday, which could offset some of the impact of US tariff hikes on the Thai economy. The US is Thailand's leading source of export goods.
@@ -7901,7 +7901,7 @@ The partnership is expected to close in Q3 2025, subject to regulatory approvals
7901
7901
  shadow-sm
7902
7902
  hover:shadow
7903
7903
  hover:bg-card/95
7904
- transition-all`,children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold tracking-tight text-lg",children:s(i)}),e.jsxs("p",{className:"font-semibold tracking-tight text-lg",children:[i.location," • ",r(i)]})]}),t.bookMeetingEnabled&&e.jsx(P,{size:"sm",variant:"accent",children:"Book Meeting"})]},o))})},jR=()=>e.jsx(ke,{value:"insights",className:"mt-0",children:e.jsx(U,{children:e.jsxs(_,{className:"py-12 text-center",children:[e.jsx(va,{className:"w-10 h-10 text-muted-foreground mx-auto mb-3"}),e.jsx("h3",{className:"font-semibold mb-2",children:"Premium Insights"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"Unlock demand trends, competitor analysis, and intent signals."}),e.jsx(P,{variant:"accent",children:"Upgrade to Access"})]})})}),wR=({companyOverview:t,similarCompanies:a})=>{var s;return e.jsxs("aside",{className:"space-y-4",children:[e.jsxs(U,{children:[e.jsx(ae,{children:e.jsx(se,{className:"text-base",children:"Contact"})}),e.jsxs(_,{className:"space-y-3",children:[e.jsxs("a",{href:t.website,target:"_blank",className:"flex items-center gap-2 text-sm text-accent hover:underline",children:[e.jsx(Lt,{className:"w-4 h-4"}),t.website.replace(/^https?:\/\//,"")]}),((s=t.socialLinks)==null?void 0:s.linkedin)&&e.jsxs("a",{href:t.socialLinks.linkedin,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground",children:[e.jsx(rl,{className:"w-4 h-4"}),"LinkedIn"]})]})]}),e.jsxs(U,{children:[e.jsx(ae,{children:e.jsx(se,{className:"text-base",children:"Similar Companies"})}),e.jsx(_,{className:"space-y-2",children:a.map((r,i)=>{const o=r.url??(r.slug?`/companies/${r.slug}`:void 0);return o?e.jsx("a",{href:o,className:"flex items-center gap-2 p-2 bg-secondary/50 rounded-lg text-sm text-foreground hover:underline",children:r.name},`${r.name}-${i}`):e.jsx("div",{className:"flex items-center gap-2 p-2 bg-secondary/50 rounded-lg text-sm",children:r.name},`${r.name}-${i}`)})})]})]})},MR=({review:t,onHelpful:a,onShare:s,onReport:r})=>{const i={employee:"Employee",client:"Client",partner:"Partner",competitor:"Industry Peer",other:"Other"};return e.jsx(U,{className:"border-border/50",children:e.jsxs(_,{className:"p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-secondary flex items-center justify-center flex-shrink-0",children:e.jsx(Ra,{className:"w-5 h-5 text-muted-foreground"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-sm text-foreground",children:t.author.displayName}),t.isVerified&&e.jsx(Ee,{className:"w-3.5 h-3.5 text-gaming-success"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.author.relationship&&e.jsx("span",{children:i[t.author.relationship]??t.author.relationship}),t.author.jobTitle&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:t.author.jobTitle})]})]})]})]}),e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:eN(new Date(t.createdAt),{addSuffix:!0})})]}),e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("h4",{className:"font-semibold text-foreground",children:t.title}),e.jsx(Nl,{rating:t.rating,size:"sm"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3 leading-relaxed",children:t.body}),(t.pros||t.cons)&&e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-3",children:[t.pros&&e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"font-medium text-gaming-success text-xs uppercase tracking-wide",children:"Pros"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:t.pros})]}),t.cons&&e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"font-medium text-destructive text-xs uppercase tracking-wide",children:"Cons"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:t.cons})]})]}),e.jsxs("div",{className:"flex items-center gap-3 pt-3 border-t border-border/50",children:[e.jsxs(P,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-accent gap-1.5 h-8",onClick:()=>a==null?void 0:a(t.id),children:[e.jsx(Ao,{className:"w-3.5 h-3.5"}),"Useful ",t.helpfulCount>0&&`(${t.helpfulCount})`]}),e.jsxs(P,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-accent gap-1.5 h-8",onClick:()=>s==null?void 0:s(t.id),children:[e.jsx(Pa,{className:"w-3.5 h-3.5"}),"Share"]}),e.jsx(P,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-destructive gap-1.5 h-8 ml-auto",onClick:()=>r==null?void 0:r(t.id),children:e.jsx(Qi,{className:"w-3.5 h-3.5"})})]})]})})},NR=({summary:t,compact:a=!1})=>{if(t.totalReviews===0)return e.jsx("div",{className:"text-center py-4",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"No reviews yet"})});const s=[5,4,3,2,1];return e.jsxs("div",{className:`flex ${a?"items-center gap-4":"flex-col sm:flex-row gap-6"}`,children:[e.jsxs("div",{className:`text-center ${a?"":"min-w-[100px]"}`,children:[e.jsx("div",{className:"text-3xl font-bold text-foreground",children:t.averageRating}),e.jsx(Nl,{rating:Math.round(t.averageRating),size:"sm"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[t.totalReviews," review",t.totalReviews!==1?"s":""]})]}),!a&&e.jsx("div",{className:"flex-1 space-y-1.5",children:s.map(r=>{const i=t.ratingDistribution[r]??0,o=t.totalReviews>0?i/t.totalReviews*100:0;return e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"w-3 text-right text-muted-foreground",children:r}),e.jsx(Xt,{value:o,className:"h-2 flex-1"}),e.jsx("span",{className:"w-6 text-muted-foreground",children:i})]},r)})})]})},CR=({companyName:t,companyId:a,companySlug:s,open:r,onOpenChange:i,onSubmit:o})=>{const[l,c]=m.useState(0),[h,d]=m.useState(""),[p,g]=m.useState(""),[y,u]=m.useState(""),[x,v]=m.useState(""),[f,k]=m.useState(""),[w,j]=m.useState(!1),[b,T]=m.useState(!1),S=l>0&&h.trim().length>=5&&p.trim().length>=20&&f,N=()=>{!S||l===0||(o==null||o({companyId:a,companySlug:s,title:h.trim(),body:p.trim(),rating:l,pros:y.trim()||void 0,cons:x.trim()||void 0,relationship:f,isAnonymous:w}),T(!0))},L=()=>{c(0),d(""),g(""),u(""),v(""),k(""),j(!1),T(!1),i(!1)};return e.jsx(tt,{open:r,onOpenChange:L,children:e.jsx(Xe,{className:"sm:max-w-[520px]",children:b?e.jsxs(e.Fragment,{children:[e.jsxs(Be,{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-gaming-success/10 flex items-center justify-center mx-auto mb-4",children:e.jsx(pt,{className:"w-8 h-8 text-gaming-success"})}),e.jsx(Ie,{children:"Review Submitted!"}),e.jsx(nt,{className:"text-center",children:"Thank you for your review. It will be published after moderation (usually within 24-48 hours)."})]}),e.jsx(et,{children:e.jsx(P,{variant:"accent",onClick:L,className:"w-full",children:"Done"})})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Be,{children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-accent/20 to-primary/20 flex items-center justify-center mb-2",children:e.jsx(pt,{className:"w-6 h-6 text-accent"})}),e.jsxs(Ie,{children:["Review ",t]}),e.jsxs(nt,{children:["Share your experience working with or for ",t,". All reviews are moderated before publishing."]})]}),e.jsxs("div",{className:"space-y-4 py-2 max-h-[60vh] overflow-y-auto",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Overall Rating *"}),e.jsx(Nl,{rating:l,size:"lg",interactive:!0,onRatingChange:I=>c(I)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Your Relationship *"}),e.jsxs(Je,{value:f,onValueChange:k,children:[e.jsx(Ue,{children:e.jsx(Ye,{placeholder:"How do you know this company?"})}),e.jsxs(_e,{children:[e.jsx(xe,{value:"employee",children:"Current/Former Employee"}),e.jsx(xe,{value:"client",children:"Client / Customer"}),e.jsx(xe,{value:"partner",children:"Business Partner"}),e.jsx(xe,{value:"competitor",children:"Industry Peer"}),e.jsx(xe,{value:"other",children:"Other"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Review Title *"}),e.jsx(ee,{placeholder:"Summarize your experience in a few words",value:h,onChange:I=>d(I.target.value),maxLength:120})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["Your Review * ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(min 20 characters)"})]}),e.jsx(st,{placeholder:"Share details about your experience...",value:p,onChange:I=>g(I.target.value),rows:4,maxLength:2e3})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["Pros ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),e.jsx(st,{placeholder:"What did you like?",value:y,onChange:I=>u(I.target.value),rows:2,maxLength:500})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["Cons ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),e.jsx(st,{placeholder:"What could be improved?",value:x,onChange:I=>v(I.target.value),rows:2,maxLength:500})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border px-4 py-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Post anonymously"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Your name won't be shown publicly"})]}),e.jsx(yt,{checked:w,onCheckedChange:j})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"By submitting, you confirm this review is based on genuine experience and complies with our community guidelines."})]}),e.jsxs(et,{children:[e.jsx(P,{variant:"outline",onClick:L,children:"Cancel"}),e.jsx(P,{variant:"accent",onClick:N,disabled:!S,children:"Submit Review"})]})]})})})},SR=({companyId:t,companySlug:a,companyName:s,reviews:r,summary:i,onLeaveReview:o,onHelpful:l,onReport:c})=>{const[h,d]=m.useState("newest"),[p,g]=m.useState(!1),y=m.useMemo(()=>{const u=[...r];switch(h){case"newest":return u.sort((x,v)=>new Date(v.createdAt).getTime()-new Date(x.createdAt).getTime());case"oldest":return u.sort((x,v)=>new Date(x.createdAt).getTime()-new Date(v.createdAt).getTime());case"highest":return u.sort((x,v)=>v.rating-x.rating);case"lowest":return u.sort((x,v)=>x.rating-v.rating);case"most-helpful":return u.sort((x,v)=>v.helpfulCount-x.helpfulCount);default:return u}},[r,h]);return e.jsxs(ke,{value:"reviews",className:"space-y-6 mt-0",children:[e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(se,{children:"Reviews"}),e.jsxs(P,{variant:"accent",size:"sm",className:"gap-1.5",onClick:()=>g(!0),children:[e.jsx(pt,{className:"w-4 h-4"}),"Add review"]})]})}),e.jsx(_,{children:e.jsx(NR,{summary:i})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:[r.length," review",r.length!==1?"s":""]}),e.jsxs(Je,{value:h,onValueChange:u=>d(u),children:[e.jsx(Ue,{className:"w-[180px]",children:e.jsx(Ye,{})}),e.jsxs(_e,{children:[e.jsx(xe,{value:"newest",children:"Newest reviews"}),e.jsx(xe,{value:"oldest",children:"Oldest reviews"}),e.jsx(xe,{value:"highest",children:"Highest rated"}),e.jsx(xe,{value:"lowest",children:"Lowest rated"}),e.jsx(xe,{value:"most-helpful",children:"Most helpful"})]})]})]}),y.length===0?e.jsx(U,{children:e.jsxs(_,{className:"py-12 text-center",children:[e.jsx(pt,{className:"w-12 h-12 text-muted-foreground/30 mx-auto mb-3"}),e.jsx("p",{className:"text-muted-foreground",children:"No reviews yet. Be the first to share your experience!"}),e.jsx(P,{variant:"accent",size:"sm",className:"mt-4",onClick:()=>g(!0),children:"Write a review"})]})}):e.jsx("div",{className:"space-y-4",children:y.map(u=>e.jsx(MR,{review:u,onHelpful:l,onReport:c},u.id))}),e.jsx(CR,{companyName:s,companyId:t,companySlug:a,open:p,onOpenChange:g,onSubmit:o})]})},LR=t=>{var a,s;if(t==null)return"";if(typeof t=="string"&&t.startsWith("http"))return t;if(typeof t=="string"&&t.startsWith("{"))try{const r=JSON.parse(t.replace(/'/g,'"'));return(r==null?void 0:r.url)??""}catch{return""}return typeof t=="object"?(t==null?void 0:t.url)??((s=(a=t==null?void 0:t.formats)==null?void 0:a.thumbnail)==null?void 0:s.url)??"":""},l9=t=>({profileViews30d:(t==null?void 0:t.profile_views_30d)??(t==null?void 0:t.profileViews30d)??0,followsCount:(t==null?void 0:t.follows_count)??(t==null?void 0:t.followsCount)??0,hiringIntensity:(t==null?void 0:t.hiring_intensity)??(t==null?void 0:t.hiringIntensity)??"Low",topSkillsHiring:(t==null?void 0:t.top_skills_hiring)??(t==null?void 0:t.topSkillsHiring)??[],topViewingCountries:(t==null?void 0:t.top_viewing_countries)??(t==null?void 0:t.topViewingCountries)??[],oftenComparedWith:(t==null?void 0:t.often_compared_with)??(t==null?void 0:t.oftenComparedWith)??[],similarCompanies:(t==null?void 0:t.similar_companies)??(t==null?void 0:t.similarCompanies)??[]}),IR=t=>{if(t)return{capabilitiesScore:t.capabilities_score??t.capabilitiesScore??0,credibilityScore:t.credibility_score??t.credibilityScore??0,complianceScore:t.compliance_score??t.complianceScore??0,hiringScore:t.hiring_score??t.hiringScore??0,overallScore:t.overall_score??t.overallScore??0,detectedBusinessModel:t.detected_business_model??t.detectedBusinessModel??"",detectedProducts:t.detected_products??t.detectedProducts??[],detectedMarkets:t.detected_markets??t.detectedMarkets??[]}},AR=t=>({id:String(t.id??t.company_id??""),name:t.name??"",slug:t.slug??"",companyType:t.company_type??t.companyType,overview:t.overview?{shortDescription:t.overview.short_description??t.overview.shortDescription,headquarters:t.overview.headquarters,employeeRange:t.overview.employee_range??t.overview.employeeRange}:void 0,isPrimary:t.is_primary??t.isPrimary}),PR=t=>({id:String((t==null?void 0:t.id)??(t==null?void 0:t.group_id)??""),name:(t==null?void 0:t.name)??(t==null?void 0:t.group_name)??"",slug:(t==null?void 0:t.slug)??"",website:(t==null?void 0:t.website)??"",description:(t==null?void 0:t.description)??"",primaryCompanyId:(t==null?void 0:t.primary_company_id)??(t==null?void 0:t.primaryCompanyId)??"",companies:Array.isArray(t==null?void 0:t.companies)?t.companies.map(AR):[],intelligenceProfile:l9((t==null?void 0:t.intelligence_profile)??(t==null?void 0:t.intelligenceProfile))}),TR=t=>{var a,s;return{shortDescription:(t==null?void 0:t.shortDescription)??(t==null?void 0:t.short_description)??"",longDescription:(t==null?void 0:t.longDescription)??(t==null?void 0:t.long_description),foundedYear:typeof(t==null?void 0:t.foundedYear)=="number"?t.foundedYear:0,headquarters:{city:((a=t==null?void 0:t.headquarters)==null?void 0:a.city)??"",country:((s=t==null?void 0:t.headquarters)==null?void 0:s.country)??""},officeLocations:t==null?void 0:t.officeLocations,employeeRange:(t==null?void 0:t.employeeRange)??(t==null?void 0:t.employee_range)??"",publicCompany:t==null?void 0:t.publicCompany,stockTicker:t==null?void 0:t.stockTicker,website:(t==null?void 0:t.website)??"",socialLinks:t==null?void 0:t.socialLinks}},RR=t=>({searchImpressions:(t==null?void 0:t.searchImpressions)??0,profileClicks:(t==null?void 0:t.profileClicks)??0,externalClicks:(t==null?void 0:t.externalClicks)??0}),DR=t=>{var a,s,r;return{...t,overview:TR(t.overview),logo:LR(t.logo),jobs:zR(t.jobs),group:PR(t.group),groupId:t.groupId??t.group_id??((a=t.group)==null?void 0:a.id),groupName:t.groupName??t.group_name??((s=t.group)==null?void 0:s.name),groupSlug:t.group_slug??t.groupSlug??((r=t.group)==null?void 0:r.slug),signalsAndInsights:l9(t.signalsAndInsights??t.signals_and_insights??t.signalsAndInsights)??t.signalsAndInsights,visibilityMetrics:RR(t.visibilityMetrics),intelligenceProfile:IR(t.intelligence_profile??t.intelligenceProfile),classification:qR(t.classification)}},zR=t=>({openRoles:Array.isArray(t==null?void 0:t.openRoles)||typeof(t==null?void 0:t.openRoles)=="number"?t.openRoles:[],departmentsHiring:Array.isArray(t==null?void 0:t.departmentsHiring)?t.departmentsHiring:[],locationsHiring:Array.isArray(t==null?void 0:t.locationsHiring)?t.locationsHiring:[],remotePolicy:(t==null?void 0:t.remotePolicy)??""}),qR=t=>({businessModel:(t==null?void 0:t.businessModel)??(t==null?void 0:t.business_model)??"",verticals:Array.isArray(t==null?void 0:t.verticals)?t.verticals:[],productCategories:Array.isArray(t==null?void 0:t.productCategories)?t.productCategories:[],tags:((t==null?void 0:t.tags)??[]).map(a=>typeof a=="string"?a:a.title??a.tag??"")}),FR=t=>({count:(t==null?void 0:t.count)??0,page:(t==null?void 0:t.page)??1,pageSize:(t==null?void 0:t.page_size)??(t==null?void 0:t.pageSize)??0,totalPages:(t==null?void 0:t.total_pages)??(t==null?void 0:t.totalPages)??1,results:Array.isArray(t==null?void 0:t.results)?t.results.map(DR):[],filterOptions:(t==null?void 0:t.filter_options)??(t==null?void 0:t.filterOptions)}),HR=t=>{if(typeof t=="string")return t;const a=t.city??t.cities??t.location,s=t.country;return`${a??"Remote"}, ${s??"Global"}`},ER=[{name:"Casino Games (Slots & RNG)",category:"Game Content",description:"RNG-based casino games including slots and table games.",keywords:["slot","rng","casino game","table game","jackpot","buy bonus"],negativeKeywords:["live casino games","live casino"],priority:10},{name:"Live Casino Games",category:"Live Casino",description:"Live dealer games streamed from professional studios.",keywords:["live casino games","live dealer games","roulette games","live roulette","sic-bo","presenter"],negativeKeywords:["real-time reporting"],priority:10},{name:"iGaming Platform / PAM",category:"Platform",description:"Core iGaming platform including player accounts, wallet, and cashier.",keywords:["pam","aggregation platform","cashier","player account"],negativeKeywords:[],priority:10},{name:"Game Aggregation",category:"Aggregation",description:"Single API access to multiple game providers.",keywords:["aggregation","aggregator","single api","content hub"],negativeKeywords:[],priority:10},{name:"Bonus & Promotions Platform",category:"CRM & Engagement",description:"Bonus management, promotions, and player engagement tools.",keywords:["bonus tools","promotional tools","free spins tools","tournament","leaderboard","rewards tools","bonus features","bonus platform"],negativeKeywords:[],priority:10},{name:"Back Office & Analytics",category:"Operations",description:"Reporting, dashboards, and performance analytics.",keywords:["back office","real-time reporting","analytics","easy-to-use tools","insights"],negativeKeywords:[],priority:10},{name:"Live Casino Infrastructure",category:"Technology",description:"Hardware, streaming, and infrastructure for live casino operations.",keywords:["streaming","video streaming","Live Casino studio","professional game hosts"],negativeKeywords:[],priority:10},{name:"Payments & Payouts",category:"Payments",description:"Payment processing, deposits, and withdrawals.",keywords:["Payment processing","psp","payout","withdrawal","deposit"],negativeKeywords:[],priority:10},{name:"Compliance & Risk",category:"Compliance",description:"KYC, AML, fraud prevention, and responsible gaming.",keywords:["kyc detection","aml detection","compliance tools","fraud detection","fraud prevention","responsible gaming tools"],negativeKeywords:[],priority:10}];function BR(t,a){var o;const s=a.toLowerCase();return!(!t.keywords.some(l=>s.includes(l))||((o=t.negativeKeywords)==null?void 0:o.some(l=>s.includes(l))))}function VR(t){return t!==null}const OR=t=>ER.map(a=>{const s=t.filter(r=>BR(a,r));return s.length===0?null:{name:a.name,category:a.category,description:a.description,keyDifferentiators:Array.from(new Set(s)),source:"derived",confidence:Math.min(1,s.length/5),priority:a.priority}}).filter(VR).sort((a,s)=>s.priority-a.priority),GR=(t,a)=>Array.isArray(t)&&t.length>0?t:a.map(s=>({name:s})),UR=({company:t,jobs:a,news:s,events:r,showReviews:i=!1,reviews:o,followLoading:l=!1,followDisabled:c=!1,onToggleFollow:h,onFollowAction:d,saveLoading:p=!1,saveDisabled:g=!1,onToggleSave:y,onSaveAction:u,canClaim:x,onClaimSubmit:v,claimPrefill:f,onBack:k,activeTab:w,tabPaths:j,onTabChange:b,similarCompanies:T})=>{var he,te,O,X,F,z,B,ce;const[S,N]=m.useState(!1),[L,I]=m.useState(w??"overview");if(m.useEffect(()=>{w&&I(w)},[w]),!t)return e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"container mx-auto px-4 py-16 text-center",children:[e.jsx(Me,{className:"w-16 h-16 text-muted-foreground mx-auto mb-4"}),e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Company Not Found"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"The company you're looking for doesn't exist."}),e.jsx("a",{href:"/companies",children:e.jsx(P,{variant:"accent",children:"Browse Directory"})})]})});const A=((te=(he=t.webIntelligence)==null?void 0:he.menus.primary_nav_details)==null?void 0:te.flatMap(ue=>ue.key_points))??[],C=t.trustAndCompliance.licenses.length+t.trustAndCompliance.certifications.length+t.trustAndCompliance.awards.length,M=t.signalsAndInsights,R=GR(T,M.similarCompanies),D=a??[],H=s??[],G=r??[],E=o??[],W=i&&Array.isArray(o),J=E.reduce((ue,Ne)=>(ue.totalReviews+=1,ue.ratingDistribution[Ne.rating]+=1,ue.averageRating+=Ne.rating,ue),{averageRating:0,totalReviews:0,ratingDistribution:{1:0,2:0,3:0,4:0,5:0}});J.totalReviews>0&&(J.averageRating=Math.round(J.averageRating/J.totalReviews*10)/10);const Y=D.length>0?D.length:Array.isArray(t.jobs.openRoles)?t.jobs.openRoles.length:t.jobs.openRoles,re=((O=t.group)==null?void 0:O.name)??t.groupName??t.group_name??null,oe=((X=t.group)==null?void 0:X.slug)??t.groupSlug??t.group_slug??((F=t.group)==null?void 0:F.id)??t.groupId??t.group_id??void 0,$=OR(A),Q=[...t.productsAndServices??[],...$??[]],de=[{value:"overview",label:"Overview",icon:fa},{value:"products",label:"Products",icon:No},{value:"trust",label:"Trust",icon:Ta},{value:"people",label:"People",icon:Ns},{value:"jobs",label:"Jobs",icon:je},{value:"news",label:"News",icon:Ut},{value:"events",label:"Events",icon:da},...W?[{value:"reviews",label:"Reviews",icon:pt}]:[],{value:"insights",label:"Insights",icon:va,disabled:!0}],ve=ue=>{const Ne=ue;w||I(Ne),b==null||b({tab:Ne,path:j==null?void 0:j[Ne]})};return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(i9,{companyName:t.name,companyType:t.companyType,overview:t.overview,classification:t.classification,companyId:t.id,companySlug:t.slug,groupSlug:oe,groupLabel:re??"Gaming",signalsAndInsights:t.signalsAndInsights,claimedStatus:t.claimedStatus,isFollowing:t.isFollowing,isSaved:t.isSaved,openRolesCount:Y,trustScore:C,onBack:k,saveDisabled:g,saveLoading:p,canClaim:x,onToggleFollow:h,onFollowAction:d,onToggleSave:y,onSaveAction:u,followLoading:l,followDisabled:c,onClaimClick:()=>N(!0)}),e.jsx("section",{className:"py-6",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs(Da,{value:w??L,onValueChange:ve,className:"space-y-6",children:[e.jsx(o9,{items:de}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[e.jsx(pR,{overview:t.overview,classification:t.classification,officeLocations:t.overview.officeLocations??[],formatOfficeLocation:HR}),e.jsx(xR,{products:Q}),e.jsx(gR,{companyTrustData:t.trustAndCompliance,credibilityEvidence:(ce=(B=(z=t.webIntelligence)==null?void 0:z.signals)==null?void 0:B.evidence)==null?void 0:ce.credibility}),e.jsx(fR,{members:t.people.members}),e.jsx(vR,{company:t,jobListings:D,openRolesCount:Y}),e.jsx(kR,{companyNews:t.newsAndMedia,newsArticles:H}),e.jsx(bR,{companyEvents:t.events,conferenceEvents:G}),W&&e.jsx(SR,{companyId:t.id,companySlug:t.slug,companyName:t.name,reviews:E,summary:J}),e.jsx(jR,{})]}),e.jsx(wR,{companyOverview:t.overview,similarCompanies:R})]})]})})}),e.jsx(mR,{company:t,open:S,onOpenChange:N,onClaimSubmit:v,claimPrefill:f})]})},_R=({group:t})=>{var r,i;if(!t)return e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"container mx-auto px-4 py-16 text-center",children:[e.jsx(Me,{className:"w-16 h-16 text-muted-foreground mx-auto mb-4"}),e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Group Not Found"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"The group you're looking for doesn't exist."}),e.jsx("a",{href:"/companies",children:e.jsx(P,{variant:"accent",children:"Browse Companies"})})]})});const a=t.intelligenceProfile,s=((r=t.companies)==null?void 0:r.length)??0;return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("section",{className:"bg-gradient-to-br from-primary via-primary to-primary-variant py-8",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsxs("a",{href:"/companies",className:"inline-flex items-center text-primary-foreground/70 hover:text-primary-foreground mb-6 text-sm",children:[e.jsx(la,{className:"w-4 h-4 mr-1"})," Back to Directory"]}),e.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[e.jsx("div",{className:"w-20 h-20 rounded-2xl bg-white/10 backdrop-blur flex items-center justify-center flex-shrink-0",children:e.jsx(Me,{className:"w-10 h-10 text-primary-foreground"})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[e.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-primary-foreground",children:t.name}),e.jsx(q,{className:"bg-white/10 text-primary-foreground border-white/20",children:"Company Group"})]}),t.description&&e.jsx("p",{className:"text-primary-foreground/80 text-sm mb-4 max-w-2xl",children:t.description}),e.jsx("div",{className:"flex flex-wrap gap-2",children:t.website&&e.jsx("a",{href:t.website,target:"_blank",rel:"noreferrer",children:e.jsxs(P,{variant:"outline",className:"border-primary-foreground/30 text-primary-foreground hover:bg-primary-foreground/10",children:[e.jsx(Lt,{className:"w-4 h-4 mr-2"})," Visit Website"]})})})]}),a&&e.jsxs("div",{className:"flex gap-4 md:gap-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-primary-foreground",children:s}),e.jsx("div",{className:"text-xs text-primary-foreground/70",children:"Member Companies"})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-primary-foreground",children:[(a.profileViews30d/1e3).toFixed(1),"k"]}),e.jsx("div",{className:"text-xs text-primary-foreground/70",children:"Views/30d"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-primary-foreground",children:a.followsCount.toLocaleString()}),e.jsx("div",{className:"text-xs text-primary-foreground/70",children:"Followers"})]})]})]})]})}),e.jsx("section",{className:"py-8",children:e.jsxs("div",{className:"container mx-auto px-4 space-y-6",children:[e.jsxs(U,{children:[e.jsx(ae,{children:e.jsx(se,{children:"Group Overview"})}),e.jsxs(_,{className:"space-y-4",children:[t.website&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-accent",children:[e.jsx(Lt,{className:"w-4 h-4"}),e.jsx("a",{href:t.website,target:"_blank",rel:"noreferrer",className:"hover:underline",children:t.website.replace(/^https?:\/\//,"")})]}),t.description?e.jsx("p",{className:"text-muted-foreground",children:t.description}):e.jsx("p",{className:"text-muted-foreground",children:"No group description available yet."})]})]}),e.jsxs(U,{children:[e.jsx(ae,{children:e.jsx(se,{children:"Member Companies"})}),e.jsxs(_,{className:"space-y-3",children:[s===0&&e.jsx("p",{className:"text-muted-foreground",children:"No member companies listed."}),(i=t.companies)==null?void 0:i.map(o=>{var c,h,d;const l=o.isPrimary||o.id===t.primaryCompanyId;return e.jsxs("div",{className:`flex flex-col md:flex-row md:items-center md:justify-between gap-3 rounded-lg border p-4 ${l?"border-accent/40 bg-accent/5":"border-border"}`,children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("a",{href:`/companies/${o.slug}`,className:"font-semibold hover:text-accent",children:o.name}),l&&e.jsx(q,{className:"bg-accent/10 text-accent border-accent/20",children:"Primary"})]}),((c=o.overview)==null?void 0:c.shortDescription)&&e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:o.overview.shortDescription})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm text-muted-foreground",children:[((h=o.overview)==null?void 0:h.headquarters)&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Me,{className:"w-4 h-4"}),o.overview.headquarters.city,", ",o.overview.headquarters.country]}),((d=o.overview)==null?void 0:d.employeeRange)&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ze,{className:"w-4 h-4"}),o.overview.employeeRange]})]})]},o.id)})]})]}),a&&e.jsxs(U,{children:[e.jsx(ae,{children:e.jsx(se,{children:"Group Intelligence"})}),e.jsxs(_,{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"rounded-lg border border-border/60 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(Ze,{className:"w-4 h-4"})," Followers"]}),e.jsx("div",{className:"text-2xl font-semibold mt-2",children:a.followsCount.toLocaleString()})]}),e.jsxs("div",{className:"rounded-lg border border-border/60 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx($e,{className:"w-4 h-4"})," Hiring Intensity"]}),e.jsx("div",{className:"text-2xl font-semibold mt-2",children:a.hiringIntensity})]}),e.jsxs("div",{className:"rounded-lg border border-border/60 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(ze,{className:"w-4 h-4"})," Top Viewing Countries"]}),e.jsx("div",{className:"text-sm font-medium mt-2",children:a.topViewingCountries.join(", ")||"No data"})]})]})]})]})})]})},$R=(t,a)=>{const{buildUrl:s,initialData:r}=a,[i,o]=m.useState(r??null),[l,c]=m.useState(!r),h=m.useMemo(()=>s(t),[s,t]);return m.useEffect(()=>{let d=!1;return c(!0),fetch(h).then(p=>{if(!p.ok)throw new Error(`Failed to load companies: ${p.status}`);return p.json()}).then(p=>{d||o(FR(p))}).catch(p=>{console.error(p)}).finally(()=>{d||c(!1)}),()=>{d=!0}},[h]),{data:i,loading:l}},HM={query:"",filters:{},sort:"popularity_desc",page:1,pageSize:50,scope:"company"},Et=(t,a)=>{var s;return((s=t.get(a))==null?void 0:s.split(",").filter(Boolean))??[]},$N=(t,a)=>{const s=Number(t);return Number.isFinite(s)&&s>0?s:a},WR=t=>{var s,r,i,o,l,c,h;const a=new URLSearchParams;return t.query&&a.set("query",t.query),t.sort&&a.set("sort",t.sort),t.scope&&t.scope!=="company"&&a.set("scope",t.scope),t.segment&&a.set("segment",t.segment),t.subcategory&&a.set("subcategory",t.subcategory),t.region&&a.set("region",t.region),a.set("page",String(t.page)),a.set("pageSize",String(t.pageSize)),t.filters.companyType&&a.set("filters[companyType]",t.filters.companyType),(s=t.filters.country)!=null&&s.length&&a.set("filters[country]",t.filters.country.join(",")),(r=t.filters.products)!=null&&r.length&&a.set("filters[products]",t.filters.products.join(",")),(i=t.filters.employees)!=null&&i.length&&a.set("filters[employees]",t.filters.employees.join(",")),(o=t.filters.verticals)!=null&&o.length&&a.set("filters[verticals]",t.filters.verticals.join(",")),(l=t.filters.productCategories)!=null&&l.length&&a.set("filters[productCategories]",t.filters.productCategories.join(",")),(c=t.filters.openRoles)!=null&&c.length&&a.set("filters[openRoles]",t.filters.openRoles.join(",")),(h=t.filters.yearsActive)!=null&&h.length&&a.set("filters[yearsActive]",t.filters.yearsActive.join(",")),t.filters.hiringNow&&a.set("filters[hiringNow]","true"),t.filters.claimedOnly&&a.set("filters[claimedOnly]","true"),t.filters.hasLicenses&&a.set("filters[hasLicenses]","true"),t.filters.hasAwards&&a.set("filters[hasAwards]","true"),a.toString()},ZR=(t,a=HM)=>{const s=new URLSearchParams(t),r=s.get("scope"),i=r==="group"||r==="company"?r:a.scope,o=s.get("query")??s.get("search")??a.query??"",l=s.get("pageSize")??s.get("page_size");return{...a,query:o,sort:s.get("sort")??a.sort,page:$N(s.get("page"),a.page),pageSize:$N(l,a.pageSize),scope:i,segment:s.get("segment")??a.segment,subcategory:s.get("subcategory")??a.subcategory,region:s.get("region")??a.region,filters:{companyType:s.get("filters[companyType]")??s.get("companyType")??a.filters.companyType,country:Et(s,"filters[country]").concat(Et(s,"country")),products:Et(s,"filters[products]").concat(Et(s,"products")),employees:Et(s,"filters[employees]").concat(Et(s,"employees")).concat(Et(s,"employeeRanges")),verticals:Et(s,"filters[verticals]").concat(Et(s,"verticals")),productCategories:Et(s,"filters[productCategories]").concat(Et(s,"productCategories")),openRoles:Et(s,"filters[openRoles]").concat(Et(s,"openRoles")),yearsActive:Et(s,"filters[yearsActive]").concat(Et(s,"yearsActive")),hiringNow:["true","1","yes"].includes(s.get("filters[hiringNow]")??s.get("hiringNow")??""),claimedOnly:["true","1","yes"].includes(s.get("filters[claimedOnly]")??s.get("claimedOnly")??""),hasLicenses:["true","1","yes"].includes(s.get("filters[hasLicenses]")??s.get("hasLicenses")??""),hasAwards:["true","1","yes"].includes(s.get("filters[hasAwards]")??s.get("hasAwards")??"")}}},JR=t=>({...t9,search:t.query??"",companyType:t.filters.companyType??"",verticals:t.filters.verticals??[],productCategories:t.filters.productCategories??[],employeeRanges:t.filters.employees??[],products:t.filters.products??[],openRolesRanges:t.filters.openRoles??[],yearsActiveRanges:t.filters.yearsActive??[],hiringNow:t.filters.hiringNow??!1,scope:t.scope,claimedOnly:t.filters.claimedOnly??!1,hasLicenses:t.filters.hasLicenses??!1,hasAwards:t.filters.hasAwards??!1}),YR=t=>({companyType:t.companyType||void 0,verticals:t.verticals.length?t.verticals:void 0,productCategories:t.productCategories.length?t.productCategories:void 0,employees:t.employeeRanges.length?t.employeeRanges:void 0,products:t.products.length?t.products:void 0,openRoles:t.openRolesRanges.length?t.openRolesRanges:void 0,yearsActive:t.yearsActiveRanges.length?t.yearsActiveRanges:void 0,hiringNow:t.hiringNow||void 0,claimedOnly:t.claimedOnly||void 0,hasLicenses:t.hasLicenses||void 0,hasAwards:t.hasAwards||void 0}),KR={companyTypes:[],verticals:[],productCategories:[],employeeRanges:[],products:[],openRolesRanges:[],yearsActiveRanges:[]},XR=[{value:"popularity",label:"Most Active"},{value:"name_asc",label:"Name (A-Z)"},{value:"name_desc",label:"Name (Z-A)"},{value:"employees",label:"Company Size"}],QR=4,eD=({initialData:t,initialFilterOptions:a,buildUrl:s,initialQuery:r,maxCompare:i=QR,sortOptions:o=XR,followDisabled:l=!1,followLoading:c=!1,onToggleFollow:h,onFollowAction:d,saveDisabled:p=!1,saveLoading:g=!1,onToggleSave:y,onSaveAction:u})=>{const[x,v]=m.useState(()=>r||(typeof window>"u"?HM:ZR(window.location.search,HM))),[f,k]=m.useState("list"),[w,j]=m.useState(a),{data:b,loading:T}=$R(x,{buildUrl:s,initialData:t}),S=b??t,N=T&&!b,L=m.useMemo(()=>JR(x),[x]);m.useEffect(()=>{if(typeof window>"u")return;const D=WR(x),H=D?`${window.location.pathname}?${D}`:window.location.pathname;window.history.replaceState(null,"",H)},[x]),m.useEffect(()=>{b!=null&&b.filterOptions&&j({...KR,...b.filterOptions})},[b]);const I=D=>{v(H=>({...H,query:D.search,scope:D.scope,filters:YR(D),page:1}))},A=()=>{I(t9)},C=D=>{v(H=>({...H,page:D}))},M=D=>{v(H=>({...H,pageSize:D,page:1}))},R=()=>{k(D=>D==="grid"?"list":"grid")};return e.jsx(r9,{companies:S.results,loading:N,page:S.page,pageSize:S.pageSize||x.pageSize,totalCount:S.count,totalPages:S.totalPages,onPageChange:C,onPageSizeChange:M,filters:L,filterOptions:w,onFiltersChange:I,onClearFilters:A,viewMode:f,onViewModeChange:R,maxCompare:i,sortOptions:o,followDisabled:l,followLoading:c,onToggleFollow:h,onFollowAction:d,saveDisabled:p,saveLoading:g,onToggleSave:y,onSaveAction:u})},tD=({isClaimed:t,canClaim:a,onClaimClick:s})=>t||!a?null:e.jsx(P,{type:"button",variant:"ghost",className:"text-primary-foreground",onClick:s,children:"Claim this company"});function aD({title:t,value:a,description:s,icon:r,trend:i}){return e.jsxs(U,{children:[e.jsxs(ae,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(se,{className:"text-sm font-medium",children:t}),e.jsx(r,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(_,{children:[e.jsx("div",{className:"text-2xl font-bold",children:a}),s&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:s}),i&&e.jsxs("p",{className:`text-xs mt-1 ${i.isPositive?"text-green-600":"text-red-600"}`,children:[i.isPositive?"+":"-",i.value," from last month"]})]})]})}function sD({stats:t}){return e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:t.map((a,s)=>e.jsx(aD,{...a},s))})}const nD=["Sarah","Michael","Emma","James","Olivia","William","Sophia","Robert","Isabella","David","Mia","John","Charlotte","Daniel","Amelia"],rD=["Johnson","Smith","Williams","Brown","Jones","Garcia","Miller","Davis","Rodriguez","Martinez","Hernandez","Lopez","Wilson","Anderson","Thomas"],iD=["Malta","London, UK","Stockholm, Sweden","Madrid, Spain","Lisbon, Portugal","Remote","Berlin, Germany","Tallinn, Estonia","Athens, Greece"],oD=["Retention Manager","CRM Specialist","Senior Game Designer","Payments Risk Analyst","Compliance Officer","Affiliate Manager","Product Owner","VIP Support Lead","UX Researcher","Data Analyst"],WN=["Senior Backend Engineer","Game Producer","QA Lead","CRM Manager","Compliance Analyst","Fraud Specialist","Payments Manager","BI Analyst","VIP Account Manager"],jM=["Lifecycle marketing","Player engagement","Responsible gaming","SQL","Live casino ops","Fraud detection","A/B testing","Segmentation","KYC/AML","Game math","Figma","Analytics"],ZN=["MGA","UKGC","DGA","B2B","Curaçao"],lD=["LinkedIn","Referral","Job board","Career page","Recruiter outreach"],cD=["new","reviewed","shortlisted","rejected"],dD=[1,2,3,4,5,null],Zt=t=>t[Math.floor(Math.random()*t.length)],wM=t=>{const a=new Date;return a.setDate(a.getDate()-Math.floor(Math.random()*t)),a.toISOString()},hD=(t=32)=>Array.from({length:t}).map((a,s)=>{const r=Zt(nD),i=Zt(rD),o=Zt(dD),l=Zt(cD),c=wM(45),h=wM(14);return{id:`candidate-${s+1}`,firstName:r,lastName:i,title:Zt(oD),location:Zt(iD),appliedDate:c,lastActive:h,source:Zt(lD),yearsExperience:Math.floor(Math.random()*8)+2,status:l,rating:o,skills:Array.from(new Set([Zt(jM),Zt(jM),Zt(jM)])).slice(0,3),licenses:Array.from(new Set([Zt(ZN),Zt(ZN)])).slice(0,2),appliedJobs:Array.from(new Set([Zt(WN),Zt(WN)])).slice(0,2),notes:[{id:`note-${s}-1`,author:"Recruiter",note:"Strong iGaming domain knowledge with proven retention wins.",createdAt:wM(20),isInternal:!0}]}}),MM={new:"New",reviewed:"Reviewed",shortlisted:"Shortlisted",rejected:"Rejected"},JN={new:"outline",reviewed:"secondary",shortlisted:"default",rejected:"destructive"},c9=({candidate:t,canEdit:a=!1,onNameClick:s,onStatusChange:r,onRatingChange:i,onAddNote:o})=>{const[l,c]=m.useState(""),[h,d]=m.useState(!0),p=m.useMemo(()=>`${t.firstName} ${t.lastName}`,[t.firstName,t.lastName]),g=m.useMemo(()=>new Date(t.appliedDate).toLocaleDateString(),[t.appliedDate]),y=m.useMemo(()=>new Date(t.lastActive).toLocaleDateString(),[t.lastActive]),u=()=>{!l.trim()||!o||(o(t.id,l.trim(),h),c(""))};return e.jsxs(U,{className:"border-muted/60",children:[e.jsxs(ae,{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(P,{variant:"link",className:"h-auto p-0 text-lg font-semibold",onClick:()=>s==null?void 0:s(t.id),children:p}),e.jsx(q,{variant:JN[t.status],children:MM[t.status]})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t.title}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-sm text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Te,{className:"h-4 w-4"}),t.location]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(je,{className:"h-4 w-4"}),t.yearsExperience,"+ yrs"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(da,{className:"h-4 w-4"}),"Applied ",g]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:items-end",children:[a?e.jsxs(Je,{value:t.status,onValueChange:x=>r==null?void 0:r(t.id,x),children:[e.jsx(Ue,{className:"w-44",children:e.jsx(Ye,{placeholder:"Update status"})}),e.jsx(_e,{children:Object.entries(MM).map(([x,v])=>e.jsx(xe,{value:x,children:v},x))})]}):e.jsxs(q,{variant:JN[t.status],children:["Status: ",MM[t.status]]}),e.jsxs("div",{className:"flex items-center gap-1",children:[Array.from({length:5}).map((x,v)=>{const f=v+1,k=t.rating!==null&&t.rating>=f;return e.jsx(P,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>a&&(i==null?void 0:i(t.id,f)),disabled:!a,children:e.jsx(Ze,{className:k?"h-4 w-4 text-yellow-500":"h-4 w-4 text-muted-foreground"})},`${t.id}-star-${v}`)}),t.rating===null&&e.jsx("span",{className:"text-xs text-muted-foreground",children:"Unrated"})]})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.licenses.map(x=>e.jsx(q,{variant:"secondary",children:x},x)),t.skills.map(x=>e.jsx(q,{variant:"outline",children:x},x))]})]}),e.jsxs(_,{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap gap-4 text-sm text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(fa,{className:"h-4 w-4"}),"Source: ",t.source]}),e.jsxs("span",{children:["Last active ",y]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-semibold",children:"Applied roles"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:t.appliedJobs.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No roles attached."}):t.appliedJobs.map(x=>e.jsx(q,{variant:"outline",children:x},x))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-semibold",children:"Notes"}),e.jsx("div",{className:"space-y-2",children:t.notes.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No notes yet."}):t.notes.map(x=>e.jsxs("div",{className:"rounded-lg border px-3 py-2 text-sm",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-xs text-muted-foreground",children:[e.jsxs("span",{children:[x.author," • ",new Date(x.createdAt).toLocaleDateString()]}),x.isInternal&&e.jsx(q,{variant:"outline",children:"Internal"})]}),e.jsx("p",{className:"mt-2",children:x.note})]},x.id))})]}),a&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(st,{value:l,onChange:x=>c(x.target.value),placeholder:"Add a note about this candidate...",rows:3}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(Vt,{checked:h,onCheckedChange:x=>d(!!x)}),"Internal note"]}),e.jsx(P,{size:"sm",onClick:u,disabled:!l.trim(),children:"Add note"})]})]})]})]})},mD=[{value:"all",label:"All"},{value:"new",label:"New"},{value:"reviewed",label:"Reviewed"},{value:"shortlisted",label:"Shortlisted"},{value:"rejected",label:"Rejected"}],uD={recent:"Most recent",name:"Name",rating:"Rating"},d9=({company:t,onUpdate:a,isSaving:s=!1,canEdit:r=!1})=>{const[i,o]=m.useState(()=>hD()),[l,c]=m.useState(""),[h,d]=m.useState("all"),[p,g]=m.useState("recent"),[y,u]=m.useState(null),x=m.useMemo(()=>i.reduce((b,T)=>(b[T.status]+=1,b.all+=1,b),{all:0,new:0,reviewed:0,shortlisted:0,rejected:0}),[i]),v=m.useMemo(()=>{const j=l.trim().toLowerCase(),b=N=>j?[`${N.firstName} ${N.lastName}`.toLowerCase(),N.title.toLowerCase(),N.location.toLowerCase(),N.skills.join(" ").toLowerCase()].join(" ").includes(j):!0;return(h==="all"?i:i.filter(N=>N.status===h)).filter(b).sort((N,L)=>{switch(p){case"name":{const I=`${N.lastName} ${N.firstName}`.toLowerCase(),A=`${L.lastName} ${L.firstName}`.toLowerCase();return I.localeCompare(A)}case"rating":{const I=N.rating??0;return(L.rating??0)-I}case"recent":default:return new Date(L.appliedDate).getTime()-new Date(N.appliedDate).getTime()}})},[i,l,p,h]),f=(j,b)=>{o(T=>T.map(S=>S.id===j?{...S,status:b}:S)),a({type:"candidates",payload:{action:"change-status",candidateId:j,status:b}})},k=(j,b)=>{o(T=>T.map(S=>S.id===j?{...S,rating:b}:S)),a({type:"candidates",payload:{action:"rate",candidateId:j,rating:b}})},w=(j,b,T)=>{o(S=>S.map(N=>N.id===j?{...N,notes:[{id:`${j}-${Date.now()}`,author:t.name,note:b,createdAt:new Date().toISOString(),isInternal:T},...N.notes]}:N)),a({type:"candidates",payload:{action:"add-note",candidateId:j,note:b,isInternal:T}})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold",children:"Candidates"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Review applicants and track status updates across your pipeline."}),y&&e.jsxs("p",{className:"text-sm text-muted-foreground mt-2",children:["Selected candidate:"," ",(()=>{const j=i.find(b=>b.id===y);return j?`${j.firstName} ${j.lastName}`:"Unknown"})()]})]}),s&&e.jsx(q,{variant:"secondary",className:"w-fit",children:"Syncing updates..."})]}),e.jsxs(U,{children:[e.jsxs(ae,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(se,{children:"Pipeline overview"}),e.jsx(Pe,{children:"Filter, sort, and review candidate activity."})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:mD.map(j=>e.jsxs(P,{variant:h===j.value?"default":"outline",size:"sm",onClick:()=>d(j.value),children:[j.label,e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:x[j.value]})]},j.value))}),e.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[e.jsx(ee,{placeholder:"Search by name, role, or skill",value:l,onChange:j=>c(j.target.value),className:"md:max-w-sm"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Sort by"}),e.jsxs(Je,{value:p,onValueChange:j=>g(j),children:[e.jsx(Ue,{className:"w-40",children:e.jsx(Ye,{placeholder:"Sort by"})}),e.jsx(_e,{children:Object.entries(uD).map(([j,b])=>e.jsx(xe,{value:j,children:b},j))})]})]})]})]}),e.jsx(_,{className:"space-y-6",children:v.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No candidates match the current filters."}):e.jsx("div",{className:"space-y-6",children:v.map(j=>e.jsx(c9,{candidate:j,canEdit:r,onNameClick:u,onStatusChange:f,onRatingChange:k,onAddNote:w},j.id))})})]})]})},Ts=ea.Root,pD=ea.Portal,h9=ie.forwardRef(({className:t,...a},s)=>e.jsx(ea.Overlay,{className:ne("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...a,ref:s}));h9.displayName=ea.Overlay.displayName;const Qa=ie.forwardRef(({className:t,...a},s)=>e.jsxs(pD,{children:[e.jsx(h9,{}),e.jsx(ea.Content,{ref:s,className:ne("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...a})]}));Qa.displayName=ea.Content.displayName;const es=({className:t,...a})=>e.jsx("div",{className:ne("flex flex-col space-y-2 text-center sm:text-left",t),...a});es.displayName="AlertDialogHeader";const ts=({className:t,...a})=>e.jsx("div",{className:ne("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a});ts.displayName="AlertDialogFooter";const as=ie.forwardRef(({className:t,...a},s)=>e.jsx(ea.Title,{ref:s,className:ne("text-lg font-semibold",t),...a}));as.displayName=ea.Title.displayName;const ss=ie.forwardRef(({className:t,...a},s)=>e.jsx(ea.Description,{ref:s,className:ne("text-sm text-muted-foreground",t),...a}));ss.displayName=ea.Description.displayName;const Ds=ie.forwardRef(({className:t,...a},s)=>e.jsx(ea.Action,{ref:s,className:ne(_M(),t),...a}));Ds.displayName=ea.Action.displayName;const ns=ie.forwardRef(({className:t,...a},s)=>e.jsx(ea.Cancel,{ref:s,className:ne(_M({variant:"outline"}),"mt-2 sm:mt-0",t),...a}));ns.displayName=ea.Cancel.displayName;const xD=({open:t,onClose:a,onSave:s,existingEvent:r})=>{const[i,o]=m.useState({title:"",date:"",location:"",description:"",url:""});m.useEffect(()=>{o(r?{id:r.id,title:r.title,date:r.date,location:r.location,description:r.description??"",url:r.url??""}:{title:"",date:"",location:"",description:"",url:""})},[r,t]);const l=(h,d)=>o(p=>({...p,[h]:d})),c=()=>{s({...i,id:(r==null?void 0:r.id)??i.id??`event-${Date.now()}`}),o({title:"",date:"",location:"",description:"",url:""}),a()};return e.jsx(tt,{open:t,onOpenChange:a,children:e.jsxs(Xe,{children:[e.jsx(Ie,{children:r?"Edit Event":"Add Event"}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{children:[e.jsx(V,{children:"Title"}),e.jsx(ee,{value:i.title,onChange:h=>l("title",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Date"}),e.jsx(ee,{type:"date",value:i.date,onChange:h=>l("date",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Location"}),e.jsx(ee,{value:i.location,onChange:h=>l("location",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Description"}),e.jsx(st,{rows:4,value:i.description,onChange:h=>l("description",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Event URL"}),e.jsx(ee,{type:"url",value:i.url,onChange:h=>l("url",h.target.value)})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(P,{variant:"outline",onClick:a,children:"Cancel"}),e.jsx(P,{onClick:c,children:"Save"})]})]})]})})},yD=(t,a)=>"eventName"in t?{id:`event-${a}`,title:t.eventName,date:t.date,location:t.location,description:"",url:""}:{id:`event-${a}`,title:t.name,date:t.startDate,location:t.location,description:"",url:""},m9=({company:t,onUpdate:a,isSaving:s=!1,canEdit:r=!1})=>{const[i,o]=m.useState({events:t.events.upcomingEvents.map(yD)}),[l,c]=m.useState(!1),[h,d]=m.useState(null),[p,g]=m.useState(null),y=()=>{a({type:"events",payload:{events:i.events}})},u=f=>{d(f),c(!0)},x=()=>{p&&(o(f=>({events:f.events.filter(k=>k.id!==p)})),g(null))},v=f=>{o(k=>{const w=k.events.findIndex(j=>j.id===f.id);if(w>=0){const j=[...k.events];return j[w]={...j[w],...f},{events:j}}return{events:[...k.events,f]}})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold",children:"Events"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Keep your event calendar current."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[r&&e.jsxs(P,{variant:"outline",onClick:()=>{d(null),c(!0)},children:[e.jsx(kt,{className:"mr-2 h-4 w-4"}),"Add event"]}),r&&e.jsx(P,{onClick:y,disabled:s,children:s?e.jsxs(e.Fragment,{children:[e.jsx(Ge,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save Changes"})]})]}),e.jsxs(U,{children:[e.jsxs(ae,{children:[e.jsx(se,{children:"Upcoming events"}),e.jsx(Pe,{children:"Highlight events, meetups, and conferences."})]}),e.jsx(_,{className:"space-y-4",children:i.events.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No events scheduled yet."}):e.jsx("div",{className:"space-y-4",children:i.events.map(f=>e.jsx("div",{className:"p-4 border rounded-lg space-y-2 relative group",children:e.jsxs("div",{className:"flex justify-between items-start gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h4",{className:"font-semibold",children:f.title}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[f.date||"Date TBD"," • ",f.location||"Location TBD"]}),f.description&&e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:f.description})]}),r&&e.jsxs("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex gap-2",children:[e.jsx(P,{variant:"outline",size:"sm",onClick:()=>u(f),children:"Edit"}),e.jsx(P,{variant:"destructive",size:"sm",onClick:()=>g(f.id??null),children:"Delete"})]})]})},f.id))})})]}),e.jsx(xD,{open:l,onClose:()=>c(!1),onSave:v,existingEvent:h}),e.jsx(Ts,{open:!!p,onOpenChange:()=>g(null),children:e.jsxs(Qa,{children:[e.jsxs(es,{children:[e.jsx(as,{children:"Delete this event?"}),e.jsx(ss,{children:"This action cannot be undone and will remove the event from the calendar."})]}),e.jsxs(ts,{children:[e.jsx(ns,{children:"Cancel"}),e.jsx(Ds,{onClick:x,children:"Delete"})]})]})})]})},gD=({open:t,onClose:a,onSave:s,existingJob:r})=>{const[i,o]=m.useState({title:"",location:"",employmentType:"",description:"",requirements:"",status:"Draft"});m.useEffect(()=>{o(r?{id:r.id,title:r.title,location:r.location,employmentType:r.employmentType,description:r.description??"",requirements:r.requirements??"",status:r.status??"Draft"}:{title:"",location:"",employmentType:"",description:"",requirements:"",status:"Draft"})},[r,t]);const l=(h,d)=>o(p=>({...p,[h]:d})),c=()=>{s({...i,id:(r==null?void 0:r.id)??i.id??`job-${Date.now()}`,status:i.status??"Draft"}),o({title:"",location:"",employmentType:"",description:"",requirements:"",status:"Draft"}),a()};return e.jsx(tt,{open:t,onOpenChange:a,children:e.jsxs(Xe,{children:[e.jsx(Ie,{children:r?"Edit Job":"Add Job"}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{children:[e.jsx(V,{children:"Title"}),e.jsx(ee,{value:i.title,onChange:h=>l("title",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Location"}),e.jsx(ee,{value:i.location,onChange:h=>l("location",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Employment Type"}),e.jsx(ee,{value:i.employmentType,onChange:h=>l("employmentType",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Description"}),e.jsx(st,{rows:4,value:i.description,onChange:h=>l("description",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Requirements"}),e.jsx(st,{rows:4,value:i.requirements,onChange:h=>l("requirements",h.target.value)})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(P,{variant:"outline",onClick:a,children:"Cancel"}),e.jsx(P,{onClick:c,children:"Save"})]})]})]})})},u9=({company:t,onUpdate:a,isSaving:s=!1,canEdit:r=!1})=>{const i=Array.isArray(t.jobs.openRoles)?t.jobs.openRoles.map((w,j)=>({id:`job-${j}`,title:w,location:"",employmentType:"",description:"",requirements:"",status:"Published"})):[],[o,l]=m.useState({jobs:i}),[c,h]=m.useState(!1),[d,p]=m.useState(null),[g,y]=m.useState(null),u=()=>{a({type:"jobs",payload:{jobs:o.jobs}})},x=w=>{p(w),h(!0)},v=()=>{g&&(l(w=>({jobs:w.jobs.filter(j=>j.id!==g)})),y(null))},f=w=>{l(j=>{const b=j.jobs.findIndex(T=>T.id===w.id);if(b>=0){const T=[...j.jobs];return T[b]={...T[b],...w},{jobs:T}}return{jobs:[...j.jobs,w]}})},k=w=>{w&&l(j=>({jobs:j.jobs.map(b=>b.id===w?{...b,status:b.status==="Published"?"Draft":"Published"}:b)}))};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold",children:"Jobs"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Publish and manage open roles."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[r&&e.jsxs(P,{variant:"outline",onClick:()=>{p(null),h(!0)},children:[e.jsx(kt,{className:"mr-2 h-4 w-4"}),"Add job"]}),r&&e.jsx(P,{onClick:u,disabled:s,children:s?e.jsxs(e.Fragment,{children:[e.jsx(Ge,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save Changes"})]})]}),e.jsxs(U,{children:[e.jsxs(ae,{children:[e.jsx(se,{children:"Open roles"}),e.jsx(Pe,{children:"Manage publishing status and job details."})]}),e.jsx(_,{className:"space-y-4",children:o.jobs.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No roles added yet."}):e.jsx("div",{className:"space-y-4",children:o.jobs.map(w=>e.jsx("div",{className:"p-4 border rounded-lg space-y-2 relative group",children:e.jsxs("div",{className:"flex justify-between items-start gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h4",{className:"font-semibold",children:w.title}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[w.location||"Location not specified"," • ",w.employmentType||"Type TBD"]}),e.jsx(q,{variant:w.status==="Published"?"default":"secondary",children:w.status??"Draft"})]}),r&&e.jsxs("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex flex-wrap gap-2",children:[e.jsx(P,{variant:"outline",size:"sm",onClick:()=>k(w.id),children:w.status==="Published"?"Unpublish":"Publish"}),e.jsx(P,{variant:"outline",size:"sm",onClick:()=>x(w),children:"Edit"}),e.jsx(P,{variant:"destructive",size:"sm",onClick:()=>y(w.id??null),children:"Delete"})]})]})},w.id))})})]}),e.jsx(gD,{open:c,onClose:()=>h(!1),onSave:f,existingJob:d}),e.jsx(Ts,{open:!!g,onOpenChange:()=>y(null),children:e.jsxs(Qa,{children:[e.jsxs(es,{children:[e.jsx(as,{children:"Delete this job?"}),e.jsx(ss,{children:"This action cannot be undone and will remove the job posting."})]}),e.jsxs(ts,{children:[e.jsx(ns,{children:"Cancel"}),e.jsx(Ds,{onClick:v,children:"Delete"})]})]})})]})},fD=(t,a)=>typeof t=="string"?{id:`news-${a}`,title:t,date:"",excerpt:"",status:"Published",content:"",url:""}:{id:`news-${a}`,title:t.title,date:"",excerpt:t.source,status:"Published",content:"",url:t.url},p9=({company:t,onUpdate:a,isSaving:s=!1,canEdit:r=!1})=>{const[i,o]=m.useState({news:t.newsAndMedia.pressMentions.map(fD)}),[l,c]=m.useState(!1),[h,d]=m.useState(null),[p,g]=m.useState(null),[y,u]=m.useState({title:"",date:"",excerpt:"",status:"Draft",content:"",url:""});m.useEffect(()=>{u(h?{id:h.id,title:h.title,date:h.date,excerpt:h.excerpt,status:h.status,content:h.content,url:h.url??""}:{title:"",date:"",excerpt:"",status:"Draft",content:"",url:""})},[h,l]);const x=()=>{a({type:"news",payload:{news:i.news}})},v=j=>{d(j),c(!0)},f=()=>{p&&(o(j=>({news:j.news.filter(b=>b.id!==p)})),g(null))},k=()=>{const j={...y,id:(h==null?void 0:h.id)??y.id??`news-${Date.now()}`};o(b=>{const T=b.news.findIndex(S=>S.id===j.id);if(T>=0){const S=[...b.news];return S[T]=j,{news:S}}return{news:[...b.news,j]}}),c(!1),d(null)},w=j=>{j&&o(b=>({news:b.news.map(T=>T.id===j?{...T,status:T.status==="Published"?"Draft":"Published"}:T)}))};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold",children:"News & Media"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Publish announcements and press coverage."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[r&&e.jsxs(P,{variant:"outline",onClick:()=>{d(null),c(!0)},children:[e.jsx(kt,{className:"mr-2 h-4 w-4"}),"Add article"]}),r&&e.jsx(P,{onClick:x,disabled:s,children:s?e.jsxs(e.Fragment,{children:[e.jsx(Ge,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save Changes"})]})]}),e.jsxs(U,{children:[e.jsxs(ae,{children:[e.jsx(se,{children:"Latest updates"}),e.jsx(Pe,{children:"Manage your press mentions and announcements."})]}),e.jsx(_,{className:"space-y-4",children:i.news.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No news items yet."}):e.jsx("div",{className:"space-y-4",children:i.news.map(j=>e.jsx("div",{className:"p-4 border rounded-lg space-y-2 relative group",children:e.jsxs("div",{className:"flex justify-between items-start gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h4",{className:"font-semibold",children:j.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:j.date||"Date TBD"}),j.excerpt&&e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:j.excerpt}),e.jsx(q,{variant:j.status==="Published"?"default":"secondary",children:j.status})]}),r&&e.jsxs("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex flex-wrap gap-2",children:[e.jsx(P,{variant:"outline",size:"sm",onClick:()=>w(j.id),children:j.status==="Published"?"Unpublish":"Publish"}),e.jsx(P,{variant:"outline",size:"sm",onClick:()=>v(j),children:"Edit"}),e.jsx(P,{variant:"destructive",size:"sm",onClick:()=>g(j.id??null),children:"Delete"})]})]})},j.id))})})]}),e.jsx(tt,{open:l,onOpenChange:c,children:e.jsxs(Xe,{children:[e.jsx(Ie,{children:h?"Edit News":"Add News"}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{children:[e.jsx(V,{children:"Title"}),e.jsx(ee,{value:y.title,onChange:j=>u(b=>({...b,title:j.target.value}))})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Date"}),e.jsx(ee,{type:"date",value:y.date,onChange:j=>u(b=>({...b,date:j.target.value}))})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Excerpt"}),e.jsx(st,{rows:3,value:y.excerpt,onChange:j=>u(b=>({...b,excerpt:j.target.value}))})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Content"}),e.jsx(st,{rows:5,value:y.content,onChange:j=>u(b=>({...b,content:j.target.value}))})]}),e.jsxs("div",{children:[e.jsx(V,{children:"URL"}),e.jsx(ee,{type:"url",value:y.url,onChange:j=>u(b=>({...b,url:j.target.value}))})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(P,{variant:"outline",onClick:()=>c(!1),children:"Cancel"}),e.jsx(P,{onClick:k,children:"Save"})]})]})]})}),e.jsx(Ts,{open:!!p,onOpenChange:()=>g(null),children:e.jsxs(Qa,{children:[e.jsxs(es,{children:[e.jsx(as,{children:"Delete this news item?"}),e.jsx(ss,{children:"This action cannot be undone and will remove the news entry."})]}),e.jsxs(ts,{children:[e.jsx(ns,{children:"Cancel"}),e.jsx(Ds,{onClick:f,children:"Delete"})]})]})})]})},vD=["Operator","Platform Provider","Game Provider","Affiliate","Payments","Agency","Other"],kD=["1-10","11-50","51-100","101-200","201-500","501-1000","1000+","5000+"],bD=["Casino","Sportsbook","Poker","Lottery","Bingo","Esports","Fantasy Sports","Live Casino"],x9=["Malta","Gibraltar","UK","Sweden","Cyprus","Isle of Man","Curacao","Poland","Spain","Germany","Netherlands","Italy","Portugal","Estonia","Latvia","Lithuania","Bulgaria","Romania","Ukraine","Serbia","Croatia","Denmark","Finland","Norway","Ireland","Switzerland","Austria","Czech Republic","Slovakia","Hungary","Greece","Belgium","France","Luxembourg","Slovenia","Bosnia and Herzegovina","North Macedonia","Albania","Montenegro","Kosovo","Moldova","Belarus","Georgia","Armenia","Azerbaijan","Kazakhstan","USA","Canada","Brazil","Mexico","Colombia","Argentina","Chile","Peru","Ecuador","Uruguay","Paraguay","Bolivia","Venezuela","Panama","Costa Rica","Guatemala","Honduras","El Salvador","Nicaragua","Dominican Republic","Puerto Rico","Jamaica","Trinidad and Tobago","Philippines","Singapore","Hong Kong","Macau","Australia","New Zealand","India","Japan","South Korea","Taiwan","Thailand","Vietnam","Indonesia","Malaysia","Cambodia","Myanmar","Sri Lanka","Bangladesh","Nepal","United Arab Emirates","Israel","South Africa","Kenya","Nigeria","Ghana","Tanzania","Uganda","Zambia","Zimbabwe","Mozambique","Morocco","Egypt","Tunisia","Senegal","Ivory Coast","Other"],jD=["Valletta","St. Julian's","Sliema","Birkirkara","Msida","Gzira","London","Manchester","Leeds","Birmingham","Edinburgh","Glasgow","Bristol","Liverpool","Sheffield","Newcastle","Nottingham","Cardiff","Belfast","Brighton","Reading","Gibraltar","St. Helier","St. Peter Port","Limassol","Nicosia","Larnaca","Paphos","Stockholm","Gothenburg","Malmö","Copenhagen","Aarhus","Helsinki","Tampere","Turku","Oslo","Bergen","Trondheim","Reykjavik","Tallinn","Tartu","Riga","Vilnius","Kaunas","Sofia","Plovdiv","Bucharest","Cluj-Napoca","Timișoara","Belgrade","Novi Sad","Warsaw","Krakow","Wrocław","Gdańsk","Poznań","Kyiv","Lviv","Kharkiv","Odessa","Prague","Brno","Bratislava","Košice","Budapest","Debrecen","Bucharest","Zagreb","Split","Sarajevo","Skopje","Tirana","Podgorica","Chisinau","Tbilisi","Yerevan","Baku","Almaty","Astana","Madrid","Barcelona","Valencia","Seville","Bilbao","Berlin","Hamburg","Munich","Frankfurt","Cologne","Düsseldorf","Stuttgart","Leipzig","Amsterdam","Rotterdam","The Hague","Eindhoven","Utrecht","Isle of Man","Douglas","Dublin","Cork","Galway","Zurich","Geneva","Bern","Basel","Vienna","Graz","Salzburg","Lisbon","Porto","Rome","Milan","Turin","Naples","Florence","Bologna","Paris","Lyon","Marseille","Brussels","Antwerp","Ghent","Luxembourg City","Athens","Thessaloniki","Las Vegas","New York","Miami","Los Angeles","Chicago","Atlantic City","Philadelphia","Houston","Phoenix","San Francisco","Seattle","Boston","Washington D.C.","Denver","Nashville","Toronto","Vancouver","Montreal","Calgary","Ottawa","Bogota","Medellin","Cali","Sao Paulo","Rio de Janeiro","Brasilia","Belo Horizonte","Buenos Aires","Cordoba","Rosario","Santiago","Lima","Mexico City","Guadalajara","Monterrey","Panama City","San José","Montevideo","Manila","Cebu","Singapore","Hong Kong","Macau","Sydney","Melbourne","Brisbane","Perth","Auckland","Wellington","Tokyo","Osaka","Seoul","Busan","Taipei","Bangkok","Chiang Mai","Ho Chi Minh City","Hanoi","Kuala Lumpur","Jakarta","Bali","Phnom Penh","Mumbai","Delhi","Bengaluru","Hyderabad","Chennai","Colombo","Dhaka","Dubai","Abu Dhabi","Tel Aviv","Jerusalem","Haifa","Cape Town","Johannesburg","Durban","Pretoria","Nairobi","Lagos","Accra","Dar es Salaam","Kampala","Lusaka","Harare","Casablanca","Cairo","Tunis","Dakar","Abidjan"],zl=1960,y9=({company:t,onUpdate:a,isSaving:s=!1,canEdit:r=!1})=>{const[i,o]=m.useState({companyName:t.name,foundedYear:t.overview.foundedYear,website:t.overview.website,employeeRange:t.overview.employeeRange,shortDescription:t.overview.shortDescription,longDescription:t.overview.longDescription??"",headquartersCity:t.overview.headquarters.city,headquartersCountry:t.overview.headquarters.country}),[l,c]=m.useState("idle"),[h,d]=m.useState(""),p=m.useMemo(()=>{const x=new Date().getFullYear();return Array.from({length:x-zl+1},(v,f)=>x-f)},[]),g=(x,v)=>{o(f=>({...f,[x]:v}))},y=async x=>{if(!x.trim()){c("idle"),d("");return}let v;try{v=new URL(x)}catch{c("invalid"),d("Please enter a full URL, e.g. https://example.com.");return}c("checking"),d("Checking website availability...");try{const f=`https://r.jina.ai/http://${v.host}${v.pathname}${v.search}`,k=await fetch(f,{method:"GET"});if(k.ok){c("valid"),d("Website is reachable.");return}c("invalid"),d(`Website check failed with status ${k.status}.`),alert(`Invalid website: ${x}. Please verify the URL.`)}catch{c("invalid"),d("Unable to verify website right now."),alert(`Invalid website: ${x}. Please verify the URL.`)}},u=()=>{if(i.foundedYear<zl||i.foundedYear>new Date().getFullYear()){alert(`Founded year must be between ${zl} and ${new Date().getFullYear()}.`);return}a({type:"overview",payload:i})};return e.jsxs("div",{className:"space-y-6",children:[e.jsx("datalist",{id:"company-overview-country-suggestions",children:x9.map(x=>e.jsx("option",{value:x},x))}),e.jsx("datalist",{id:"company-overview-city-suggestions",children:jD.map(x=>e.jsx("option",{value:x},x))}),e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold",children:"Company Overview"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Manage your company information"})]}),r&&e.jsx(P,{onClick:u,disabled:s,children:s?e.jsxs(e.Fragment,{children:[e.jsx(Ge,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save Changes"})]}),e.jsxs(U,{children:[e.jsxs(ae,{children:[e.jsx(se,{children:"Company details"}),e.jsx(Pe,{children:"Keep your profile accurate and up to date."})]}),e.jsxs(_,{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{htmlFor:"companyName",children:"Company Name"}),r?e.jsx(ee,{id:"companyName",value:i.companyName,onChange:x=>g("companyName",x.target.value)}):e.jsx("p",{className:"text-sm text-muted-foreground",children:i.companyName})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{htmlFor:"foundedYear",children:"Founded Year"}),r?e.jsx(ee,{id:"foundedYear",type:"number",min:zl,max:new Date().getFullYear(),list:"company-overview-founded-year-options",value:i.foundedYear,onChange:x=>g("foundedYear",Number(x.target.value))}):e.jsx("p",{className:"text-sm text-muted-foreground",children:i.foundedYear}),e.jsx("datalist",{id:"company-overview-founded-year-options",children:p.map(x=>e.jsx("option",{value:x},x))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{htmlFor:"website",children:"Website"}),r?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative",children:[e.jsx(ee,{id:"website",type:"url",value:i.website,onChange:x=>g("website",x.target.value),onBlur:x=>{y(x.target.value)},className:"pr-9"}),e.jsxs("div",{className:"pointer-events-none absolute inset-y-0 right-3 flex items-center",children:[l==="checking"&&e.jsx(Ge,{className:"h-4 w-4 animate-spin text-muted-foreground"}),l==="valid"&&e.jsx(Ee,{className:"h-4 w-4 text-green-600"}),l==="invalid"&&e.jsx(oa,{className:"h-4 w-4 text-red-600"})]})]}),h&&e.jsx("p",{className:`text-xs ${l==="invalid"?"text-red-600":"text-muted-foreground"}`,children:h})]}):e.jsx("p",{className:"text-sm text-muted-foreground",children:i.website})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{htmlFor:"employeeRange",children:"Employee Range"}),r?e.jsx(ee,{id:"employeeRange",list:"company-overview-employee-range-options",value:i.employeeRange,onChange:x=>g("employeeRange",x.target.value)}):e.jsx("p",{className:"text-sm text-muted-foreground",children:i.employeeRange}),e.jsx("datalist",{id:"company-overview-employee-range-options",children:kD.map(x=>e.jsx("option",{value:x},x))})]}),e.jsxs("div",{className:"space-y-2 md:col-span-2",children:[e.jsx(V,{htmlFor:"shortDescription",children:"Short Description"}),r?e.jsx(st,{id:"shortDescription",rows:3,value:i.shortDescription,onChange:x=>g("shortDescription",x.target.value)}):e.jsx("p",{className:"text-sm text-muted-foreground",children:i.shortDescription})]}),e.jsxs("div",{className:"space-y-2 md:col-span-2",children:[e.jsx(V,{htmlFor:"longDescription",children:"Long Description"}),r?e.jsx(st,{id:"longDescription",rows:6,value:i.longDescription,onChange:x=>g("longDescription",x.target.value)}):e.jsx("p",{className:"text-sm text-muted-foreground",children:i.longDescription})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{htmlFor:"headquartersCity",children:"Headquarters City"}),r?e.jsx(ee,{id:"headquartersCity",list:"company-overview-city-suggestions",value:i.headquartersCity,onChange:x=>g("headquartersCity",x.target.value)}):e.jsx("p",{className:"text-sm text-muted-foreground",children:i.headquartersCity})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{htmlFor:"headquartersCountry",children:"Headquarters Country"}),r?e.jsx(ee,{id:"headquartersCountry",list:"company-overview-country-suggestions",value:i.headquartersCountry,onChange:x=>g("headquartersCountry",x.target.value)}):e.jsx("p",{className:"text-sm text-muted-foreground",children:i.headquartersCountry})]}),l==="invalid"&&r&&e.jsx("div",{className:"md:col-span-2 rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700",children:e.jsxs("p",{className:"flex items-center gap-2 font-medium",children:[e.jsx(Gt,{className:"h-4 w-4"}),"The entered website appears invalid. Please verify before saving."]})})]})]})]})},wD=({open:t,onClose:a,onSave:s,existingPerson:r})=>{const[i,o]=m.useState({name:"",role:"",linkedIn:"",email:""});m.useEffect(()=>{o(r?{id:r.id,name:r.name,role:r.role,linkedIn:r.linkedIn??"",email:r.email??""}:{name:"",role:"",linkedIn:"",email:""})},[r,t]);const l=(h,d)=>o(p=>({...p,[h]:d})),c=()=>{s({...i,id:(r==null?void 0:r.id)??i.id??`person-${Date.now()}`}),o({name:"",role:"",linkedIn:"",email:""}),a()};return e.jsx(tt,{open:t,onOpenChange:a,children:e.jsxs(Xe,{children:[e.jsx(Ie,{children:r?"Edit Team Member":"Add Team Member"}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{children:[e.jsx(V,{children:"Name"}),e.jsx(ee,{value:i.name,onChange:h=>l("name",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Role"}),e.jsx(ee,{value:i.role,onChange:h=>l("role",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"LinkedIn"}),e.jsx(ee,{value:i.linkedIn,onChange:h=>l("linkedIn",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Email"}),e.jsx(ee,{type:"email",value:i.email,onChange:h=>l("email",h.target.value)})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(P,{variant:"outline",onClick:a,children:"Cancel"}),e.jsx(P,{onClick:c,children:"Save"})]})]})]})})},g9=({company:t,onUpdate:a,isSaving:s=!1,canEdit:r=!1})=>{const[i,o]=m.useState({members:t.people.members.map((f,k)=>({id:`person-${k}`,name:f.name,role:f.title,linkedIn:f.profileUrl??"",email:""}))}),[l,c]=m.useState(!1),[h,d]=m.useState(null),[p,g]=m.useState(null),y=()=>{const f=i.members.map(k=>({name:k.name,title:k.role,profileUrl:k.linkedIn}));a({type:"people",payload:{members:f}})},u=f=>{d(f),c(!0)},x=()=>{p&&(o(f=>({members:f.members.filter(k=>k.id!==p)})),g(null))},v=f=>{o(k=>{const w=k.members.findIndex(j=>j.id===f.id);if(w>=0){const j=[...k.members];return j[w]={...j[w],...f},{members:j}}return{members:[...k.members,f]}})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold",children:"People"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Manage your leadership and team members."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[r&&e.jsxs(P,{variant:"outline",onClick:()=>{d(null),c(!0)},children:[e.jsx(kt,{className:"mr-2 h-4 w-4"}),"Add member"]}),r&&e.jsx(P,{onClick:y,disabled:s,children:s?e.jsxs(e.Fragment,{children:[e.jsx(Ge,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save Changes"})]})]}),e.jsxs(U,{children:[e.jsxs(ae,{children:[e.jsx(se,{children:"Team directory"}),e.jsx(Pe,{children:"Highlight decision makers and team contacts."})]}),e.jsx(_,{className:"space-y-4",children:i.members.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No team members added yet."}):e.jsx("div",{className:"space-y-4",children:i.members.map(f=>e.jsx("div",{className:"p-4 border rounded-lg space-y-2 relative group",children:e.jsxs("div",{className:"flex justify-between items-start gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h4",{className:"font-semibold",children:f.name}),e.jsx("p",{className:"text-sm text-muted-foreground",children:f.role}),f.linkedIn&&e.jsx("a",{href:f.linkedIn,target:"_blank",rel:"noreferrer",className:"text-sm text-primary underline",children:"LinkedIn profile"})]}),r&&e.jsxs("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex gap-2",children:[e.jsx(P,{variant:"outline",size:"sm",onClick:()=>u(f),children:"Edit"}),e.jsx(P,{variant:"destructive",size:"sm",onClick:()=>g(f.id??null),children:"Delete"})]})]})},f.id))})})]}),e.jsx(wD,{open:l,onClose:()=>c(!1),onSave:v,existingPerson:h}),e.jsx(Ts,{open:!!p,onOpenChange:()=>g(null),children:e.jsxs(Qa,{children:[e.jsxs(es,{children:[e.jsx(as,{children:"Delete this team member?"}),e.jsx(ss,{children:"This action cannot be undone and will remove the member from your list."})]}),e.jsxs(ts,{children:[e.jsx(ns,{children:"Cancel"}),e.jsx(Ds,{onClick:x,children:"Delete"})]})]})})]})},MD=({open:t,onClose:a,onSave:s,existingProduct:r})=>{const[i,o]=m.useState({name:"",category:"",description:"",url:""});m.useEffect(()=>{o(r?{id:r.id,name:r.name,category:r.category,description:r.description,url:r.url??""}:{name:"",category:"",description:"",url:""})},[r,t]);const l=(h,d)=>o(p=>({...p,[h]:d})),c=()=>{s({...i,id:(r==null?void 0:r.id)??i.id??`product-${Date.now()}`}),o({name:"",category:"",description:"",url:""}),a()};return e.jsx(tt,{open:t,onOpenChange:a,children:e.jsxs(Xe,{children:[e.jsx(Ie,{children:r?"Edit Product":"Add Product"}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{children:[e.jsx(V,{children:"Name"}),e.jsx(ee,{value:i.name,onChange:h=>l("name",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Category"}),e.jsx(ee,{value:i.category,onChange:h=>l("category",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Description"}),e.jsx(st,{rows:4,value:i.description,onChange:h=>l("description",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"URL"}),e.jsx(ee,{type:"url",value:i.url,onChange:h=>l("url",h.target.value)})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(P,{variant:"outline",onClick:a,children:"Cancel"}),e.jsx(P,{onClick:c,children:"Save"})]})]})]})})},f9=({company:t,onUpdate:a,isSaving:s=!1,canEdit:r=!1})=>{const[i,o]=m.useState({products:t.productsAndServices.map((f,k)=>({id:`product-${k}`,...f}))}),[l,c]=m.useState(!1),[h,d]=m.useState(null),[p,g]=m.useState(null),y=()=>{a({type:"products",payload:{products:i.products}})},u=f=>{d(f),c(!0)},x=()=>{p&&(o(f=>({products:f.products.filter(k=>k.id!==p)})),g(null))},v=f=>{o(k=>{const w=k.products.findIndex(j=>j.id===f.id);if(w>=0){const j=[...k.products];return j[w]={...j[w],...f},{products:j}}return{products:[...k.products,f]}})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold",children:"Products & Services"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Showcase the offerings that define your company."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[r&&e.jsxs(P,{variant:"outline",onClick:()=>{d(null),c(!0)},children:[e.jsx(kt,{className:"mr-2 h-4 w-4"}),"Add product"]}),r&&e.jsx(P,{onClick:y,disabled:s,children:s?e.jsxs(e.Fragment,{children:[e.jsx(Ge,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save Changes"})]})]}),e.jsxs(U,{children:[e.jsxs(ae,{children:[e.jsx(se,{children:"Product catalog"}),e.jsx(Pe,{children:"Update categories, descriptions, and links."})]}),e.jsx(_,{className:"space-y-4",children:i.products.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No products added yet."}):e.jsx("div",{className:"space-y-4",children:i.products.map(f=>e.jsx("div",{className:"p-4 border rounded-lg space-y-2 relative group",children:e.jsxs("div",{className:"flex justify-between items-start gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:f.name}),f.category&&e.jsx(q,{variant:"secondary",children:f.category}),f.description&&e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:f.description})]}),r&&e.jsxs("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex gap-2",children:[e.jsx(P,{variant:"outline",size:"sm",onClick:()=>u(f),children:"Edit"}),e.jsx(P,{variant:"destructive",size:"sm",onClick:()=>g(f.id??null),children:"Delete"})]})]})},f.id))})})]}),e.jsx(MD,{open:l,onClose:()=>c(!1),onSave:v,existingProduct:h}),e.jsx(Ts,{open:!!p,onOpenChange:()=>g(null),children:e.jsxs(Qa,{children:[e.jsxs(es,{children:[e.jsx(as,{children:"Delete this product?"}),e.jsx(ss,{children:"This action cannot be undone and will remove the product from your catalog."})]}),e.jsxs(ts,{children:[e.jsx(ns,{children:"Cancel"}),e.jsx(Ds,{onClick:x,children:"Delete"})]})]})})]})},v9=({company:t,onUpdate:a,isSaving:s=!1,canEdit:r=!1})=>{const i={visibility:t.claimedStatus==="claimed",notifications:{jobAlerts:!0,newsAlerts:!0,eventAlerts:!1},integrations:{slackEnabled:!1,webhookUrl:""},team:t.people.members.map((x,v)=>({id:`team-${v}`,name:x.name,role:x.title}))},o=t.settings,[l,c]=m.useState({...i,...o,notifications:{...i.notifications,...o==null?void 0:o.notifications},integrations:{...i.integrations,...o==null?void 0:o.integrations},team:(o==null?void 0:o.team)??i.team}),h=()=>{a({type:"settings",payload:l})},d=x=>{c(v=>({...v,notifications:{...v.notifications,[x]:!v.notifications[x]}}))},p=()=>{c(x=>({...x,integrations:{...x.integrations,slackEnabled:!x.integrations.slackEnabled}}))},g=(x,v)=>{c(f=>({...f,team:f.team.map(k=>k.id===x?{...k,role:v}:k)}))},y=()=>{c(x=>({...x,team:[...x.team,{id:`team-${Date.now()}`,name:"New member",role:"Contributor"}]}))},u=x=>{c(v=>({...v,team:v.team.filter(f=>f.id!==x)}))};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold",children:"Settings"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Control visibility, notifications, and team roles."})]}),r&&e.jsx(P,{onClick:h,disabled:s,children:s?e.jsxs(e.Fragment,{children:[e.jsx(Ge,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save Changes"})]}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.jsxs(U,{children:[e.jsxs(ae,{children:[e.jsx(se,{children:"Visibility & notifications"}),e.jsx(Pe,{children:"Adjust how your company appears and who gets notified."})]}),e.jsxs(_,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(V,{children:"Public profile"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Show your company in the directory."})]}),e.jsx(yt,{checked:l.visibility,onCheckedChange:()=>r&&c(x=>({...x,visibility:!x.visibility})),disabled:!r})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(V,{children:"Job alerts"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Notify recruiters about new applicants."})]}),e.jsx(yt,{checked:l.notifications.jobAlerts,onCheckedChange:()=>r&&d("jobAlerts"),disabled:!r})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(V,{children:"News alerts"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Send weekly press mention updates."})]}),e.jsx(yt,{checked:l.notifications.newsAlerts,onCheckedChange:()=>r&&d("newsAlerts"),disabled:!r})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(V,{children:"Event alerts"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Notify teams about upcoming events."})]}),e.jsx(yt,{checked:l.notifications.eventAlerts,onCheckedChange:()=>r&&d("eventAlerts"),disabled:!r})]})]})]}),e.jsxs(U,{children:[e.jsxs(ae,{children:[e.jsx(se,{children:"Integrations"}),e.jsx(Pe,{children:"Connect your workspace tools."})]}),e.jsxs(_,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(V,{children:"Slack notifications"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Send updates to a Slack channel."})]}),e.jsx(yt,{checked:l.integrations.slackEnabled,onCheckedChange:()=>r&&p(),disabled:!r})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{htmlFor:"webhookUrl",children:"Webhook URL"}),r?e.jsx(ee,{id:"webhookUrl",value:l.integrations.webhookUrl,onChange:x=>c(v=>({...v,integrations:{...v.integrations,webhookUrl:x.target.value}}))}):e.jsx("p",{className:"text-sm text-muted-foreground",children:l.integrations.webhookUrl||"No webhook configured"})]})]})]})]}),e.jsxs(U,{children:[e.jsxs(ae,{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx(se,{children:"Team roles"}),e.jsx(Pe,{children:"Assign roles for company administrators."})]}),r&&e.jsxs(P,{variant:"outline",onClick:y,children:[e.jsx(kt,{className:"mr-2 h-4 w-4"}),"Add member"]})]}),e.jsx(_,{className:"space-y-4",children:l.team.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No team members assigned."}):l.team.map(x=>e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:x.name}),e.jsx("p",{className:"text-sm text-muted-foreground",children:x.role})]}),r&&e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(ee,{className:"w-48",value:x.role,onChange:v=>g(x.id,v.target.value)}),e.jsx(P,{variant:"ghost",size:"icon",onClick:()=>u(x.id),children:e.jsx(Ms,{className:"h-4 w-4"})})]})]},x.id))})]})]})},ND=["Operator","Game Provider","Platform Provider","Affiliate","Payments","KYC/AML","Marketing","Hosting/Infrastructure","Legal/Compliance","Recruitment"],CD=ie.createContext(null),SD={overview:fa,products:Me,people:ze,jobs:je,candidates:Ns,news:Ns,events:da,settings:ba},LD={overview:"Overview",products:"Products",people:"People",jobs:"Jobs",events:"Events",news:"News",candidates:"Candidates",settings:"Settings"},ID={canViewOverview:"Overview",canManageProducts:"Products",canManagePeople:"People",canManageJobs:"Jobs",canManageEvents:"Events",canManageNews:"News",canManageCandidates:"Candidates",canManageSettings:"Settings"},AD={overview:"canViewOverview",products:"canManageProducts",people:"canManagePeople",jobs:"canManageJobs",events:"canManageEvents",news:"canManageNews",candidates:"canManageCandidates",settings:"canManageSettings"},PD=["overview","products","people","jobs","events","news","candidates","settings"],TD=({company:t,companyName:a,companySlug:s,activeTab:r,visibleTabs:i,onTabChange:o,role:l,permissions:c,summaryStats:h,onUpdate:d,isSaving:p})=>{const g=a??t.name,y=s??t.slug,u=l??"admin",x=i??PD,v=ie.useMemo(()=>{var M,R,D;if(h)return h;const A=Array.isArray(t.jobs.openRoles)?t.jobs.openRoles.length:t.jobs.openRoles,C=(((M=t.trustAndCompliance.licenses)==null?void 0:M.length)??0)+(((R=t.trustAndCompliance.certifications)==null?void 0:R.length)??0)+(((D=t.trustAndCompliance.awards)==null?void 0:D.length)??0);return[{title:"Open roles",value:A,description:"Live listings",icon:je},{title:"Team members",value:t.people.members.length,description:"Listed people",icon:ze},{title:"Trust signals",value:C,description:"Licenses & awards",icon:Kt}]},[t,h]),[f,k]=ie.useState(()=>r??x[0]??"overview"),w=r??f,j=Object.entries(ID).filter(([A])=>!!c[A]),b=ie.useMemo(()=>x.filter(A=>{const C=AD[A];return c[C]!==!1}),[c,x]),T=b.includes(w),S=ie.useCallback(A=>{o==null||o(A),r===void 0&&k(A)},[r,o]),N=ie.useCallback(A=>d==null?void 0:d(A),[d]);ie.useEffect(()=>{!T&&b.length>0&&S(b[0])},[S,T,b]);const L=ie.useMemo(()=>b.map(A=>({value:A,label:LD[A],icon:SD[A]})),[b]),I=()=>{switch(w){case"overview":return e.jsx(y9,{company:t,onUpdate:N,isSaving:p,canEdit:c.canViewOverview});case"products":return e.jsx(f9,{company:t,onUpdate:N,isSaving:p,canEdit:c.canManageProducts});case"people":return e.jsx(g9,{company:t,onUpdate:N,isSaving:p,canEdit:c.canManagePeople});case"jobs":return e.jsx(u9,{company:t,onUpdate:N,isSaving:p,canEdit:c.canManageJobs});case"events":return e.jsx(m9,{company:t,onUpdate:N,isSaving:p,canEdit:c.canManageEvents});case"news":return e.jsx(p9,{company:t,onUpdate:N,isSaving:p,canEdit:c.canManageNews});case"candidates":return e.jsx(d9,{company:t,onUpdate:N,isSaving:p,canEdit:c.canManageCandidates});case"settings":return e.jsx(v9,{company:t,onUpdate:N,isSaving:p,canEdit:c.canManageSettings});default:return null}};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(i9,{companyName:g,isAdminView:!0,role:u,enabledPermissions:j,overview:t.overview,classification:t.classification,companyType:ND[0],companyId:y,companySlug:y,claimedStatus:"claimed",signalsAndInsights:t.signalsAndInsights,openRolesCount:0,trustScore:0}),v.length>0?e.jsx("section",{className:"py-6",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsx(sD,{stats:v})})}):null,e.jsx("section",{className:"py-6",children:e.jsx("div",{className:"container mx-auto px-4",children:b.length>0?e.jsxs(Da,{value:w,onValueChange:A=>S(A),children:[e.jsx(o9,{items:L}),T?e.jsx(ke,{value:w,className:"mt-6",children:e.jsx(CD.Provider,{value:{onUpdate:N,isSaving:p,permissions:c},children:e.jsx("div",{className:"rounded-2xl border bg-background p-6 shadow-sm",children:I()})})}):null]}):null})})]})},RD=({companyName:t,companySlug:a,open:s,onOpenChange:r,onSave:i})=>{const[o,l]=m.useState({companyName:t,companySlug:a,shortDescription:"",website:""}),c=()=>{i==null||i(o),r(!1)};return e.jsx(tt,{open:s,onOpenChange:r,children:e.jsxs(Xe,{className:"sm:max-w-[520px]",children:[e.jsxs(Be,{children:[e.jsx(Ie,{children:"Edit company profile"}),e.jsx(nt,{children:"Update company details for admins with profile permissions. This dialog is layout-only and does not perform any API calls."})]}),e.jsxs("div",{className:"grid gap-4 py-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(V,{htmlFor:"admin-company-name",children:"Company name"}),e.jsx(ee,{id:"admin-company-name",value:o.companyName,onChange:h=>l(d=>({...d,companyName:h.target.value}))})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(V,{htmlFor:"admin-company-slug",children:"Company slug"}),e.jsx(ee,{id:"admin-company-slug",value:o.companySlug,onChange:h=>l(d=>({...d,companySlug:h.target.value}))})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(V,{htmlFor:"admin-company-description",children:"Short description"}),e.jsx(st,{id:"admin-company-description",rows:4,value:o.shortDescription,onChange:h=>l(d=>({...d,shortDescription:h.target.value}))})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(V,{htmlFor:"admin-company-website",children:"Website"}),e.jsx(ee,{id:"admin-company-website",value:o.website,onChange:h=>l(d=>({...d,website:h.target.value}))})]})]}),e.jsxs(et,{children:[e.jsx(P,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e.jsx(P,{variant:"accent",onClick:c,children:"Save changes"})]})]})})},DD=(t,a)=>t[a]===!0,zD=t=>Object.entries(t).filter(([a,s])=>s===!0).map(([a])=>a),qD=({slug:t,title:a,department:s,description:r,typicalTimeline:i,keySkills:o,nodesCount:l,entryPointsCount:c,marketHotspots:h,salaryRange:d,viewMode:p="grid",onNavigate:g})=>p==="list"?e.jsxs("div",{onClick:()=>g(`/knowledge/career-paths/${t}`),className:"group relative flex items-center gap-4 rounded-lg border border-border bg-card p-4 cursor-pointer transition-all hover:border-primary/30 hover:shadow-sm",children:[e.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-lg bg-accent/10 text-accent",children:e.jsx($e,{className:"h-6 w-6"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h3",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:a}),e.jsx(q,{variant:"outline",className:"text-xs",children:s})]}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground line-clamp-1",children:r}),e.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ut,{className:"h-3 w-3"}),i]}),e.jsxs("span",{children:[l," career stages"]}),e.jsxs("span",{children:[c," entry points"]}),d&&e.jsxs("span",{className:"font-mono",children:[d.entry," → ",d.director]})]})]}),e.jsx(Pt,{className:"h-5 w-5 text-muted-foreground group-hover:text-primary transition-colors shrink-0"})]}):e.jsxs("div",{onClick:()=>g(`/knowledge/career-paths/${t}`),className:"group relative flex flex-col rounded-lg border border-border bg-card p-5 cursor-pointer transition-all hover:border-primary/30 hover:shadow-md",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-accent/10 text-accent",children:e.jsx($e,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:a}),e.jsx(q,{variant:"outline",className:"text-xs mt-0.5",children:s})]})]}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 flex-1",children:r}),e.jsx("div",{className:"mt-4 flex items-center gap-1",children:Array.from({length:l}).map((y,u)=>e.jsxs(m.Fragment,{children:[e.jsx("div",{className:`h-2 w-2 rounded-full ${u===0?"bg-accent":"bg-border group-hover:bg-accent/50"} transition-colors`}),u<l-1&&e.jsx("div",{className:"h-px flex-1 bg-border group-hover:bg-accent/30 transition-colors"})]},u))}),e.jsxs("div",{className:"mt-3 flex items-center justify-between text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ut,{className:"h-3 w-3"}),i]}),d&&e.jsxs("span",{className:"font-mono",children:[d.entry," → ",d.director]})]}),e.jsxs("div",{className:"mt-2 flex gap-1.5 flex-wrap",children:[o.slice(0,3).map(y=>e.jsx(q,{variant:"secondary",className:"text-xs",children:y},y)),o.length>3&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["+",o.length-3]})]}),h.length>0&&e.jsxs("div",{className:"mt-2 flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(Te,{className:"h-3 w-3"}),h.join(", ")]})]}),YN={Shield:e.jsx(Ta,{className:"h-5 w-5"}),TrendingUp:e.jsx($e,{className:"h-5 w-5"}),Heart:e.jsx(ma,{className:"h-5 w-5"}),Code:e.jsx(Xo,{className:"h-5 w-5"}),Lightbulb:e.jsx(eo,{className:"h-5 w-5"}),Megaphone:e.jsx(il,{className:"h-5 w-5"}),CreditCard:e.jsx(xo,{className:"h-5 w-5"}),Dice1:e.jsx(el,{className:"h-5 w-5"})},FD=({slug:t,name:a,icon:s,description:r,roleGuideCount:i,careerPathCount:o,jobCount:l,keyFunctions:c,viewMode:h="grid",onNavigate:d})=>h==="list"?e.jsxs("div",{onClick:()=>d(`/knowledge/departments/${t}`),className:"group relative flex items-center gap-4 rounded-lg border border-border bg-card p-4 cursor-pointer transition-all hover:border-primary/30 hover:shadow-sm",children:[e.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:YN[s]||e.jsx(je,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:a}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground line-clamp-1",children:r}),e.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-muted-foreground",children:[e.jsxs("span",{children:[l," open jobs"]}),e.jsxs("span",{children:[i," role guides"]}),e.jsxs("span",{children:[o," career paths"]})]})]}),e.jsx(Pt,{className:"h-5 w-5 text-muted-foreground group-hover:text-primary transition-colors shrink-0"})]}):e.jsxs("div",{onClick:()=>d(`/knowledge/departments/${t}`),className:"group relative flex flex-col rounded-lg border border-border bg-card p-5 cursor-pointer transition-all hover:border-primary/30 hover:shadow-md",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10 text-primary",children:YN[s]||e.jsx(je,{className:"h-5 w-5"})}),e.jsx("h3",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:a})]}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 flex-1",children:r}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-1.5",children:[c.slice(0,3).map(p=>e.jsx(q,{variant:"secondary",className:"text-xs",children:p},p)),c.length>3&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["+",c.length-3]})]}),e.jsxs("div",{className:"mt-3 flex items-center gap-3 text-xs text-muted-foreground pt-3 border-t border-border",children:[e.jsx("span",{className:"font-semibold text-foreground",children:l})," jobs",e.jsx("span",{children:"·"}),e.jsx("span",{className:"font-semibold text-foreground",children:i})," role guides",e.jsx("span",{children:"·"}),e.jsx("span",{className:"font-semibold text-foreground",children:o})," career paths"]})]}),KN={onboarding:"bg-gaming-success/10 text-gaming-success border-gaming-success/20",transition:"bg-accent/10 text-accent border-accent/20",growth:"bg-primary/10 text-primary border-primary/20",leadership:"bg-gaming-gold/10 text-gaming-gold border-gaming-gold/20","market-entry":"bg-gaming-warning/10 text-gaming-warning border-gaming-warning/20"},HD=({slug:t,title:a,type:s,department:r,seniority:i,market:o,description:l,estimatedReadTime:c,accessLevel:h,tags:d,viewMode:p="grid",onNavigate:g})=>{const y=h!=="public";return p==="list"?e.jsxs("div",{onClick:()=>g(`/knowledge/playbooks/${t}`),className:"group relative flex items-center gap-4 rounded-lg border border-border bg-card p-4 cursor-pointer transition-all hover:border-primary/30 hover:shadow-sm",children:[e.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:e.jsx(At,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h3",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:a}),e.jsx(q,{className:`${KN[s]||"bg-muted text-muted-foreground"} text-xs border capitalize`,children:s.replace("-"," ")}),y&&e.jsx(va,{className:"h-3 w-3 text-muted-foreground"})]}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground line-clamp-1",children:l}),e.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ut,{className:"h-3 w-3"}),c," min read"]}),e.jsx(q,{variant:"outline",className:"text-xs",children:r}),e.jsx(q,{variant:"secondary",className:"text-xs",children:i}),o&&e.jsx("span",{children:o})]})]}),e.jsx(Pt,{className:"h-5 w-5 text-muted-foreground group-hover:text-primary transition-colors shrink-0"})]}):e.jsxs("div",{onClick:()=>g(`/knowledge/playbooks/${t}`),className:"group relative flex flex-col rounded-lg border border-border bg-card p-5 cursor-pointer transition-all hover:border-primary/30 hover:shadow-md",children:[y&&e.jsx("div",{className:"absolute top-3 right-3",children:e.jsx(va,{className:"h-4 w-4 text-muted-foreground"})}),e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(q,{className:`${KN[s]||"bg-muted text-muted-foreground"} text-xs border capitalize`,children:s.replace("-"," ")}),e.jsx(q,{variant:"outline",className:"text-xs",children:r})]}),e.jsx("h3",{className:"font-semibold text-foreground group-hover:text-primary transition-colors line-clamp-2",children:a}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-2 flex-1",children:l}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5",children:d.slice(0,3).map(u=>e.jsx(q,{variant:"secondary",className:"text-xs",children:u},u))}),e.jsxs("div",{className:"mt-3 flex items-center justify-between text-xs text-muted-foreground pt-3 border-t border-border",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ut,{className:"h-3 w-3"}),c," min read"]}),e.jsxs("span",{children:[i,o?` · ${o}`:""]})]})]})},XN=t=>t==="Growing"?e.jsx($e,{className:"h-3 w-3 text-gaming-success"}):t==="Declining"?e.jsx(Po,{className:"h-3 w-3 text-destructive"}):e.jsx(Mo,{className:"h-3 w-3 text-muted-foreground"}),QN=t=>t==="High"?"bg-gaming-success/10 text-gaming-success border-gaming-success/20":t==="Medium"?"bg-gaming-warning/10 text-gaming-warning border-gaming-warning/20":"bg-muted text-muted-foreground",ED=({slug:t,title:a,alternativeTitles:s,department:r,seniority:i,summary:o,demandLevel:l,growthTrend:c,markets:h,requiredSkills:d,viewMode:p="grid",onNavigate:g})=>p==="list"?e.jsxs("div",{onClick:()=>g(`/knowledge/role-guides/${t}`),className:"group relative flex items-center gap-4 rounded-lg border border-border bg-card p-4 cursor-pointer transition-all hover:border-primary/30 hover:shadow-sm",children:[e.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:e.jsx(je,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h3",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:a}),e.jsx(q,{variant:"outline",className:"text-xs",children:r}),e.jsx(q,{variant:"secondary",className:"text-xs",children:i})]}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground line-clamp-1",children:o}),e.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs",children:[e.jsxs(q,{className:`${QN(l)} text-xs border`,children:[l," demand"]}),e.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",children:[XN(c),c]}),h.length>0&&e.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",children:[e.jsx(Te,{className:"h-3 w-3"}),h.slice(0,3).join(", ")]})]})]}),e.jsx(Pt,{className:"h-5 w-5 text-muted-foreground group-hover:text-primary transition-colors shrink-0"})]}):e.jsxs("div",{onClick:()=>g(`/knowledge/role-guides/${t}`),className:"group relative flex flex-col rounded-lg border border-border bg-card p-5 cursor-pointer transition-all hover:border-primary/30 hover:shadow-md",children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10 text-primary",children:e.jsx(je,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:a}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[r," · ",i]})]})]}),e.jsx(q,{className:`${QN(l)} text-xs border`,children:l})]}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-3 flex-1",children:o}),s.length>0&&e.jsxs("p",{className:"mt-2 text-xs text-muted-foreground",children:["Also: ",s.slice(0,2).join(", ")]}),e.jsx("div",{className:"mt-3 flex gap-1.5 flex-wrap",children:d.slice(0,3).map(y=>e.jsx(q,{variant:"secondary",className:"text-xs",children:y},y))}),e.jsxs("div",{className:"mt-3 flex items-center justify-between text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[XN(c),c]}),h.length>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Te,{className:"h-3 w-3"}),h.slice(0,2).join(", ")]})]})]}),BD=({slug:t,term:a,fullName:s,definition:r,departments:i,topicCategory:o,synonyms:l=[],viewMode:c="grid",onNavigate:h})=>c==="list"?e.jsxs("div",{onClick:()=>h(`/knowledge/glossary/${t}`),className:"group relative flex items-start gap-4 rounded-lg border border-border bg-card p-4 cursor-pointer transition-all hover:border-primary/30 hover:shadow-sm",children:[e.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary font-bold text-sm font-mono",children:a.slice(0,3)}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h3",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:a}),s&&e.jsxs("span",{className:"text-sm text-muted-foreground",children:["— ",s]})]}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground line-clamp-2",children:r}),e.jsxs("div",{className:"mt-2 flex items-center gap-2 flex-wrap",children:[e.jsx(q,{variant:"outline",className:"text-xs",children:o}),i.slice(0,2).map(d=>e.jsx(q,{variant:"secondary",className:"text-xs",children:d},d))]})]}),e.jsx(bt,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0 mt-1"})]}):e.jsxs("div",{onClick:()=>h(`/knowledge/glossary/${t}`),className:"group relative flex flex-col rounded-lg border border-border bg-card p-5 cursor-pointer transition-all hover:border-primary/30 hover:shadow-md",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-md bg-primary/10 text-primary font-bold text-sm font-mono",children:a.slice(0,3)}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:a}),s&&e.jsx("p",{className:"text-xs text-muted-foreground",children:s})]})]}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-3 flex-1",children:r}),e.jsxs("div",{className:"mt-3 flex items-center gap-1.5 flex-wrap",children:[e.jsx(q,{variant:"outline",className:"text-xs",children:o}),i.slice(0,1).map(d=>e.jsx(q,{variant:"secondary",className:"text-xs",children:d},d)),l.length>0&&e.jsxs("span",{className:"text-xs text-muted-foreground ml-auto flex items-center gap-1",children:[e.jsx(Io,{className:"h-3 w-3"}),l.length," synonyms"]})]})]}),e7=t=>{const a=Math.floor(t/60);return a>=60?`${Math.floor(a/60)}h ${a%60}m`:`${a} min`},VD=({slug:t,title:a,description:s,thumbnailUrl:r,duration:i,speaker:o,speakerRole:l,speakerCompany:c,conference:h,departments:d,sourceType:p,viewCount:g,saveCount:y,qualityRating:u,viewMode:x="grid",onNavigate:v})=>x==="list"?e.jsxs("div",{onClick:()=>v(`/knowledge/videos/${t}`),className:"group relative flex gap-4 rounded-lg border border-border bg-card p-3 cursor-pointer transition-all hover:border-primary/30 hover:shadow-sm",children:[e.jsxs("div",{className:"relative w-48 h-28 rounded-md overflow-hidden bg-muted shrink-0",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent z-10"}),e.jsxs("div",{className:"absolute bottom-2 right-2 z-20 flex items-center gap-1 bg-black/80 text-white text-xs px-1.5 py-0.5 rounded font-mono",children:[e.jsx(ut,{className:"h-3 w-3"}),e7(i)]}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-20 opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx("div",{className:"bg-primary/90 rounded-full p-2",children:e.jsx(ka,{className:"h-5 w-5 text-primary-foreground",fill:"currentColor"})})}),e.jsx("img",{src:r,alt:a,className:"w-full h-full object-cover",onError:f=>{f.target.style.display="none"}})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("h3",{className:"font-semibold text-foreground group-hover:text-primary transition-colors line-clamp-1",children:a}),e.jsx(q,{variant:"outline",className:"text-xs shrink-0 capitalize",children:p})]}),o&&e.jsxs("p",{className:"text-sm text-muted-foreground mt-1 flex items-center gap-1",children:[e.jsx(wo,{className:"h-3 w-3"}),o,c&&` · ${c}`]}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:s}),e.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Aa,{className:"h-3 w-3"}),g.toLocaleString()]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(St,{className:"h-3 w-3"}),y]}),e.jsx("span",{className:"flex items-center gap-1",children:Array.from({length:u}).map((f,k)=>e.jsx(Ze,{className:"h-3 w-3 fill-gaming-gold text-gaming-gold"},k))}),d.slice(0,2).map(f=>e.jsx(q,{variant:"secondary",className:"text-xs",children:f},f))]})]})]}):e.jsxs("div",{onClick:()=>v(`/knowledge/videos/${t}`),className:"group relative flex flex-col rounded-lg border border-border bg-card overflow-hidden cursor-pointer transition-all hover:border-primary/30 hover:shadow-md",children:[e.jsxs("div",{className:"relative w-full aspect-video bg-muted",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent z-10"}),e.jsxs("div",{className:"absolute bottom-2 right-2 z-20 flex items-center gap-1 bg-black/80 text-white text-xs px-1.5 py-0.5 rounded font-mono",children:[e.jsx(ut,{className:"h-3 w-3"}),e7(i)]}),h&&e.jsx("div",{className:"absolute top-2 left-2 z-20",children:e.jsx(q,{className:"bg-accent text-accent-foreground text-xs",children:h})}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-20 opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx("div",{className:"bg-primary/90 rounded-full p-3",children:e.jsx(ka,{className:"h-6 w-6 text-primary-foreground",fill:"currentColor"})})}),e.jsx("img",{src:r,alt:a,className:"w-full h-full object-cover",onError:f=>{f.target.style.display="none"}})]}),e.jsxs("div",{className:"p-4 flex flex-col flex-1",children:[e.jsx("h3",{className:"font-semibold text-foreground group-hover:text-primary transition-colors line-clamp-2",children:a}),o&&e.jsxs("p",{className:"text-sm text-muted-foreground mt-1 flex items-center gap-1",children:[e.jsx(wo,{className:"h-3 w-3"}),o,c&&` · ${c}`]}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-2 flex-1",children:s}),e.jsxs("div",{className:"mt-3 flex items-center gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Aa,{className:"h-3 w-3"}),g.toLocaleString()]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(St,{className:"h-3 w-3"}),y]}),d.slice(0,1).map(f=>e.jsx(q,{variant:"secondary",className:"text-xs",children:f},f))]})]})]}),OD=({item:t,viewMode:a="grid",onNavigate:s})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card cursor-pointer group",onClick:()=>s(`/gambling-channels/${t.slug}`),children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[t.isDigital?e.jsxs(q,{className:"bg-gaming-success/10 text-gaming-success text-xs",children:[e.jsx(so,{className:"h-3 w-3 mr-1"}),"Digital"]}):e.jsxs(q,{variant:"secondary",className:"text-xs",children:[e.jsx(ll,{className:"h-3 w-3 mr-1"}),"Physical"]}),t.isRegulatedDifferently&&e.jsx(q,{className:"bg-gaming-warning/10 text-gaming-warning text-xs",children:"Separate regulation"})]}),e.jsx("h3",{className:"text-lg font-semibold text-foreground group-hover:text-accent transition-colors mb-1",children:t.name}),e.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:t.label}),e.jsx("p",{className:"text-xs text-muted-foreground mb-3 line-clamp-2",children:t.description}),e.jsxs("div",{className:"flex items-center gap-2 mb-3 py-2 border-y border-border/50",children:[e.jsx(Me,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-lg font-bold text-foreground",children:t.companyCount.toLocaleString()}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"companies"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.typicalCompanyTypes.slice(0,4).map(r=>e.jsx(q,{variant:"outline",className:"text-xs capitalize",children:r.replace(/-/g," ")},r))})]}),GD={high:"bg-destructive/10 text-destructive",medium:"bg-gaming-warning/10 text-gaming-warning",low:"bg-gaming-success/10 text-gaming-success"},UD=({item:t,viewMode:a="grid",onNavigate:s})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card cursor-pointer group",onClick:()=>s(`/gambling-verticals/${t.slug}`),children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[e.jsx(q,{variant:"secondary",className:"text-xs",children:t.channel}),e.jsxs(q,{className:`text-xs ${GD[t.regulationLevel]}`,children:[e.jsx(Kt,{className:"h-3 w-3 mr-1"}),t.regulationLevel," regulation"]}),t.isFastGrowing&&e.jsxs(q,{className:"bg-gaming-success/10 text-gaming-success text-xs",children:[e.jsx($e,{className:"h-3 w-3 mr-1"}),"Fast growing"]}),t.isFeatured&&e.jsx(q,{className:"bg-primary text-primary-foreground text-xs",children:"Featured"})]}),e.jsx("h3",{className:"text-lg font-semibold text-foreground group-hover:text-accent transition-colors mb-1",children:t.name}),e.jsx("p",{className:"text-xs text-muted-foreground mb-3 line-clamp-2",children:t.description}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-3 py-2 border-y border-border/50",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-bold text-foreground",children:t.jobCount.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center justify-center gap-1",children:[e.jsx(je,{className:"h-3 w-3"})," Jobs"]})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-bold text-foreground",children:t.companyCount.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center justify-center gap-1",children:[e.jsx(Me,{className:"h-3 w-3"})," Companies"]})]})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-3",children:t.topMarkets.slice(0,3).map(r=>e.jsx(q,{variant:"outline",className:"text-xs capitalize",children:r.replace(/-/g," ")},r))}),t.keyRoles[0]&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx($e,{className:"h-3 w-3 text-gaming-success"}),e.jsxs("span",{children:["Top role: ",e.jsx("strong",{className:"text-foreground",children:t.keyRoles[0].role})]})]})]}),t7={growing:{label:"Growing",cls:"text-gaming-success"},stable:{label:"Stable",cls:"text-muted-foreground"},declining:{label:"Declining",cls:"text-destructive"}},_D=({item:t,viewMode:a="grid",onNavigate:s})=>{const r=t7[t.growthTrend]??t7.stable;return e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card cursor-pointer group",onClick:()=>s(`/departments/${t.slug}`),children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[t.isTechnical&&e.jsx(q,{variant:"secondary",className:"text-xs",children:"Technical"}),t.isRegulated&&e.jsx(q,{className:"bg-destructive/10 text-destructive text-xs",children:"Regulated"}),t.isIgamingSpecific&&e.jsx(q,{className:"bg-primary text-primary-foreground text-xs",children:"iGaming-specific"}),e.jsxs(q,{className:`text-xs ${r.cls} bg-transparent border border-current`,children:[e.jsx($e,{className:"h-3 w-3 mr-1"}),r.label]})]}),e.jsx("h3",{className:"text-lg font-semibold text-foreground group-hover:text-accent transition-colors mb-1",children:t.name}),e.jsx("p",{className:"text-xs text-muted-foreground mb-3 line-clamp-2",children:t.description}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-3 py-2 border-y border-border/50",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-bold text-foreground",children:t.jobCount.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center justify-center gap-1",children:[e.jsx(je,{className:"h-3 w-3"})," Jobs"]})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-sm font-bold text-foreground",children:[t.avgSalaryRange.currency==="EUR"?"€":t.avgSalaryRange.currency==="GBP"?"£":"$",Math.round(t.avgSalaryRange.min/1e3),"k–",Math.round(t.avgSalaryRange.max/1e3),"k"]}),e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center justify-center gap-1",children:[e.jsx(Oa,{className:"h-3 w-3"})," Salary"]})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-3",children:[t.topSkills.slice(0,4).map(i=>e.jsx(q,{variant:"outline",className:"text-xs",children:i},i)),t.topSkills.length>4&&e.jsxs(q,{variant:"outline",className:"text-xs",children:["+",t.topSkills.length-4]})]}),t.subDepartments.length>0&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[t.subDepartments.length," sub-departments"]})]})},$D={High:"text-gaming-success",Medium:"text-gaming-warning",Low:"text-muted-foreground"},WD=({item:t,viewMode:a="grid",onNavigate:s})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card cursor-pointer group",onClick:()=>s(`/company-types/${t.slug}`),children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[e.jsx(q,{variant:"secondary",className:"text-xs",children:t.businessModel.toUpperCase()}),t.isRegulated&&e.jsx(q,{className:"bg-destructive/10 text-destructive text-xs",children:"Regulated"}),t.isFeatured&&e.jsx(q,{className:"bg-primary text-primary-foreground text-xs",children:"Featured"})]}),e.jsx("h3",{className:"text-lg font-semibold text-foreground group-hover:text-accent transition-colors mb-1",children:t.name}),e.jsx("p",{className:"text-xs text-muted-foreground mb-3 line-clamp-2",children:t.description}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-3 py-2 border-y border-border/50",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-bold text-foreground",children:t.jobCount.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center justify-center gap-1",children:[e.jsx(je,{className:"h-3 w-3"})," Jobs"]})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-bold text-foreground",children:t.companyCount.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center justify-center gap-1",children:[e.jsx(Me,{className:"h-3 w-3"})," Companies"]})]})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-3",children:t.subtypes.slice(0,3).map(r=>e.jsx(q,{variant:"outline",className:"text-xs",children:r.name},r.slug))}),t.keyRoles[0]&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(ze,{className:"h-3 w-3"}),e.jsxs("span",{children:["Top role: ",e.jsx("strong",{className:"text-foreground",children:t.keyRoles[0].role})]}),e.jsx("span",{className:$D[t.keyRoles[0].demand],children:t.keyRoles[0].demand})]})]}),aN=({title:t,icon:a,children:s,className:r,compact:i=!1})=>e.jsxs(U,{className:r,children:[t&&e.jsx("div",{className:"flex flex-col space-y-1.5 p-6 pb-0",children:e.jsxs("h3",{className:"flex items-center gap-2 font-semibold leading-none tracking-tight",children:[a,t]})}),e.jsx("div",{className:ne(i?"p-4 space-y-3":"p-6 pt-3"),children:s})]});aN.displayName="DirectoryDetailCard";const ZD={High:"bg-gaming-success/10 text-gaming-success",Medium:"bg-gaming-warning/10 text-gaming-warning",Low:"bg-secondary text-muted-foreground"},k9=({roles:t,className:a})=>e.jsx("div",{className:ne("space-y-2",a),children:t.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ze,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:s.role})]}),e.jsxs(q,{className:ne("text-xs",ZD[s.demand]),children:[s.demand," demand"]})]},s.role))});k9.displayName="DirectoryKeyRolesList";const b9=({title:t,rows:a,badges:s,links:r,onNavigate:i,className:o})=>e.jsxs(aN,{title:t,compact:!0,className:o,children:[a&&a.length>0&&e.jsx("div",{className:"space-y-3",children:a.map(({label:l,value:c})=>e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:l}),e.jsx("span",{className:"text-foreground font-medium capitalize",children:c})]},l))}),s&&s.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(l=>e.jsx(q,{variant:"outline",className:"text-xs",children:l},l))}),r&&r.length>0&&e.jsx("div",{className:"space-y-1.5",children:r.map(({slug:l,label:c,icon:h,href:d})=>e.jsxs(P,{variant:"outline",size:"sm",className:"w-full justify-start gap-2 capitalize",onClick:()=>i==null?void 0:i(d),children:[h,c]},l))})]});b9.displayName="DirectoryInfoPanel";function JD(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var EM={exports:{}},sN={};function YD(t){return t&&t.__esModule?t:{default:t}}sN._=YD;var j9={};function w9(t){if(typeof WeakMap!="function")return null;var a=new WeakMap,s=new WeakMap;return(w9=function(r){return r?s:a})(t)}function KD(t,a){if(!a&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var s=w9(a);if(s&&s.has(t))return s.get(t);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var l=i?Object.getOwnPropertyDescriptor(t,o):null;l&&(l.get||l.set)?Object.defineProperty(r,o,l):r[o]=t[o]}return r.default=t,s&&s.set(t,r),r}j9._=KD;var NM={},a7;function XD(){return a7||(a7=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HeadManagerContext",{enumerable:!0,get:function(){return r}});const r=sN._(m).default.createContext({});process.env.NODE_ENV!=="production"&&(r.displayName="HeadManagerContext")}(NM)),NM}var ql={exports:{}},s7;function QD(){return s7||(s7=1,function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"setAttributesFromProps",{enumerable:!0,get:function(){return o}});const s={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv",noModule:"noModule"},r=["onLoad","onReady","dangerouslySetInnerHTML","children","onError","strategy","stylesheets"];function i(l){return["async","defer","noModule"].includes(l)}function o(l,c){for(const[h,d]of Object.entries(c)){if(!c.hasOwnProperty(h)||r.includes(h)||d===void 0)continue;const p=s[h]||h.toLowerCase();l.tagName==="SCRIPT"&&i(p)?l[p]=!!d:l.setAttribute(p,String(d)),(d===!1||l.tagName==="SCRIPT"&&i(p)&&(!d||d==="false"))&&(l.setAttribute(p,""),l.removeAttribute(p))}}(typeof a.default=="function"||typeof a.default=="object"&&a.default!==null)&&typeof a.default.__esModule>"u"&&(Object.defineProperty(a.default,"__esModule",{value:!0}),Object.assign(a.default,a),t.exports=a.default)}(ql,ql.exports)),ql.exports}var Fl={exports:{}},n7;function ez(){return n7||(n7=1,function(t,a){Object.defineProperty(a,"__esModule",{value:!0});function s(o,l){for(var c in l)Object.defineProperty(o,c,{enumerable:!0,get:l[c]})}s(a,{cancelIdleCallback:function(){return i},requestIdleCallback:function(){return r}});const r=typeof self<"u"&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(o){let l=Date.now();return self.setTimeout(function(){o({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-l))}})},1)},i=typeof self<"u"&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(o){return clearTimeout(o)};(typeof a.default=="function"||typeof a.default=="object"&&a.default!==null)&&typeof a.default.__esModule>"u"&&(Object.defineProperty(a.default,"__esModule",{value:!0}),Object.assign(a.default,a),t.exports=a.default)}(Fl,Fl.exports)),Fl.exports}(function(t,a){"use client";Object.defineProperty(a,"__esModule",{value:!0});function s(T,S){for(var N in S)Object.defineProperty(T,N,{enumerable:!0,get:S[N]})}s(a,{default:function(){return b},handleClientScriptLoad:function(){return v},initScriptLoader:function(){return w}});const r=sN,i=j9,o=e,l=r._(k7),c=i._(m),h=XD(),d=QD(),p=ez(),g=new Map,y=new Set,u=T=>{if(l.default.preinit){T.forEach(S=>{l.default.preinit(S,{as:"style"})});return}if(typeof window<"u"){let S=document.head;T.forEach(N=>{let L=document.createElement("link");L.type="text/css",L.rel="stylesheet",L.href=N,S.appendChild(L)})}},x=T=>{const{src:S,id:N,onLoad:L=()=>{},onReady:I=null,dangerouslySetInnerHTML:A,children:C="",strategy:M="afterInteractive",onError:R,stylesheets:D}=T,H=N||S;if(H&&y.has(H))return;if(g.has(S)){y.add(H),g.get(S).then(L,R);return}const G=()=>{I&&I(),y.add(H)},E=document.createElement("script"),W=new Promise((J,Y)=>{E.addEventListener("load",function(re){J(),L&&L.call(this,re),G()}),E.addEventListener("error",function(re){Y(re)})}).catch(function(J){R&&R(J)});A?(E.innerHTML=A.__html||"",G()):C?(E.textContent=typeof C=="string"?C:Array.isArray(C)?C.join(""):"",G()):S&&(E.src=S,g.set(S,W)),(0,d.setAttributesFromProps)(E,T),M==="worker"&&E.setAttribute("type","text/partytown"),E.setAttribute("data-nscript",M),D&&u(D),document.body.appendChild(E)};function v(T){const{strategy:S="afterInteractive"}=T;S==="lazyOnload"?window.addEventListener("load",()=>{(0,p.requestIdleCallback)(()=>x(T))}):x(T)}function f(T){document.readyState==="complete"?(0,p.requestIdleCallback)(()=>x(T)):window.addEventListener("load",()=>{(0,p.requestIdleCallback)(()=>x(T))})}function k(){[...document.querySelectorAll('[data-nscript="beforeInteractive"]'),...document.querySelectorAll('[data-nscript="beforePageRender"]')].forEach(S=>{const N=S.id||S.getAttribute("src");y.add(N)})}function w(T){T.forEach(v),k()}function j(T){const{id:S,src:N="",onLoad:L=()=>{},onReady:I=null,strategy:A="afterInteractive",onError:C,stylesheets:M,...R}=T;let{updateScripts:D,scripts:H,getIsSsr:G,appDir:E,nonce:W}=(0,c.useContext)(h.HeadManagerContext);W=R.nonce||W;const J=(0,c.useRef)(!1);(0,c.useEffect)(()=>{const re=S||N;J.current||(I&&re&&y.has(re)&&I(),J.current=!0)},[I,S,N]);const Y=(0,c.useRef)(!1);if((0,c.useEffect)(()=>{Y.current||(A==="afterInteractive"?x(T):A==="lazyOnload"&&f(T),Y.current=!0)},[T,A]),(A==="beforeInteractive"||A==="worker")&&(D?(H[A]=(H[A]||[]).concat([{id:S,src:N,onLoad:L,onReady:I,onError:C,...R,nonce:W}]),D(H)):G&&G()?y.add(S||N):G&&!G()&&x({...T,nonce:W})),E){if(M&&M.forEach(re=>{l.default.preinit(re,{as:"style"})}),A==="beforeInteractive")return N?(l.default.preload(N,R.integrity?{as:"script",integrity:R.integrity,nonce:W,crossOrigin:R.crossOrigin}:{as:"script",nonce:W,crossOrigin:R.crossOrigin}),(0,o.jsx)("script",{nonce:W,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${JSON.stringify([N,{...R,id:S}])})`}})):(R.dangerouslySetInnerHTML&&(R.children=R.dangerouslySetInnerHTML.__html,delete R.dangerouslySetInnerHTML),(0,o.jsx)("script",{nonce:W,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${JSON.stringify([0,{...R,id:S}])})`}}));A==="afterInteractive"&&N&&l.default.preload(N,R.integrity?{as:"script",integrity:R.integrity,nonce:W,crossOrigin:R.crossOrigin}:{as:"script",nonce:W,crossOrigin:R.crossOrigin})}return null}Object.defineProperty(j,"__nextScript",{value:!0});const b=j;(typeof a.default=="function"||typeof a.default=="object"&&a.default!==null)&&typeof a.default.__esModule>"u"&&(Object.defineProperty(a.default,"__esModule",{value:!0}),Object.assign(a.default,a),t.exports=a.default)})(EM,EM.exports);var tz=EM.exports,az=tz;const sz=JD(az),nz=`
7904
+ transition-all`,children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold tracking-tight text-lg",children:s(i)}),e.jsxs("p",{className:"font-semibold tracking-tight text-lg",children:[i.location," • ",r(i)]})]}),t.bookMeetingEnabled&&e.jsx(P,{size:"sm",variant:"accent",children:"Book Meeting"})]},o))})},jR=()=>e.jsx(ke,{value:"insights",className:"mt-0",children:e.jsx(U,{children:e.jsxs(_,{className:"py-12 text-center",children:[e.jsx(va,{className:"w-10 h-10 text-muted-foreground mx-auto mb-3"}),e.jsx("h3",{className:"font-semibold mb-2",children:"Premium Insights"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"Unlock demand trends, competitor analysis, and intent signals."}),e.jsx(P,{variant:"accent",children:"Upgrade to Access"})]})})}),wR=({companyOverview:t,similarCompanies:a})=>{var s;return e.jsxs("aside",{className:"space-y-4",children:[e.jsxs(U,{children:[e.jsx(ae,{children:e.jsx(se,{className:"text-base",children:"Contact"})}),e.jsxs(_,{className:"space-y-3",children:[e.jsxs("a",{href:t.website,target:"_blank",className:"flex items-center gap-2 text-sm text-accent hover:underline",children:[e.jsx(Lt,{className:"w-4 h-4"}),t.website.replace(/^https?:\/\//,"")]}),((s=t.socialLinks)==null?void 0:s.linkedin)&&e.jsxs("a",{href:t.socialLinks.linkedin,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground",children:[e.jsx(rl,{className:"w-4 h-4"}),"LinkedIn"]})]})]}),e.jsxs(U,{children:[e.jsx(ae,{children:e.jsx(se,{className:"text-base",children:"Similar Companies"})}),e.jsx(_,{className:"space-y-2",children:a.map((r,i)=>{const o=r.url??(r.slug?`/companies/${r.slug}`:void 0);return o?e.jsx("a",{href:o,className:"flex items-center gap-2 p-2 bg-secondary/50 rounded-lg text-sm text-foreground hover:underline",children:r.name},`${r.name}-${i}`):e.jsx("div",{className:"flex items-center gap-2 p-2 bg-secondary/50 rounded-lg text-sm",children:r.name},`${r.name}-${i}`)})})]})]})},MR=({review:t,onHelpful:a,onShare:s,onReport:r})=>{const i={employee:"Employee",client:"Client",partner:"Partner",competitor:"Industry Peer",other:"Other"};return e.jsx(U,{className:"border-border/50",children:e.jsxs(_,{className:"p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-secondary flex items-center justify-center flex-shrink-0",children:e.jsx(Ra,{className:"w-5 h-5 text-muted-foreground"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-sm text-foreground",children:t.author.displayName}),t.isVerified&&e.jsx(Ee,{className:"w-3.5 h-3.5 text-gaming-success"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.author.relationship&&e.jsx("span",{children:i[t.author.relationship]??t.author.relationship}),t.author.jobTitle&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:t.author.jobTitle})]})]})]})]}),e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:eN(new Date(t.createdAt),{addSuffix:!0})})]}),e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("h4",{className:"font-semibold text-foreground",children:t.title}),e.jsx(Nl,{rating:t.rating,size:"sm"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3 leading-relaxed",children:t.body}),(t.pros||t.cons)&&e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-3",children:[t.pros&&e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"font-medium text-gaming-success text-xs uppercase tracking-wide",children:"Pros"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:t.pros})]}),t.cons&&e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"font-medium text-destructive text-xs uppercase tracking-wide",children:"Cons"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:t.cons})]})]}),e.jsxs("div",{className:"flex items-center gap-3 pt-3 border-t border-border/50",children:[e.jsxs(P,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-accent gap-1.5 h-8",onClick:()=>a==null?void 0:a(t.id),children:[e.jsx(Ao,{className:"w-3.5 h-3.5"}),"Useful ",t.helpfulCount>0&&`(${t.helpfulCount})`]}),e.jsxs(P,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-accent gap-1.5 h-8",onClick:()=>s==null?void 0:s(t.id),children:[e.jsx(Pa,{className:"w-3.5 h-3.5"}),"Share"]}),e.jsx(P,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-destructive gap-1.5 h-8 ml-auto",onClick:()=>r==null?void 0:r(t.id),children:e.jsx(Qi,{className:"w-3.5 h-3.5"})})]})]})})},NR=({summary:t,compact:a=!1})=>{if(t.totalReviews===0)return e.jsx("div",{className:"text-center py-4",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"No reviews yet"})});const s=[5,4,3,2,1];return e.jsxs("div",{className:`flex ${a?"items-center gap-4":"flex-col sm:flex-row gap-6"}`,children:[e.jsxs("div",{className:`text-center ${a?"":"min-w-[100px]"}`,children:[e.jsx("div",{className:"text-3xl font-bold text-foreground",children:t.averageRating}),e.jsx(Nl,{rating:Math.round(t.averageRating),size:"sm"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[t.totalReviews," review",t.totalReviews!==1?"s":""]})]}),!a&&e.jsx("div",{className:"flex-1 space-y-1.5",children:s.map(r=>{const i=t.ratingDistribution[r]??0,o=t.totalReviews>0?i/t.totalReviews*100:0;return e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"w-3 text-right text-muted-foreground",children:r}),e.jsx(Xt,{value:o,className:"h-2 flex-1"}),e.jsx("span",{className:"w-6 text-muted-foreground",children:i})]},r)})})]})},CR=({companyName:t,companyId:a,companySlug:s,open:r,onOpenChange:i,onSubmit:o})=>{const[l,c]=m.useState(0),[h,d]=m.useState(""),[p,g]=m.useState(""),[y,u]=m.useState(""),[x,v]=m.useState(""),[f,k]=m.useState(""),[w,j]=m.useState(!1),[b,T]=m.useState(!1),S=l>0&&h.trim().length>=5&&p.trim().length>=20&&f,N=()=>{!S||l===0||(o==null||o({companyId:a,companySlug:s,title:h.trim(),body:p.trim(),rating:l,pros:y.trim()||void 0,cons:x.trim()||void 0,relationship:f,isAnonymous:w}),T(!0))},L=()=>{c(0),d(""),g(""),u(""),v(""),k(""),j(!1),T(!1),i(!1)};return e.jsx(tt,{open:r,onOpenChange:L,children:e.jsx(Xe,{className:"sm:max-w-[520px]",children:b?e.jsxs(e.Fragment,{children:[e.jsxs(Be,{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-gaming-success/10 flex items-center justify-center mx-auto mb-4",children:e.jsx(pt,{className:"w-8 h-8 text-gaming-success"})}),e.jsx(Ie,{children:"Review Submitted!"}),e.jsx(nt,{className:"text-center",children:"Thank you for your review. It will be published after moderation (usually within 24-48 hours)."})]}),e.jsx(et,{children:e.jsx(P,{variant:"accent",onClick:L,className:"w-full",children:"Done"})})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Be,{children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-accent/20 to-primary/20 flex items-center justify-center mb-2",children:e.jsx(pt,{className:"w-6 h-6 text-accent"})}),e.jsxs(Ie,{children:["Review ",t]}),e.jsxs(nt,{children:["Share your experience working with or for ",t,". All reviews are moderated before publishing."]})]}),e.jsxs("div",{className:"space-y-4 py-2 max-h-[60vh] overflow-y-auto",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Overall Rating *"}),e.jsx(Nl,{rating:l,size:"lg",interactive:!0,onRatingChange:I=>c(I)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Your Relationship *"}),e.jsxs(Je,{value:f,onValueChange:k,children:[e.jsx(Ue,{children:e.jsx(Ye,{placeholder:"How do you know this company?"})}),e.jsxs(_e,{children:[e.jsx(xe,{value:"employee",children:"Current/Former Employee"}),e.jsx(xe,{value:"client",children:"Client / Customer"}),e.jsx(xe,{value:"partner",children:"Business Partner"}),e.jsx(xe,{value:"competitor",children:"Industry Peer"}),e.jsx(xe,{value:"other",children:"Other"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Review Title *"}),e.jsx(ee,{placeholder:"Summarize your experience in a few words",value:h,onChange:I=>d(I.target.value),maxLength:120})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["Your Review * ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(min 20 characters)"})]}),e.jsx(st,{placeholder:"Share details about your experience...",value:p,onChange:I=>g(I.target.value),rows:4,maxLength:2e3})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["Pros ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),e.jsx(st,{placeholder:"What did you like?",value:y,onChange:I=>u(I.target.value),rows:2,maxLength:500})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(V,{children:["Cons ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),e.jsx(st,{placeholder:"What could be improved?",value:x,onChange:I=>v(I.target.value),rows:2,maxLength:500})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border px-4 py-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Post anonymously"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Your name won't be shown publicly"})]}),e.jsx(yt,{checked:w,onCheckedChange:j})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"By submitting, you confirm this review is based on genuine experience and complies with our community guidelines."})]}),e.jsxs(et,{children:[e.jsx(P,{variant:"outline",onClick:L,children:"Cancel"}),e.jsx(P,{variant:"accent",onClick:N,disabled:!S,children:"Submit Review"})]})]})})})},SR=({companyId:t,companySlug:a,companyName:s,reviews:r,summary:i,onLeaveReview:o,onHelpful:l,onReport:c})=>{const[h,d]=m.useState("newest"),[p,g]=m.useState(!1),y=m.useMemo(()=>{const u=[...r];switch(h){case"newest":return u.sort((x,v)=>new Date(v.createdAt).getTime()-new Date(x.createdAt).getTime());case"oldest":return u.sort((x,v)=>new Date(x.createdAt).getTime()-new Date(v.createdAt).getTime());case"highest":return u.sort((x,v)=>v.rating-x.rating);case"lowest":return u.sort((x,v)=>x.rating-v.rating);case"most-helpful":return u.sort((x,v)=>v.helpfulCount-x.helpfulCount);default:return u}},[r,h]);return e.jsxs(ke,{value:"reviews",className:"space-y-6 mt-0",children:[e.jsxs(U,{children:[e.jsx(ae,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(se,{children:"Reviews"}),e.jsxs(P,{variant:"accent",size:"sm",className:"gap-1.5",onClick:()=>g(!0),children:[e.jsx(pt,{className:"w-4 h-4"}),"Add review"]})]})}),e.jsx(_,{children:e.jsx(NR,{summary:i})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:[r.length," review",r.length!==1?"s":""]}),e.jsxs(Je,{value:h,onValueChange:u=>d(u),children:[e.jsx(Ue,{className:"w-[180px]",children:e.jsx(Ye,{})}),e.jsxs(_e,{children:[e.jsx(xe,{value:"newest",children:"Newest reviews"}),e.jsx(xe,{value:"oldest",children:"Oldest reviews"}),e.jsx(xe,{value:"highest",children:"Highest rated"}),e.jsx(xe,{value:"lowest",children:"Lowest rated"}),e.jsx(xe,{value:"most-helpful",children:"Most helpful"})]})]})]}),y.length===0?e.jsx(U,{children:e.jsxs(_,{className:"py-12 text-center",children:[e.jsx(pt,{className:"w-12 h-12 text-muted-foreground/30 mx-auto mb-3"}),e.jsx("p",{className:"text-muted-foreground",children:"No reviews yet. Be the first to share your experience!"}),e.jsx(P,{variant:"accent",size:"sm",className:"mt-4",onClick:()=>g(!0),children:"Write a review"})]})}):e.jsx("div",{className:"space-y-4",children:y.map(u=>e.jsx(MR,{review:u,onHelpful:l,onReport:c},u.id))}),e.jsx(CR,{companyName:s,companyId:t,companySlug:a,open:p,onOpenChange:g,onSubmit:o})]})},LR=t=>{var a,s;if(t==null)return"";if(typeof t=="string"&&t.startsWith("http"))return t;if(typeof t=="string"&&t.startsWith("{"))try{const r=JSON.parse(t.replace(/'/g,'"'));return(r==null?void 0:r.url)??""}catch{return""}return typeof t=="object"?(t==null?void 0:t.url)??((s=(a=t==null?void 0:t.formats)==null?void 0:a.thumbnail)==null?void 0:s.url)??"":""},l9=t=>({profileViews30d:(t==null?void 0:t.profile_views_30d)??(t==null?void 0:t.profileViews30d)??0,followsCount:(t==null?void 0:t.follows_count)??(t==null?void 0:t.followsCount)??0,hiringIntensity:(t==null?void 0:t.hiring_intensity)??(t==null?void 0:t.hiringIntensity)??"Low",topSkillsHiring:(t==null?void 0:t.top_skills_hiring)??(t==null?void 0:t.topSkillsHiring)??[],topViewingCountries:(t==null?void 0:t.top_viewing_countries)??(t==null?void 0:t.topViewingCountries)??[],oftenComparedWith:(t==null?void 0:t.often_compared_with)??(t==null?void 0:t.oftenComparedWith)??[],similarCompanies:(t==null?void 0:t.similar_companies)??(t==null?void 0:t.similarCompanies)??[]}),IR=t=>{if(t)return{capabilitiesScore:t.capabilities_score??t.capabilitiesScore??0,credibilityScore:t.credibility_score??t.credibilityScore??0,complianceScore:t.compliance_score??t.complianceScore??0,hiringScore:t.hiring_score??t.hiringScore??0,overallScore:t.overall_score??t.overallScore??0,detectedBusinessModel:t.detected_business_model??t.detectedBusinessModel??"",detectedProducts:t.detected_products??t.detectedProducts??[],detectedMarkets:t.detected_markets??t.detectedMarkets??[]}},AR=t=>({id:String(t.id??t.company_id??""),name:t.name??"",slug:t.slug??"",companyType:t.company_type??t.companyType,overview:t.overview?{shortDescription:t.overview.short_description??t.overview.shortDescription,headquarters:t.overview.headquarters,employeeRange:t.overview.employee_range??t.overview.employeeRange}:void 0,isPrimary:t.is_primary??t.isPrimary}),PR=t=>({id:String((t==null?void 0:t.id)??(t==null?void 0:t.group_id)??""),name:(t==null?void 0:t.name)??(t==null?void 0:t.group_name)??"",slug:(t==null?void 0:t.slug)??"",website:(t==null?void 0:t.website)??"",description:(t==null?void 0:t.description)??"",primaryCompanyId:(t==null?void 0:t.primary_company_id)??(t==null?void 0:t.primaryCompanyId)??"",companies:Array.isArray(t==null?void 0:t.companies)?t.companies.map(AR):[],intelligenceProfile:l9((t==null?void 0:t.intelligence_profile)??(t==null?void 0:t.intelligenceProfile))}),TR=t=>{var a,s;return{shortDescription:(t==null?void 0:t.shortDescription)??(t==null?void 0:t.short_description)??"",longDescription:(t==null?void 0:t.longDescription)??(t==null?void 0:t.long_description),foundedYear:typeof(t==null?void 0:t.foundedYear)=="number"?t.foundedYear:0,headquarters:{city:((a=t==null?void 0:t.headquarters)==null?void 0:a.city)??"",country:((s=t==null?void 0:t.headquarters)==null?void 0:s.country)??""},officeLocations:t==null?void 0:t.officeLocations,employeeRange:(t==null?void 0:t.employeeRange)??(t==null?void 0:t.employee_range)??"",publicCompany:t==null?void 0:t.publicCompany,stockTicker:t==null?void 0:t.stockTicker,website:(t==null?void 0:t.website)??"",socialLinks:t==null?void 0:t.socialLinks}},RR=t=>({searchImpressions:(t==null?void 0:t.searchImpressions)??0,profileClicks:(t==null?void 0:t.profileClicks)??0,externalClicks:(t==null?void 0:t.externalClicks)??0}),DR=t=>{var a,s,r;return{...t,overview:TR(t.overview),logo:LR(t.logo),jobs:zR(t.jobs),group:PR(t.group),groupId:t.groupId??t.group_id??((a=t.group)==null?void 0:a.id),groupName:t.groupName??t.group_name??((s=t.group)==null?void 0:s.name),groupSlug:t.group_slug??t.groupSlug??((r=t.group)==null?void 0:r.slug),signalsAndInsights:l9(t.signalsAndInsights??t.signals_and_insights??t.signalsAndInsights)??t.signalsAndInsights,visibilityMetrics:RR(t.visibilityMetrics),intelligenceProfile:IR(t.intelligence_profile??t.intelligenceProfile),classification:qR(t.classification)}},zR=t=>({openRoles:Array.isArray(t==null?void 0:t.openRoles)||typeof(t==null?void 0:t.openRoles)=="number"?t.openRoles:[],departmentsHiring:Array.isArray(t==null?void 0:t.departmentsHiring)?t.departmentsHiring:[],locationsHiring:Array.isArray(t==null?void 0:t.locationsHiring)?t.locationsHiring:[],remotePolicy:(t==null?void 0:t.remotePolicy)??""}),qR=t=>({businessModel:(t==null?void 0:t.businessModel)??(t==null?void 0:t.business_model)??"",verticals:Array.isArray(t==null?void 0:t.verticals)?t.verticals:[],productCategories:Array.isArray(t==null?void 0:t.productCategories)?t.productCategories:[],tags:((t==null?void 0:t.tags)??[]).map(a=>typeof a=="string"?a:a.title??a.tag??"")}),FR=t=>({count:(t==null?void 0:t.count)??0,page:(t==null?void 0:t.page)??1,pageSize:(t==null?void 0:t.page_size)??(t==null?void 0:t.pageSize)??0,totalPages:(t==null?void 0:t.total_pages)??(t==null?void 0:t.totalPages)??1,results:Array.isArray(t==null?void 0:t.results)?t.results.map(DR):[],filterOptions:(t==null?void 0:t.filter_options)??(t==null?void 0:t.filterOptions)}),HR=t=>{if(typeof t=="string")return t;const a=t.city??t.cities??t.location,s=t.country;return`${a??"Remote"}, ${s??"Global"}`},ER=[{name:"Casino Games (Slots & RNG)",category:"Game Content",description:"RNG-based casino games including slots and table games.",keywords:["slot","rng","casino game","table game","jackpot","buy bonus"],negativeKeywords:["live casino games","live casino"],priority:10},{name:"Live Casino Games",category:"Live Casino",description:"Live dealer games streamed from professional studios.",keywords:["live casino games","live dealer games","roulette games","live roulette","sic-bo","presenter"],negativeKeywords:["real-time reporting"],priority:10},{name:"iGaming Platform / PAM",category:"Platform",description:"Core iGaming platform including player accounts, wallet, and cashier.",keywords:["pam","aggregation platform","cashier","player account"],negativeKeywords:[],priority:10},{name:"Game Aggregation",category:"Aggregation",description:"Single API access to multiple game providers.",keywords:["aggregation","aggregator","single api","content hub"],negativeKeywords:[],priority:10},{name:"Bonus & Promotions Platform",category:"CRM & Engagement",description:"Bonus management, promotions, and player engagement tools.",keywords:["bonus tools","promotional tools","free spins tools","tournament","leaderboard","rewards tools","bonus features","bonus platform"],negativeKeywords:[],priority:10},{name:"Back Office & Analytics",category:"Operations",description:"Reporting, dashboards, and performance analytics.",keywords:["back office","real-time reporting","analytics","easy-to-use tools","insights"],negativeKeywords:[],priority:10},{name:"Live Casino Infrastructure",category:"Technology",description:"Hardware, streaming, and infrastructure for live casino operations.",keywords:["streaming","video streaming","Live Casino studio","professional game hosts"],negativeKeywords:[],priority:10},{name:"Payments & Payouts",category:"Payments",description:"Payment processing, deposits, and withdrawals.",keywords:["Payment processing","psp","payout","withdrawal","deposit"],negativeKeywords:[],priority:10},{name:"Compliance & Risk",category:"Compliance",description:"KYC, AML, fraud prevention, and responsible gaming.",keywords:["kyc detection","aml detection","compliance tools","fraud detection","fraud prevention","responsible gaming tools"],negativeKeywords:[],priority:10}];function BR(t,a){var o;const s=a.toLowerCase();return!(!t.keywords.some(l=>s.includes(l))||((o=t.negativeKeywords)==null?void 0:o.some(l=>s.includes(l))))}function VR(t){return t!==null}const OR=t=>ER.map(a=>{const s=t.filter(r=>BR(a,r));return s.length===0?null:{name:a.name,category:a.category,description:a.description,keyDifferentiators:Array.from(new Set(s)),source:"derived",confidence:Math.min(1,s.length/5),priority:a.priority}}).filter(VR).sort((a,s)=>s.priority-a.priority),GR=(t,a)=>Array.isArray(t)&&t.length>0?t:a.map(s=>({name:s})),UR=({company:t,jobs:a,news:s,events:r,showReviews:i=!1,reviews:o,followLoading:l=!1,followDisabled:c=!1,onToggleFollow:h,onFollowAction:d,saveLoading:p=!1,saveDisabled:g=!1,onToggleSave:y,onSaveAction:u,canClaim:x,onClaimSubmit:v,claimPrefill:f,onBack:k,activeTab:w,tabPaths:j,onTabChange:b,similarCompanies:T})=>{var he,te,O,X,F,z,B,ce;const[S,N]=m.useState(!1),[L,I]=m.useState(w??"overview");if(m.useEffect(()=>{w&&I(w)},[w]),!t)return e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"container mx-auto px-4 py-16 text-center",children:[e.jsx(Me,{className:"w-16 h-16 text-muted-foreground mx-auto mb-4"}),e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Company Not Found"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"The company you're looking for doesn't exist."}),e.jsx("a",{href:"/companies",children:e.jsx(P,{variant:"accent",children:"Browse Directory"})})]})});const A=((te=(he=t.webIntelligence)==null?void 0:he.menus.primary_nav_details)==null?void 0:te.flatMap(ue=>ue.key_points))??[],C=t.trustAndCompliance.licenses.length+t.trustAndCompliance.certifications.length+t.trustAndCompliance.awards.length,M=t.signalsAndInsights,R=GR(T,M.similarCompanies),D=a??[],H=s??[],G=r??[],E=o??[],W=i&&Array.isArray(o),J=E.reduce((ue,Ne)=>(ue.totalReviews+=1,ue.ratingDistribution[Ne.rating]+=1,ue.averageRating+=Ne.rating,ue),{averageRating:0,totalReviews:0,ratingDistribution:{1:0,2:0,3:0,4:0,5:0}});J.totalReviews>0&&(J.averageRating=Math.round(J.averageRating/J.totalReviews*10)/10);const Y=D.length>0?D.length:Array.isArray(t.jobs.openRoles)?t.jobs.openRoles.length:t.jobs.openRoles,re=((O=t.group)==null?void 0:O.name)??t.groupName??t.group_name??null,oe=((X=t.group)==null?void 0:X.slug)??t.groupSlug??t.group_slug??((F=t.group)==null?void 0:F.id)??t.groupId??t.group_id??void 0,$=OR(A),Q=[...t.productsAndServices??[],...$??[]],de=[{value:"overview",label:"Overview",icon:fa},{value:"products",label:"Products",icon:No},{value:"trust",label:"Trust",icon:Ta},{value:"people",label:"People",icon:Ns},{value:"jobs",label:"Jobs",icon:je},{value:"news",label:"News",icon:Ut},{value:"events",label:"Events",icon:da},...W?[{value:"reviews",label:"Reviews",icon:pt}]:[],{value:"insights",label:"Insights",icon:va,disabled:!0}],ve=ue=>{const Ne=ue;w||I(Ne),b==null||b({tab:Ne,path:j==null?void 0:j[Ne]})};return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(i9,{companyName:t.name,companyType:t.companyType,overview:t.overview,classification:t.classification,companyId:t.id,companySlug:t.slug,groupSlug:oe,groupLabel:re??"Gaming",signalsAndInsights:t.signalsAndInsights,claimedStatus:t.claimedStatus,isFollowing:t.isFollowing,isSaved:t.isSaved,openRolesCount:Y,trustScore:C,onBack:k,saveDisabled:g,saveLoading:p,canClaim:x,onToggleFollow:h,onFollowAction:d,onToggleSave:y,onSaveAction:u,followLoading:l,followDisabled:c,onClaimClick:()=>N(!0)}),e.jsx("section",{className:"py-6",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs(Da,{value:w??L,onValueChange:ve,className:"space-y-6",children:[e.jsx(o9,{items:de}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[e.jsx(pR,{overview:t.overview,classification:t.classification,officeLocations:t.overview.officeLocations??[],formatOfficeLocation:HR}),e.jsx(xR,{products:Q}),e.jsx(gR,{companyTrustData:t.trustAndCompliance,credibilityEvidence:(ce=(B=(z=t.webIntelligence)==null?void 0:z.signals)==null?void 0:B.evidence)==null?void 0:ce.credibility}),e.jsx(fR,{members:t.people.members}),e.jsx(vR,{company:t,jobListings:D,openRolesCount:Y}),e.jsx(kR,{companyNews:t.newsAndMedia,newsArticles:H}),e.jsx(bR,{companyEvents:t.events,conferenceEvents:G}),W&&e.jsx(SR,{companyId:t.id,companySlug:t.slug,companyName:t.name,reviews:E,summary:J}),e.jsx(jR,{})]}),e.jsx(wR,{companyOverview:t.overview,similarCompanies:R})]})]})})}),e.jsx(mR,{company:t,open:S,onOpenChange:N,onClaimSubmit:v,claimPrefill:f})]})},_R=({group:t})=>{var r,i;if(!t)return e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"container mx-auto px-4 py-16 text-center",children:[e.jsx(Me,{className:"w-16 h-16 text-muted-foreground mx-auto mb-4"}),e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Group Not Found"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"The group you're looking for doesn't exist."}),e.jsx("a",{href:"/companies",children:e.jsx(P,{variant:"accent",children:"Browse Companies"})})]})});const a=t.intelligenceProfile,s=((r=t.companies)==null?void 0:r.length)??0;return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("section",{className:"bg-gradient-to-br from-primary via-primary to-primary-variant py-8",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsxs("a",{href:"/companies",className:"inline-flex items-center text-primary-foreground/70 hover:text-primary-foreground mb-6 text-sm",children:[e.jsx(la,{className:"w-4 h-4 mr-1"})," Back to Directory"]}),e.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[e.jsx("div",{className:"w-20 h-20 rounded-2xl bg-white/10 backdrop-blur flex items-center justify-center flex-shrink-0",children:e.jsx(Me,{className:"w-10 h-10 text-primary-foreground"})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[e.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-primary-foreground",children:t.name}),e.jsx(q,{className:"bg-white/10 text-primary-foreground border-white/20",children:"Company Group"})]}),t.description&&e.jsx("p",{className:"text-primary-foreground/80 text-sm mb-4 max-w-2xl",children:t.description}),e.jsx("div",{className:"flex flex-wrap gap-2",children:t.website&&e.jsx("a",{href:t.website,target:"_blank",rel:"noreferrer",children:e.jsxs(P,{variant:"outline",className:"border-primary-foreground/30 text-primary-foreground hover:bg-primary-foreground/10",children:[e.jsx(Lt,{className:"w-4 h-4 mr-2"})," Visit Website"]})})})]}),a&&e.jsxs("div",{className:"flex gap-4 md:gap-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-primary-foreground",children:s}),e.jsx("div",{className:"text-xs text-primary-foreground/70",children:"Member Companies"})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-primary-foreground",children:[(a.profileViews30d/1e3).toFixed(1),"k"]}),e.jsx("div",{className:"text-xs text-primary-foreground/70",children:"Views/30d"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-primary-foreground",children:a.followsCount.toLocaleString()}),e.jsx("div",{className:"text-xs text-primary-foreground/70",children:"Followers"})]})]})]})]})}),e.jsx("section",{className:"py-8",children:e.jsxs("div",{className:"container mx-auto px-4 space-y-6",children:[e.jsxs(U,{children:[e.jsx(ae,{children:e.jsx(se,{children:"Group Overview"})}),e.jsxs(_,{className:"space-y-4",children:[t.website&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-accent",children:[e.jsx(Lt,{className:"w-4 h-4"}),e.jsx("a",{href:t.website,target:"_blank",rel:"noreferrer",className:"hover:underline",children:t.website.replace(/^https?:\/\//,"")})]}),t.description?e.jsx("p",{className:"text-muted-foreground",children:t.description}):e.jsx("p",{className:"text-muted-foreground",children:"No group description available yet."})]})]}),e.jsxs(U,{children:[e.jsx(ae,{children:e.jsx(se,{children:"Member Companies"})}),e.jsxs(_,{className:"space-y-3",children:[s===0&&e.jsx("p",{className:"text-muted-foreground",children:"No member companies listed."}),(i=t.companies)==null?void 0:i.map(o=>{var c,h,d;const l=o.isPrimary||o.id===t.primaryCompanyId;return e.jsxs("div",{className:`flex flex-col md:flex-row md:items-center md:justify-between gap-3 rounded-lg border p-4 ${l?"border-accent/40 bg-accent/5":"border-border"}`,children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("a",{href:`/companies/${o.slug}`,className:"font-semibold hover:text-accent",children:o.name}),l&&e.jsx(q,{className:"bg-accent/10 text-accent border-accent/20",children:"Primary"})]}),((c=o.overview)==null?void 0:c.shortDescription)&&e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:o.overview.shortDescription})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm text-muted-foreground",children:[((h=o.overview)==null?void 0:h.headquarters)&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Me,{className:"w-4 h-4"}),o.overview.headquarters.city,", ",o.overview.headquarters.country]}),((d=o.overview)==null?void 0:d.employeeRange)&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ze,{className:"w-4 h-4"}),o.overview.employeeRange]})]})]},o.id)})]})]}),a&&e.jsxs(U,{children:[e.jsx(ae,{children:e.jsx(se,{children:"Group Intelligence"})}),e.jsxs(_,{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"rounded-lg border border-border/60 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(Ze,{className:"w-4 h-4"})," Followers"]}),e.jsx("div",{className:"text-2xl font-semibold mt-2",children:a.followsCount.toLocaleString()})]}),e.jsxs("div",{className:"rounded-lg border border-border/60 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx($e,{className:"w-4 h-4"})," Hiring Intensity"]}),e.jsx("div",{className:"text-2xl font-semibold mt-2",children:a.hiringIntensity})]}),e.jsxs("div",{className:"rounded-lg border border-border/60 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(ze,{className:"w-4 h-4"})," Top Viewing Countries"]}),e.jsx("div",{className:"text-sm font-medium mt-2",children:a.topViewingCountries.join(", ")||"No data"})]})]})]})]})})]})},$R=(t,a)=>{const{buildUrl:s,initialData:r}=a,[i,o]=m.useState(r??null),[l,c]=m.useState(!r),h=m.useMemo(()=>s(t),[s,t]);return m.useEffect(()=>{let d=!1;return c(!0),fetch(h).then(p=>{if(!p.ok)throw new Error(`Failed to load companies: ${p.status}`);return p.json()}).then(p=>{d||o(FR(p))}).catch(p=>{console.error(p)}).finally(()=>{d||c(!1)}),()=>{d=!0}},[h]),{data:i,loading:l}},HM={query:"",filters:{},sort:"popularity_desc",page:1,pageSize:50,scope:"company"},Et=(t,a)=>{var s;return((s=t.get(a))==null?void 0:s.split(",").filter(Boolean))??[]},$N=(t,a)=>{const s=Number(t);return Number.isFinite(s)&&s>0?s:a},WR=t=>{var s,r,i,o,l,c,h;const a=new URLSearchParams;return t.query&&a.set("query",t.query),t.sort&&a.set("sort",t.sort),t.scope&&t.scope!=="company"&&a.set("scope",t.scope),t.segment&&a.set("segment",t.segment),t.subcategory&&a.set("subcategory",t.subcategory),t.region&&a.set("region",t.region),a.set("page",String(t.page)),a.set("pageSize",String(t.pageSize)),t.filters.companyType&&a.set("filters[companyType]",t.filters.companyType),(s=t.filters.country)!=null&&s.length&&a.set("filters[country]",t.filters.country.join(",")),(r=t.filters.products)!=null&&r.length&&a.set("filters[products]",t.filters.products.join(",")),(i=t.filters.employees)!=null&&i.length&&a.set("filters[employees]",t.filters.employees.join(",")),(o=t.filters.verticals)!=null&&o.length&&a.set("filters[verticals]",t.filters.verticals.join(",")),(l=t.filters.productCategories)!=null&&l.length&&a.set("filters[productCategories]",t.filters.productCategories.join(",")),(c=t.filters.openRoles)!=null&&c.length&&a.set("filters[openRoles]",t.filters.openRoles.join(",")),(h=t.filters.yearsActive)!=null&&h.length&&a.set("filters[yearsActive]",t.filters.yearsActive.join(",")),t.filters.hiringNow&&a.set("filters[hiringNow]","true"),t.filters.claimedOnly&&a.set("filters[claimedOnly]","true"),t.filters.hasLicenses&&a.set("filters[hasLicenses]","true"),t.filters.hasAwards&&a.set("filters[hasAwards]","true"),a.toString()},ZR=(t,a=HM)=>{const s=new URLSearchParams(t),r=s.get("scope"),i=r==="group"||r==="company"?r:a.scope,o=s.get("query")??s.get("search")??a.query??"",l=s.get("pageSize")??s.get("page_size");return{...a,query:o,sort:s.get("sort")??a.sort,page:$N(s.get("page"),a.page),pageSize:$N(l,a.pageSize),scope:i,segment:s.get("segment")??a.segment,subcategory:s.get("subcategory")??a.subcategory,region:s.get("region")??a.region,filters:{companyType:s.get("filters[companyType]")??s.get("companyType")??a.filters.companyType,country:Et(s,"filters[country]").concat(Et(s,"country")),products:Et(s,"filters[products]").concat(Et(s,"products")),employees:Et(s,"filters[employees]").concat(Et(s,"employees")).concat(Et(s,"employeeRanges")),verticals:Et(s,"filters[verticals]").concat(Et(s,"verticals")),productCategories:Et(s,"filters[productCategories]").concat(Et(s,"productCategories")),openRoles:Et(s,"filters[openRoles]").concat(Et(s,"openRoles")),yearsActive:Et(s,"filters[yearsActive]").concat(Et(s,"yearsActive")),hiringNow:["true","1","yes"].includes(s.get("filters[hiringNow]")??s.get("hiringNow")??""),claimedOnly:["true","1","yes"].includes(s.get("filters[claimedOnly]")??s.get("claimedOnly")??""),hasLicenses:["true","1","yes"].includes(s.get("filters[hasLicenses]")??s.get("hasLicenses")??""),hasAwards:["true","1","yes"].includes(s.get("filters[hasAwards]")??s.get("hasAwards")??"")}}},JR=t=>({...t9,search:t.query??"",companyType:t.filters.companyType??"",verticals:t.filters.verticals??[],productCategories:t.filters.productCategories??[],employeeRanges:t.filters.employees??[],products:t.filters.products??[],openRolesRanges:t.filters.openRoles??[],yearsActiveRanges:t.filters.yearsActive??[],hiringNow:t.filters.hiringNow??!1,scope:t.scope,claimedOnly:t.filters.claimedOnly??!1,hasLicenses:t.filters.hasLicenses??!1,hasAwards:t.filters.hasAwards??!1}),YR=t=>({companyType:t.companyType||void 0,verticals:t.verticals.length?t.verticals:void 0,productCategories:t.productCategories.length?t.productCategories:void 0,employees:t.employeeRanges.length?t.employeeRanges:void 0,products:t.products.length?t.products:void 0,openRoles:t.openRolesRanges.length?t.openRolesRanges:void 0,yearsActive:t.yearsActiveRanges.length?t.yearsActiveRanges:void 0,hiringNow:t.hiringNow||void 0,claimedOnly:t.claimedOnly||void 0,hasLicenses:t.hasLicenses||void 0,hasAwards:t.hasAwards||void 0}),KR={companyTypes:[],verticals:[],productCategories:[],employeeRanges:[],products:[],openRolesRanges:[],yearsActiveRanges:[]},XR=[{value:"popularity",label:"Most Active"},{value:"name_asc",label:"Name (A-Z)"},{value:"name_desc",label:"Name (Z-A)"},{value:"employees",label:"Company Size"}],QR=4,eD=({initialData:t,initialFilterOptions:a,buildUrl:s,initialQuery:r,maxCompare:i=QR,sortOptions:o=XR,followDisabled:l=!1,followLoading:c=!1,onToggleFollow:h,onFollowAction:d,saveDisabled:p=!1,saveLoading:g=!1,onToggleSave:y,onSaveAction:u})=>{const[x,v]=m.useState(()=>r||(typeof window>"u"?HM:ZR(window.location.search,HM))),[f,k]=m.useState("list"),[w,j]=m.useState(a),{data:b,loading:T}=$R(x,{buildUrl:s,initialData:t}),S=b??t,N=T&&!b,L=m.useMemo(()=>JR(x),[x]);m.useEffect(()=>{if(typeof window>"u")return;const D=WR(x),H=D?`${window.location.pathname}?${D}`:window.location.pathname;window.history.replaceState(null,"",H)},[x]),m.useEffect(()=>{b!=null&&b.filterOptions&&j({...KR,...b.filterOptions})},[b]);const I=D=>{v(H=>({...H,query:D.search,scope:D.scope,filters:YR(D),page:1}))},A=()=>{I(t9)},C=D=>{v(H=>({...H,page:D}))},M=D=>{v(H=>({...H,pageSize:D,page:1}))},R=()=>{k(D=>D==="grid"?"list":"grid")};return e.jsx(r9,{companies:S.results,loading:N,page:S.page,pageSize:S.pageSize||x.pageSize,totalCount:S.count,totalPages:S.totalPages,onPageChange:C,onPageSizeChange:M,filters:L,filterOptions:w,onFiltersChange:I,onClearFilters:A,viewMode:f,onViewModeChange:R,maxCompare:i,sortOptions:o,followDisabled:l,followLoading:c,onToggleFollow:h,onFollowAction:d,saveDisabled:p,saveLoading:g,onToggleSave:y,onSaveAction:u})},tD=({isClaimed:t,canClaim:a,onClaimClick:s})=>t||!a?null:e.jsx(P,{type:"button",variant:"ghost",className:"text-primary-foreground",onClick:s,children:"Claim this company"});function aD({title:t,value:a,description:s,icon:r,trend:i}){return e.jsxs(U,{children:[e.jsxs(ae,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(se,{className:"text-sm font-medium",children:t}),e.jsx(r,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(_,{children:[e.jsx("div",{className:"text-2xl font-bold",children:a}),s&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:s}),i&&e.jsxs("p",{className:`text-xs mt-1 ${i.isPositive?"text-green-600":"text-red-600"}`,children:[i.isPositive?"+":"-",i.value," from last month"]})]})]})}function sD({stats:t}){return e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:t.map((a,s)=>e.jsx(aD,{...a},s))})}const nD=["Sarah","Michael","Emma","James","Olivia","William","Sophia","Robert","Isabella","David","Mia","John","Charlotte","Daniel","Amelia"],rD=["Johnson","Smith","Williams","Brown","Jones","Garcia","Miller","Davis","Rodriguez","Martinez","Hernandez","Lopez","Wilson","Anderson","Thomas"],iD=["Malta","London, UK","Stockholm, Sweden","Madrid, Spain","Lisbon, Portugal","Remote","Berlin, Germany","Tallinn, Estonia","Athens, Greece"],oD=["Retention Manager","CRM Specialist","Senior Game Designer","Payments Risk Analyst","Compliance Officer","Affiliate Manager","Product Owner","VIP Support Lead","UX Researcher","Data Analyst"],WN=["Senior Backend Engineer","Game Producer","QA Lead","CRM Manager","Compliance Analyst","Fraud Specialist","Payments Manager","BI Analyst","VIP Account Manager"],jM=["Lifecycle marketing","Player engagement","Responsible gaming","SQL","Live casino ops","Fraud detection","A/B testing","Segmentation","KYC/AML","Game math","Figma","Analytics"],ZN=["MGA","UKGC","DGA","B2B","Curaçao"],lD=["LinkedIn","Referral","Job board","Career page","Recruiter outreach"],cD=["new","reviewed","shortlisted","rejected"],dD=[1,2,3,4,5,null],Zt=t=>t[Math.floor(Math.random()*t.length)],wM=t=>{const a=new Date;return a.setDate(a.getDate()-Math.floor(Math.random()*t)),a.toISOString()},hD=(t=32)=>Array.from({length:t}).map((a,s)=>{const r=Zt(nD),i=Zt(rD),o=Zt(dD),l=Zt(cD),c=wM(45),h=wM(14);return{id:`candidate-${s+1}`,firstName:r,lastName:i,title:Zt(oD),location:Zt(iD),appliedDate:c,lastActive:h,source:Zt(lD),yearsExperience:Math.floor(Math.random()*8)+2,status:l,rating:o,skills:Array.from(new Set([Zt(jM),Zt(jM),Zt(jM)])).slice(0,3),licenses:Array.from(new Set([Zt(ZN),Zt(ZN)])).slice(0,2),appliedJobs:Array.from(new Set([Zt(WN),Zt(WN)])).slice(0,2),notes:[{id:`note-${s}-1`,author:"Recruiter",note:"Strong iGaming domain knowledge with proven retention wins.",createdAt:wM(20),isInternal:!0}]}}),MM={new:"New",reviewed:"Reviewed",shortlisted:"Shortlisted",rejected:"Rejected"},JN={new:"outline",reviewed:"secondary",shortlisted:"default",rejected:"destructive"},c9=({candidate:t,canEdit:a=!1,onNameClick:s,onStatusChange:r,onRatingChange:i,onAddNote:o})=>{const[l,c]=m.useState(""),[h,d]=m.useState(!0),p=m.useMemo(()=>`${t.firstName} ${t.lastName}`,[t.firstName,t.lastName]),g=m.useMemo(()=>new Date(t.appliedDate).toLocaleDateString(),[t.appliedDate]),y=m.useMemo(()=>new Date(t.lastActive).toLocaleDateString(),[t.lastActive]),u=()=>{!l.trim()||!o||(o(t.id,l.trim(),h),c(""))};return e.jsxs(U,{className:"border-muted/60",children:[e.jsxs(ae,{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(P,{variant:"link",className:"h-auto p-0 text-lg font-semibold",onClick:()=>s==null?void 0:s(t.id),children:p}),e.jsx(q,{variant:JN[t.status],children:MM[t.status]})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t.title}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-sm text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Te,{className:"h-4 w-4"}),t.location]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(je,{className:"h-4 w-4"}),t.yearsExperience,"+ yrs"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(da,{className:"h-4 w-4"}),"Applied ",g]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:items-end",children:[a?e.jsxs(Je,{value:t.status,onValueChange:x=>r==null?void 0:r(t.id,x),children:[e.jsx(Ue,{className:"w-44",children:e.jsx(Ye,{placeholder:"Update status"})}),e.jsx(_e,{children:Object.entries(MM).map(([x,v])=>e.jsx(xe,{value:x,children:v},x))})]}):e.jsxs(q,{variant:JN[t.status],children:["Status: ",MM[t.status]]}),e.jsxs("div",{className:"flex items-center gap-1",children:[Array.from({length:5}).map((x,v)=>{const f=v+1,k=t.rating!==null&&t.rating>=f;return e.jsx(P,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>a&&(i==null?void 0:i(t.id,f)),disabled:!a,children:e.jsx(Ze,{className:k?"h-4 w-4 text-yellow-500":"h-4 w-4 text-muted-foreground"})},`${t.id}-star-${v}`)}),t.rating===null&&e.jsx("span",{className:"text-xs text-muted-foreground",children:"Unrated"})]})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.licenses.map(x=>e.jsx(q,{variant:"secondary",children:x},x)),t.skills.map(x=>e.jsx(q,{variant:"outline",children:x},x))]})]}),e.jsxs(_,{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap gap-4 text-sm text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(fa,{className:"h-4 w-4"}),"Source: ",t.source]}),e.jsxs("span",{children:["Last active ",y]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-semibold",children:"Applied roles"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:t.appliedJobs.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No roles attached."}):t.appliedJobs.map(x=>e.jsx(q,{variant:"outline",children:x},x))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-semibold",children:"Notes"}),e.jsx("div",{className:"space-y-2",children:t.notes.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No notes yet."}):t.notes.map(x=>e.jsxs("div",{className:"rounded-lg border px-3 py-2 text-sm",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-xs text-muted-foreground",children:[e.jsxs("span",{children:[x.author," • ",new Date(x.createdAt).toLocaleDateString()]}),x.isInternal&&e.jsx(q,{variant:"outline",children:"Internal"})]}),e.jsx("p",{className:"mt-2",children:x.note})]},x.id))})]}),a&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(st,{value:l,onChange:x=>c(x.target.value),placeholder:"Add a note about this candidate...",rows:3}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(Vt,{checked:h,onCheckedChange:x=>d(!!x)}),"Internal note"]}),e.jsx(P,{size:"sm",onClick:u,disabled:!l.trim(),children:"Add note"})]})]})]})]})},mD=[{value:"all",label:"All"},{value:"new",label:"New"},{value:"reviewed",label:"Reviewed"},{value:"shortlisted",label:"Shortlisted"},{value:"rejected",label:"Rejected"}],uD={recent:"Most recent",name:"Name",rating:"Rating"},d9=({company:t,onUpdate:a,isSaving:s=!1,canEdit:r=!1})=>{const[i,o]=m.useState(()=>hD()),[l,c]=m.useState(""),[h,d]=m.useState("all"),[p,g]=m.useState("recent"),[y,u]=m.useState(null),x=m.useMemo(()=>i.reduce((b,T)=>(b[T.status]+=1,b.all+=1,b),{all:0,new:0,reviewed:0,shortlisted:0,rejected:0}),[i]),v=m.useMemo(()=>{const j=l.trim().toLowerCase(),b=N=>j?[`${N.firstName} ${N.lastName}`.toLowerCase(),N.title.toLowerCase(),N.location.toLowerCase(),N.skills.join(" ").toLowerCase()].join(" ").includes(j):!0;return(h==="all"?i:i.filter(N=>N.status===h)).filter(b).sort((N,L)=>{switch(p){case"name":{const I=`${N.lastName} ${N.firstName}`.toLowerCase(),A=`${L.lastName} ${L.firstName}`.toLowerCase();return I.localeCompare(A)}case"rating":{const I=N.rating??0;return(L.rating??0)-I}case"recent":default:return new Date(L.appliedDate).getTime()-new Date(N.appliedDate).getTime()}})},[i,l,p,h]),f=(j,b)=>{o(T=>T.map(S=>S.id===j?{...S,status:b}:S)),a({type:"candidates",payload:{action:"change-status",candidateId:j,status:b}})},k=(j,b)=>{o(T=>T.map(S=>S.id===j?{...S,rating:b}:S)),a({type:"candidates",payload:{action:"rate",candidateId:j,rating:b}})},w=(j,b,T)=>{o(S=>S.map(N=>N.id===j?{...N,notes:[{id:`${j}-${Date.now()}`,author:t.name,note:b,createdAt:new Date().toISOString(),isInternal:T},...N.notes]}:N)),a({type:"candidates",payload:{action:"add-note",candidateId:j,note:b,isInternal:T}})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold",children:"Candidates"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Review applicants and track status updates across your pipeline."}),y&&e.jsxs("p",{className:"text-sm text-muted-foreground mt-2",children:["Selected candidate:"," ",(()=>{const j=i.find(b=>b.id===y);return j?`${j.firstName} ${j.lastName}`:"Unknown"})()]})]}),s&&e.jsx(q,{variant:"secondary",className:"w-fit",children:"Syncing updates..."})]}),e.jsxs(U,{children:[e.jsxs(ae,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(se,{children:"Pipeline overview"}),e.jsx(Pe,{children:"Filter, sort, and review candidate activity."})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:mD.map(j=>e.jsxs(P,{variant:h===j.value?"default":"outline",size:"sm",onClick:()=>d(j.value),children:[j.label,e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:x[j.value]})]},j.value))}),e.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[e.jsx(ee,{placeholder:"Search by name, role, or skill",value:l,onChange:j=>c(j.target.value),className:"md:max-w-sm"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Sort by"}),e.jsxs(Je,{value:p,onValueChange:j=>g(j),children:[e.jsx(Ue,{className:"w-40",children:e.jsx(Ye,{placeholder:"Sort by"})}),e.jsx(_e,{children:Object.entries(uD).map(([j,b])=>e.jsx(xe,{value:j,children:b},j))})]})]})]})]}),e.jsx(_,{className:"space-y-6",children:v.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No candidates match the current filters."}):e.jsx("div",{className:"space-y-6",children:v.map(j=>e.jsx(c9,{candidate:j,canEdit:r,onNameClick:u,onStatusChange:f,onRatingChange:k,onAddNote:w},j.id))})})]})]})},Ts=ea.Root,pD=ea.Portal,h9=ie.forwardRef(({className:t,...a},s)=>e.jsx(ea.Overlay,{className:ne("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...a,ref:s}));h9.displayName=ea.Overlay.displayName;const Qa=ie.forwardRef(({className:t,...a},s)=>e.jsxs(pD,{children:[e.jsx(h9,{}),e.jsx(ea.Content,{ref:s,className:ne("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...a})]}));Qa.displayName=ea.Content.displayName;const es=({className:t,...a})=>e.jsx("div",{className:ne("flex flex-col space-y-2 text-center sm:text-left",t),...a});es.displayName="AlertDialogHeader";const ts=({className:t,...a})=>e.jsx("div",{className:ne("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a});ts.displayName="AlertDialogFooter";const as=ie.forwardRef(({className:t,...a},s)=>e.jsx(ea.Title,{ref:s,className:ne("text-lg font-semibold",t),...a}));as.displayName=ea.Title.displayName;const ss=ie.forwardRef(({className:t,...a},s)=>e.jsx(ea.Description,{ref:s,className:ne("text-sm text-muted-foreground",t),...a}));ss.displayName=ea.Description.displayName;const Ds=ie.forwardRef(({className:t,...a},s)=>e.jsx(ea.Action,{ref:s,className:ne(_M(),t),...a}));Ds.displayName=ea.Action.displayName;const ns=ie.forwardRef(({className:t,...a},s)=>e.jsx(ea.Cancel,{ref:s,className:ne(_M({variant:"outline"}),"mt-2 sm:mt-0",t),...a}));ns.displayName=ea.Cancel.displayName;const xD=({open:t,onClose:a,onSave:s,existingEvent:r})=>{const[i,o]=m.useState({title:"",date:"",location:"",description:"",url:""});m.useEffect(()=>{o(r?{id:r.id,title:r.title,date:r.date,location:r.location,description:r.description??"",url:r.url??""}:{title:"",date:"",location:"",description:"",url:""})},[r,t]);const l=(h,d)=>o(p=>({...p,[h]:d})),c=()=>{s({...i,id:(r==null?void 0:r.id)??i.id??`event-${Date.now()}`}),o({title:"",date:"",location:"",description:"",url:""}),a()};return e.jsx(tt,{open:t,onOpenChange:a,children:e.jsxs(Xe,{children:[e.jsx(Ie,{children:r?"Edit Event":"Add Event"}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{children:[e.jsx(V,{children:"Title"}),e.jsx(ee,{value:i.title,onChange:h=>l("title",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Date"}),e.jsx(ee,{type:"date",value:i.date,onChange:h=>l("date",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Location"}),e.jsx(ee,{value:i.location,onChange:h=>l("location",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Description"}),e.jsx(st,{rows:4,value:i.description,onChange:h=>l("description",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Event URL"}),e.jsx(ee,{type:"url",value:i.url,onChange:h=>l("url",h.target.value)})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(P,{variant:"outline",onClick:a,children:"Cancel"}),e.jsx(P,{onClick:c,children:"Save"})]})]})]})})},yD=(t,a)=>"eventName"in t?{id:`event-${a}`,title:t.eventName,date:t.date,location:t.location,description:"",url:""}:{id:`event-${a}`,title:t.name,date:t.startDate,location:t.location,description:"",url:""},m9=({company:t,onUpdate:a,isSaving:s=!1,canEdit:r=!1})=>{const[i,o]=m.useState({events:t.events.upcomingEvents.map(yD)}),[l,c]=m.useState(!1),[h,d]=m.useState(null),[p,g]=m.useState(null),y=()=>{a({type:"events",payload:{events:i.events}})},u=f=>{d(f),c(!0)},x=()=>{p&&(o(f=>({events:f.events.filter(k=>k.id!==p)})),g(null))},v=f=>{o(k=>{const w=k.events.findIndex(j=>j.id===f.id);if(w>=0){const j=[...k.events];return j[w]={...j[w],...f},{events:j}}return{events:[...k.events,f]}})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold",children:"Events"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Keep your event calendar current."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[r&&e.jsxs(P,{variant:"outline",onClick:()=>{d(null),c(!0)},children:[e.jsx(kt,{className:"mr-2 h-4 w-4"}),"Add event"]}),r&&e.jsx(P,{onClick:y,disabled:s,children:s?e.jsxs(e.Fragment,{children:[e.jsx(Ge,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save Changes"})]})]}),e.jsxs(U,{children:[e.jsxs(ae,{children:[e.jsx(se,{children:"Upcoming events"}),e.jsx(Pe,{children:"Highlight events, meetups, and conferences."})]}),e.jsx(_,{className:"space-y-4",children:i.events.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No events scheduled yet."}):e.jsx("div",{className:"space-y-4",children:i.events.map(f=>e.jsx("div",{className:"p-4 border rounded-lg space-y-2 relative group",children:e.jsxs("div",{className:"flex justify-between items-start gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h4",{className:"font-semibold",children:f.title}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[f.date||"Date TBD"," • ",f.location||"Location TBD"]}),f.description&&e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:f.description})]}),r&&e.jsxs("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex gap-2",children:[e.jsx(P,{variant:"outline",size:"sm",onClick:()=>u(f),children:"Edit"}),e.jsx(P,{variant:"destructive",size:"sm",onClick:()=>g(f.id??null),children:"Delete"})]})]})},f.id))})})]}),e.jsx(xD,{open:l,onClose:()=>c(!1),onSave:v,existingEvent:h}),e.jsx(Ts,{open:!!p,onOpenChange:()=>g(null),children:e.jsxs(Qa,{children:[e.jsxs(es,{children:[e.jsx(as,{children:"Delete this event?"}),e.jsx(ss,{children:"This action cannot be undone and will remove the event from the calendar."})]}),e.jsxs(ts,{children:[e.jsx(ns,{children:"Cancel"}),e.jsx(Ds,{onClick:x,children:"Delete"})]})]})})]})},gD=({open:t,onClose:a,onSave:s,existingJob:r})=>{const[i,o]=m.useState({title:"",location:"",employmentType:"",description:"",requirements:"",status:"Draft"});m.useEffect(()=>{o(r?{id:r.id,title:r.title,location:r.location,employmentType:r.employmentType,description:r.description??"",requirements:r.requirements??"",status:r.status??"Draft"}:{title:"",location:"",employmentType:"",description:"",requirements:"",status:"Draft"})},[r,t]);const l=(h,d)=>o(p=>({...p,[h]:d})),c=()=>{s({...i,id:(r==null?void 0:r.id)??i.id??`job-${Date.now()}`,status:i.status??"Draft"}),o({title:"",location:"",employmentType:"",description:"",requirements:"",status:"Draft"}),a()};return e.jsx(tt,{open:t,onOpenChange:a,children:e.jsxs(Xe,{children:[e.jsx(Ie,{children:r?"Edit Job":"Add Job"}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{children:[e.jsx(V,{children:"Title"}),e.jsx(ee,{value:i.title,onChange:h=>l("title",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Location"}),e.jsx(ee,{value:i.location,onChange:h=>l("location",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Employment Type"}),e.jsx(ee,{value:i.employmentType,onChange:h=>l("employmentType",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Description"}),e.jsx(st,{rows:4,value:i.description,onChange:h=>l("description",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Requirements"}),e.jsx(st,{rows:4,value:i.requirements,onChange:h=>l("requirements",h.target.value)})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(P,{variant:"outline",onClick:a,children:"Cancel"}),e.jsx(P,{onClick:c,children:"Save"})]})]})]})})},u9=({company:t,onUpdate:a,isSaving:s=!1,canEdit:r=!1})=>{const i=Array.isArray(t.jobs.openRoles)?t.jobs.openRoles.map((w,j)=>({id:`job-${j}`,title:w,location:"",employmentType:"",description:"",requirements:"",status:"Published"})):[],[o,l]=m.useState({jobs:i}),[c,h]=m.useState(!1),[d,p]=m.useState(null),[g,y]=m.useState(null),u=()=>{a({type:"jobs",payload:{jobs:o.jobs}})},x=w=>{p(w),h(!0)},v=()=>{g&&(l(w=>({jobs:w.jobs.filter(j=>j.id!==g)})),y(null))},f=w=>{l(j=>{const b=j.jobs.findIndex(T=>T.id===w.id);if(b>=0){const T=[...j.jobs];return T[b]={...T[b],...w},{jobs:T}}return{jobs:[...j.jobs,w]}})},k=w=>{w&&l(j=>({jobs:j.jobs.map(b=>b.id===w?{...b,status:b.status==="Published"?"Draft":"Published"}:b)}))};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold",children:"Jobs"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Publish and manage open roles."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[r&&e.jsxs(P,{variant:"outline",onClick:()=>{p(null),h(!0)},children:[e.jsx(kt,{className:"mr-2 h-4 w-4"}),"Add job"]}),r&&e.jsx(P,{onClick:u,disabled:s,children:s?e.jsxs(e.Fragment,{children:[e.jsx(Ge,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save Changes"})]})]}),e.jsxs(U,{children:[e.jsxs(ae,{children:[e.jsx(se,{children:"Open roles"}),e.jsx(Pe,{children:"Manage publishing status and job details."})]}),e.jsx(_,{className:"space-y-4",children:o.jobs.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No roles added yet."}):e.jsx("div",{className:"space-y-4",children:o.jobs.map(w=>e.jsx("div",{className:"p-4 border rounded-lg space-y-2 relative group",children:e.jsxs("div",{className:"flex justify-between items-start gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h4",{className:"font-semibold",children:w.title}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[w.location||"Location not specified"," • ",w.employmentType||"Type TBD"]}),e.jsx(q,{variant:w.status==="Published"?"default":"secondary",children:w.status??"Draft"})]}),r&&e.jsxs("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex flex-wrap gap-2",children:[e.jsx(P,{variant:"outline",size:"sm",onClick:()=>k(w.id),children:w.status==="Published"?"Unpublish":"Publish"}),e.jsx(P,{variant:"outline",size:"sm",onClick:()=>x(w),children:"Edit"}),e.jsx(P,{variant:"destructive",size:"sm",onClick:()=>y(w.id??null),children:"Delete"})]})]})},w.id))})})]}),e.jsx(gD,{open:c,onClose:()=>h(!1),onSave:f,existingJob:d}),e.jsx(Ts,{open:!!g,onOpenChange:()=>y(null),children:e.jsxs(Qa,{children:[e.jsxs(es,{children:[e.jsx(as,{children:"Delete this job?"}),e.jsx(ss,{children:"This action cannot be undone and will remove the job posting."})]}),e.jsxs(ts,{children:[e.jsx(ns,{children:"Cancel"}),e.jsx(Ds,{onClick:v,children:"Delete"})]})]})})]})},fD=(t,a)=>typeof t=="string"?{id:`news-${a}`,title:t,date:"",excerpt:"",status:"Published",content:"",url:""}:{id:`news-${a}`,title:t.title,date:"",excerpt:t.source,status:"Published",content:"",url:t.url},p9=({company:t,onUpdate:a,isSaving:s=!1,canEdit:r=!1})=>{const[i,o]=m.useState({news:t.newsAndMedia.pressMentions.map(fD)}),[l,c]=m.useState(!1),[h,d]=m.useState(null),[p,g]=m.useState(null),[y,u]=m.useState({title:"",date:"",excerpt:"",status:"Draft",content:"",url:""});m.useEffect(()=>{u(h?{id:h.id,title:h.title,date:h.date,excerpt:h.excerpt,status:h.status,content:h.content,url:h.url??""}:{title:"",date:"",excerpt:"",status:"Draft",content:"",url:""})},[h,l]);const x=()=>{a({type:"news",payload:{news:i.news}})},v=j=>{d(j),c(!0)},f=()=>{p&&(o(j=>({news:j.news.filter(b=>b.id!==p)})),g(null))},k=()=>{const j={...y,id:(h==null?void 0:h.id)??y.id??`news-${Date.now()}`};o(b=>{const T=b.news.findIndex(S=>S.id===j.id);if(T>=0){const S=[...b.news];return S[T]=j,{news:S}}return{news:[...b.news,j]}}),c(!1),d(null)},w=j=>{j&&o(b=>({news:b.news.map(T=>T.id===j?{...T,status:T.status==="Published"?"Draft":"Published"}:T)}))};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold",children:"News & Media"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Publish announcements and press coverage."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[r&&e.jsxs(P,{variant:"outline",onClick:()=>{d(null),c(!0)},children:[e.jsx(kt,{className:"mr-2 h-4 w-4"}),"Add article"]}),r&&e.jsx(P,{onClick:x,disabled:s,children:s?e.jsxs(e.Fragment,{children:[e.jsx(Ge,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save Changes"})]})]}),e.jsxs(U,{children:[e.jsxs(ae,{children:[e.jsx(se,{children:"Latest updates"}),e.jsx(Pe,{children:"Manage your press mentions and announcements."})]}),e.jsx(_,{className:"space-y-4",children:i.news.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No news items yet."}):e.jsx("div",{className:"space-y-4",children:i.news.map(j=>e.jsx("div",{className:"p-4 border rounded-lg space-y-2 relative group",children:e.jsxs("div",{className:"flex justify-between items-start gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h4",{className:"font-semibold",children:j.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:j.date||"Date TBD"}),j.excerpt&&e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:j.excerpt}),e.jsx(q,{variant:j.status==="Published"?"default":"secondary",children:j.status})]}),r&&e.jsxs("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex flex-wrap gap-2",children:[e.jsx(P,{variant:"outline",size:"sm",onClick:()=>w(j.id),children:j.status==="Published"?"Unpublish":"Publish"}),e.jsx(P,{variant:"outline",size:"sm",onClick:()=>v(j),children:"Edit"}),e.jsx(P,{variant:"destructive",size:"sm",onClick:()=>g(j.id??null),children:"Delete"})]})]})},j.id))})})]}),e.jsx(tt,{open:l,onOpenChange:c,children:e.jsxs(Xe,{children:[e.jsx(Ie,{children:h?"Edit News":"Add News"}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{children:[e.jsx(V,{children:"Title"}),e.jsx(ee,{value:y.title,onChange:j=>u(b=>({...b,title:j.target.value}))})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Date"}),e.jsx(ee,{type:"date",value:y.date,onChange:j=>u(b=>({...b,date:j.target.value}))})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Excerpt"}),e.jsx(st,{rows:3,value:y.excerpt,onChange:j=>u(b=>({...b,excerpt:j.target.value}))})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Content"}),e.jsx(st,{rows:5,value:y.content,onChange:j=>u(b=>({...b,content:j.target.value}))})]}),e.jsxs("div",{children:[e.jsx(V,{children:"URL"}),e.jsx(ee,{type:"url",value:y.url,onChange:j=>u(b=>({...b,url:j.target.value}))})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(P,{variant:"outline",onClick:()=>c(!1),children:"Cancel"}),e.jsx(P,{onClick:k,children:"Save"})]})]})]})}),e.jsx(Ts,{open:!!p,onOpenChange:()=>g(null),children:e.jsxs(Qa,{children:[e.jsxs(es,{children:[e.jsx(as,{children:"Delete this news item?"}),e.jsx(ss,{children:"This action cannot be undone and will remove the news entry."})]}),e.jsxs(ts,{children:[e.jsx(ns,{children:"Cancel"}),e.jsx(Ds,{onClick:f,children:"Delete"})]})]})})]})},vD=["Operator","Platform Provider","Game Provider","Affiliate","Payments","Agency","Other"],kD=["1-10","11-50","51-100","101-200","201-500","501-1000","1000+","5000+"],bD=["Casino","Sportsbook","Poker","Lottery","Bingo","Esports","Fantasy Sports","Live Casino"],x9=["Malta","Gibraltar","UK","Sweden","Cyprus","Isle of Man","Curacao","Poland","Spain","Germany","Netherlands","Italy","Portugal","Estonia","Latvia","Lithuania","Bulgaria","Romania","Ukraine","Serbia","Croatia","Denmark","Finland","Norway","Ireland","Switzerland","Austria","Czech Republic","Slovakia","Hungary","Greece","Belgium","France","Luxembourg","Slovenia","Bosnia and Herzegovina","North Macedonia","Albania","Montenegro","Kosovo","Moldova","Belarus","Georgia","Armenia","Azerbaijan","Kazakhstan","USA","Canada","Brazil","Mexico","Colombia","Argentina","Chile","Peru","Ecuador","Uruguay","Paraguay","Bolivia","Venezuela","Panama","Costa Rica","Guatemala","Honduras","El Salvador","Nicaragua","Dominican Republic","Puerto Rico","Jamaica","Trinidad and Tobago","Philippines","Singapore","Hong Kong","Macau","Australia","New Zealand","India","Japan","South Korea","Taiwan","Thailand","Vietnam","Indonesia","Malaysia","Cambodia","Myanmar","Sri Lanka","Bangladesh","Nepal","United Arab Emirates","Israel","South Africa","Kenya","Nigeria","Ghana","Tanzania","Uganda","Zambia","Zimbabwe","Mozambique","Morocco","Egypt","Tunisia","Senegal","Ivory Coast","Other"],jD=["Valletta","St. Julian's","Sliema","Birkirkara","Msida","Gzira","London","Manchester","Leeds","Birmingham","Edinburgh","Glasgow","Bristol","Liverpool","Sheffield","Newcastle","Nottingham","Cardiff","Belfast","Brighton","Reading","Gibraltar","St. Helier","St. Peter Port","Limassol","Nicosia","Larnaca","Paphos","Stockholm","Gothenburg","Malmö","Copenhagen","Aarhus","Helsinki","Tampere","Turku","Oslo","Bergen","Trondheim","Reykjavik","Tallinn","Tartu","Riga","Vilnius","Kaunas","Sofia","Plovdiv","Bucharest","Cluj-Napoca","Timișoara","Belgrade","Novi Sad","Warsaw","Krakow","Wrocław","Gdańsk","Poznań","Kyiv","Lviv","Kharkiv","Odessa","Prague","Brno","Bratislava","Košice","Budapest","Debrecen","Bucharest","Zagreb","Split","Sarajevo","Skopje","Tirana","Podgorica","Chisinau","Tbilisi","Yerevan","Baku","Almaty","Astana","Madrid","Barcelona","Valencia","Seville","Bilbao","Berlin","Hamburg","Munich","Frankfurt","Cologne","Düsseldorf","Stuttgart","Leipzig","Amsterdam","Rotterdam","The Hague","Eindhoven","Utrecht","Isle of Man","Douglas","Dublin","Cork","Galway","Zurich","Geneva","Bern","Basel","Vienna","Graz","Salzburg","Lisbon","Porto","Rome","Milan","Turin","Naples","Florence","Bologna","Paris","Lyon","Marseille","Brussels","Antwerp","Ghent","Luxembourg City","Athens","Thessaloniki","Las Vegas","New York","Miami","Los Angeles","Chicago","Atlantic City","Philadelphia","Houston","Phoenix","San Francisco","Seattle","Boston","Washington D.C.","Denver","Nashville","Toronto","Vancouver","Montreal","Calgary","Ottawa","Bogota","Medellin","Cali","Sao Paulo","Rio de Janeiro","Brasilia","Belo Horizonte","Buenos Aires","Cordoba","Rosario","Santiago","Lima","Mexico City","Guadalajara","Monterrey","Panama City","San José","Montevideo","Manila","Cebu","Singapore","Hong Kong","Macau","Sydney","Melbourne","Brisbane","Perth","Auckland","Wellington","Tokyo","Osaka","Seoul","Busan","Taipei","Bangkok","Chiang Mai","Ho Chi Minh City","Hanoi","Kuala Lumpur","Jakarta","Bali","Phnom Penh","Mumbai","Delhi","Bengaluru","Hyderabad","Chennai","Colombo","Dhaka","Dubai","Abu Dhabi","Tel Aviv","Jerusalem","Haifa","Cape Town","Johannesburg","Durban","Pretoria","Nairobi","Lagos","Accra","Dar es Salaam","Kampala","Lusaka","Harare","Casablanca","Cairo","Tunis","Dakar","Abidjan"],zl=1960,y9=({company:t,onUpdate:a,isSaving:s=!1,canEdit:r=!1})=>{const[i,o]=m.useState({companyName:t.name,foundedYear:t.overview.foundedYear,website:t.overview.website,employeeRange:t.overview.employeeRange,shortDescription:t.overview.shortDescription,longDescription:t.overview.longDescription??"",headquartersCity:t.overview.headquarters.city,headquartersCountry:t.overview.headquarters.country}),[l,c]=m.useState("idle"),[h,d]=m.useState(""),p=m.useMemo(()=>{const x=new Date().getFullYear();return Array.from({length:x-zl+1},(v,f)=>x-f)},[]),g=(x,v)=>{o(f=>({...f,[x]:v}))},y=async x=>{if(!x.trim()){c("idle"),d("");return}let v;try{v=new URL(x)}catch{c("invalid"),d("Please enter a full URL, e.g. https://example.com.");return}c("checking"),d("Checking website availability...");try{const f=`https://r.jina.ai/http://${v.host}${v.pathname}${v.search}`,k=await fetch(f,{method:"GET"});if(k.ok){c("valid"),d("Website is reachable.");return}c("invalid"),d(`Website check failed with status ${k.status}.`),alert(`Invalid website: ${x}. Please verify the URL.`)}catch{c("invalid"),d("Unable to verify website right now."),alert(`Invalid website: ${x}. Please verify the URL.`)}},u=()=>{if(i.foundedYear<zl||i.foundedYear>new Date().getFullYear()){alert(`Founded year must be between ${zl} and ${new Date().getFullYear()}.`);return}a({type:"overview",payload:i})};return e.jsxs("div",{className:"space-y-6",children:[e.jsx("datalist",{id:"company-overview-country-suggestions",children:x9.map(x=>e.jsx("option",{value:x},x))}),e.jsx("datalist",{id:"company-overview-city-suggestions",children:jD.map(x=>e.jsx("option",{value:x},x))}),e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold",children:"Company Overview"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Manage your company information"})]}),r&&e.jsx(P,{onClick:u,disabled:s,children:s?e.jsxs(e.Fragment,{children:[e.jsx(Ge,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save Changes"})]}),e.jsxs(U,{children:[e.jsxs(ae,{children:[e.jsx(se,{children:"Company details"}),e.jsx(Pe,{children:"Keep your profile accurate and up to date."})]}),e.jsxs(_,{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{htmlFor:"companyName",children:"Company Name"}),r?e.jsx(ee,{id:"companyName",value:i.companyName,onChange:x=>g("companyName",x.target.value)}):e.jsx("p",{className:"text-sm text-muted-foreground",children:i.companyName})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{htmlFor:"foundedYear",children:"Founded Year"}),r?e.jsx(ee,{id:"foundedYear",type:"number",min:zl,max:new Date().getFullYear(),list:"company-overview-founded-year-options",value:i.foundedYear,onChange:x=>g("foundedYear",Number(x.target.value))}):e.jsx("p",{className:"text-sm text-muted-foreground",children:i.foundedYear}),e.jsx("datalist",{id:"company-overview-founded-year-options",children:p.map(x=>e.jsx("option",{value:x},x))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{htmlFor:"website",children:"Website"}),r?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative",children:[e.jsx(ee,{id:"website",type:"url",value:i.website,onChange:x=>g("website",x.target.value),onBlur:x=>{y(x.target.value)},className:"pr-9"}),e.jsxs("div",{className:"pointer-events-none absolute inset-y-0 right-3 flex items-center",children:[l==="checking"&&e.jsx(Ge,{className:"h-4 w-4 animate-spin text-muted-foreground"}),l==="valid"&&e.jsx(Ee,{className:"h-4 w-4 text-green-600"}),l==="invalid"&&e.jsx(oa,{className:"h-4 w-4 text-red-600"})]})]}),h&&e.jsx("p",{className:`text-xs ${l==="invalid"?"text-red-600":"text-muted-foreground"}`,children:h})]}):e.jsx("p",{className:"text-sm text-muted-foreground",children:i.website})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{htmlFor:"employeeRange",children:"Employee Range"}),r?e.jsx(ee,{id:"employeeRange",list:"company-overview-employee-range-options",value:i.employeeRange,onChange:x=>g("employeeRange",x.target.value)}):e.jsx("p",{className:"text-sm text-muted-foreground",children:i.employeeRange}),e.jsx("datalist",{id:"company-overview-employee-range-options",children:kD.map(x=>e.jsx("option",{value:x},x))})]}),e.jsxs("div",{className:"space-y-2 md:col-span-2",children:[e.jsx(V,{htmlFor:"shortDescription",children:"Short Description"}),r?e.jsx(st,{id:"shortDescription",rows:3,value:i.shortDescription,onChange:x=>g("shortDescription",x.target.value)}):e.jsx("p",{className:"text-sm text-muted-foreground",children:i.shortDescription})]}),e.jsxs("div",{className:"space-y-2 md:col-span-2",children:[e.jsx(V,{htmlFor:"longDescription",children:"Long Description"}),r?e.jsx(st,{id:"longDescription",rows:6,value:i.longDescription,onChange:x=>g("longDescription",x.target.value)}):e.jsx("p",{className:"text-sm text-muted-foreground",children:i.longDescription})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{htmlFor:"headquartersCity",children:"Headquarters City"}),r?e.jsx(ee,{id:"headquartersCity",list:"company-overview-city-suggestions",value:i.headquartersCity,onChange:x=>g("headquartersCity",x.target.value)}):e.jsx("p",{className:"text-sm text-muted-foreground",children:i.headquartersCity})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{htmlFor:"headquartersCountry",children:"Headquarters Country"}),r?e.jsx(ee,{id:"headquartersCountry",list:"company-overview-country-suggestions",value:i.headquartersCountry,onChange:x=>g("headquartersCountry",x.target.value)}):e.jsx("p",{className:"text-sm text-muted-foreground",children:i.headquartersCountry})]}),l==="invalid"&&r&&e.jsx("div",{className:"md:col-span-2 rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700",children:e.jsxs("p",{className:"flex items-center gap-2 font-medium",children:[e.jsx(Gt,{className:"h-4 w-4"}),"The entered website appears invalid. Please verify before saving."]})})]})]})]})},wD=({open:t,onClose:a,onSave:s,existingPerson:r})=>{const[i,o]=m.useState({name:"",role:"",linkedIn:"",email:""});m.useEffect(()=>{o(r?{id:r.id,name:r.name,role:r.role,linkedIn:r.linkedIn??"",email:r.email??""}:{name:"",role:"",linkedIn:"",email:""})},[r,t]);const l=(h,d)=>o(p=>({...p,[h]:d})),c=()=>{s({...i,id:(r==null?void 0:r.id)??i.id??`person-${Date.now()}`}),o({name:"",role:"",linkedIn:"",email:""}),a()};return e.jsx(tt,{open:t,onOpenChange:a,children:e.jsxs(Xe,{children:[e.jsx(Ie,{children:r?"Edit Team Member":"Add Team Member"}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{children:[e.jsx(V,{children:"Name"}),e.jsx(ee,{value:i.name,onChange:h=>l("name",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Role"}),e.jsx(ee,{value:i.role,onChange:h=>l("role",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"LinkedIn"}),e.jsx(ee,{value:i.linkedIn,onChange:h=>l("linkedIn",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Email"}),e.jsx(ee,{type:"email",value:i.email,onChange:h=>l("email",h.target.value)})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(P,{variant:"outline",onClick:a,children:"Cancel"}),e.jsx(P,{onClick:c,children:"Save"})]})]})]})})},g9=({company:t,onUpdate:a,isSaving:s=!1,canEdit:r=!1})=>{const[i,o]=m.useState({members:t.people.members.map((f,k)=>({id:`person-${k}`,name:f.name,role:f.title,linkedIn:f.profileUrl??"",email:""}))}),[l,c]=m.useState(!1),[h,d]=m.useState(null),[p,g]=m.useState(null),y=()=>{const f=i.members.map(k=>({name:k.name,title:k.role,profileUrl:k.linkedIn}));a({type:"people",payload:{members:f}})},u=f=>{d(f),c(!0)},x=()=>{p&&(o(f=>({members:f.members.filter(k=>k.id!==p)})),g(null))},v=f=>{o(k=>{const w=k.members.findIndex(j=>j.id===f.id);if(w>=0){const j=[...k.members];return j[w]={...j[w],...f},{members:j}}return{members:[...k.members,f]}})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold",children:"People"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Manage your leadership and team members."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[r&&e.jsxs(P,{variant:"outline",onClick:()=>{d(null),c(!0)},children:[e.jsx(kt,{className:"mr-2 h-4 w-4"}),"Add member"]}),r&&e.jsx(P,{onClick:y,disabled:s,children:s?e.jsxs(e.Fragment,{children:[e.jsx(Ge,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save Changes"})]})]}),e.jsxs(U,{children:[e.jsxs(ae,{children:[e.jsx(se,{children:"Team directory"}),e.jsx(Pe,{children:"Highlight decision makers and team contacts."})]}),e.jsx(_,{className:"space-y-4",children:i.members.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No team members added yet."}):e.jsx("div",{className:"space-y-4",children:i.members.map(f=>e.jsx("div",{className:"p-4 border rounded-lg space-y-2 relative group",children:e.jsxs("div",{className:"flex justify-between items-start gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h4",{className:"font-semibold",children:f.name}),e.jsx("p",{className:"text-sm text-muted-foreground",children:f.role}),f.linkedIn&&e.jsx("a",{href:f.linkedIn,target:"_blank",rel:"noreferrer",className:"text-sm text-primary underline",children:"LinkedIn profile"})]}),r&&e.jsxs("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex gap-2",children:[e.jsx(P,{variant:"outline",size:"sm",onClick:()=>u(f),children:"Edit"}),e.jsx(P,{variant:"destructive",size:"sm",onClick:()=>g(f.id??null),children:"Delete"})]})]})},f.id))})})]}),e.jsx(wD,{open:l,onClose:()=>c(!1),onSave:v,existingPerson:h}),e.jsx(Ts,{open:!!p,onOpenChange:()=>g(null),children:e.jsxs(Qa,{children:[e.jsxs(es,{children:[e.jsx(as,{children:"Delete this team member?"}),e.jsx(ss,{children:"This action cannot be undone and will remove the member from your list."})]}),e.jsxs(ts,{children:[e.jsx(ns,{children:"Cancel"}),e.jsx(Ds,{onClick:x,children:"Delete"})]})]})})]})},MD=({open:t,onClose:a,onSave:s,existingProduct:r})=>{const[i,o]=m.useState({name:"",category:"",description:"",url:""});m.useEffect(()=>{o(r?{id:r.id,name:r.name,category:r.category,description:r.description,url:r.url??""}:{name:"",category:"",description:"",url:""})},[r,t]);const l=(h,d)=>o(p=>({...p,[h]:d})),c=()=>{s({...i,id:(r==null?void 0:r.id)??i.id??`product-${Date.now()}`}),o({name:"",category:"",description:"",url:""}),a()};return e.jsx(tt,{open:t,onOpenChange:a,children:e.jsxs(Xe,{children:[e.jsx(Ie,{children:r?"Edit Product":"Add Product"}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{children:[e.jsx(V,{children:"Name"}),e.jsx(ee,{value:i.name,onChange:h=>l("name",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Category"}),e.jsx(ee,{value:i.category,onChange:h=>l("category",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"Description"}),e.jsx(st,{rows:4,value:i.description,onChange:h=>l("description",h.target.value)})]}),e.jsxs("div",{children:[e.jsx(V,{children:"URL"}),e.jsx(ee,{type:"url",value:i.url,onChange:h=>l("url",h.target.value)})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(P,{variant:"outline",onClick:a,children:"Cancel"}),e.jsx(P,{onClick:c,children:"Save"})]})]})]})})},f9=({company:t,onUpdate:a,isSaving:s=!1,canEdit:r=!1})=>{const[i,o]=m.useState({products:t.productsAndServices.map((f,k)=>({id:`product-${k}`,...f}))}),[l,c]=m.useState(!1),[h,d]=m.useState(null),[p,g]=m.useState(null),y=()=>{a({type:"products",payload:{products:i.products}})},u=f=>{d(f),c(!0)},x=()=>{p&&(o(f=>({products:f.products.filter(k=>k.id!==p)})),g(null))},v=f=>{o(k=>{const w=k.products.findIndex(j=>j.id===f.id);if(w>=0){const j=[...k.products];return j[w]={...j[w],...f},{products:j}}return{products:[...k.products,f]}})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold",children:"Products & Services"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Showcase the offerings that define your company."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[r&&e.jsxs(P,{variant:"outline",onClick:()=>{d(null),c(!0)},children:[e.jsx(kt,{className:"mr-2 h-4 w-4"}),"Add product"]}),r&&e.jsx(P,{onClick:y,disabled:s,children:s?e.jsxs(e.Fragment,{children:[e.jsx(Ge,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save Changes"})]})]}),e.jsxs(U,{children:[e.jsxs(ae,{children:[e.jsx(se,{children:"Product catalog"}),e.jsx(Pe,{children:"Update categories, descriptions, and links."})]}),e.jsx(_,{className:"space-y-4",children:i.products.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No products added yet."}):e.jsx("div",{className:"space-y-4",children:i.products.map(f=>e.jsx("div",{className:"p-4 border rounded-lg space-y-2 relative group",children:e.jsxs("div",{className:"flex justify-between items-start gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-semibold",children:f.name}),f.category&&e.jsx(q,{variant:"secondary",children:f.category}),f.description&&e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:f.description})]}),r&&e.jsxs("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex gap-2",children:[e.jsx(P,{variant:"outline",size:"sm",onClick:()=>u(f),children:"Edit"}),e.jsx(P,{variant:"destructive",size:"sm",onClick:()=>g(f.id??null),children:"Delete"})]})]})},f.id))})})]}),e.jsx(MD,{open:l,onClose:()=>c(!1),onSave:v,existingProduct:h}),e.jsx(Ts,{open:!!p,onOpenChange:()=>g(null),children:e.jsxs(Qa,{children:[e.jsxs(es,{children:[e.jsx(as,{children:"Delete this product?"}),e.jsx(ss,{children:"This action cannot be undone and will remove the product from your catalog."})]}),e.jsxs(ts,{children:[e.jsx(ns,{children:"Cancel"}),e.jsx(Ds,{onClick:x,children:"Delete"})]})]})})]})},v9=({company:t,onUpdate:a,isSaving:s=!1,canEdit:r=!1})=>{const i={visibility:t.claimedStatus==="claimed",notifications:{jobAlerts:!0,newsAlerts:!0,eventAlerts:!1},integrations:{slackEnabled:!1,webhookUrl:""},team:t.people.members.map((x,v)=>({id:`team-${v}`,name:x.name,role:x.title}))},o=t.settings,[l,c]=m.useState({...i,...o,notifications:{...i.notifications,...o==null?void 0:o.notifications},integrations:{...i.integrations,...o==null?void 0:o.integrations},team:(o==null?void 0:o.team)??i.team}),h=()=>{a({type:"settings",payload:l})},d=x=>{c(v=>({...v,notifications:{...v.notifications,[x]:!v.notifications[x]}}))},p=()=>{c(x=>({...x,integrations:{...x.integrations,slackEnabled:!x.integrations.slackEnabled}}))},g=(x,v)=>{c(f=>({...f,team:f.team.map(k=>k.id===x?{...k,role:v}:k)}))},y=()=>{c(x=>({...x,team:[...x.team,{id:`team-${Date.now()}`,name:"New member",role:"Contributor"}]}))},u=x=>{c(v=>({...v,team:v.team.filter(f=>f.id!==x)}))};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold",children:"Settings"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Control visibility, notifications, and team roles."})]}),r&&e.jsx(P,{onClick:h,disabled:s,children:s?e.jsxs(e.Fragment,{children:[e.jsx(Ge,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save Changes"})]}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.jsxs(U,{children:[e.jsxs(ae,{children:[e.jsx(se,{children:"Visibility & notifications"}),e.jsx(Pe,{children:"Adjust how your company appears and who gets notified."})]}),e.jsxs(_,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(V,{children:"Public profile"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Show your company in the directory."})]}),e.jsx(yt,{checked:l.visibility,onCheckedChange:()=>r&&c(x=>({...x,visibility:!x.visibility})),disabled:!r})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(V,{children:"Job alerts"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Notify recruiters about new applicants."})]}),e.jsx(yt,{checked:l.notifications.jobAlerts,onCheckedChange:()=>r&&d("jobAlerts"),disabled:!r})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(V,{children:"News alerts"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Send weekly press mention updates."})]}),e.jsx(yt,{checked:l.notifications.newsAlerts,onCheckedChange:()=>r&&d("newsAlerts"),disabled:!r})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(V,{children:"Event alerts"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Notify teams about upcoming events."})]}),e.jsx(yt,{checked:l.notifications.eventAlerts,onCheckedChange:()=>r&&d("eventAlerts"),disabled:!r})]})]})]}),e.jsxs(U,{children:[e.jsxs(ae,{children:[e.jsx(se,{children:"Integrations"}),e.jsx(Pe,{children:"Connect your workspace tools."})]}),e.jsxs(_,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(V,{children:"Slack notifications"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Send updates to a Slack channel."})]}),e.jsx(yt,{checked:l.integrations.slackEnabled,onCheckedChange:()=>r&&p(),disabled:!r})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{htmlFor:"webhookUrl",children:"Webhook URL"}),r?e.jsx(ee,{id:"webhookUrl",value:l.integrations.webhookUrl,onChange:x=>c(v=>({...v,integrations:{...v.integrations,webhookUrl:x.target.value}}))}):e.jsx("p",{className:"text-sm text-muted-foreground",children:l.integrations.webhookUrl||"No webhook configured"})]})]})]})]}),e.jsxs(U,{children:[e.jsxs(ae,{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx(se,{children:"Team roles"}),e.jsx(Pe,{children:"Assign roles for company administrators."})]}),r&&e.jsxs(P,{variant:"outline",onClick:y,children:[e.jsx(kt,{className:"mr-2 h-4 w-4"}),"Add member"]})]}),e.jsx(_,{className:"space-y-4",children:l.team.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No team members assigned."}):l.team.map(x=>e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:x.name}),e.jsx("p",{className:"text-sm text-muted-foreground",children:x.role})]}),r&&e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(ee,{className:"w-48",value:x.role,onChange:v=>g(x.id,v.target.value)}),e.jsx(P,{variant:"ghost",size:"icon",onClick:()=>u(x.id),children:e.jsx(Ms,{className:"h-4 w-4"})})]})]},x.id))})]})]})},ND=["Operator","Game Provider","Platform Provider","Affiliate","Payments","KYC/AML","Marketing","Hosting/Infrastructure","Legal/Compliance","Recruitment"],CD=ie.createContext(null),SD={overview:fa,products:Me,people:ze,jobs:je,candidates:Ns,news:Ns,events:da,settings:ba},LD={overview:"Overview",products:"Products",people:"People",jobs:"Jobs",events:"Events",news:"News",candidates:"Candidates",settings:"Settings"},ID={canViewOverview:"Overview",canManageProducts:"Products",canManagePeople:"People",canManageJobs:"Jobs",canManageEvents:"Events",canManageNews:"News",canManageCandidates:"Candidates",canManageSettings:"Settings"},AD={overview:"canViewOverview",products:"canManageProducts",people:"canManagePeople",jobs:"canManageJobs",events:"canManageEvents",news:"canManageNews",candidates:"canManageCandidates",settings:"canManageSettings"},PD=["overview","products","people","jobs","events","news","candidates","settings"],TD=({company:t,companyName:a,companySlug:s,activeTab:r,visibleTabs:i,onTabChange:o,role:l,permissions:c,summaryStats:h,onUpdate:d,isSaving:p})=>{const g=a??t.name,y=s??t.slug,u=l??"admin",x=i??PD,v=ie.useMemo(()=>{var M,R,D;if(h)return h;const A=Array.isArray(t.jobs.openRoles)?t.jobs.openRoles.length:t.jobs.openRoles,C=(((M=t.trustAndCompliance.licenses)==null?void 0:M.length)??0)+(((R=t.trustAndCompliance.certifications)==null?void 0:R.length)??0)+(((D=t.trustAndCompliance.awards)==null?void 0:D.length)??0);return[{title:"Open roles",value:A,description:"Live listings",icon:je},{title:"Team members",value:t.people.members.length,description:"Listed people",icon:ze},{title:"Trust signals",value:C,description:"Licenses & awards",icon:Kt}]},[t,h]),[f,k]=ie.useState(()=>r??x[0]??"overview"),w=r??f,j=Object.entries(ID).filter(([A])=>!!c[A]),b=ie.useMemo(()=>x.filter(A=>{const C=AD[A];return c[C]!==!1}),[c,x]),T=b.includes(w),S=ie.useCallback(A=>{o==null||o(A),r===void 0&&k(A)},[r,o]),N=ie.useCallback(A=>d==null?void 0:d(A),[d]);ie.useEffect(()=>{!T&&b.length>0&&S(b[0])},[S,T,b]);const L=ie.useMemo(()=>b.map(A=>({value:A,label:LD[A],icon:SD[A]})),[b]),I=()=>{switch(w){case"overview":return e.jsx(y9,{company:t,onUpdate:N,isSaving:p,canEdit:c.canViewOverview});case"products":return e.jsx(f9,{company:t,onUpdate:N,isSaving:p,canEdit:c.canManageProducts});case"people":return e.jsx(g9,{company:t,onUpdate:N,isSaving:p,canEdit:c.canManagePeople});case"jobs":return e.jsx(u9,{company:t,onUpdate:N,isSaving:p,canEdit:c.canManageJobs});case"events":return e.jsx(m9,{company:t,onUpdate:N,isSaving:p,canEdit:c.canManageEvents});case"news":return e.jsx(p9,{company:t,onUpdate:N,isSaving:p,canEdit:c.canManageNews});case"candidates":return e.jsx(d9,{company:t,onUpdate:N,isSaving:p,canEdit:c.canManageCandidates});case"settings":return e.jsx(v9,{company:t,onUpdate:N,isSaving:p,canEdit:c.canManageSettings});default:return null}};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(i9,{companyName:g,isAdminView:!0,role:u,enabledPermissions:j,overview:t.overview,classification:t.classification,companyType:ND[0],companyId:y,companySlug:y,claimedStatus:"claimed",signalsAndInsights:t.signalsAndInsights,openRolesCount:0,trustScore:0}),v.length>0?e.jsx("section",{className:"py-6",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsx(sD,{stats:v})})}):null,e.jsx("section",{className:"py-6",children:e.jsx("div",{className:"container mx-auto px-4",children:b.length>0?e.jsxs(Da,{value:w,onValueChange:A=>S(A),children:[e.jsx(o9,{items:L}),T?e.jsx(ke,{value:w,className:"mt-6",children:e.jsx(CD.Provider,{value:{onUpdate:N,isSaving:p,permissions:c},children:e.jsx("div",{className:"rounded-2xl border bg-background p-6 shadow-sm",children:I()})})}):null]}):null})})]})},RD=({companyName:t,companySlug:a,open:s,onOpenChange:r,onSave:i})=>{const[o,l]=m.useState({companyName:t,companySlug:a,shortDescription:"",website:""}),c=()=>{i==null||i(o),r(!1)};return e.jsx(tt,{open:s,onOpenChange:r,children:e.jsxs(Xe,{className:"sm:max-w-[520px]",children:[e.jsxs(Be,{children:[e.jsx(Ie,{children:"Edit company profile"}),e.jsx(nt,{children:"Update company details for admins with profile permissions. This dialog is layout-only and does not perform any API calls."})]}),e.jsxs("div",{className:"grid gap-4 py-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(V,{htmlFor:"admin-company-name",children:"Company name"}),e.jsx(ee,{id:"admin-company-name",value:o.companyName,onChange:h=>l(d=>({...d,companyName:h.target.value}))})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(V,{htmlFor:"admin-company-slug",children:"Company slug"}),e.jsx(ee,{id:"admin-company-slug",value:o.companySlug,onChange:h=>l(d=>({...d,companySlug:h.target.value}))})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(V,{htmlFor:"admin-company-description",children:"Short description"}),e.jsx(st,{id:"admin-company-description",rows:4,value:o.shortDescription,onChange:h=>l(d=>({...d,shortDescription:h.target.value}))})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(V,{htmlFor:"admin-company-website",children:"Website"}),e.jsx(ee,{id:"admin-company-website",value:o.website,onChange:h=>l(d=>({...d,website:h.target.value}))})]})]}),e.jsxs(et,{children:[e.jsx(P,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e.jsx(P,{variant:"accent",onClick:c,children:"Save changes"})]})]})})},DD=(t,a)=>t[a]===!0,zD=t=>Object.entries(t).filter(([a,s])=>s===!0).map(([a])=>a),qD=({slug:t,title:a,department:s,description:r,typicalTimeline:i,keySkills:o,nodesCount:l,entryPointsCount:c,marketHotspots:h,salaryRange:d,viewMode:p="grid",onNavigate:g})=>p==="list"?e.jsxs("div",{onClick:()=>g(`/knowledge/career-paths/${t}`),className:"group relative flex items-center gap-4 rounded-lg border border-border bg-card p-4 cursor-pointer transition-all hover:border-primary/30 hover:shadow-sm",children:[e.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-lg bg-accent/10 text-accent",children:e.jsx($e,{className:"h-6 w-6"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h3",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:a}),e.jsx(q,{variant:"outline",className:"text-xs",children:s})]}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground line-clamp-1",children:r}),e.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ut,{className:"h-3 w-3"}),i]}),e.jsxs("span",{children:[l," career stages"]}),e.jsxs("span",{children:[c," entry points"]}),d&&e.jsxs("span",{className:"font-mono",children:[d.entry," → ",d.director]})]})]}),e.jsx(Pt,{className:"h-5 w-5 text-muted-foreground group-hover:text-primary transition-colors shrink-0"})]}):e.jsxs("div",{onClick:()=>g(`/knowledge/career-paths/${t}`),className:"group relative flex flex-col rounded-lg border border-border bg-card p-5 cursor-pointer transition-all hover:border-primary/30 hover:shadow-md",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-accent/10 text-accent",children:e.jsx($e,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:a}),e.jsx(q,{variant:"outline",className:"text-xs mt-0.5",children:s})]})]}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 flex-1",children:r}),e.jsx("div",{className:"mt-4 flex items-center gap-1",children:Array.from({length:l}).map((y,u)=>e.jsxs(m.Fragment,{children:[e.jsx("div",{className:`h-2 w-2 rounded-full ${u===0?"bg-accent":"bg-border group-hover:bg-accent/50"} transition-colors`}),u<l-1&&e.jsx("div",{className:"h-px flex-1 bg-border group-hover:bg-accent/30 transition-colors"})]},u))}),e.jsxs("div",{className:"mt-3 flex items-center justify-between text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ut,{className:"h-3 w-3"}),i]}),d&&e.jsxs("span",{className:"font-mono",children:[d.entry," → ",d.director]})]}),e.jsxs("div",{className:"mt-2 flex gap-1.5 flex-wrap",children:[o.slice(0,3).map(y=>e.jsx(q,{variant:"secondary",className:"text-xs",children:y},y)),o.length>3&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["+",o.length-3]})]}),h.length>0&&e.jsxs("div",{className:"mt-2 flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(Te,{className:"h-3 w-3"}),h.join(", ")]})]}),YN={Shield:e.jsx(Ta,{className:"h-5 w-5"}),TrendingUp:e.jsx($e,{className:"h-5 w-5"}),Heart:e.jsx(ma,{className:"h-5 w-5"}),Code:e.jsx(Xo,{className:"h-5 w-5"}),Lightbulb:e.jsx(eo,{className:"h-5 w-5"}),Megaphone:e.jsx(il,{className:"h-5 w-5"}),CreditCard:e.jsx(xo,{className:"h-5 w-5"}),Dice1:e.jsx(el,{className:"h-5 w-5"})},FD=({slug:t,name:a,icon:s,description:r,roleGuideCount:i,careerPathCount:o,jobCount:l,keyFunctions:c,viewMode:h="grid",onNavigate:d})=>h==="list"?e.jsxs("div",{onClick:()=>d(`/knowledge/departments/${t}`),className:"group relative flex items-center gap-4 rounded-lg border border-border bg-card p-4 cursor-pointer transition-all hover:border-primary/30 hover:shadow-sm",children:[e.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:YN[s]||e.jsx(je,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:a}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground line-clamp-1",children:r}),e.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-muted-foreground",children:[e.jsxs("span",{children:[l," open jobs"]}),e.jsxs("span",{children:[i," role guides"]}),e.jsxs("span",{children:[o," career paths"]})]})]}),e.jsx(Pt,{className:"h-5 w-5 text-muted-foreground group-hover:text-primary transition-colors shrink-0"})]}):e.jsxs("div",{onClick:()=>d(`/knowledge/departments/${t}`),className:"group relative flex flex-col rounded-lg border border-border bg-card p-5 cursor-pointer transition-all hover:border-primary/30 hover:shadow-md",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10 text-primary",children:YN[s]||e.jsx(je,{className:"h-5 w-5"})}),e.jsx("h3",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:a})]}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 flex-1",children:r}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-1.5",children:[c.slice(0,3).map(p=>e.jsx(q,{variant:"secondary",className:"text-xs",children:p},p)),c.length>3&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["+",c.length-3]})]}),e.jsxs("div",{className:"mt-3 flex items-center gap-3 text-xs text-muted-foreground pt-3 border-t border-border",children:[e.jsx("span",{className:"font-semibold text-foreground",children:l})," jobs",e.jsx("span",{children:"·"}),e.jsx("span",{className:"font-semibold text-foreground",children:i})," role guides",e.jsx("span",{children:"·"}),e.jsx("span",{className:"font-semibold text-foreground",children:o})," career paths"]})]}),KN={onboarding:"bg-gaming-success/10 text-gaming-success border-gaming-success/20",transition:"bg-accent/10 text-accent border-accent/20",growth:"bg-primary/10 text-primary border-primary/20",leadership:"bg-gaming-gold/10 text-gaming-gold border-gaming-gold/20","market-entry":"bg-gaming-warning/10 text-gaming-warning border-gaming-warning/20"},HD=({slug:t,title:a,type:s,department:r,seniority:i,market:o,description:l,estimatedReadTime:c,accessLevel:h,tags:d,viewMode:p="grid",onNavigate:g})=>{const y=h!=="public";return p==="list"?e.jsxs("div",{onClick:()=>g(`/knowledge/playbooks/${t}`),className:"group relative flex items-center gap-4 rounded-lg border border-border bg-card p-4 cursor-pointer transition-all hover:border-primary/30 hover:shadow-sm",children:[e.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:e.jsx(At,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h3",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:a}),e.jsx(q,{className:`${KN[s]||"bg-muted text-muted-foreground"} text-xs border capitalize`,children:s.replace("-"," ")}),y&&e.jsx(va,{className:"h-3 w-3 text-muted-foreground"})]}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground line-clamp-1",children:l}),e.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ut,{className:"h-3 w-3"}),c," min read"]}),e.jsx(q,{variant:"outline",className:"text-xs",children:r}),e.jsx(q,{variant:"secondary",className:"text-xs",children:i}),o&&e.jsx("span",{children:o})]})]}),e.jsx(Pt,{className:"h-5 w-5 text-muted-foreground group-hover:text-primary transition-colors shrink-0"})]}):e.jsxs("div",{onClick:()=>g(`/knowledge/playbooks/${t}`),className:"group relative flex flex-col rounded-lg border border-border bg-card p-5 cursor-pointer transition-all hover:border-primary/30 hover:shadow-md",children:[y&&e.jsx("div",{className:"absolute top-3 right-3",children:e.jsx(va,{className:"h-4 w-4 text-muted-foreground"})}),e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(q,{className:`${KN[s]||"bg-muted text-muted-foreground"} text-xs border capitalize`,children:s.replace("-"," ")}),e.jsx(q,{variant:"outline",className:"text-xs",children:r})]}),e.jsx("h3",{className:"font-semibold text-foreground group-hover:text-primary transition-colors line-clamp-2",children:a}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-2 flex-1",children:l}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5",children:d.slice(0,3).map(u=>e.jsx(q,{variant:"secondary",className:"text-xs",children:u},u))}),e.jsxs("div",{className:"mt-3 flex items-center justify-between text-xs text-muted-foreground pt-3 border-t border-border",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ut,{className:"h-3 w-3"}),c," min read"]}),e.jsxs("span",{children:[i,o?` · ${o}`:""]})]})]})},XN=t=>t==="Growing"?e.jsx($e,{className:"h-3 w-3 text-gaming-success"}):t==="Declining"?e.jsx(Po,{className:"h-3 w-3 text-destructive"}):e.jsx(Mo,{className:"h-3 w-3 text-muted-foreground"}),QN=t=>t==="High"?"bg-gaming-success/10 text-gaming-success border-gaming-success/20":t==="Medium"?"bg-gaming-warning/10 text-gaming-warning border-gaming-warning/20":"bg-muted text-muted-foreground",ED=({slug:t,title:a,alternativeTitles:s,department:r,seniority:i,summary:o,demandLevel:l,growthTrend:c,markets:h,requiredSkills:d,viewMode:p="grid",onNavigate:g})=>p==="list"?e.jsxs("div",{onClick:()=>g(`/knowledge/role-guides/${t}`),className:"group relative flex items-center gap-4 rounded-lg border border-border bg-card p-4 cursor-pointer transition-all hover:border-primary/30 hover:shadow-sm",children:[e.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:e.jsx(je,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h3",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:a}),e.jsx(q,{variant:"outline",className:"text-xs",children:r}),e.jsx(q,{variant:"secondary",className:"text-xs",children:i})]}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground line-clamp-1",children:o}),e.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs",children:[e.jsxs(q,{className:`${QN(l)} text-xs border`,children:[l," demand"]}),e.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",children:[XN(c),c]}),h.length>0&&e.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",children:[e.jsx(Te,{className:"h-3 w-3"}),h.slice(0,3).join(", ")]})]})]}),e.jsx(Pt,{className:"h-5 w-5 text-muted-foreground group-hover:text-primary transition-colors shrink-0"})]}):e.jsxs("div",{onClick:()=>g(`/knowledge/role-guides/${t}`),className:"group relative flex flex-col rounded-lg border border-border bg-card p-5 cursor-pointer transition-all hover:border-primary/30 hover:shadow-md",children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10 text-primary",children:e.jsx(je,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:a}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[r," · ",i]})]})]}),e.jsx(q,{className:`${QN(l)} text-xs border`,children:l})]}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-3 flex-1",children:o}),s.length>0&&e.jsxs("p",{className:"mt-2 text-xs text-muted-foreground",children:["Also: ",s.slice(0,2).join(", ")]}),e.jsx("div",{className:"mt-3 flex gap-1.5 flex-wrap",children:d.slice(0,3).map(y=>e.jsx(q,{variant:"secondary",className:"text-xs",children:y},y))}),e.jsxs("div",{className:"mt-3 flex items-center justify-between text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[XN(c),c]}),h.length>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Te,{className:"h-3 w-3"}),h.slice(0,2).join(", ")]})]})]}),BD=({slug:t,term:a,fullName:s,definition:r,departments:i,topicCategory:o,synonyms:l=[],viewMode:c="grid",onNavigate:h})=>c==="list"?e.jsxs("div",{onClick:()=>h(`/knowledge/glossary/${t}`),className:"group relative flex items-start gap-4 rounded-lg border border-border bg-card p-4 cursor-pointer transition-all hover:border-primary/30 hover:shadow-sm",children:[e.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary font-bold text-sm font-mono",children:a.slice(0,3)}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h3",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:a}),s&&e.jsxs("span",{className:"text-sm text-muted-foreground",children:["— ",s]})]}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground line-clamp-2",children:r}),e.jsxs("div",{className:"mt-2 flex items-center gap-2 flex-wrap",children:[e.jsx(q,{variant:"outline",className:"text-xs",children:o}),i.slice(0,2).map(d=>e.jsx(q,{variant:"secondary",className:"text-xs",children:d},d))]})]}),e.jsx(bt,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0 mt-1"})]}):e.jsxs("div",{onClick:()=>h(`/knowledge/glossary/${t}`),className:"group relative flex flex-col rounded-lg border border-border bg-card p-5 cursor-pointer transition-all hover:border-primary/30 hover:shadow-md",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-md bg-primary/10 text-primary font-bold text-sm font-mono",children:a.slice(0,3)}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-foreground group-hover:text-primary transition-colors",children:a}),s&&e.jsx("p",{className:"text-xs text-muted-foreground",children:s})]})]}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-3 flex-1",children:r}),e.jsxs("div",{className:"mt-3 flex items-center gap-1.5 flex-wrap",children:[e.jsx(q,{variant:"outline",className:"text-xs",children:o}),i.slice(0,1).map(d=>e.jsx(q,{variant:"secondary",className:"text-xs",children:d},d)),l.length>0&&e.jsxs("span",{className:"text-xs text-muted-foreground ml-auto flex items-center gap-1",children:[e.jsx(Io,{className:"h-3 w-3"}),l.length," synonyms"]})]})]}),e7=t=>{const a=Math.floor(t/60);return a>=60?`${Math.floor(a/60)}h ${a%60}m`:`${a} min`},VD=({slug:t,title:a,description:s,thumbnailUrl:r,duration:i,speaker:o,speakerRole:l,speakerCompany:c,conference:h,departments:d,sourceType:p,viewCount:g,saveCount:y,qualityRating:u,viewMode:x="grid",onNavigate:v})=>x==="list"?e.jsxs("div",{onClick:()=>v(`/knowledge/videos/${t}`),className:"group relative flex gap-4 rounded-lg border border-border bg-card p-3 cursor-pointer transition-all hover:border-primary/30 hover:shadow-sm",children:[e.jsxs("div",{className:"relative w-48 h-28 rounded-md overflow-hidden bg-muted shrink-0",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent z-10"}),e.jsxs("div",{className:"absolute bottom-2 right-2 z-20 flex items-center gap-1 bg-black/80 text-white text-xs px-1.5 py-0.5 rounded font-mono",children:[e.jsx(ut,{className:"h-3 w-3"}),e7(i)]}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-20 opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx("div",{className:"bg-primary/90 rounded-full p-2",children:e.jsx(ka,{className:"h-5 w-5 text-primary-foreground",fill:"currentColor"})})}),e.jsx("img",{src:r,alt:a,className:"w-full h-full object-cover",onError:f=>{f.target.style.display="none"}})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("h3",{className:"font-semibold text-foreground group-hover:text-primary transition-colors line-clamp-1",children:a}),e.jsx(q,{variant:"outline",className:"text-xs shrink-0 capitalize",children:p})]}),o&&e.jsxs("p",{className:"text-sm text-muted-foreground mt-1 flex items-center gap-1",children:[e.jsx(wo,{className:"h-3 w-3"}),o,c&&` · ${c}`]}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:s}),e.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Aa,{className:"h-3 w-3"}),g.toLocaleString()]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(St,{className:"h-3 w-3"}),y]}),e.jsx("span",{className:"flex items-center gap-1",children:Array.from({length:u}).map((f,k)=>e.jsx(Ze,{className:"h-3 w-3 fill-gaming-gold text-gaming-gold"},k))}),d.slice(0,2).map(f=>e.jsx(q,{variant:"secondary",className:"text-xs",children:f},f))]})]})]}):e.jsxs("div",{onClick:()=>v(`/knowledge/videos/${t}`),className:"group relative flex flex-col rounded-lg border border-border bg-card overflow-hidden cursor-pointer transition-all hover:border-primary/30 hover:shadow-md",children:[e.jsxs("div",{className:"relative w-full aspect-video bg-muted",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent z-10"}),e.jsxs("div",{className:"absolute bottom-2 right-2 z-20 flex items-center gap-1 bg-black/80 text-white text-xs px-1.5 py-0.5 rounded font-mono",children:[e.jsx(ut,{className:"h-3 w-3"}),e7(i)]}),h&&e.jsx("div",{className:"absolute top-2 left-2 z-20",children:e.jsx(q,{className:"bg-accent text-accent-foreground text-xs",children:h})}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-20 opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx("div",{className:"bg-primary/90 rounded-full p-3",children:e.jsx(ka,{className:"h-6 w-6 text-primary-foreground",fill:"currentColor"})})}),e.jsx("img",{src:r,alt:a,className:"w-full h-full object-cover",onError:f=>{f.target.style.display="none"}})]}),e.jsxs("div",{className:"p-4 flex flex-col flex-1",children:[e.jsx("h3",{className:"font-semibold text-foreground group-hover:text-primary transition-colors line-clamp-2",children:a}),o&&e.jsxs("p",{className:"text-sm text-muted-foreground mt-1 flex items-center gap-1",children:[e.jsx(wo,{className:"h-3 w-3"}),o,c&&` · ${c}`]}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-2 flex-1",children:s}),e.jsxs("div",{className:"mt-3 flex items-center gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Aa,{className:"h-3 w-3"}),g.toLocaleString()]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(St,{className:"h-3 w-3"}),y]}),d.slice(0,1).map(f=>e.jsx(q,{variant:"secondary",className:"text-xs",children:f},f))]})]})]}),OD=({item:t,viewMode:a="grid",onNavigate:s})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card cursor-pointer group",onClick:()=>s(`/channels/${t.slug}`),children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[t.isDigital?e.jsxs(q,{className:"bg-gaming-success/10 text-gaming-success text-xs",children:[e.jsx(so,{className:"h-3 w-3 mr-1"}),"Digital"]}):e.jsxs(q,{variant:"secondary",className:"text-xs",children:[e.jsx(ll,{className:"h-3 w-3 mr-1"}),"Physical"]}),t.isRegulatedDifferently&&e.jsx(q,{className:"bg-gaming-warning/10 text-gaming-warning text-xs",children:"Separate regulation"})]}),e.jsx("h3",{className:"text-lg font-semibold text-foreground group-hover:text-accent transition-colors mb-1",children:t.name}),e.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:t.label}),e.jsx("p",{className:"text-xs text-muted-foreground mb-3 line-clamp-2",children:t.description}),e.jsxs("div",{className:"flex items-center gap-2 mb-3 py-2 border-y border-border/50",children:[e.jsx(Me,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-lg font-bold text-foreground",children:t.companyCount.toLocaleString()}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"companies"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.typicalCompanyTypes.slice(0,4).map(r=>e.jsx(q,{variant:"outline",className:"text-xs capitalize",children:r.replace(/-/g," ")},r))})]}),GD={high:"bg-destructive/10 text-destructive",medium:"bg-gaming-warning/10 text-gaming-warning",low:"bg-gaming-success/10 text-gaming-success"},UD=({item:t,viewMode:a="grid",onNavigate:s})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card cursor-pointer group",onClick:()=>s(`/verticals/${t.slug}`),children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[e.jsx(q,{variant:"secondary",className:"text-xs",children:t.channel}),e.jsxs(q,{className:`text-xs ${GD[t.regulationLevel]}`,children:[e.jsx(Kt,{className:"h-3 w-3 mr-1"}),t.regulationLevel," regulation"]}),t.isFastGrowing&&e.jsxs(q,{className:"bg-gaming-success/10 text-gaming-success text-xs",children:[e.jsx($e,{className:"h-3 w-3 mr-1"}),"Fast growing"]}),t.isFeatured&&e.jsx(q,{className:"bg-primary text-primary-foreground text-xs",children:"Featured"})]}),e.jsx("h3",{className:"text-lg font-semibold text-foreground group-hover:text-accent transition-colors mb-1",children:t.name}),e.jsx("p",{className:"text-xs text-muted-foreground mb-3 line-clamp-2",children:t.description}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-3 py-2 border-y border-border/50",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-bold text-foreground",children:t.jobCount.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center justify-center gap-1",children:[e.jsx(je,{className:"h-3 w-3"})," Jobs"]})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-bold text-foreground",children:t.companyCount.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center justify-center gap-1",children:[e.jsx(Me,{className:"h-3 w-3"})," Companies"]})]})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-3",children:t.topMarkets.slice(0,3).map(r=>e.jsx(q,{variant:"outline",className:"text-xs capitalize",children:r.replace(/-/g," ")},r))}),t.keyRoles[0]&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx($e,{className:"h-3 w-3 text-gaming-success"}),e.jsxs("span",{children:["Top role: ",e.jsx("strong",{className:"text-foreground",children:t.keyRoles[0].role})]})]})]}),t7={growing:{label:"Growing",cls:"text-gaming-success"},stable:{label:"Stable",cls:"text-muted-foreground"},declining:{label:"Declining",cls:"text-destructive"}},_D=({item:t,viewMode:a="grid",onNavigate:s})=>{const r=t7[t.growthTrend]??t7.stable;return e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card cursor-pointer group",onClick:()=>s(`/departments/${t.slug}`),children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[t.isTechnical&&e.jsx(q,{variant:"secondary",className:"text-xs",children:"Technical"}),t.isRegulated&&e.jsx(q,{className:"bg-destructive/10 text-destructive text-xs",children:"Regulated"}),t.isIgamingSpecific&&e.jsx(q,{className:"bg-primary text-primary-foreground text-xs",children:"iGaming-specific"}),e.jsxs(q,{className:`text-xs ${r.cls} bg-transparent border border-current`,children:[e.jsx($e,{className:"h-3 w-3 mr-1"}),r.label]})]}),e.jsx("h3",{className:"text-lg font-semibold text-foreground group-hover:text-accent transition-colors mb-1",children:t.name}),e.jsx("p",{className:"text-xs text-muted-foreground mb-3 line-clamp-2",children:t.description}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-3 py-2 border-y border-border/50",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-bold text-foreground",children:t.jobCount.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center justify-center gap-1",children:[e.jsx(je,{className:"h-3 w-3"})," Jobs"]})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-sm font-bold text-foreground",children:[t.avgSalaryRange.currency==="EUR"?"€":t.avgSalaryRange.currency==="GBP"?"£":"$",Math.round(t.avgSalaryRange.min/1e3),"k–",Math.round(t.avgSalaryRange.max/1e3),"k"]}),e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center justify-center gap-1",children:[e.jsx(Oa,{className:"h-3 w-3"})," Salary"]})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-3",children:[t.topSkills.slice(0,4).map(i=>e.jsx(q,{variant:"outline",className:"text-xs",children:i},i)),t.topSkills.length>4&&e.jsxs(q,{variant:"outline",className:"text-xs",children:["+",t.topSkills.length-4]})]}),t.subDepartments.length>0&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[t.subDepartments.length," sub-departments"]})]})},$D={High:"text-gaming-success",Medium:"text-gaming-warning",Low:"text-muted-foreground"},WD=({item:t,viewMode:a="grid",onNavigate:s})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card cursor-pointer group",onClick:()=>s(`/company-types/${t.slug}`),children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[e.jsx(q,{variant:"secondary",className:"text-xs",children:t.businessModel.toUpperCase()}),t.isRegulated&&e.jsx(q,{className:"bg-destructive/10 text-destructive text-xs",children:"Regulated"}),t.isFeatured&&e.jsx(q,{className:"bg-primary text-primary-foreground text-xs",children:"Featured"})]}),e.jsx("h3",{className:"text-lg font-semibold text-foreground group-hover:text-accent transition-colors mb-1",children:t.name}),e.jsx("p",{className:"text-xs text-muted-foreground mb-3 line-clamp-2",children:t.description}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-3 py-2 border-y border-border/50",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-bold text-foreground",children:t.jobCount.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center justify-center gap-1",children:[e.jsx(je,{className:"h-3 w-3"})," Jobs"]})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-bold text-foreground",children:t.companyCount.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center justify-center gap-1",children:[e.jsx(Me,{className:"h-3 w-3"})," Companies"]})]})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-3",children:t.subtypes.slice(0,3).map(r=>e.jsx(q,{variant:"outline",className:"text-xs",children:r.name},r.slug))}),t.keyRoles[0]&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(ze,{className:"h-3 w-3"}),e.jsxs("span",{children:["Top role: ",e.jsx("strong",{className:"text-foreground",children:t.keyRoles[0].role})]}),e.jsx("span",{className:$D[t.keyRoles[0].demand],children:t.keyRoles[0].demand})]})]}),aN=({title:t,icon:a,children:s,className:r,compact:i=!1})=>e.jsxs(U,{className:r,children:[t&&e.jsx("div",{className:"flex flex-col space-y-1.5 p-6 pb-0",children:e.jsxs("h3",{className:"flex items-center gap-2 font-semibold leading-none tracking-tight",children:[a,t]})}),e.jsx("div",{className:ne(i?"p-4 space-y-3":"p-6 pt-3"),children:s})]});aN.displayName="DirectoryDetailCard";const ZD={High:"bg-gaming-success/10 text-gaming-success",Medium:"bg-gaming-warning/10 text-gaming-warning",Low:"bg-secondary text-muted-foreground"},k9=({roles:t,className:a})=>e.jsx("div",{className:ne("space-y-2",a),children:t.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ze,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:s.role})]}),e.jsxs(q,{className:ne("text-xs",ZD[s.demand]),children:[s.demand," demand"]})]},s.role))});k9.displayName="DirectoryKeyRolesList";const b9=({title:t,rows:a,badges:s,links:r,onNavigate:i,className:o})=>e.jsxs(aN,{title:t,compact:!0,className:o,children:[a&&a.length>0&&e.jsx("div",{className:"space-y-3",children:a.map(({label:l,value:c})=>e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:l}),e.jsx("span",{className:"text-foreground font-medium capitalize",children:c})]},l))}),s&&s.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(l=>e.jsx(q,{variant:"outline",className:"text-xs",children:l},l))}),r&&r.length>0&&e.jsx("div",{className:"space-y-1.5",children:r.map(({slug:l,label:c,icon:h,href:d})=>e.jsxs(P,{variant:"outline",size:"sm",className:"w-full justify-start gap-2 capitalize",onClick:()=>i==null?void 0:i(d),children:[h,c]},l))})]});b9.displayName="DirectoryInfoPanel";function JD(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var EM={exports:{}},sN={};function YD(t){return t&&t.__esModule?t:{default:t}}sN._=YD;var j9={};function w9(t){if(typeof WeakMap!="function")return null;var a=new WeakMap,s=new WeakMap;return(w9=function(r){return r?s:a})(t)}function KD(t,a){if(!a&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var s=w9(a);if(s&&s.has(t))return s.get(t);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var l=i?Object.getOwnPropertyDescriptor(t,o):null;l&&(l.get||l.set)?Object.defineProperty(r,o,l):r[o]=t[o]}return r.default=t,s&&s.set(t,r),r}j9._=KD;var NM={},a7;function XD(){return a7||(a7=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HeadManagerContext",{enumerable:!0,get:function(){return r}});const r=sN._(m).default.createContext({});process.env.NODE_ENV!=="production"&&(r.displayName="HeadManagerContext")}(NM)),NM}var ql={exports:{}},s7;function QD(){return s7||(s7=1,function(t,a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"setAttributesFromProps",{enumerable:!0,get:function(){return o}});const s={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv",noModule:"noModule"},r=["onLoad","onReady","dangerouslySetInnerHTML","children","onError","strategy","stylesheets"];function i(l){return["async","defer","noModule"].includes(l)}function o(l,c){for(const[h,d]of Object.entries(c)){if(!c.hasOwnProperty(h)||r.includes(h)||d===void 0)continue;const p=s[h]||h.toLowerCase();l.tagName==="SCRIPT"&&i(p)?l[p]=!!d:l.setAttribute(p,String(d)),(d===!1||l.tagName==="SCRIPT"&&i(p)&&(!d||d==="false"))&&(l.setAttribute(p,""),l.removeAttribute(p))}}(typeof a.default=="function"||typeof a.default=="object"&&a.default!==null)&&typeof a.default.__esModule>"u"&&(Object.defineProperty(a.default,"__esModule",{value:!0}),Object.assign(a.default,a),t.exports=a.default)}(ql,ql.exports)),ql.exports}var Fl={exports:{}},n7;function ez(){return n7||(n7=1,function(t,a){Object.defineProperty(a,"__esModule",{value:!0});function s(o,l){for(var c in l)Object.defineProperty(o,c,{enumerable:!0,get:l[c]})}s(a,{cancelIdleCallback:function(){return i},requestIdleCallback:function(){return r}});const r=typeof self<"u"&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(o){let l=Date.now();return self.setTimeout(function(){o({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-l))}})},1)},i=typeof self<"u"&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(o){return clearTimeout(o)};(typeof a.default=="function"||typeof a.default=="object"&&a.default!==null)&&typeof a.default.__esModule>"u"&&(Object.defineProperty(a.default,"__esModule",{value:!0}),Object.assign(a.default,a),t.exports=a.default)}(Fl,Fl.exports)),Fl.exports}(function(t,a){"use client";Object.defineProperty(a,"__esModule",{value:!0});function s(T,S){for(var N in S)Object.defineProperty(T,N,{enumerable:!0,get:S[N]})}s(a,{default:function(){return b},handleClientScriptLoad:function(){return v},initScriptLoader:function(){return w}});const r=sN,i=j9,o=e,l=r._(k7),c=i._(m),h=XD(),d=QD(),p=ez(),g=new Map,y=new Set,u=T=>{if(l.default.preinit){T.forEach(S=>{l.default.preinit(S,{as:"style"})});return}if(typeof window<"u"){let S=document.head;T.forEach(N=>{let L=document.createElement("link");L.type="text/css",L.rel="stylesheet",L.href=N,S.appendChild(L)})}},x=T=>{const{src:S,id:N,onLoad:L=()=>{},onReady:I=null,dangerouslySetInnerHTML:A,children:C="",strategy:M="afterInteractive",onError:R,stylesheets:D}=T,H=N||S;if(H&&y.has(H))return;if(g.has(S)){y.add(H),g.get(S).then(L,R);return}const G=()=>{I&&I(),y.add(H)},E=document.createElement("script"),W=new Promise((J,Y)=>{E.addEventListener("load",function(re){J(),L&&L.call(this,re),G()}),E.addEventListener("error",function(re){Y(re)})}).catch(function(J){R&&R(J)});A?(E.innerHTML=A.__html||"",G()):C?(E.textContent=typeof C=="string"?C:Array.isArray(C)?C.join(""):"",G()):S&&(E.src=S,g.set(S,W)),(0,d.setAttributesFromProps)(E,T),M==="worker"&&E.setAttribute("type","text/partytown"),E.setAttribute("data-nscript",M),D&&u(D),document.body.appendChild(E)};function v(T){const{strategy:S="afterInteractive"}=T;S==="lazyOnload"?window.addEventListener("load",()=>{(0,p.requestIdleCallback)(()=>x(T))}):x(T)}function f(T){document.readyState==="complete"?(0,p.requestIdleCallback)(()=>x(T)):window.addEventListener("load",()=>{(0,p.requestIdleCallback)(()=>x(T))})}function k(){[...document.querySelectorAll('[data-nscript="beforeInteractive"]'),...document.querySelectorAll('[data-nscript="beforePageRender"]')].forEach(S=>{const N=S.id||S.getAttribute("src");y.add(N)})}function w(T){T.forEach(v),k()}function j(T){const{id:S,src:N="",onLoad:L=()=>{},onReady:I=null,strategy:A="afterInteractive",onError:C,stylesheets:M,...R}=T;let{updateScripts:D,scripts:H,getIsSsr:G,appDir:E,nonce:W}=(0,c.useContext)(h.HeadManagerContext);W=R.nonce||W;const J=(0,c.useRef)(!1);(0,c.useEffect)(()=>{const re=S||N;J.current||(I&&re&&y.has(re)&&I(),J.current=!0)},[I,S,N]);const Y=(0,c.useRef)(!1);if((0,c.useEffect)(()=>{Y.current||(A==="afterInteractive"?x(T):A==="lazyOnload"&&f(T),Y.current=!0)},[T,A]),(A==="beforeInteractive"||A==="worker")&&(D?(H[A]=(H[A]||[]).concat([{id:S,src:N,onLoad:L,onReady:I,onError:C,...R,nonce:W}]),D(H)):G&&G()?y.add(S||N):G&&!G()&&x({...T,nonce:W})),E){if(M&&M.forEach(re=>{l.default.preinit(re,{as:"style"})}),A==="beforeInteractive")return N?(l.default.preload(N,R.integrity?{as:"script",integrity:R.integrity,nonce:W,crossOrigin:R.crossOrigin}:{as:"script",nonce:W,crossOrigin:R.crossOrigin}),(0,o.jsx)("script",{nonce:W,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${JSON.stringify([N,{...R,id:S}])})`}})):(R.dangerouslySetInnerHTML&&(R.children=R.dangerouslySetInnerHTML.__html,delete R.dangerouslySetInnerHTML),(0,o.jsx)("script",{nonce:W,dangerouslySetInnerHTML:{__html:`(self.__next_s=self.__next_s||[]).push(${JSON.stringify([0,{...R,id:S}])})`}}));A==="afterInteractive"&&N&&l.default.preload(N,R.integrity?{as:"script",integrity:R.integrity,nonce:W,crossOrigin:R.crossOrigin}:{as:"script",nonce:W,crossOrigin:R.crossOrigin})}return null}Object.defineProperty(j,"__nextScript",{value:!0});const b=j;(typeof a.default=="function"||typeof a.default=="object"&&a.default!==null)&&typeof a.default.__esModule>"u"&&(Object.defineProperty(a.default,"__esModule",{value:!0}),Object.assign(a.default,a),t.exports=a.default)})(EM,EM.exports);var tz=EM.exports,az=tz;const sz=JD(az),nz=`
7905
7905
  window.dataLayer = window.dataLayer || [];
7906
7906
  window.dataLayer.push({ event: 'consent_granted' });
7907
7907
  // gtag('consent', 'update', { ad_storage: 'granted', analytics_storage: 'granted' });