!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},l=(new e.Error).stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="95e6423c-9fb8-4758-8e4a-95af069c95bd",e._sentryDebugIdIdentifier="sentry-dbid-95e6423c-9fb8-4758-8e4a-95af069c95bd")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2895],{55716:function(e,l,t){Promise.resolve().then(t.bind(t,94384))},94384:function(e,l,t){"use strict";t.d(l,{SearchPageContent:function(){return ee}});var a=t(79307),r=t(62126),i=t(15827),n=t(3270),o=t(46332),s=t(97837);let c="\n  query EmployerCandidateSearch (\n    $from: Int\n		$pageSize: Int\n		$search: String\n		$locations: [String]\n		$aircraftTypes: [String]\n		$contractPositions: Boolean\n		$fullTimePositions: Boolean\n		$jobType: ProfessionalType\n		$willingToRelocate: Boolean\n		$salaryRangeMin: Float\n		$salaryRangeMax: Float\n		$faaRegulations: [String]\n		$flightHistory: [String]\n		$datePosted: String\n  ) {\n    employerCandidateSearch(\n      from: $from\n      pageSize: $pageSize\n      search: $search\n      locations: $locations\n      aircraftTypes: $aircraftTypes\n      contractPositions: $contractPositions\n      fullTimePositions: $fullTimePositions\n      jobType: $jobType\n      willingToRelocate: $willingToRelocate\n      salaryRangeMin: $salaryRangeMin\n      salaryRangeMax: $salaryRangeMax\n      faaRegulations: $faaRegulations\n      flightHistory: $flightHistory\n      datePosted: $datePosted\n    ) {\n      from\n      pageSize\n      hasNextPage\n      totalItems\n      data {\n        id\n        name\n        accountType\n        accountTypeOther\n        photo\n        tagline\n        totalHours\n        yearsExperience\n        tags\n        isBoosted\n        city\n        state\n        country\n      }\n    }\n  }\n";var d=t(29046),u=t(49145),m=t(56505),v=t(5857),p=t(73454);function h(e){var l,t;let{user:r,searchState:h}=e,f=(0,d.Rp)(e=>e.actions),y=(0,v.useMemo)(()=>{var e,l,t,a,r,i,n,o,s,c,d,u;return{datePosted:null!==(n=null==h?void 0:null===(e=h.datePosted)||void 0===e?void 0:e.value)&&void 0!==n?n:"",search:null!==(o=null==h?void 0:h.search)&&void 0!==o?o:"",locations:null!==(s=null==h?void 0:null===(l=h.locations)||void 0===l?void 0:l.map(e=>e.value))&&void 0!==s?s:[],aircraftTypes:null!==(c=null==h?void 0:null===(t=h.aircraftTypes)||void 0===t?void 0:t.map(e=>e.label))&&void 0!==c?c:[],contractPositions:null==h?void 0:h.contractPositions,fullTimePositions:null==h?void 0:h.fullTimePositions,willingToRelocate:null==h?void 0:h.willingToRelocate,jobType:null==h?void 0:null===(a=h.jobType)||void 0===a?void 0:a.value,faaRegulations:null!==(d=null==h?void 0:null===(r=h.faaRegulations)||void 0===r?void 0:r.map(e=>e.value))&&void 0!==d?d:[],flightHistory:null!==(u=null==h?void 0:null===(i=h.flightHistory)||void 0===i?void 0:i.map(e=>e.value))&&void 0!==u?u:[]}},[h]),[{data:x,fetching:g,error:b,operation:j}]=(0,p.aM)({query:c,variables:{pageSize:u.vp,...y},requestPolicy:"network-only",context:(0,v.useMemo)(()=>(0,u.UI)(r),[r])});return(0,v.useEffect)(()=>{var e,l;null==f||f.setIsFetching(g),null==f||f.setSearchResultsCount(null!==(l=null==x?void 0:null===(e=x.employerCandidateSearch)||void 0===e?void 0:e.totalItems)&&void 0!==l?l:0)},[x,g,f]),(0,v.useEffect)(()=>{var e,l;(0,m.OF)({user_type:null==r?void 0:r.userType,search_query:y.search,search_result_count:null!==(l=null==x?void 0:null===(e=x.employerCandidateSearch)||void 0===e?void 0:e.totalItems)&&void 0!==l?l:0,search_filters:y})},[r,x,y]),b&&console.log(b),(0,a.jsxs)("div",{className:"flex w-full flex-col gap-4",children:[b&&!g&&(0,a.jsx)(i.EmptyMessage,{title:"Something went wrong",subtitle:"We are unable to load the page. Please try again later."}),!b&&!g&&(null==x?void 0:null===(l=x.employerCandidateSearch)||void 0===l?void 0:l.data)&&(null===(t=x.employerCandidateSearch)||void 0===t?void 0:t.data.length)===0&&(0,a.jsx)(i.EmptyMessage,{title:"No search results found",subtitle:"Try widening your search criteria"}),g?(0,a.jsx)(o.Button,{type:"button",hierarchy:"link",size:"lg",loading:!0,loadingClassName:"stroke-primary-700 w-6 h-6","aria-label":"Loading"}):x&&(0,a.jsx)(n.v_,{firstPage:null==x?void 0:x.employerCandidateSearch,dataKey:"employerCandidateSearch",pageSize:u.vp,query:c,extraVariables:y,options:null==j?void 0:j.context,searchParams:h,isSearchPage:!0,render:e=>(0,a.jsx)(s.UserCard,{user:e,searchCard:!0})})]})}var f=t(94403),y=t(22740),x=t(57702),g=t(47283);function b(e){var l;let{searchState:t}=e,r=(0,g.useRouter)(),i=(0,v.useCallback)(e=>{let l=(0,y.t5)({...t,...e});r.push(x.G.search(l))},[t,r]);return(0,a.jsxs)("div",{className:"flex w-full flex-wrap gap-2 lg:w-auto",children:[(null==t?void 0:t.search)&&(null==t?void 0:t.search.length)>0&&(0,a.jsx)(j,{item:null==t?void 0:t.search,onClick:()=>i({search:""})}),(0,a.jsx)(j,{item:null==t?void 0:t.contractPositions,onClick:()=>i({contractPositions:!1}),label:"Contract"}),(0,a.jsx)(j,{item:null==t?void 0:t.fullTimePositions,onClick:()=>i({fullTimePositions:!1}),label:"Full Time"}),(0,a.jsx)(j,{item:null==t?void 0:t.commutable,onClick:()=>i({commutable:!1}),label:"Commutable"}),(0,a.jsx)(j,{item:null==t?void 0:t.typeNotRequired,onClick:()=>i({typeNotRequired:!1}),label:"Type Not Required"}),(0,a.jsx)(j,{item:null==t?void 0:t.restricted,onClick:()=>i({restricted:!1}),label:"Restricted"}),(0,a.jsx)(j,{item:null==t?void 0:t.jobType,onClick:()=>i({jobType:void 0})}),(0,a.jsx)(j,{item:null==t?void 0:t.locations,onClick:e=>{var l;return i({locations:null==t?void 0:null===(l=t.locations)||void 0===l?void 0:l.filter(l=>l.value!==e)})}}),(0,a.jsx)(j,{item:null==t?void 0:t.aircraftTypes,onClick:e=>{var l;return i({aircraftTypes:null==t?void 0:null===(l=t.aircraftTypes)||void 0===l?void 0:l.filter(l=>l.value!==e)})}}),(0,a.jsx)(j,{item:null==t?void 0:t.willingToRelocate,onClick:()=>i({willingToRelocate:!1}),label:"Willing to Relocate"}),(0,a.jsx)(j,{item:null==t?void 0:t.salaryRange,onClick:()=>i({salaryRange:void 0})}),(0,a.jsx)(j,{item:null==t?void 0:t.faaRegulations,onClick:e=>{var l;return i({faaRegulations:null==t?void 0:null===(l=t.faaRegulations)||void 0===l?void 0:l.filter(l=>l.value!==e)})}}),(0,a.jsx)(j,{item:null==t?void 0:t.flightHistory,onClick:e=>{var l;return i({flightHistory:null==t?void 0:null===(l=t.flightHistory)||void 0===l?void 0:l.filter(l=>l.value!==e)})}}),(0,a.jsx)(j,{item:null==t?void 0:null===(l=t.category)||void 0===l?void 0:l.filter(e=>["Part 91","Part 135","Part 91/135","Part 121","Instructor"].includes(e.value)),onClick:e=>{var l;return i({category:null==t?void 0:null===(l=t.category)||void 0===l?void 0:l.filter(l=>l.value!==e)})}}),(0,a.jsx)(j,{item:null==t?void 0:t.datePosted,onClick:()=>i({datePosted:null})})]})}function j(e){let{label:l,item:t,onClick:r}=e;if(null==t||!1===t)return null;if("string"==typeof t)return(0,a.jsx)("button",{type:"button",onClick:()=>r(),children:(0,a.jsx)(f.C,{variant:"blue",size:"lg",closable:!0,children:t})});if("boolean"==typeof t)return(0,a.jsx)("button",{type:"button",onClick:()=>r(),children:(0,a.jsx)(f.C,{variant:"blue",size:"lg",closable:!0,children:l})});if("object"==typeof t){if(Array.isArray(t))return(0,a.jsx)(a.Fragment,{children:t.map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>r(e.value),children:(0,a.jsx)(f.C,{variant:"blue",size:"lg",closable:!0,children:e.label})},e.value))});if("min"in t){let e=[t.min?(0,y.xG)(t.min):void 0,t.max?(0,y.xG)(t.max):void 0].filter(y.vJ).join(" - ");return(0,a.jsx)("button",{type:"button",onClick:()=>r(),children:(0,a.jsx)(f.C,{variant:"blue",size:"lg",closable:!0,children:e})})}return(0,a.jsx)("button",{type:"button",onClick:()=>r(),children:(0,a.jsx)(f.C,{variant:"blue",size:"lg",closable:!0,children:t.label})})}return null}var N=t(8179),R=t(15234),_=t(17542),w=t(17973),T=t(83301),P=t(33644),C=t(51075);let k=v.forwardRef((e,l)=>{let{className:t,...r}=e,i=r.value||r.defaultValue;return(0,a.jsxs)(C.fC,{ref:l,className:(0,P.cn)("relative flex w-full touch-none select-none items-center",t),...r,children:[(0,a.jsx)(C.fQ,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-gray-200",children:(0,a.jsx)(C.e6,{className:"absolute h-full bg-primary-600"})}),null==i?void 0:i.map((e,l)=>(0,a.jsx)(C.bU,{"data-value":(0,y.xG)(e),className:(0,P.cn)("block h-6 w-6 cursor-pointer rounded-full border-2 border-primary-600 bg-white ring-offset-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-100 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50","after:body-xs after:absolute after:-top-10 after:left-1/2 after:flex after:h-8 after:-translate-x-1/2 after:items-center after:justify-center after:rounded-md after:border after:border-gray-200 after:bg-white after:px-4 after:font-semibold after:text-gray-700 after:shadow-lg after:content-[attr(data-value)]")},l))]})});k.displayName=C.fC.displayName;var S=t(89309),M=t(774),I=t(42518),A=t(9796),E=t(9016),F=t(59042);function $(e){var l;let{account:t,form:r,isEmployer:i,isAdmin:n,onSubmit:s}=e,[c]=(0,E.aM)({query:I.w}),d=(0,S.w)(null===(l=c.data)||void 0===l?void 0:l.aircrafts),m=(0,M.d)(),p=r.watch("jobType"),h=(0,v.useCallback)((e,l)=>{let t=[u.LL.CITY,u.LL.COUNTRY,u.LL.REGION,u.LL.SUB_REGION,u.LL.NEIGHBORHOOD];fetch("/api/address?query=".concat(e,"&category=").concat(t.join(","))).then(e=>e.json()).then(e=>{var t;l(null!==(t=e.map(e=>({label:e.name,value:e.name})))&&void 0!==t?t:[])}).catch(e=>{console.error(e)})},[]);return(0,a.jsx)(R.l0,{...r,children:(0,a.jsxs)("form",{id:"filter-form",onSubmit:r.handleSubmit(s),className:"flex flex-col gap-4 px-4 pb-4 max-md:overflow-auto lg:px-0 lg:pb-0",tabIndex:-1,children:[n&&(0,a.jsx)("div",{className:(0,P.cn)("flex items-center justify-between gap-4",{"border-b border-b-gray-200 pb-4":!i}),children:(0,a.jsx)(R.Wi,{control:r.control,name:"restricted",render:e=>{let{field:l}=e;return(0,a.jsx)(R.xJ,{children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(R.NI,{children:(0,a.jsx)(N.X,{checked:l.value,onCheckedChange:l.onChange})}),(0,a.jsx)(R.lX,{className:"body-sm font-medium text-gray-700 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Restricted"})]})})}})}),(0,a.jsxs)("div",{className:(0,P.cn)("flex items-center justify-between gap-4",{"border-b border-b-gray-200 pb-4":!i}),children:[(0,a.jsx)(R.Wi,{control:r.control,name:"contractPositions",render:e=>{let{field:l}=e;return(0,a.jsx)(R.xJ,{children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(R.NI,{children:(0,a.jsx)(N.X,{checked:l.value,onCheckedChange:l.onChange})}),(0,a.jsx)(R.lX,{className:"body-sm font-medium text-gray-700 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Contract"})]})})}}),(0,a.jsx)(R.Wi,{control:r.control,name:"fullTimePositions",render:e=>{let{field:l}=e;return(0,a.jsx)(R.xJ,{children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(R.NI,{children:(0,a.jsx)(N.X,{checked:l.value,onCheckedChange:l.onChange})}),(0,a.jsx)(R.lX,{className:"body-sm font-medium text-gray-700 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Full Time"})]})})}})]}),i?(0,a.jsx)(R.Wi,{control:r.control,name:"willingToRelocate",render:e=>{let{field:l}=e;return(0,a.jsx)(R.xJ,{children:(0,a.jsxs)("div",{className:"flex items-center space-x-2 border-b border-b-gray-200 pb-4",children:[(0,a.jsx)(R.NI,{children:(0,a.jsx)(N.X,{checked:l.value,onCheckedChange:l.onChange})}),(0,a.jsx)(R.lX,{className:"body-sm font-medium text-gray-700 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Willing to Relocate"})]})})}}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(R.Wi,{control:r.control,name:"commutable",render:e=>{let{field:l}=e;return(0,a.jsx)(R.xJ,{children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(R.NI,{children:(0,a.jsx)(N.X,{checked:l.value,onCheckedChange:l.onChange})}),(0,a.jsx)(R.lX,{className:"body-sm font-medium text-gray-700 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Commutable"})]})})}}),(0,a.jsx)(R.Wi,{control:r.control,name:"typeNotRequired",render:e=>{let{field:l}=e;return(0,a.jsx)(R.xJ,{children:(0,a.jsxs)("div",{className:(0,P.cn)("flex items-center space-x-2",{"border-b border-b-gray-200 pb-4":!i}),children:[(0,a.jsx)(R.NI,{children:(0,a.jsx)(N.X,{checked:l.value,onCheckedChange:l.onChange})}),(0,a.jsx)(R.lX,{className:"body-sm font-medium text-gray-700 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Type Not Required"})]})})}})]}),(0,a.jsx)(R.Wi,{control:r.control,name:"jobType",render:e=>{let{field:l}=e;return(0,a.jsx)(R.xJ,{children:(0,a.jsx)(R.NI,{children:(0,a.jsx)(T.P,{...l,dataTestid:A.N.SEARCH_FILTER.FILTER_INPUT_JOB_TYPE,placeholder:"Job Type",options:u.re})})})}}),(0,a.jsx)(R.Wi,{control:r.control,name:"aircraftTypes",render:e=>{let{field:l}=e;return(0,a.jsx)(R.xJ,{children:(0,a.jsx)(R.NI,{children:(0,a.jsx)(w.F,{...l,"aria-labelledby":"aircraftTypes-label",name:"aircraftTypes",options:d,placeholder:"Aircraft Type",isLoading:c.fetching,collapseMultiValues:!0,hideSelectedOptions:!1,dataTestid:A.N.SEARCH_FILTER.FILTER_INPUT_AIRCRAFT_TYPE})})})}}),(0,a.jsx)(R.Wi,{control:r.control,name:"locations",render:e=>{let{field:l}=e;return(0,a.jsx)(R.xJ,{children:(0,a.jsx)(R.NI,{children:(0,a.jsx)(T.P,{...l,"aria-labelledby":"locations-label",name:"locations",placeholder:"Location",hideSelectedCheck:!0,isAsync:!0,isMulti:!0,collapseMultiValues:!0,noOptionsMessage:e=>e.inputValue.length>0?"No locations found":"Type to search locations",loadOptions:h,dataTestid:A.N.SEARCH_BAR_LOCATIONS_INPUT})})})}}),!i&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(R.Wi,{control:r.control,name:"salaryRange",render:e=>{var l,t,r,i;let{field:n}=e;return(0,a.jsx)(R.xJ,{children:(0,a.jsx)(R.NI,{children:(0,a.jsxs)(_.J2,{children:[(0,a.jsx)(_.xo,{asChild:!0,children:(0,a.jsxs)(o.Button,{size:"lg",hierarchy:"secondary-gray",className:(0,P.cn)("group flex h-11 w-full justify-between pr-2 font-normal shadow-sm",n.value?"text-gray-900":"text-gray-500"),children:[n.value?"".concat((0,y.xG)(n.value.min)," - ").concat((0,y.xG)(n.value.max)):"Salary Range",(0,a.jsx)(F._M,{className:"stroke-gray-500 group-aria-[expanded=true]:hidden",size:"20px"}),(0,a.jsx)(F.Kh,{className:"stroke-gray-500 group-aria-[expanded=false]:hidden",size:"20px"})]})}),(0,a.jsx)(_.yk,{className:"flex h-28 w-[360px] max-w-[100vw] items-end px-6 py-8",children:(0,a.jsx)(k,{value:[null!==(r=null===(l=n.value)||void 0===l?void 0:l.min)&&void 0!==r?r:1,null!==(i=null===(t=n.value)||void 0===t?void 0:t.max)&&void 0!==i?i:1e6],max:1e6,step:100,onValueChange:e=>{n.onChange({min:e[0],max:e[1]})}})})]})})})}})}),i?(0,a.jsx)(R.Wi,{control:r.control,name:"faaRegulations",render:e=>{let{field:l}=e;return(0,a.jsx)(R.xJ,{children:(0,a.jsx)(R.NI,{children:(0,a.jsx)(T.P,{...l,dataTestid:A.N.SEARCH_FILTER.FILTER_INPUT_FAA_REGULATIONS,placeholder:"FAA Regulations",menuPlacement:m?"top":"bottom",isMulti:!0,isDisabled:(null==p?void 0:p.value)==="FlightAttendant"||(null==p?void 0:p.value)==="Other",options:[{value:"Part 91",label:"Part 91"},{value:"Part 135",label:"Part 135"}]})})})}}):(0,a.jsx)(R.Wi,{control:r.control,name:"category",render:e=>{let{field:l}=e;return(0,a.jsx)(R.xJ,{children:(0,a.jsx)(R.NI,{children:(0,a.jsx)(T.P,{...l,dataTestid:A.N.SEARCH_FILTER.FILTER_INPUT_CATEGORY,placeholder:"Job Category",menuPlacement:m?"top":"bottom",isMulti:!0,isDisabled:(null==p?void 0:p.value)==="FlightAttendant"||(null==p?void 0:p.value)==="Other",options:[{value:"Part 91",label:"Part 91"},{value:"Part 135",label:"Part 135"},{value:"Part 91/135",label:"Part 91/135"},{value:"Part 121",label:"Part 121"},{value:"Instructor",label:"Instructor"}]})})})}}),i&&(0,a.jsx)(R.Wi,{control:r.control,name:"flightHistory",render:e=>{let{field:l}=e;return(0,a.jsx)(R.xJ,{children:(0,a.jsx)(R.NI,{children:(0,a.jsx)(T.P,{...l,dataTestid:A.N.SEARCH_FILTER.FILTER_INPUT_FLIGHT_HISTORY,placeholder:"Flight History",menuPlacement:m?"top":"bottom",isMulti:!0,isDisabled:(null==p?void 0:p.value)==="FlightAttendant"||(null==p?void 0:p.value)==="Other",options:[{value:"Corporate",label:"Corporate"},{value:"Retired/ing Airline",label:"Retired/ing Airline"},{value:"GovernmentMilitary",label:"Military Experience"}]})})})}}),!i&&(0,a.jsx)(R.Wi,{control:r.control,name:"datePosted",render:e=>{let{field:l}=e;return(0,a.jsx)(R.xJ,{children:(0,a.jsx)(R.NI,{children:(0,a.jsx)(T.P,{...l,dataTestid:A.N.SEARCH_FILTER.FILTER_INPUT_DATE_POSTED,placeholder:"Date Posted",menuPlacement:m?"top":"bottom",options:[{value:"Past 24 hours",label:"Past 24 hours"},{value:"Past week",label:"Past week"},{value:"Past month",label:"Past month"},{value:"Any Time",label:"Any Time"}]})})})}})]})})}var L=t(48911);let O="\n  query SearchJobs(\n    $search: String!, \n    $from: Int!, \n    $pageSize: Int!, \n    $userId: String, \n    $restricted: Boolean,\n    $contractPositions: Boolean,\n    $fullTimePositions: Boolean,\n    $commutable: Boolean,\n    $typeNotRequired: Boolean,\n    $jobType: String,\n    $aircraftTypes: [String], \n    $locations: [String], \n    $willingToRelocate: Boolean,\n    $salaryRangeMin: Int,\n    $salaryRangeMax: Int,\n    $faaRegulations: [String],\n    $flightHistory: [String],\n    $category: [String],\n    $datePosted: String\n  ) {\n    jobSearch(\n      search: $search, \n      from: $from, \n      pageSize: $pageSize, \n      userId: $userId, \n      restricted: $restricted,\n      contractPositions: $contractPositions,\n      fullTimePositions: $fullTimePositions,\n      commutable: $commutable,\n      typeNotRequired: $typeNotRequired,\n      jobType: $jobType,\n      aircraftTypes: $aircraftTypes, \n      locations: $locations, \n      willingToRelocate: $willingToRelocate,\n      salaryRangeMin: $salaryRangeMin,\n      salaryRangeMax: $salaryRangeMax,\n      faaRegulations: $faaRegulations,\n      flightHistory: $flightHistory\n      category: $category,\n      datePosted: $datePosted\n    ) {\n      from\n      pageSize\n      hasNextPage\n      totalItems\n      data {\n        isSponsored\n        isFavorited\n        id\n        title\n        description\n        company {\n          logo\n          name\n        }\n        location {\n          code\n          name\n        }\n        aircraftTypes {\n          id\n          model\n        }\n        salary\n        positionType\n        jobType\n        datePosted\n        positionHighlights\n        accountName\n        closedAt\n        publishDate\n        isConfidential\n        flagged\n      }\n    }\n  }\n";function z(e){let{user:l,searchState:t}=e,r=(0,d.Rp)(e=>e.actions),s=(0,v.useMemo)(()=>{var e,a,r,i,n,o,s,c,d,u,m,v,p,h,f,y,x,g;return{userId:null==l?void 0:l.id,datePosted:null!==(m=null==t?void 0:null===(e=t.datePosted)||void 0===e?void 0:e.value)&&void 0!==m?m:"",search:null!==(v=null==t?void 0:t.search)&&void 0!==v?v:"",locations:null!==(p=null==t?void 0:null===(a=t.locations)||void 0===a?void 0:a.map(e=>e.value))&&void 0!==p?p:[],aircraftTypes:null!==(h=null==t?void 0:null===(r=t.aircraftTypes)||void 0===r?void 0:r.map(e=>e.label))&&void 0!==h?h:[],restricted:null==t?void 0:t.restricted,contractPositions:null==t?void 0:t.contractPositions,fullTimePositions:null==t?void 0:t.fullTimePositions,commutable:null==t?void 0:t.commutable,typeNotRequired:null==t?void 0:t.typeNotRequired,willingToRelocate:null==t?void 0:t.willingToRelocate,jobType:null==t?void 0:null===(i=t.jobType)||void 0===i?void 0:i.value,salaryRangeMin:null==t?void 0:null===(n=t.salaryRange)||void 0===n?void 0:n.min,salaryRangeMax:null==t?void 0:null===(o=t.salaryRange)||void 0===o?void 0:o.max,faaRegulations:null!==(f=null==t?void 0:null===(s=t.faaRegulations)||void 0===s?void 0:s.map(e=>e.value))&&void 0!==f?f:[],flightHistory:null!==(y=null==t?void 0:null===(c=t.flightHistory)||void 0===c?void 0:c.map(e=>e.value))&&void 0!==y?y:[],category:[...null!==(x=null==t?void 0:null===(d=t.category)||void 0===d?void 0:d.map(e=>e.value))&&void 0!==x?x:[],...null!==(g=null==t?void 0:null===(u=t.categoryHidden)||void 0===u?void 0:u.map(e=>e.value))&&void 0!==g?g:[]]}},[t,l]),[{data:c,fetching:h,error:f}]=(0,p.aM)({query:O,variables:{from:0,pageSize:u.vp,...s},requestPolicy:"network-only",context:u.zW});return(0,v.useEffect)(()=>{var e,l;null==r||r.setIsFetching(h),null==r||r.setSearchResultsCount(null!==(l=null==c?void 0:null===(e=c.jobSearch)||void 0===e?void 0:e.totalItems)&&void 0!==l?l:0)},[c,h,r]),(0,v.useEffect)(()=>{var e,t;(0,m.Qr)({user_type:null==l?void 0:l.userType,search_query:s.search,search_result_count:null!==(t=null==c?void 0:null===(e=c.jobSearch)||void 0===e?void 0:e.totalItems)&&void 0!==t?t:0,search_filters:s})},[l,c,s]),f&&console.log(f),(0,a.jsxs)("div",{className:"flex w-full flex-col gap-4",children:[f&&!h&&(0,a.jsx)(i.EmptyMessage,{title:"Something went wrong",subtitle:"We are unable to load the page. Please try again later."}),!f&&!h&&c&&c.jobSearch&&0===c.jobSearch.data.length&&(0,a.jsx)(i.EmptyMessage,{title:"No search results found",subtitle:"Try widening your search criteria"}),h?(0,a.jsx)(o.Button,{type:"button",hierarchy:"link",size:"lg",loading:!0,loadingClassName:"stroke-primary-700 w-6 h-6","aria-label":"Loading"}):c&&(0,a.jsx)(n.v_,{firstPage:c.jobSearch,dataKey:"jobSearch",pageSize:u.vp,query:O,extraVariables:s,options:u.zW,searchParams:t,isSearchPage:!0,render:e=>(0,a.jsx)(L.JobPostCardWrapper,{user:l,jobPost:e})})]})}var H=t(99901);let q=H.Ry({restricted:H.O7().optional(),contractPositions:H.O7().optional(),fullTimePositions:H.O7().optional(),commutable:H.O7().optional(),typeNotRequired:H.O7().optional(),jobType:H.Ry({value:H.Z_(),label:H.Z_()}).optional().nullable(),aircraftTypes:H.IX(H.Ry({value:H.Z_(),label:H.Z_()})).optional(),locations:H.IX(H.Ry({value:H.Z_(),label:H.Z_()})).optional(),willingToRelocate:H.O7().optional(),salaryRange:H.Ry({min:H.Rx(),max:H.Rx()}).optional().nullable(),faaRegulations:H.IX(H.Ry({value:H.Z_(),label:H.Z_()})).optional(),category:H.IX(H.Ry({value:H.Z_(),label:H.Z_()})).optional(),flightHistory:H.IX(H.Ry({value:H.Z_(),label:H.Z_()})).optional(),datePosted:H.Ry({value:H.Z_(),label:H.Z_()}).optional().nullable()});function G(e){let{url:l,children:t}=e;return(0,a.jsx)("div",{onClick:()=>{window.open(l,"_blank")},className:"cursor-pointer",children:t})}function U(e){let{url:l}=e;return(0,a.jsx)("img",{src:l,alt:"Advertisement",width:"1",height:"1",style:{display:"none"}})}function B(e){let{html:l,width:t,height:r}=e,i=(0,v.useMemo)(()=>{let e=new Blob([l],{type:"text/html"});return URL.createObjectURL(e)},[l]);return(0,a.jsxs)("div",{className:"flex flex-col text-center",children:[(0,a.jsx)("span",{className:"body-sm text-gray-300",children:"SPONSORED"}),(0,a.jsx)("div",{className:"flex justify-center",children:(0,a.jsx)("iframe",{id:"dcmi-frame",title:"Ad",src:i,width:t,height:r,frameBorder:"0",scrolling:"no",sandbox:"allow-scripts allow-same-origin allow-popups"})})]})}function D(e){let{html:l,impressionUrl:t,clickTrackerUrl:r,width:i,height:n}=e;return(0,a.jsxs)(G,{url:r,children:[(0,a.jsx)(U,{url:t}),(0,a.jsx)(B,{html:l,width:i,height:n})]})}var J=t(30296),W=t(39395),Z=t(59155),V=t(5027),X=t(78949),Y=t(4203),K=t(19713);function Q(e){let{advertisement:l,isMobile:t}=e;if(!l)return null;let r=l.impressionUrl&&l.clickTrackerUrl;return t?l.widthMobile&&l.heightMobile&&l.siteServedMobileHtml?(0,a.jsx)("div",{className:"mt-8 flex justify-center",children:r?(0,a.jsx)(D,{html:l.siteServedMobileHtml,impressionUrl:l.impressionUrl,clickTrackerUrl:l.clickTrackerUrl,width:l.widthMobile,height:l.heightMobile}):(0,a.jsx)(B,{html:l.siteServedMobileHtml,width:l.widthMobile,height:l.heightMobile})}):null:l.widthDesktop&&l.heightDesktop&&l.siteServedDesktopHtml?(0,a.jsx)("div",{className:"mb-8 flex justify-center",children:r?(0,a.jsx)(D,{html:l.siteServedDesktopHtml,impressionUrl:l.impressionUrl,clickTrackerUrl:l.clickTrackerUrl,width:l.widthDesktop,height:l.heightDesktop}):(0,a.jsx)(B,{html:l.siteServedDesktopHtml,width:l.widthDesktop,height:l.heightDesktop})}):null}function ee(e){var l;let{user:t,account:i,searchParams:n,advertisement:s}=e,c=(0,g.useRouter)(),u=(0,d.Rp)(e=>e),[m,p]=(0,v.useState)(!1),[f,j]=(0,v.useState)(!1),{toast:N}=(0,V.pm)(),R=(0,M.d)(),[_,w]=(0,v.useState)(null),[T,P]=(0,v.useTransition)(),[C,k]=(0,v.useTransition)(),S=t&&(0,y.GJ)(t),I=(0,v.useMemo)(()=>{var e;return null!==(e=t&&((0,y.ak)(t)||(0,y.UN)(t)))&&void 0!==e&&e},[t]),[A,E]=(0,v.useState)(!1);(0,v.useEffect)(()=>(E(!0),()=>{E(!1)}),[]);let L=(0,v.useMemo)(()=>(0,y.Fn)({page:null==n?void 0:n.page,search:null==n?void 0:n.search,locations:null==n?void 0:n.locations,aircraftTypes:null==n?void 0:n.aircraftTypes,restricted:null==n?void 0:n.restricted,contractPositions:null==n?void 0:n.contractPositions,fullTimePositions:null==n?void 0:n.fullTimePositions,commutable:null==n?void 0:n.commutable,typeNotRequired:null==n?void 0:n.typeNotRequired,jobType:null==n?void 0:n.jobType,willingToRelocate:null==n?void 0:n.willingToRelocate,salaryRangeMin:null==n?void 0:n["salaryRange-min"],salaryRangeMax:null==n?void 0:n["salaryRange-max"],faaRegulations:null==n?void 0:n.faaRegulations,flightHistory:null==n?void 0:n.flightHistory,category:null==n?void 0:n.category,datePosted:null==n?void 0:n.datePosted}),[n]);(0,v.useEffect)(()=>{P(()=>{var e,l,t,a,i,n,o,s,c,d,u,m,v,p,h;(0,r.C9)(null!==(d=null==L?void 0:L.search)&&void 0!==d?d:"",null!==(u=null==L?void 0:null===(e=L.locations)||void 0===e?void 0:e.map(e=>e.value))&&void 0!==u?u:[],null!==(m=null==L?void 0:null===(l=L.aircraftTypes)||void 0===l?void 0:l.map(e=>e.value))&&void 0!==m?m:[],null==L?void 0:L.contractPositions,null==L?void 0:L.fullTimePositions,null==L?void 0:L.commutable,null==L?void 0:L.typeNotRequired,null==L?void 0:null===(t=L.jobType)||void 0===t?void 0:t.value,null==L?void 0:L.willingToRelocate,null==L?void 0:null===(a=L.salaryRange)||void 0===a?void 0:a.min,null==L?void 0:null===(i=L.salaryRange)||void 0===i?void 0:i.max,null!==(v=null==L?void 0:null===(n=L.faaRegulations)||void 0===n?void 0:n.map(e=>e.value))&&void 0!==v?v:[],null!==(p=null==L?void 0:null===(o=L.flightHistory)||void 0===o?void 0:o.map(e=>e.value))&&void 0!==p?p:[],null!==(h=null==L?void 0:null===(s=L.category)||void 0===s?void 0:s.map(e=>e.value))&&void 0!==h?h:[],null==L?void 0:null===(c=L.datePosted)||void 0===c?void 0:c.value).then(e=>{var l;w(null!==(l=null==e?void 0:e.id)&&void 0!==l?l:null),j(!!e)})})},[L]);let O=(0,Y.cI)({resolver:(0,X.F)(q),defaultValues:{restricted:!1,contractPositions:!1,fullTimePositions:!1,commutable:!1,typeNotRequired:!1}});(0,v.useEffect)(()=>{var e,l,t,a,r,i,n,o,s,c,d;O.reset({restricted:null!==(e=null==L?void 0:L.restricted)&&void 0!==e&&e,contractPositions:null!==(l=null==L?void 0:L.contractPositions)&&void 0!==l&&l,fullTimePositions:null!==(t=null==L?void 0:L.fullTimePositions)&&void 0!==t&&t,commutable:null!==(a=null==L?void 0:L.commutable)&&void 0!==a&&a,typeNotRequired:null!==(r=null==L?void 0:L.typeNotRequired)&&void 0!==r&&r,jobType:null!==(i=null==L?void 0:L.jobType)&&void 0!==i?i:null,aircraftTypes:null!==(n=null==L?void 0:L.aircraftTypes)&&void 0!==n?n:[],locations:null!==(o=null==L?void 0:L.locations)&&void 0!==o?o:[],willingToRelocate:null!==(s=null==L?void 0:L.willingToRelocate)&&void 0!==s&&s,salaryRange:null==L?void 0:L.salaryRange,faaRegulations:null!==(c=null==L?void 0:L.faaRegulations)&&void 0!==c?c:[],flightHistory:null!==(d=null==L?void 0:L.flightHistory)&&void 0!==d?d:[],category:null==L?void 0:L.category,datePosted:null==L?void 0:L.datePosted})},[L,O]);let H=(0,v.useCallback)(e=>{var l,t,a;p(!1);let r=(0,y.t5)({search:null!==(l=null==L?void 0:L.search)&&void 0!==l?l:"",restricted:e.restricted,contractPositions:e.contractPositions,fullTimePositions:e.fullTimePositions,commutable:e.commutable,typeNotRequired:e.typeNotRequired,jobType:e.jobType,aircraftTypes:null!==(t=e.aircraftTypes)&&void 0!==t?t:[],locations:null!==(a=e.locations)&&void 0!==a?a:[],willingToRelocate:e.willingToRelocate,salaryRange:e.salaryRange,faaRegulations:e.faaRegulations,flightHistory:e.flightHistory,category:e.category,categoryHidden:[],datePosted:e.datePosted});c.push(x.G.search(r))},[L,c]),G=(0,v.useCallback)(()=>{var e;p(!1);let l=(0,y.t5)({search:null!==(e=null==L?void 0:L.search)&&void 0!==e?e:"",restricted:!1,contractPositions:!1,fullTimePositions:!1,commutable:!1,typeNotRequired:!1,jobType:null,aircraftTypes:[],locations:[],willingToRelocate:!1,salaryRange:null,faaRegulations:[],flightHistory:[],category:[],categoryHidden:[],datePosted:null});c.push(x.G.search(l))},[L,c]),U=(0,v.useCallback)(e=>{e?k(async()=>{var e,l,t,i,n,s,d,u,m,v,p,h,f,y,g;let b=await (0,r.Vv)(null!==(v=null==L?void 0:L.search)&&void 0!==v?v:"",null!==(p=null==L?void 0:null===(e=L.locations)||void 0===e?void 0:e.map(e=>e.value))&&void 0!==p?p:[],null!==(h=null==L?void 0:null===(l=L.aircraftTypes)||void 0===l?void 0:l.map(e=>e.value))&&void 0!==h?h:[],null==L?void 0:L.contractPositions,null==L?void 0:L.fullTimePositions,null==L?void 0:L.commutable,null==L?void 0:L.typeNotRequired,null==L?void 0:null===(t=L.jobType)||void 0===t?void 0:t.value,null==L?void 0:L.willingToRelocate,null==L?void 0:null===(i=L.salaryRange)||void 0===i?void 0:i.min,null==L?void 0:null===(n=L.salaryRange)||void 0===n?void 0:n.max,null!==(f=null==L?void 0:null===(s=L.faaRegulations)||void 0===s?void 0:s.map(e=>e.value))&&void 0!==f?f:[],null!==(y=null==L?void 0:null===(d=L.flightHistory)||void 0===d?void 0:d.map(e=>e.value))&&void 0!==y?y:[],null!==(g=null==L?void 0:null===(u=L.category)||void 0===u?void 0:u.map(e=>e.value))&&void 0!==g?g:[],null==L?void 0:null===(m=L.datePosted)||void 0===m?void 0:m.value);b?(w(b.id),j(!0),N({title:I?"Your alert was created!":"Your job alert was created!",icon:"success",action:(0,a.jsx)(o.Button,{type:"button",size:"sm",hierarchy:"link",className:"whitespace-nowrap",onClick:()=>{c.push(x.G.settingsAlerts())},children:"Manage alerts"})})):N({title:"Error creating alert",icon:"error"})}):_&&k(()=>{(0,r.M9)(_),j(!1),N({title:I?"Your alert was deleted!":"Your job alert was deleted!",icon:"success"})})},[L,N,c,_,I]);return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex flex-col items-start gap-5 border-b border-b-gray-200 pb-5",children:[(0,a.jsx)(o.Button,{hierarchy:"link",size:"lg",leftIcon:(0,a.jsx)(F.ArrowNarrowLeft,{size:"20px",className:"stroke-primary-700"}),className:"text-primary-700",onClick:()=>c.back(),children:"Back"}),L&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h1",{className:"body-lg font-semibold text-gray-600",children:!u||(null==u?void 0:u.isFetching)?"Searching...":"Search Results: ".concat(null!==(l=null==u?void 0:u.searchResultsCount)&&void 0!==l?l:"-")}),(0,a.jsxs)("div",{className:"flex w-full flex-col items-center justify-between gap-8 lg:flex-row",children:[(0,a.jsx)(b,{searchState:L}),(0,a.jsxs)("div",{className:"flex w-full items-center justify-between lg:w-auto",children:[t&&!S&&(0,a.jsxs)("div",{className:"flex flex-shrink-0 items-center space-x-2",children:[(0,a.jsx)(J._,{className:"text-gray-700",htmlFor:"set-alert",children:"Set Alert"}),(0,a.jsx)(Z.r,{id:"set-alert","aria-label":"Set Alert",disabled:T||C,checked:f,onCheckedChange:U}),(0,a.jsx)(J._,{className:"text-gray-700",htmlFor:"set-alert",children:f?"On":"Off"})]}),(0,a.jsxs)(W.yo,{open:m,onOpenChange:p,children:[(0,a.jsx)(W.aM,{asChild:!0,children:(0,a.jsx)(o.Button,{hierarchy:"secondary-gray",leftIcon:(0,a.jsx)(K.FilterLines,{className:"stroke-gray-700",size:"20px"}),className:"lg:hidden",children:"All Filters"})}),(0,a.jsxs)(W.ue,{side:"right",className:"max-w-[352px]",children:[(0,a.jsxs)("div",{className:"mb-6 flex gap-4 border-b border-b-gray-200 px-4 pb-2 pt-6",children:[(0,a.jsx)("div",{className:"flex h-[60px] w-[60px] items-center justify-center rounded-full border-8 border-primary-50 bg-primary-100 p-3",children:(0,a.jsx)(K.FilterLines,{size:"20px",className:"stroke-primary-600"})}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"body-lg font-semibold text-gray-900",children:"Filter By"}),(0,a.jsx)("span",{className:"body-sm text-gray-600",children:"Apply filters to help with your search."})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4 overflow-hidden",children:[(0,a.jsxs)("div",{className:"mx-4 flex justify-between border-b border-b-gray-200 pb-6",children:[(0,a.jsx)(o.Button,{onClick:G,hierarchy:"secondary-gray",children:"Clear all Filters"}),(0,a.jsx)(o.Button,{type:"submit",form:"filter-form",children:"Apply Filters"})]}),(0,a.jsx)($,{account:i,isEmployer:I,isAdmin:S,form:O,onSubmit:H})]})]})]})]})]})]})]}),A&&R&&(0,a.jsx)(Q,{advertisement:s,isMobile:R}),L&&(0,a.jsxs)("div",{className:"mt-4 flex flex-row items-start gap-16",children:[(0,a.jsxs)("div",{className:"sticky top-[92px] hidden w-full max-w-[240px] flex-col gap-4 lg:flex",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 border-b border-b-gray-200 pb-4",children:[(0,a.jsx)(K.FilterLines,{className:"stroke-gray-400",size:"20px"}),(0,a.jsx)("span",{className:"body-md text-gray-600",children:"Filter By"})]}),(0,a.jsx)($,{account:i,isEmployer:I,isAdmin:S,form:O,onSubmit:H}),(0,a.jsx)(o.Button,{type:"button",hierarchy:"secondary-color",onClick:G,children:"Clear All"}),(0,a.jsx)(o.Button,{type:"submit",form:"filter-form",children:"Apply Filters"})]}),(0,a.jsxs)("div",{className:"w-full",children:[A&&!R&&(0,a.jsx)(Q,{advertisement:s,isMobile:R}),I?(0,a.jsx)(h,{user:t,searchState:L}):(0,a.jsx)(z,{user:t,searchState:L})]})]})]})}},15827:function(e,l,t){"use strict";t.d(l,{EmptyMessage:function(){return i}});var a=t(79307),r=t(19713);function i(e){let{title:l,subtitle:t,icon:i,children:n}=e;return(0,a.jsx)("div",{className:"flex w-full flex-col items-center justify-center px-8 pb-12 pt-10",children:(0,a.jsxs)("div",{className:"flex flex-col items-center justify-start gap-4",children:[(0,a.jsx)("div",{className:"flex items-center justify-center rounded-full border-8 border-primary-50 bg-primary-100 p-3",children:null!=i?i:(0,a.jsx)(r.SearchLG,{size:"24px",className:"stroke-primary-600"})}),(0,a.jsxs)("div",{className:"flex max-w-sm flex-col items-center justify-start gap-1",children:[(0,a.jsx)("div",{className:"body-md text-center font-semibold text-gray-900",children:l}),t&&(0,a.jsx)("div",{className:"body-sm text-center text-gray-600",children:t})]}),n]})})}},3270:function(e,l,t){"use strict";t.d(l,{v_:function(){return m}});var a=t(79307),r=t(46332),i=t(9796),n=t(22740),o=t(57702),s=t(9016),c=t(47283),d=t(5857),u=t(59042);function m(e){let{firstPage:l,pageSize:t,query:r,dataKey:i,extraVariables:s,options:u,searchParams:m,isSearchPage:h,render:f}=e,y=(0,c.useRouter)(),[x,g]=(0,d.useState)(()=>{if(h){let e=(null==m?void 0:m.page)&&m.page.length>0?parseInt(m.page):0;if(e&&e>0)return Array(e).fill(0).map((e,l)=>({from:(l+1)*t,pageSize:t}))}return[]}),b=(0,d.useCallback)(e=>{if(h){let l=m?{...m,page:e.toString()}:{page:e.toString()},t=(0,n.t5)(l);y.replace(o.G.search(t),{scroll:!1})}g(l=>[...l,{from:e*t,pageSize:t}])},[t,m,h,y]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p,{data:l,isLastPage:0===x.length&&(null==l?void 0:l.hasNextPage),onLoadMore:b,render:f,page:0}),x.map((e,l)=>(0,a.jsx)(v,{variables:{...e,...null!=s?s:{}},isLastPage:l===x.length-1,onLoadMore:b,render:f,page:l+1,query:r,dataKey:i,options:u},"page-".concat(e.from)))]})}function v(e){let{variables:l,isLastPage:t,query:i,dataKey:n,options:o,page:c,render:d,onLoadMore:u}=e,[{data:m,fetching:v}]=(0,s.aM)({query:i,variables:l,context:o}),h=null==m?void 0:m[n];return(0,a.jsxs)(a.Fragment,{children:[v&&(0,a.jsx)(r.Button,{type:"button",hierarchy:"link",size:"lg",loading:!0,loadingClassName:"stroke-primary-700 w-6 h-6","aria-label":"Loading"}),h&&(0,a.jsx)(p,{page:c,data:h,isLastPage:t,onLoadMore:u,render:d})]})}function p(e){var l;let{data:t,isLastPage:n,page:o,render:s,onLoadMore:c}=e;return(0,a.jsxs)(a.Fragment,{children:[null==t?void 0:null===(l=t.data)||void 0===l?void 0:l.map((e,l)=>(0,a.jsx)(d.Fragment,{children:s(e)},l)),n&&t.hasNextPage&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(r.Button,{type:"button",hierarchy:"link",size:"lg",onClick:()=>c(o+1),rightIcon:(0,a.jsx)(u._M,{size:"20px",className:"stroke-primary-700"}),"data-test-id":i.N.SHOW_MORE_BUTTON,children:"Show More"})})]})}},66404:function(e,l,t){"use strict";t.d(l,{o:function(){return c}});var a=t(79307),r=t(76185),i=t(33644),n=t(49145),o=t(21529),s=t(5857);function c(e){let{alt:l,src:t,className:c,blurry:d,...u}=e,[m,v]=(0,s.useState)(null);return((0,s.useEffect)(()=>{v(null)},[t]),!t||m)?(0,a.jsx)("div",{className:(0,i.cn)(c,"flex items-center justify-center"),children:(0,a.jsx)(o.default,{src:r.Z,alt:null!=l?l:n.px,className:"h-1/2 w-1/2 opacity-40 contrast-0"})}):d?(0,a.jsx)("div",{className:(0,i.cn)(c,"bg-gradient-to-r from-primary-500 to-primary-300 blur-sm")}):(0,a.jsx)(o.default,{alt:null!=l?l:n.px,className:c,onError:v,src:m?r.Z:t,...u})}},8179:function(e,l,t){"use strict";t.d(l,{X:function(){return s}});var a=t(79307),r=t(33644),i=t(16349),n=t(5857),o=t(19713);let s=n.forwardRef((e,l)=>{let{className:t,...n}=e;return(0,a.jsx)(i.fC,{ref:l,className:(0,r.cn)("peer h-5 w-5 shrink-0 rounded-sm border border-primary-600 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-100 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary-50 data-[state=checked]:text-primary-600",t),...n,children:(0,a.jsx)(i.z$,{className:(0,r.cn)("text-current flex items-center justify-center"),children:(0,a.jsx)(o.Check,{className:"h-4 w-4"})})})});s.displayName=i.fC.displayName},15234:function(e,l,t){"use strict";t.d(l,{NI:function(){return f},Wi:function(){return u},l0:function(){return c},lX:function(){return h},pf:function(){return y},xJ:function(){return p},zG:function(){return x}});var a=t(79307),r=t(30296),i=t(33644),n=t(34221),o=t(5857),s=t(4203);let c=s.RV,d=o.createContext({}),u=e=>{let{...l}=e;return(0,a.jsx)(d.Provider,{value:{name:l.name},children:(0,a.jsx)(s.Qr,{...l})})},m=()=>{let e=o.useContext(d),l=o.useContext(v),{getFieldState:t,formState:a}=(0,s.Gc)(),r=t(e.name,a);if(!e)throw Error("useFormField should be used within <FormField>");let{id:i}=l;return{id:i,name:e.name,formItemId:"".concat(i,"-form-item"),formDescriptionId:"".concat(i,"-form-item-description"),formMessageId:"".concat(i,"-form-item-message"),...r}},v=o.createContext({}),p=o.forwardRef((e,l)=>{let{className:t,...r}=e,n=o.useId();return(0,a.jsx)(v.Provider,{value:{id:n},children:(0,a.jsx)("div",{ref:l,className:(0,i.cn)("space-y-1.5",t),...r})})});p.displayName="FormItem";let h=o.forwardRef((e,l)=>{let{className:t,...n}=e,{formItemId:o}=m();return(0,a.jsx)(r._,{ref:l,className:(0,i.cn)(t),htmlFor:o,...n})});h.displayName="FormLabel";let f=o.forwardRef((e,l)=>{let{...t}=e,{error:r,formItemId:i,formDescriptionId:o,formMessageId:s}=m();return(0,a.jsx)(n.g7,{ref:l,id:i,"aria-describedby":r?"".concat(o," ").concat(s):"".concat(o),"aria-invalid":!!r,"data-error-message":null==r?void 0:r.message,...t})});f.displayName="FormControl";let y=o.forwardRef((e,l)=>{let{className:t,...r}=e,{formDescriptionId:n}=m();return(0,a.jsx)("p",{ref:l,id:n,className:(0,i.cn)("text-sm text-gray-600",t),...r})});y.displayName="FormDescription";let x=o.forwardRef((e,l)=>{let{className:t,children:r,...n}=e,{error:o,formMessageId:s}=m(),c=o?String(null==o?void 0:o.message):r;return c?(0,a.jsx)("p",{ref:l,id:s,className:(0,i.cn)("text-sm text-error-500",t),...n,children:c}):null});x.displayName="FormMessage"},17542:function(e,l,t){"use strict";t.d(l,{J2:function(){return o},xo:function(){return s},yk:function(){return c}});var a=t(79307),r=t(33644),i=t(82637),n=t(5857);let o=i.fC,s=i.xz,c=n.forwardRef((e,l)=>{let{className:t,align:n="center",sideOffset:o=4,...s}=e;return(0,a.jsx)(i.h_,{children:(0,a.jsx)(i.VY,{ref:l,align:n,sideOffset:o,className:(0,r.cn)("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",t),...s})})});c.displayName=i.VY.displayName},17973:function(e,l,t){"use strict";t.d(l,{F:function(){return c}});var a=t(79307),r=t(83301),i=t(5857),n=t(16411),o=t(19713),s=t(57214);let c=i.forwardRef(function(e,l){return(0,a.jsx)(r.P,{ref:l,menuIcon:e=>e?(0,a.jsx)(o.CheckSquare,{size:"20px",className:"stroke-gray-300"}):(0,a.jsx)(s.bK,{size:"20px",className:"stroke-gray-300"}),hideSelectedCheck:!0,formatGroupLabel:m,isMulti:!0,hideSelectedOptions:!1,components:{Group:d,GroupHeading:u},...e})});function d(e){var l,t;let r=null!==(t=e.children)&&void 0!==t?t:[],i=r.some(e=>e.props.isSelected),o=r.every(e=>e.props.isSelected),s=null===(l=r.filter(e=>e.props.isSelected))||void 0===l?void 0:l.map(e=>e.props.value);return(0,a.jsx)(n.c.Group,{...e,headingProps:{...e.headingProps,hasSelectedOption:i,hasAllSelectedOptions:o,onClick:function(){var l;let t=[...e.options,...null!==(l=e.selectProps.value)&&void 0!==l?l:[]].filter((e,l,t)=>t.findIndex(l=>e.value===l.value)===l&&(!o||o&&!s.includes(e.value)));e.selectProps.onChange(t,{action:"select-option",option:e})}}})}function u(e){let{children:l,hasSelectedOption:t,hasAllSelectedOptions:r,...i}=e;return(0,a.jsx)(n.c.GroupHeading,{...i,className:"!cursor-pointer rounded hover:bg-gray-50",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 border-y border-y-gray-300 py-1",children:[r?(0,a.jsx)(o.CheckSquare,{size:"20px",className:"stroke-gray-300"}):t?(0,a.jsx)(o.MinusSquare,{size:"20px",className:"stroke-gray-300"}):(0,a.jsx)(s.bK,{size:"20px",className:"stroke-gray-300"}),l]})})}function m(e){return(0,a.jsx)("div",{className:"body-sm py-2.5 font-semibold capitalize text-gray-700",children:e.label})}},83301:function(e,l,t){"use strict";t.d(l,{P:function(){return f}});var a=t(79307),r=t(93046),i=t(33644),n=t(9796),o=t(5857),s=t(20458),c=t(16411),d=t(37622),u=t(87979),m=t(60612),v=t(59042),p=t(19713);function h(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}let f=o.forwardRef(function(e,l){let{value:t,leftIcon:r,collapseMultiValues:n,className:m,classNameDropdownIndicator:v,classNameMenu:p,classNameOption:f,isCreatable:j,isAsync:N,components:R,nextInputDataId:_,onFocus:w,onBlur:T,loadOptions:P,...C}=e,k=j?u.Z:N?d.Z:s.ZP,[S,M]=o.useState(!1),[I,A]=o.useState("");return(0,a.jsxs)("div",{className:"relative",children:[r&&(0,a.jsx)("div",{className:"pointer-events-none absolute left-3.5 top-1/2 z-[2] -translate-y-1/2",children:r}),(0,a.jsx)(k,{ref:l,createOptionPosition:"first",formatCreateLabel:e=>'Search "'.concat(e,'"'),loadOptions:P,filterOption:(e,l)=>{var t;let a=e.label,r=null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.manufacturer;if(!a||!a.toLowerCase)return!1;let i=h(l).replace(/[^a-zA-Z ]/g,"").trim().toLowerCase(),n=h(a).replace(/[^a-zA-Z ]/g,"").trim().toLowerCase();return(null!=n?n:"").includes(null!=i?i:"")||(null!=r?r:"").toLowerCase().includes((null!=l?l:"").toLowerCase())},classNames:{control:e=>(0,i.cn)("flex !min-h-[44px] w-full !rounded !border !border-gray-300 bg-white pl-3.5 !shadow-sm !cursor-text",e.isDisabled&&"!cursor-not-allowed !bg-gray-50 !text-gray-500",e.isFocused&&"!border-primary-300 !outline-none !ring-4 !ring-primary-100",e.selectProps["aria-invalid"]&&"!border-error-300 !ring-error-100",r&&"pl-9",m),valueContainer:()=>"!p-0",placeholder:()=>"!text-gray-500",singleValue:()=>S&&j&&_?"!text-transparent":"!text-gray-900",indicatorSeparator:()=>"hidden",indicatorsContainer:()=>"!text-gray-500",dropdownIndicator:()=>null!=v?v:"",menu:()=>(0,i.cn)("!shadow-md !rounded-md !z-10",p),menuList:()=>"!z-10",option:e=>(0,i.cn)("mb-px !cursor-pointer hover:!bg-gray-50",e.isFocused&&"!bg-gray-50 !text-gray-900",e.isSelected&&"!bg-transparent !text-gray-900",f),multiValue:()=>"!bg-white !text-gray-700 !rounded-md !border !border-gray-300",multiValueLabel:()=>"!pl-[5px] !pr-0 !py-0",multiValueRemove:()=>"!text-gray-400 hover:!bg-transparent hover:!text-gray-700"},components:{Option:g,Input:x,DropdownIndicator:b,MultiValue:n?y:c.c.MultiValue,...null!=R?R:{}},isClearable:!1,closeMenuOnSelect:!C.isMulti,leftIcon:r,inputValue:I,onInputChange:A,onFocus:e=>{j&&_&&(t&&t.label&&A(t.label),M(!0)),null==w||w(e)},onBlur:e=>{j&&_&&M(!1),null==T||T(e)},onCreateOption:j&&_?()=>{var e;null===(e=document.querySelector("[data-test-id=".concat(_,"]")))||void 0===e||e.focus()}:void 0,blurInputOnSelect:!!(j&&_),value:t,...C})]})});function y(e){let{index:l,getValue:t}=e;if(t().some(e=>e.shortLabel)){var r;let i=t();return(0,a.jsx)(c.c.MultiValue,{...e,children:null===(r=i[l])||void 0===r?void 0:r.shortLabel})}return l<1?(0,a.jsx)(c.c.MultiValue,{...e}):1===l?(0,a.jsxs)(c.c.MultiValue,{...e,children:[t().length-1,"+"]}):null}function x(e){let{dataTestid:l}=e.selectProps;return(0,a.jsx)(c.c.Input,{...e,"data-test-id":l})}function g(e){let{children:l,...t}=e,{menuIcon:r,leftIcon:i,hideSelectedCheck:o}=t.selectProps,s=t.data;return(0,a.jsx)(c.c.Option,{...t,children:(0,a.jsxs)("div",{className:"flex items-center justify-between","data-test-id":n.N.SEARCH_BAR_QUERY_ITEM(l),children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(r||i)&&(0,a.jsx)("div",{className:"pointer-events-none mr-4",children:(null==r?void 0:r(t.isSelected))||i}),(null==s?void 0:s.code4)?(0,a.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,a.jsxs)("span",{children:[(0,a.jsx)("span",{className:"font-semibold",children:s.code4}),": ",s.name||s.city]}),(0,a.jsxs)("span",{className:"text-xs text-gray-500",children:["".concat(s.name?"".concat(s.city," - ").concat(s.country):s.country)," ",s.code3&&"N/A"!==s.code3&&"(".concat(s.code3,")")]})]}):(0,a.jsx)("span",{children:l})]}),t.isSelected&&!o&&(0,a.jsx)(p.Check,{className:"stroke-primary-600",size:"20px"})]})})}function b(e){let l=e.selectProps["data-error-message"];return(0,a.jsxs)(c.c.DropdownIndicator,{...e,children:[l&&!e.selectProps.isLoading&&(0,a.jsx)(r.pn,{children:(0,a.jsxs)(r.u,{children:[(0,a.jsx)(r.aJ,{type:"button",className:"absolute right-8 top-1/2 -translate-y-1/2",children:l&&(0,a.jsx)(m.bG,{size:"16px",className:"stroke-error-500"})}),(0,a.jsx)(r._v,{children:l})]})}),(0,a.jsx)(v._M,{className:(0,i.cn)("stroke-gray-500",e.selectProps.menuIsOpen?"rotate-180":""),size:"20px"})]})}},97837:function(e,l,t){"use strict";t.d(l,{UserCard:function(){return _}});var a=t(79307),r=t(24903),i=t(66404),n=t(37055),o=t(94403),s=t(46332),c=t(5027);t(21259);var d=(0,t(74197).$)("e2a0450648dce3f0b8ac5f7d499fd85fe5a6da79"),u=t(87242),m=t(49145),v=t(9796),p=t(22740),h=t(57702),f=t(71315),y=t(49874),x=t(35715),g=t.n(x),b=t(5857),j=t(59042),N=t(73654),R=t(41782);function _(e){var l,t;let{user:x,searchCard:_,idJob:w,idApplied:T,dateApplied:P,status:C}=e,k=(0,p.Hm)(x),{toast:S}=(0,c.pm)(),[M,I]=(0,b.useTransition)();return(0,a.jsxs)("div",{className:"relative flex w-full flex-col items-start gap-2 rounded border border-gray-200 bg-white p-4 shadow-lg hover:border-white hover:shadow-lg hover:ring-2 hover:ring-primary-200 md:p-6 md:shadow-sm",children:[(0,a.jsx)(r.Link,{href:h.G.profile(null==x?void 0:x.id),className:"w-full","data-test-id":v.N.USER_CARD(null!==(l=null==x?void 0:x.id)&&void 0!==l?l:""),children:(0,a.jsxs)("div",{className:"relative flex w-full items-start justify-start gap-2 md:gap-6",children:[(0,a.jsx)("div",{children:(0,a.jsx)(i.o,{width:36,height:36,alt:null!==(t=x.name)&&void 0!==t?t:"",loading:"lazy",className:"h-9 w-9 rounded bg-gray-200 md:h-12 md:w-12",src:x.photo})}),(0,a.jsxs)("div",{className:"flex shrink grow basis-0 flex-col items-start justify-start gap-2",children:[(0,a.jsxs)("div",{className:"flex flex-col items-start justify-start gap-1 self-stretch",children:[(0,a.jsxs)("div",{className:"flex flex-col items-start justify-start",children:[(0,a.jsx)("div",{className:"body-lg font-medium",children:null==x?void 0:x.name}),(null==x?void 0:x.accountType)&&(0,a.jsx)("div",{className:"body-xs font-semibold",children:"other"===x.accountType?x.accountTypeOther:m.kw[x.accountType]})]}),(0,a.jsxs)("div",{className:"flex flex-col justify-start self-stretch md:flex-row md:items-center md:gap-6",children:[null!=x.totalHours&&(0,a.jsxs)("div",{className:"flex items-center justify-start gap-1",children:[(0,a.jsx)(R.HourGlass03,{className:"h-3 w-3 stroke-gray-400 md:h-4 md:w-4"}),(0,a.jsxs)("div",{className:"body-xs text-[10px] font-medium text-gray-600 md:text-xs",children:[(0,p.uf)(x.totalHours)," Total ",g()("Hour",x.totalHours)]})]}),null!=x.yearsExperience&&(0,a.jsxs)("div",{className:"flex items-center justify-start gap-1",children:[(0,a.jsx)(R.HourGlass03,{className:"h-3 w-3 stroke-gray-400 md:h-4 md:w-4"}),(0,a.jsxs)("div",{className:"body-xs text-[10px] font-medium text-gray-600 md:text-xs",children:[(0,p.uf)(x.yearsExperience)," ",g()("Year Experience",x.yearsExperience)]})]}),k&&(0,a.jsxs)("div",{className:"flex items-center justify-start gap-1",children:[(0,a.jsx)(N.MarkerPin01,{className:"h-3 w-3 stroke-gray-400 md:h-4 md:w-4"}),(0,a.jsx)("div",{className:"body-xs text-[10px] font-medium text-gray-600 md:text-xs",children:(0,p.sC)(k)})]})]})]}),x.tags&&(0,a.jsx)("div",{className:"flex flex-wrap items-start justify-start gap-1",children:x.tags.map(e=>(0,a.jsx)(o.C,{variant:"yellow",children:e},e))}),P&&(0,a.jsx)("div",{className:"flex flex-wrap items-start justify-start gap-1",children:P&&(0,a.jsxs)(o.C,{variant:"gray",children:["Applied on ",(0,f.Z)((0,y.Z)(P),"MM/dd/yyyy")]})})]}),_?(0,a.jsx)(s.Button,{size:"lg",hierarchy:"link",rightIcon:(0,a.jsx)(j.ArrowRight,{className:"stroke-primary-500",size:"20px"}),className:"mt-6 hidden self-center md:flex",children:"View"}):(0,a.jsx)(s.Button,{icon:!0,size:"lg",hierarchy:"link",className:"mt-6 hidden self-center md:flex",children:(0,a.jsx)(j._Q,{className:"stroke-primary-500",size:"20px"})})]})}),T&&(0,a.jsxs)(n.aR,{children:[(0,a.jsx)(n.vW,{asChild:!0,children:(0,a.jsx)(s.Button,{hierarchy:"link",type:"button",loading:M,loadingClassName:"stroke-primary-700",className:"ml-12 underline md:ml-[70px]",children:C===u.t.Archived?"Unarchive":"Archive"})}),(0,a.jsxs)(n._T,{children:[(0,a.jsxs)(n.fY,{children:[(0,a.jsxs)(n.f$,{children:[C===u.t.Archived?"Unarchive":"Archive"," Job Application"]}),(0,a.jsx)(n.yT,{children:C===u.t.Archived?"Are you sure you want to unarchive this applicant?":"Are you sure you want to archive this applicant?"})]}),(0,a.jsxs)(n.xo,{children:[(0,a.jsx)(n.le,{children:"No"}),(0,a.jsx)(n.OL,{onClick:function(){I(async()=>{if(T&&w)try{await d({jobApplicationId:T,jobId:w,status:C===u.t.Applied?u.t.Archived:u.t.Applied}),C===u.t.Applied?S({title:"Job Application Archived",description:"Job application for ".concat(x.name," has been archived.")}):S({title:"Job Application Unarchived",description:"Job application for ".concat(x.name," has been unarchived.")})}catch(e){C===u.t.Applied?S({title:"Failed to Archive Job Application",description:"Failed to archive job application for ".concat(x.name,"."),icon:"error"}):S({title:"Failed to Unarchive Job Application",description:"Failed to unarchive job application for ".concat(x.name,"."),icon:"error"})}})},children:"Yes"})]})]})]})]})}},89309:function(e,l,t){"use strict";t.d(l,{w:function(){return i}});var a=t(22740),r=t(5857);function i(e){return(0,r.useMemo)(()=>{let l=null==e?void 0:e.reduce((e,l)=>{var t,a,r,i;let n=null!==(a=l.manufacturer)&&void 0!==a?a:"No manufacturer";return e[n]||(e[n]=[]),null===(t=e[n])||void 0===t||t.push({label:null!==(r=l.model)&&void 0!==r?r:"",value:null!==(i=l.id)&&void 0!==i?i:"",manufacturer:n}),e},{});return Object.entries(null!=l?l:{}).map(e=>{let[l,t]=e;return{label:(0,a.kC)(l),options:t}}).sort((e,l)=>e.label.localeCompare(l.label))},[e])}},42518:function(e,l,t){"use strict";t.d(l,{w:function(){return a}});let a="\n  query Aircrafts {\n    aircrafts {\n      id\n      model\n      manufacturer\n    }\n  }\n"},87242:function(e,l,t){"use strict";var a,r;t.d(l,{t:function(){return a}}),(r=a||(a={})).Accepted="Accepted",r.Applied="Applied",r.Closed="Closed",r.Rejected="Rejected",r.Archived="Archived"},56505:function(e,l,t){"use strict";t.d(l,{$k:function(){return n},Aq:function(){return v},OF:function(){return c},Qr:function(){return s},WK:function(){return m},Xn:function(){return o},i2:function(){return p},lH:function(){return u},nB:function(){return d},vy:function(){return h}});var a=t(49145);t(62126);var r=t(23554),i=t(77663);async function n(e){try{var l,t;(0,r.sendGTMEvent)({event:"user_login",user_type:null==e?void 0:e.user.account.accountType,user_subscription_plan:null==e?void 0:e.user.planName}),(0,i.j)("user_login",{user_type:null!==(l=null==e?void 0:e.user.account.accountType)&&void 0!==l?l:"",user_subscription_plan:null!==(t=null==e?void 0:e.user.planName)&&void 0!==t?t:""})}catch(e){console.error("[GTM ERROR] gtmUserLogin",e)}}async function o(e){try{var l,t,a,n,o,s;(0,r.sendGTMEvent)({event:"user_signup",user_city:e.user_city,user_state:e.user_state,aircraft_type:null===(l=e.aircraft_type)||void 0===l?void 0:l.join(", "),user_type:e.user_type}),(0,i.j)("user_signup",{user_city:null!==(a=e.user_city)&&void 0!==a?a:"",user_state:null!==(n=e.user_state)&&void 0!==n?n:"",aircraft_type:null!==(o=null===(t=e.aircraft_type)||void 0===t?void 0:t.join(", "))&&void 0!==o?o:"",user_type:null!==(s=e.user_type)&&void 0!==s?s:""})}catch(e){console.error("[GTM ERROR] gtmUserSignup",e)}}async function s(e){try{var l,t,a,n;(0,r.sendGTMEvent)({event:"job_search",search_query:e.search_query,search_result_count:e.search_result_count,search_filters:e.search_filters,user_type:e.user_type}),(0,i.j)("job_search",{search_query:null!==(l=e.search_query)&&void 0!==l?l:"",search_result_count:null!==(t=e.search_result_count)&&void 0!==t?t:0,search_filters:null!==(a=e.search_filters)&&void 0!==a?a:{},user_type:null!==(n=e.user_type)&&void 0!==n?n:""})}catch(e){console.error("[GTM ERROR] gtmJobSearch",e)}}async function c(e){try{var l,t,a,n;(0,r.sendGTMEvent)({event:"user_search",search_query:e.search_query,search_result_count:e.search_result_count,search_filters:e.search_filters,user_type:e.user_type}),(0,i.j)("user_search",{search_query:null!==(l=e.search_query)&&void 0!==l?l:"",search_result_count:null!==(t=e.search_result_count)&&void 0!==t?t:0,search_filters:null!==(a=e.search_filters)&&void 0!==a?a:{},user_type:null!==(n=e.user_type)&&void 0!==n?n:""})}catch(e){console.error("[GTM ERROR] gtmUserSearch",e)}}async function d(e){try{(0,r.sendGTMEvent)({event:e}),(0,i.j)(e)}catch(e){console.error("[GTM ERROR] gtmSignUp",e)}}async function u(e){try{var l,t,a,n,o,s;(0,r.sendGTMEvent)({event:"application_submitted",job_title:e.job_title,company_name:e.company_name,aircraft_type:e.aircraft_type,required_certifications:e.required_certifications,job_type:e.job_type,user_type:e.user_type}),(0,i.j)("application_submitted",{job_title:null!==(l=e.job_title)&&void 0!==l?l:"",company_name:null!==(t=e.company_name)&&void 0!==t?t:"",aircraft_type:null!==(a=e.aircraft_type)&&void 0!==a?a:"",required_certifications:null!==(n=e.required_certifications)&&void 0!==n&&n,job_type:null!==(o=e.job_type)&&void 0!==o?o:"",user_type:null!==(s=e.user_type)&&void 0!==s?s:""})}catch(e){console.error("[GTM ERROR] gtmApplicationSubmitted",e)}}async function m(e){try{var l,t,a;(0,r.sendGTMEvent)({event:"saved_search",search_term:e.search_term,search_filters:e.search_filters,user_type:e.user_type}),(0,i.j)("saved_search",{search_term:null!==(l=e.search_term)&&void 0!==l?l:"",search_filters:null!==(t=e.search_filters)&&void 0!==t?t:{},user_type:null!==(a=e.user_type)&&void 0!==a?a:""})}catch(e){console.error("[GTM ERROR] gtmSavedSearch",e)}}async function v(e){let{firstName:l,lastName:t,email:n,role:o,value:s,subscriptionId:c,phoneNumber:d,street:u,city:m,state:v,zipCode:p,country:h}=e;try{var f;null!=window&&(window.email=n,window.phoneNumber=d,window.firstName=l,window.lastName=t,window.street=u,window.city=m,window.region=v,window.zipCode=p,window.country=h);let e={send_to:o===a.XM?"AW-962332155/Z5b2CJ66g6cZEPuL8MoD":"AW-962332155/L-DACKrmrO4YEPuL8MoD",role:o,type:"",region:"USA",purchase_type:"new",subscription_id:c,value:s,currency:"USD",firstName:l,lastName:t,email:n};(0,r.sendGTMEvent)({event:o===a.XM?"conversion_emp":"conversion",...e}),(0,i.j)("conversion",{...e,send_to:null!==(f=e.send_to)&&void 0!==f?f:""})}catch(e){console.error("[GTM ERROR] gtmConversion",e)}}function p(e){try{var l;(0,r.sendGTMEvent)({event:"lead_form_submitted",send_to:"AW-962332155/i2gFCKG6g6cZEPuL8MoD",...e}),(0,i.j)("lead_form_submitted",{send_to:(l="AW-962332155/i2gFCKG6g6cZEPuL8MoD",void 0!==l)?l:"",...e})}catch(e){console.error("[GTM ERROR] gtmLeadFormConversion",e)}}async function h(e){let{transactionUuid:l,value:t,items:a}=e,n={event:"purchase",ecommerce:{transaction_id:l,value:t,currency:"USD",items:a.map(e=>({item_id:e.itemId,item_name:e.itemName,item_category:e.itemCategory,price:e.price,item_quantity:e.quantity}))}};console.log("gtm purchase event: ",n),(0,r.sendGTMEvent)(n),(0,i.j)("purchase",{...n.ecommerce,items:JSON.stringify(n.ecommerce.items)})}}},function(e){e.O(0,[6138,1222,7198,4529,9042,6604,9227,8798,8902,7569,8501,612,1042,339,1719,3692,6006,1603,2243,1782,1315,5743,3654,271,6903,201,5260,9438,9584,2731,8134,7617,1744],function(){return e(e.s=55716)}),_N_E=e.O()}]);