"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5419],{71714:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(85893),i=r(67294),o=r(45697),a=r.n(o),s=r(60419);let l=(0,i.forwardRef)((e,t)=>{let{children:r,sx:i,...o}=e;return(0,n.jsx)(s.Zb,{ref:t,sx:{width:"216px",boxShadow:"0px 1px 8px 0px rgba(27, 36, 50, 0.10), 0px 4px 16px 0px rgba(27, 36, 50, 0.10)",borderRadius:"4px",...i},...o,children:r})});l.defaultProps={sx:{}},l.propTypes={children:a().node.isRequired,sx:a().shape({})}},82298:function(e,t,r){r.d(t,{p:function(){return H}});var n=r(85893),i=r(67294),o=r(45697),a=r.n(o),s=r(60419),l=r(41352),u=r(87764),c=r(14416),d=r(12688),p=r(42530),x=r(7667),h=r(95780),g=r(30934);let m=(0,i.forwardRef)((e,t)=>{let{placeholder:r,leftIcon:i,leftIconSx:o,rightIcon:a,sx:l,value:u,onRightIconClicked:c,onChange:d,showRightIconOnValue:p,...x}=e;return(0,n.jsxs)(s.kC,{sx:{alignItems:"center",width:"100%",position:"relative"},children:[i&&(0,n.jsx)(s.xu,{variant:"icon",color:"neutral.500",sx:{stroke:"currentColor",position:"absolute",left:"16px",...o},"data-item":"close-icon",height:"16px",width:"16px",strokeWidth:"1.5","aria-hidden":"true",as:i}),(0,n.jsx)(g.II,{placeholder:r,value:u,sx:{fontFamily:"inherit!important",pl:i?"40px":"16px",borderRadius:"4px",border:"1px solid",borderColor:"#8797AB !important",fontSize:"16px",color:"","::placeholder":{color:"text.placeholder",fontSize:"16px"},...l},onChange:e=>d(e.target.value),ref:t,...x}),(a&&p&&u||a&&!p)&&(0,n.jsx)(s.xu,{"data-testid":"search-clear",display:"flex",alignItems:"center",color:"neutral.500","aria-hidden":"true",sx:{stroke:"neutral.500",background:"transparent",position:"absolute",right:"16px",cursor:"pointer"},onClick:e=>{d&&d(""),c&&c(e)},children:(0,n.jsx)(s.xu,{variant:"icon",color:"neutral.500",sx:{stroke:"currentColor"},size:"16px","data-item":"clear-icon","aria-hidden":"true",strokeWidth:"1.5",height:"1em",width:"1em",as:a})})]})});m.propTypes={placeholder:a().string.isRequired,rightIcon:a().any,leftIcon:a().any,sx:a().object,leftIconSx:a().object,value:a().string.isRequired,onRightIconClicked:a().func,onChange:a().func,showRightIconOnValue:a().bool},m.defaultProps={rightIcon:null,leftIcon:null,sx:{},leftIconSx:{},onRightIconClicked:null,onChange:null,showRightIconOnValue:!0};var f=r(54976),y=r(8971),v=r(84979),b=r(13742),q=r(91466),j=r(71714),C=r(78971);let R=e=>{let{locations:t,selectedLocations:r,onSearchChange:o,updateFilters:a,term:u,isLocationSuggestionsLoading:c,hasAdvancedDesign:d}=e,[p,x]=(0,i.useState)(!1),g=(0,q.Z)(()=>{x(!1)}),R=(0,i.useMemo)(()=>t.map(e=>({name:e.value,value:e.value})),[t]),w=(0,i.useMemo)(()=>{let e=new Set;return r.forEach(t=>{e.has(t.id)||e.add(t.id)}),e},[r]),k=(0,i.useMemo)(()=>r.length>0?"".concat(r[0].name," ").concat(r.length>1?"\xb7 And ".concat(r.length-1," more"):""):"",[r]);return(0,n.jsxs)(s.xu,{"data-testid":"location-filter",ref:g,width:"100%",sx:{position:"relative",svg:{ml:"0px"}},children:[!p&&(0,n.jsx)(m,{"data-testid":"location-search",onFocus:()=>{x(!0),o("")},placeholder:"Location",leftIcon:f.Z,height:"56px",value:k,sx:{transition:"none",textTransform:"none"},rightIcon:y.Z,showRightIconOnValue:!1,onRightIconClicked:e=>{e.stopPropagation(),x(!p),(null==u?void 0:u.length)===0&&o("")}}),p&&(0,n.jsxs)(j.Z,{padding:"0px",sx:{position:"absolute",zIndex:9999,width:"100%"},children:[r.length>0&&(0,n.jsxs)(s.kC,{sx:{gap:"4px",py:"12px",px:"16px"},children:[(0,n.jsx)(s.kC,{sx:{height:"100%",mt:"8px",marginRight:"8px"},children:(0,n.jsx)(s.xu,{as:f.Z,size:"16px",sx:{cursor:"pointer",color:"neutral.500",ml:"2px",maxWidth:"16px",minWidth:"16px"}})}),(0,n.jsx)(s.kC,{sx:{flexWrap:"wrap",gap:"4px",flex:1},children:r.map(e=>(0,n.jsxs)(s.kC,{sx:{gap:"4px",alignItems:"center",padding:"0px 8px",justifyContent:"space-between",width:"fit-content",borderRadius:"4px",border:"1px solid",borderColor:"border.subtle",height:"32px"},children:[(0,n.jsx)(s.xu,{as:"p",sx:{fontSize:"14px",color:"text-main",lineHeight:"22px",padding:"8px 0px","white-space":"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.name}),(0,n.jsx)(s.xu,{onClick:()=>{a({filter:{queryParam:"searchable_locations",value:e.id||e.value,name:e.name},mode:"remove"})},as:l.Z,size:"16px",sx:{cursor:"pointer",color:"text.subtle"}})]},e.value))}),(0,n.jsx)(s.xu,{onClick:()=>{x(!1)},size:"16px",as:v.Z,sx:{color:"text.subtle",cursor:"pointer",minWidth:"16px",mt:"8px"}})]}),(0,n.jsx)(m,{value:u,"data-testid":"location-search-filter",onChange:e=>{o(e)},autoFocus:!0,sx:{border:"1px solid transparent!important",borderBottom:r.length>0?"1px solid":"0px",borderBottomColor:r.length>0?"#DEE4ED!important":"initial",transition:"none"},mx:r.length?"16px":"0px",p:r.length?"0px":"8px 12px 8px 40px",height:r.length?"40px":"56px",placeholder:"Type to search",leftIcon:r.length?null:f.Z,rightIcon:r.length?null:v.Z,showRightIconOnValue:!1,onRightIconClicked:e=>{e.stopPropagation(),x(!p)}}),(0,n.jsxs)(s.xu,{p:"8px",children:[!c&&(null==R?void 0:R.map(e=>{let{value:t,name:r}=e;return(0,n.jsxs)(s.kC,{sx:{alignItems:"center",justifyContent:"space-between",backgroundColor:w.has(t)?"neutral.20":"none",cursor:"pointer",px:"8px",mb:"2px"},onClick:()=>{w.has(t)?a({filter:{queryParam:"searchable_locations",value:t,name:t},mode:"remove"}):(a({filter:{queryParam:"searchable_locations",value:t,name:t}}),u&&o(""))},children:[(0,n.jsx)(s.xu,{as:"p",sx:{fontSize:"14px",color:w.has(t)?"text.dark":"text.main",lineHeight:"1.4",padding:"8px 0px"},children:r},t),w.has(t)&&(0,n.jsx)(s.xu,{as:b.Z,size:"16px",sx:{color:(0,C.$)(d).primary}})]})})),(c||0===R.length)&&(0,n.jsx)(s.kC,{sx:{height:200,justifyContent:"center"},children:c?(0,n.jsx)(h.w,{"data-testid":"loading",color:(0,C.$)(d).color}):(0,n.jsx)(s.xu,{sx:{color:"text.subtle",fontSize:"14px",fontStyle:"italic",mt:"20px"},as:"p",children:"No results"})})]})]})]})};R.propTypes={locations:a().array,onSearchChange:a().func.isRequired,selectedLocations:a().array,term:a().string.isRequired,isLocationSuggestionsLoading:a().bool.isRequired,updateFilters:a().func.isRequired,hasAdvancedDesign:a().bool.isRequired},R.defaultProps={locations:[],selectedLocations:[]};var w=r(83479),k=r(18482);let P=e=>{let{children:t,hasAdvanceDesign:r}=e;return(0,n.jsx)(s.kC,{sx:{color:"neutral.0",fontSize:"12px",fontWeight:600,lineHeight:"16px",backgroundColor:(0,C.$)(r).primary,minWidth:"16px",minHeight:"16px",width:"16px",height:"16px",borderRadius:"100%",justifyContent:"center",alignItems:"center"},children:(0,n.jsx)(s.xu,{children:t})})};P.propTypes={children:a().node.isRequired,hasAdvanceDesign:a().bool},P.defaultProps={hasAdvanceDesign:!1};let S=e=>{let{trigger:t,triggerProps:r,placement:o,autoPlacement:a,offset:l,extraOptions:u,onOpen:c,onClose:d,children:p,buttonText:x,selectedCount:h,hasAdvanceDesign:g,...m}=e,f=(0,i.useRef)(!1),[b,q]=(0,i.useState)(!1),j=[(0,w.cv)(l),(0,w.uY)()];a&&j.push((0,w.X5)());let{x:C,y:R,strategy:S,refs:I,context:F}=(0,k.YF)({open:b,onOpenChange:q,placement:o,middleware:j,...u});(0,i.useEffect)(()=>{f.current?b&&c?c():!b&&d&&d():f.current=!0},[b]);let z=(0,k.eS)(F),_=(0,k.qs)(F),E=(0,k.bQ)(F,{bubbles:{outsidePress:!1}}),{getReferenceProps:O,getFloatingProps:A}=(0,k.NI)([z,_,E]),Z=O();return(0,n.jsxs)(n.Fragment,{children:[(0,i.cloneElement)((0,n.jsxs)(s.kC,{sx:{zIndex:999,border:"1px solid",borderRadius:"4px",alignItems:["left","center"],width:["100%","auto"],p:"4px 16px",justifyContent:"space-between",gap:"4px",borderColor:"border.subtle",height:"32px",position:"relative",cursor:"pointer"},children:[(0,n.jsx)(s.xv,{sx:{fontSize:"14px",fontWeight:500,lineHeight:"24px",color:"text.main"},children:x}),h?(0,n.jsx)(P,{hasAdvanceDesign:g,children:h}):(0,n.jsx)(s.xu,{variant:"icon",sx:{stroke:"text",color:"text.main"},strokeWidth:"1.5","aria-hidden":"true",size:"16px",as:b?v.Z:y.Z})]}),{ref:I.setReference,...r,...O(),onClick:e=>{r.onClick&&r.onClick(e),Z.onClick&&Z.onClick(e)}}),b&&(0,n.jsx)(k.y0,{children:(0,n.jsx)(k.ll,{children:(0,n.jsx)(s.xu,{ref:I.setFloating,style:{position:S,top:null!=R?R:0,left:null!=C?C:0,zIndex:50},...m,...A(),children:p})})})]})};S.propTypes={autoPlacement:a().bool,children:a().oneOfType([a().arrayOf(a().node),a().node]).isRequired,trigger:a().node.isRequired,placement:a().oneOf(["top","top-start","top-end","bottom","bottom-start","bottom-end","right","right-start","right-end","left","left-start","left-end"]),offset:a().number,extraOptions:a().object,onOpen:a().func,onClose:a().func,triggerProps:a().object,buttonText:a().string.isRequired,selectedCount:a().number,hasAdvanceDesign:a().bool.isRequired},S.defaultProps={autoPlacement:!1,placement:"bottom-start",offset:4,extraOptions:{},onOpen:null,onClose:null,triggerProps:{},selectedCount:0};var I=r(98814),F=r(64998),z=r(58606),_=r(91033);let E=e=>{let{canFilterResults:t,filterFunction:r,options:o,itemTemplate:a,sort:u,searchValue:c,onFilter:d,isLoading:p,autoFocus:x}=e,[h,f]=(0,i.useState)(null!=c?c:""),y=(0,i.useRef)(),v=(0,i.useMemo)(()=>r({filter:h,options:o}),[h,r,o]),b=(0,i.useMemo)(()=>!1!==u||h?v:o,[h,v,o,u]),[q,j]=(0,i.useState)(0);return(0,i.useEffect)(()=>{let e=new _.Z(e=>{e.forEach(e=>{if(e.contentRect.width>1040){let e=38*v.length;j(e>400?400:e)}else j(50*v.length)})}),t=document.body;return t&&e.observe(t),()=>{t&&e.unobserve(t)}},[v.length]),(0,i.useEffect)(()=>{y.current&&x&&setTimeout(()=>{var e,t;null===(t=y.current)||void 0===t||null===(e=t.focus)||void 0===e||e.call(t)},100)},[x]),(0,n.jsxs)(s.kC,{py:["16px","16px","8px"],"data-testid":"filter-list",flexDirection:"column",flexGrow:1,sx:{overflow:"hidden"},children:[t&&(0,n.jsx)(s.xu,{px:"16px",pb:["0","0","16px"],pt:["0px","opx","8px"],"data-testid":"search-filter",children:(0,n.jsx)(m,{ref:y,rightIcon:l.Z,"data-testid":"textInput",type:"text",value:d?c:h,placeholder:"Type to search",height:["48px","48px","40px"],onChange:e=>{if(d){d(e);return}f(e)},sx:{borderColor:"#DEE4ED!important",p:"10px 12px"}})}),b.length>0&&!p&&(0,n.jsx)(s.kC,{"data-testid":"filter-results",overflow:"hidden",flexDirection:"column",sx:{overflowY:"auto",maxHeight:"".concat(q,"px")},children:(0,n.jsx)(s.xu,{width:1,sx:{height:"".concat(q,"px"),"& > div":{flexDirection:"column",overflowY:["hidden!important","hidden!important","auto!important"],"&::-webkit-scrollbar":{color:"red",width:"3px"},"&::-webkit-scrollbar-track":{},"&::-webkit-scrollbar-thumb":{borderRadius:"10px","-webkit-box-shadow":"inset 0 0 6px rgba(0,0,0,.3)"},"&::-webkit-scrollbar-bar":{width:"12px"},scrollbarWidth:"3px"}},"data-testid":"virtualized-wrapper",children:(0,n.jsx)(g.Jd,{initialItemCount:3,items:b.map(e=>({children:a(e)}))})})}),p&&(0,n.jsx)(s.xu,{mt:"16px",children:(0,n.jsx)(g.aN,{})}),!p&&(o&&o.length>0&&0===b.length||t&&0===o.length)&&(0,n.jsx)(s.xv,{"data-testid":"empty-results",sx:{color:"text.subtle",textAlign:"center",fontSize:"14px",lineHeight:"1.4",pt:"8px",pb:"16px",fontStyle:"italic"},children:"No results"})]})};E.propTypes={options:a().array,itemTemplate:a().func.isRequired,filterFunction:a().func.isRequired,onFilter:a().func.isRequired,searchValue:a().string.isRequired,canFilterResults:a().bool,sort:a().bool,isLoading:a().bool,autoFocus:a().bool},E.defaultProps={options:[],canFilterResults:!0,sort:null,isLoading:!1,autoFocus:!0};var O=r(78946);let A=e=>{let{tag:t,filter:{options:r,...o},updateFilters:a,hasAdvanceDesign:l,autoFocus:u}=e,c=(0,i.useRef)(null),d=(0,i.useMemo)(()=>t.values.reduce((e,t)=>(e.add("".concat(o.queryParam,"-").concat(encodeURIComponent(t.id))),e),new Set),[o,t]),[p,x]=(0,i.useState)();return(0,i.useEffect)(()=>{if(c.current&&!o.canFilter)return;let e=[],t=[];r.forEach(r=>{let n="".concat(o.queryParam,"-").concat(encodeURIComponent(r.value));d.has(n)?e.push(r):t.push(r)}),x(e.concat(o.sort?O.Z.alphabetic(t):t)),c.current=!0},[o.canFilter,o.queryParam,o.sort,r]),(0,n.jsx)(E,{autoFocus:u,canFilterResults:o.canFilter||o.options&&o.options.length>12,filterFunction:e=>{let{filter:t,options:r}=e;return r.filter(e=>e.name.toLowerCase().indexOf(t.toLowerCase())>=0)},itemTemplate:e=>{let t="".concat(o.queryParam,"-").concat(encodeURIComponent(e.value));return(0,n.jsxs)(s.kC,{"data-testid":t,sx:{mx:"8px",px:"8px",mb:"2px",gap:"8px",justifyContent:"space-between",alignItems:"center",backgroundColor:d.has(t)?"neutral.20":"none",borderRadius:d.has(t)?"4px":"0px",":hover":{backgroundColor:"neutral.20",cursor:"pointer",borderRadius:"4px"}},onClick:()=>{a({filter:{queryParam:o.queryParam,value:e.value,name:e.name},mode:d.has(t)?"remove":"add"})},children:[(0,n.jsx)(s.xu,{sx:{height:["48px","48px","36px"],py:["14px","14px","8px"],...d.has(t)?{color:"text.dark",fontWeight:500}:{color:"text.main",fontWeight:400},fontSize:"14px",lineHeight:"1.4",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.name},t),d.has(t)&&(0,n.jsx)(s.xu,{as:b.Z,size:"16px",sx:{color:(0,C.$)(l).primary}})]})},options:p,sort:o.sort,...o})};A.propTypes={tag:a().object.isRequired,updateFilters:a().func.isRequired,filter:a().object.isRequired,hasAdvanceDesign:a().bool.isRequired,autoFocus:a().bool.isRequired};let Z=e=>{var t;let{filterOptions:r,tags:o,updateFilters:a,total:c,searchValue:d,onInputChange:p,resetFilters:x,hasAdvanceDesign:h}=e,[f,y]=(0,i.useState)(!1),[v,b]=(0,i.useState)(null),q=v?r.find(e=>e.queryParam===v):null,j=(0,i.useRef)(),R=()=>{y(!1),b(null)},w=(0,C.$)(h),k=(0,i.useMemo)(()=>o.reduce((e,t)=>(e.set(t.queryParam,t.values.length),e),new Map),[o]);return(0,i.useEffect)(()=>(f&&(document.querySelector("body").style.overflow="hidden"),()=>{document.querySelector("body").style.overflow=null}),[f]),(0,n.jsxs)(n.Fragment,{children:[f&&(0,n.jsxs)(g.u_,{ref:j,actions:(0,n.jsxs)(g.zx,{size:"large",sx:{display:"flex",justifyContent:"center",width:"100%",height:"48px",bg:w.primary,color:w.accent,"&:hover":{bg:w.primary,color:w.accent}},onClick:R,children:["View",c>0?" ".concat(c.toLocaleString("en-US")," "):" ",1===c?"result":"results"]}),title:(0,n.jsxs)(s.kC,{justifyContent:"center",children:[(0,n.jsx)(s.xu,{onClick:()=>b(null),size:"24px",sx:{visibility:v?"visible":"hidden",color:"neutral.900",cursor:"pointer"},as:I.Z}),(0,n.jsx)(s.xu,{sx:{flex:1,":fist-letter":{textTransform:"uppercase"}},children:q?q.name:"Filters"}),v&&k.get(v)>0&&(0,n.jsx)(s.xu,{onClick:()=>{x(q)},sx:{color:"text.subtle",cursor:"pointer",fontSize:"13px",lineHeight:"22px",fontWeight:"400"},as:"p",children:"Clear all"}),!v&&(0,n.jsx)(s.xu,{"data-testid":"close-modal",onClick:R,size:"24px",sx:{color:"neutral.400",cursor:"pointer"},as:l.Z})]}),variant:"mobile",onCancel:R,children:[v&&(0,n.jsx)(A,{tag:null!==(t=o.find(e=>e.queryParam===v))&&void 0!==t?t:{values:[]},filter:q,updateFilters:a,hasAdvanceDesign:h,autoFocus:!1}),!v&&(0,n.jsxs)(s.kC,{sx:{flexDirection:"column",gap:"16px",p:"16px"},children:[(0,n.jsx)(m,{leftIcon:u.Z,rightIcon:l.Z,"data-testid":"textInput",type:"text",value:d,placeholder:"Job title, company or keyword",onChange:e=>p(e),onRightIconClicked:()=>p(""),sx:{borderColor:"#DEE4ED!important"},size:"xLarge"}),(0,n.jsx)(s.xu,{children:r.map(e=>(0,n.jsxs)(s.kC,{onClick:()=>{b(e.queryParam)},sx:{alignItems:"center",justifyContent:"space-between",py:"12px",cursor:"pointer",color:"text.main",fontSize:"16px",lineHeight:"24px"},children:[(0,n.jsx)(s.xu,{children:e.name}),(0,n.jsxs)(s.kC,{sx:{alignItems:"center",gap:"4px"},children:[k.get(e.queryParam)>0&&(0,n.jsx)(P,{hasAdvanceDesign:h,children:k.get(e.queryParam)}),(0,n.jsx)(s.xu,{size:"24px",as:F.Z})]})]}))})]})]}),(0,n.jsx)(g.zx,{sx:{display:["flex","flex","none"],justifyContent:"center"},icon:z.Z,variant:"secondary",width:"100%",iconGap:"8px",height:["40px","40px","32px"],onClick:()=>y(!0),children:"All filters"})]})};Z.propTypes={filterOptions:a().array.isRequired,tags:a().array.isRequired,updateFilters:a().func.isRequired,total:a().number.isRequired,searchValue:a().string.isRequired,onInputChange:a().func.isRequired,resetFilters:a().func.isRequired,hasAdvanceDesign:a().bool.isRequired};let L=e=>{let{filterOptions:t,locationFilterOptions:r,updateFilters:o,tags:a,total:l,onInputChange:u,searchValue:c,resetFilters:d,hasAdvanceDesign:p,showJobAlert:x}=e,h=(0,i.useRef)(),[g,m]=(0,i.useState)(!1),[f,y]=(0,i.useState)(!1),[v,b]=(0,i.useState)(850),[q,C]=(0,i.useState)(x?900:1070),R=(0,i.useRef)(),w=(0,i.useMemo)(()=>a.reduce((e,t)=>(e.set(t.queryParam,t.values.length),e),new Map),[a]);return(0,i.useLayoutEffect)(()=>{if(!R.current)return()=>{};C(R.current.getBoundingClientRect().width);let e=()=>{let{width:e}=R.current.getBoundingClientRect();C(e)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),(0,i.useLayoutEffect)(()=>{let e=t.sort(e=>e.order).map((e,t)=>{var r,n,i;let o=null===(i=R.current)||void 0===i?void 0:null===(n=i.querySelector)||void 0===n?void 0:null===(r=n.call(i,"#filter-".concat(t)))||void 0===r?void 0:r.getBoundingClientRect();return(null==o?void 0:o.width)||0}),r=(e.length-1)*8,n=e.reduce((e,t)=>e+t,0)+r;if(0!==n){if(n<=q)b(n),m(!1),y(!1);else{let t=!1;b(e.reduce((e,r)=>e+r+8+110<q&&!t?e+r+8:(t=!0,e),0)),y(!0)}}},[q,t]),(0,n.jsxs)(s.kC,{"data-testid":"filter-option",ref:R,width:x?["100%","50%","100%"]:"100%",sx:{gap:["0px","0px","8px"]},children:[q<481&&(0,n.jsx)(Z,{updateFilters:o,filterOptions:[...r,...t],tags:a,total:l,searchValue:c,onInputChange:u,resetFilters:d,hasAdvanceDesign:p}),q>479&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.xu,{maxWidth:g?"100%":"".concat(v,"px"),sx:{overflow:"hidden",zIndex:1},children:(0,n.jsxs)(s.xu,{flexWrap:"wrap",height:g?"72px":"34px",overflow:g?"initial":"hidden","data-testid":"filter-options",sx:{display:["none","none","flex"],gap:"8px",button:{padding:"0px"}},children:[t.map((e,t)=>{var r;return(0,n.jsx)(s.kC,{id:"filter-".concat(t),"data-testid":"filter-option-item-".concat(t),sx:{boxSizing:"border-box"},order:e.order,children:(0,n.jsx)(S,{selectedCount:w.get(e.queryParam),buttonText:e.name,fixedBottomPlacement:!0,ref:h,hasAdvanceDesign:p,children:(0,n.jsx)(j.Z,{sx:{width:"320px",p:0},children:(0,n.jsx)(A,{tag:null!==(r=a.find(t=>t.queryParam===e.queryParam))&&void 0!==r?r:{values:[]},filter:e,updateFilters:o,hasAdvanceDesign:p,autoFocus:!0})})})},e.name)}),!0===g&&(0,n.jsx)(s.kC,{order:999999999,sx:{alignItems:["left","center"],minWidth:"130px",p:"4px 16px",justifyContent:"space-between",gap:"4px",fontSize:"14px",cursor:"pointer"},onClick:()=>m(),children:"Collapse filters"})]})}),!g&&f&&(0,n.jsx)(s.xu,{order:999999999,sx:{alignItems:["left","center"],minWidth:"110px",p:"4px 16px",justifyContent:"space-between",gap:"4px",fontSize:"14px",cursor:"pointer",height:"32px",display:["none","none","flex"]},onClick:()=>m(!0),children:"More filters"})]})]})};L.propTypes={filterOptions:a().array.isRequired,locationFilterOptions:a().array.isRequired,tags:a().array.isRequired,updateFilters:a().func.isRequired,total:a().number.isRequired,searchValue:a().string.isRequired,onInputChange:a().func.isRequired,resetFilters:a().func.isRequired,hasAdvanceDesign:a().bool.isRequired,showJobAlert:a().bool.isRequired};var D=r(27168),T=r(68697);let W=e=>e.locationSuggestions,U=(0,T.P1)(W,e=>e.loading),M=(0,T.P1)(W,e=>e.suggestions),V=(0,T.P1)(W,e=>e.term);var B=e=>{let{network:t,company:r,origin:n="jobs"}=e,o=(0,c.I0)(),a=(0,c.v9)(M),s=(0,c.v9)(V),l=(0,c.v9)(U);return(0,i.useEffect)(()=>{o((0,D.EB)())},[o]),{resetSearchTerm:()=>o((0,D.EB)()),locationSuggestionsTerm:s,locationSuggestions:a,loadLocationSuggestions:e=>{let{term:i}=e;o((0,D.cK)({network:t,company:r,term:i,origin:n}))},isLocationSuggestionsLoading:l}};let H=e=>{var t,r,o;let{network:a,company:p,isLoading:x,searchPlaceholder:g,onRemoveTag:f,tags:y,children:v,searchValue:b,rightItem:q,searchRowFilters:j,hideLocationFilter:w,updateFilters:k,filterBySearchTerm:P,origin:S,filterOptions:I,itemCount:F,resetFilters:z,showJobAlert:_,...E}=e,[O,A]=(0,i.useState)(b),Z=(0,c.I0)(),D=y.find(e=>"searchable_locations"===e.queryParam),T=y.filter(e=>"searchable_locations"!==e.queryParam&&"searchable_location_option"!==e.queryParam).reduce((e,t)=>(e.push(...t.values.map(e=>({queryParam:t.queryParam,...e}))),e),[]).flat();(0,i.useEffect)(()=>{b||A("")},[b]);let{resetSearchTerm:W,locationSuggestionsTerm:U,locationSuggestions:M,loadLocationSuggestions:V,isLocationSuggestionsLoading:H}=B({network:a,company:p,origin:S}),J=(0,i.useMemo)(()=>M.map(e=>({name:e.value,value:e.value})),[M]),N=-1!==a.features.indexOf("advanced_design");return(0,n.jsxs)(s.xu,{mt:"64px",mb:"32px",children:[(0,n.jsxs)(s.Zb,{tx:"card",variant:"filters",className:"filters","data-testid":"list-filter",p:"16px",my:"0px",mt:"0px",mb:"0px",...E,children:[(0,n.jsxs)(s.kC,{flexDirection:"column",sx:{position:"relative"},children:[(0,n.jsxs)(s.kC,{alignItems:"flex-start",sx:{gap:"8px",position:"relative",flexDirection:["column","column","row"],pb:"8px"},children:[(0,n.jsx)(m,{"data-testid":"search-input",value:O,type:"text",placeholder:g,onChange:e=>{A(e),P({filter:{queryParam:"q",value:e}})},maxLength:"512",height:"56px",rightIcon:O?l.Z:null,leftIcon:u.Z}),j,w?null:(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(R,{hasAdvancedDesign:N,locations:M,updateFilters:k,selectedLocations:null!==(r=null==D?void 0:D.values)&&void 0!==r?r:[],term:U,isLocationSuggestionsLoading:H,onSearchChange:e=>{V({term:e})},resetSearchTerm:W})})]}),x&&(0,n.jsx)(s.xu,{children:(0,n.jsx)(h.w,{color:(0,C.$)(N).primary,"data-testid":"filter-loader"})}),!x&&(0,n.jsxs)(s.kC,{sx:{gap:["24px","8px"],flexDirection:["column","row"]},children:[(0,n.jsx)(n.Fragment,{children:(null==I?void 0:I.length)>0&&(0,n.jsx)(L,{showJobAlert:_,hasAdvanceDesign:N,searchValue:b,onInputChange:e=>{P({filter:{queryParam:"q",value:e}})},total:F,locationFilterOptions:[{name:"Locations",options:J,queryParam:"searchable_locations",value:null!==(o=null==D?void 0:D.values)&&void 0!==o?o:[],searchValue:U,canFilter:!0,onFilter:e=>{U!==e&&V({term:e})},isLoading:H}],filterOptions:I,updateFilters:k,resetFilters:z,tags:y})}),q&&q]})]}),T.length>0&&(0,n.jsxs)(s.kC,{"data-testid":"filter-tags",sx:{gap:"16px",mt:"16px",flexWrap:"wrap",alignItems:"center"},children:[T.map(e=>(0,n.jsxs)(s.kC,{sx:{gap:"4px",alignItems:"center"},"data-testid":"filter_id=".concat(e.id),children:[(0,n.jsx)(s.xu,{sx:{color:"text.main",fontSize:"14px",lineHeight:"14px",fontWeight:500},children:e.name}),(0,n.jsx)(s.xu,{size:"16px",sx:{color:"neutral.400",cursor:"pointer"},as:l.Z,onClick:()=>f({tag:e,queryParam:e.queryParam})})]},e.id)),(0,n.jsx)(s.xu,{color:"text.subtle",sx:{color:"text.subtle",fontSize:"14px",fontWeight:500,lineHeight:"24px",cursor:"pointer"},onClick:()=>z(),children:"Clear all"})]})]}),!(null==a?void 0:null===(t=a.features)||void 0===t?void 0:t.includes("hide_getro_in_filters"))&&(0,n.jsx)(s.kC,{sx:{pt:"8px",justifyContent:"flex-end"},children:(0,n.jsx)(s.rU,{href:"https://www.getro.com/getro-jobs",target:"_blank",onClick:()=>Z((0,d.jg)({network:a,origin:"powered_by_filters"})),sx:{position:"relative",textAlign:"right",textDecoration:"none",color:"#6B778F!important",fontSize:"12px",":hover":{color:"#3F495A!important"}},children:"Powered by Getro"})})]})};H.propTypes={network:p.h.isRequired,company:x.m,isLoading:a().bool,searchValue:a().string,onRemoveTag:a().func,children:a().oneOfType([a().arrayOf(a().node),a().node]),tags:a().array,searchPlaceholder:a().string.isRequired,rightItem:a().node,searchRowFilters:a().node,updateFilters:a().func.isRequired,hideLocationFilter:a().bool.isRequired,origin:a().string,filterOptions:a().array.isRequired,filterBySearchTerm:a().func.isRequired,itemCount:a().number.isRequired,resetFilters:a().func.isRequired,showJobAlert:a().bool},H.defaultProps={company:null,isLoading:!1,tags:[],searchValue:"",onRemoveTag:()=>{},children:null,rightItem:null,searchRowFilters:null,origin:"jobs",showJobAlert:!1}},20828:function(e,t,r){r.d(t,{j:function(){return o}});var n=r(17771),i=r(23544);let o=e=>{let{allCompanies:t,query:r}=e,o=[],{companySlug:a,q:s,page:l,...u}=r;return Object.keys(u).forEach(e=>{switch(e){case"job_functions":o.push({queryParam:"job_functions",key:"job_functions",values:r[e].map(e=>({id:e,name:decodeURIComponent(e)}))});break;case"searchable_locations":o.push({queryParam:"searchable_locations",key:"searchable_locations",values:r[e].map(e=>({id:e,name:e}))});break;case"organization.id":o.push({queryParam:"organization.id",values:r[e].map(e=>t.find(t=>t.id.toString()===e.toString())).filter(e=>void 0!==e)});break;case"organization.slug":o.push({queryParam:"organization.slug",values:r[e].map(e=>t.find(t=>t.id.toString()===e.toString()))});break;case"organization.head_count":case"head_count":o.push({key:e,queryParam:e,values:r[e].map(e=>({id:e,name:"".concat((0,n.Dt)(e)," employees"),value:e}))});break;case"organization.stage":case"stage":o.push({key:e,queryParam:e,values:r[e].map(e=>({id:e,name:(0,n.p5)(e),value:e}))});break;case"seniority":o.push({key:e,queryParam:e,values:r[e].map(e=>({id:e,name:i.Zh[e],value:e}))});break;default:o.push({queryParam:e,values:r[e].map(e=>({id:e,name:decodeURIComponent(e)}))})}}),o}},91466:function(e,t,r){var n=r(67294);t.Z=(e,t)=>{let r=(0,n.useRef)();return(0,n.useEffect)(()=>{let n=t=>{!r.current||r.current.contains(t.target)||e(t,r)},i=t=>{"Escape"===t.key&&e(t)};return document.addEventListener((null==t?void 0:t.downEvent)||"mousedown",n),document.addEventListener("touchstart",n),(null==t?void 0:t.useEsc)&&document.addEventListener("keyup",i),()=>{document.removeEventListener((null==t?void 0:t.downEvent)||"mousedown",n),document.removeEventListener("touchstart",n),(null==t?void 0:t.useEsc)&&document.removeEventListener("keyup",i)}},[t,e]),r}},58487:function(e,t,r){var n=r(67294),i=r(14416),o=r(27846),a=r(79364),s=r(99521);t.Z=e=>{let{network:t}=e,r=(0,i.I0)(),l=(0,i.v9)(s.r),u=(0,i.v9)((0,o.d)("customFilters")),{filters:c,initialized:d}=l,p=(0,n.useMemo)(()=>null==c?void 0:c.filter(e=>{let{visibility:t}=e;return"visible"===t}),[c]);return(0,n.useEffect)(()=>{d||u||r((0,a.Bw)({network:t}))},[t,r,u,d]),{customFilters:l.filters,visibleCustomFilters:p,initialized:d,isLoading:u}}},54188:function(e,t,r){var n=r(20296),i=r.n(n),o=r(72307),a=r.n(o),s=r(14416),l=r(47531),u=r(50511),c=r(84903);t.Z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=(0,c.ZP)(),n=(0,s.I0)(),o=i()(e=>h(e),400),d=e=>{let{filter:t,query:r}=e,n={...r},{queryParam:i}=t,{value:o}=t,a=Object.prototype.hasOwnProperty.call(n,i),s=Array.isArray(o)?o.length>0:o.toString().trim().length>0;if(a&&!Array.isArray(o)){if(n[i].indexOf(o.toString())>-1)return n;Array.isArray(n[i])&&s&&(n[i]=Array.from(new Set([...n[i],o.toString()])))}else a&&Array.isArray(o)?n[i]=[...n[i],...o]:!a&&s&&(n[i]=Array.isArray(o)?o:[o.toString()]);return n},p=e=>{let{filter:t,query:r}=e,n={...r};return r[t.queryParam]&&r[t.queryParam].length>0&&(n[t.queryParam]=r[t.queryParam].filter(e=>e.toString()!==t.value.toString()),0===n[t.queryParam].length&&delete n[t.queryParam]),n},x=(e,i,o)=>{let{queryParam:a,name:s,value:l}=e,c={"organization.id":"organization",job_functions:"job_function",q:"query","organization.topic":"topic",searchable_locations:"location","organization.industry_tags":"industry_tags",industry_tags:"industry_tags","organization.head_count":"head_count",head_count:"head_count",searchable_location_option:"onsite_remote",seniority:"seniority"}[a];!c&&e.queryParam.indexOf("topic")>-1&&(c="topic");let d=Object.keys(i).length,p=i[e.queryParam]?i[e.queryParam].length:1,x=Object.keys(i).reduce((e,t)=>"string"==typeof i[t]?e+1:e+i[t].length,0),h="q"===e.queryParam&&""===l?r.query.q:s||l;n((0,u.zQ)({filterName:c,mode:"q"===e.queryParam&&""===l?"remove":o,filterOptionAdded:h,totalActiveFilters:d,totalSelectedFilters:x,clearedOptionsCount:p,network:t}))},h=t=>{var n,i;let{filter:o,mode:s="add"}=t,l={...o,value:Array.isArray(null==o?void 0:o.value)?null==o?void 0:o.value.map(e=>{var t;return null==e?void 0:null===(t=e.toString())||void 0===t?void 0:t.replace(/'/g," ")}):(null==o?void 0:null===(i=o.value)||void 0===i?void 0:null===(n=i.toString())||void 0===n?void 0:n.replace(/'/g," "))||""},{query:u}=r,{q:c,page:h,...g}={...e,...u},m={..."remove"===s?p({filter:l,query:g}):d({filter:l,query:g})};return c&&(m.q=c),h&&(m.page=h),"q"===l.queryParam&&(0===l.value.toString().trim().length?delete m.q:m.q=l.value.toString()),a()(u,m)||(delete m.page,x(l,m,s),r.push({pathname:r.pathname,query:m})),m};return{filterBySearchTerm:o,updateFilters:h,toFilters:l.nZ,query:(0,l.T9)(r.query),resetFilters:i=>{let{query:o}=r;if(i)x(i,o,"clear"),delete o[i.queryParam];else{let{clearedFiltersCount:e,clearedOptionsCount:r}=Object.keys(o).reduce((e,t)=>("searchable_location_option"===t?(e.clearedOptionsCount+=o[t].length<2?1:0,e.clearedFiltersCount+=o[t].length<2?1:0):("string"==typeof o[t]?e.clearedOptionsCount+=1:e.clearedOptionsCount+=o[t].length,e.clearedFiltersCount+=1),e),{clearedFiltersCount:0,clearedOptionsCount:0});n((0,u.zQ)({mode:"clear_all",network:t,clearedFiltersCount:e,clearedOptionsCount:r}))}r.push({pathname:r.pathname,query:i?o:e})},addFilter:d}}},81754:function(e,t,r){var n=r(72307),i=r.n(n),o=r(67294),a=r(14416),s=r(57309),l=r(84903);t.Z=e=>{let{action:t,network:r}=e,n=(0,l.ZP)(),u=(0,s.D)(n.query),c=(0,a.I0)();(0,o.useEffect)(()=>{let e=n.query,o=!i()(u,e);u&&o&&c(t({network:r,query:e}))},[r,t,c,u,n.query])}},7667:function(e,t,r){r.d(t,{m:function(){return o}});var n=r(45697),i=r.n(n);let o=i().shape({id:i().oneOfType([i().string,i().number]).isRequired,name:i().string.isRequired,slug:i().string.isRequired,logoUrl:i().string,websiteUrl:i().string.isRequired,founded:i().string,angellistUrl:i().string,crunchbaseUrl:i().string,facebookUrl:i().string,instagramUrl:i().string,linkedinUrl:i().string,twitterUrl:i().string,hasActiveJobs:i().bool.isRequired,topics:i().arrayOf(i().shape({id:i().oneOfType([i().string,i().number]).isRequired,name:i().string.isRequired})).isRequired,locations:i().arrayOf(i().shape({id:i().oneOfType([i().string,i().number]).isRequired,name:i().string.isRequired,placeId:i().string})),approxEmployees:i().number})}}]);
//# sourceMappingURL=5419-88caf262485193d4.js.map