PageSourceSearch

https://lounge.com/cdn/shop/t/1059/assets/ProspectForm-D-q6p9AU.js

js lounge.com collected 2026-09-24 08:59:39 UTC 6,974 bytes, 2 lines download raw bytes

1import{z as d,r as m,u as k,j as e,c as x,q as P}from"./vendor-DyWvsi4h.js";import{ar as V,Y as $,I as z,T as i,w as B,p as a,a6 as U,b as A}from"./index-entry-CXWKOKOD.js";import{u as J}from"./useCareersEndpoint-Czrh4FbC.js";import{a as G,g as K}from"./useJobs-qTnzmNah.js";import"./motion-Ct9D-VhY.js";try{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},c=new t.Error().stack;c&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[c]="ed2ff984-8c2b-4cd3-84e0-dd666ac066cc",t._sentryDebugIdIdentifier="sentry-dbid-ed2ff984-8c2b-4cd3-84e0-dd666ac066cc")}catch{}{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t._sentryModuleMetadata=t._sentryModuleMetadata||{},t._sentryModuleMetadata[new t.Error().stack]=Object.assign({},t._sentryModuleMetadata[new t.Error().stack],{"_sentryBundlerPluginAppKey:frontend/theme":!0})}const R=d.object({firstName:d.string().nonempty(),lastName:d.string().nonempty(),email:d.string().email(),resume:d.array(d.instanceof(File)).min(1),department:d.string().nonempty()}),L=({data:t})=>{const[c,u]=m.useState(!1),{t:s}=k(),{toast:h}=V(),g=J();if(!t)return null;const{title:b,subtitle:p,image:o,departments:r,successTitle:y,successSubtitle:j,successButtonText:N,className:v}=t,w=m.useMemo(()=>r.length?r.flatMap(n=>n.greenhouse_ids?.map(Number)??[]):[],[r]),{data:_}=$({targetPageSize:1,filterDepartments:w,filterLocations:[],articles:[]}),S=_?.departments||[],I=m.useMemo(()=>r.length>0&&r[0]?.greenhouse_ids?.[0]||"",[r]),M={firstName:"",lastName:"",email:"",resume:[],department:I},E=async({firstName:n,lastName:C,email:F,resume:T,department:f})=>{try{await new U(g).submitProspect({first_name:n,last_name:C,email:F,resume:[T[0]],department_id:parseInt(f,10)}),u(!0)}catch(D){P(D),h({severity:"critical",title:s("general.error"),message:s("general.error_unexpected")})}},l=n=>{n.stopPropagation(),document.getElementById("section-careers-vacancies")?.scrollIntoView()};return e.jsx("div",{className:"wrapper",children:e.jsxs("div",{className:x("flex flex-col md:flex-row items-stretch",v),id:"prospect-form",children:[o&&e.jsx("div",{className:"overflow-hidden md:basis-2/5 flex-shrink-0",children:e.jsx(z,{className:"object-cover h-full w-full",data:{src:o.src,width:675,height:675,crop:"center"},alt:o.alt})}),e.jsx("div",{className:x("px-6 py-8 bg-primary md:p-12 border border-primary md:border-t flex flex-col justify-center w-full",o&&"border-t-0 md:border-l-0 md:basis-3/5 min-h-[750px]"),children:c?e.jsxs("div",{className:"w-full h-full flex flex-col gap-8 justify-center items-center",children:[e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(i,{variant:"display-two",className:"typography--title-three italic font-light",children:y}),e.jsx(i,{variant:"body-md",children:j})]}),e.jsx(B,{onClick:l,children:N})]}):e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(i,{variant:"display-two",className:"typography--title-three italic font-light",children:b}),p&&e.jsx(i,{variant:"body-md",className:"md:mb-2",children:p}),e.jsxs(a,{onSubmit:E,defaultValues:M,className:"flex flex-col h-full",validationSchema:R,children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-12 gap-y-6",children:[e.jsx(a.Input,{name:"firstName",placeholder:s("account.first_name"),filled:!0}),e.jsx(a.Input,{name:"lastName",placeholder:s("account.last_name"),filled:!0}),e.jsx(a.Input,{name:"email",placeholder:s("account.email_address"),filled:!0}),e.jsx(a.Select,{name:"department",placeholder:"Select department",options:S.map(n=>({label:n.name,value:n.id.toString()}))})]}),e.jsxs("div",{className:"flex flex-col gap-3 mt-6 mb-8",children:[e.jsx(i,{variant:"body-sm",children:"Upload your CV:"}),e.jsx(a.FileUpload,{name:"resume",accept:{"application/pdf":[".pdf"]},maxSize:1024*1024*5})]}),e.jsx(a.Submit,{className:"md:mt-4 self-end w-full",size:"lg",children:s("action.submit")})]})]})})]})})},Y=({data:t})=>{const[c,u]=m.useState(!1),{t:s}=k(),{toast:h}=V(),g=J();if(!t)return null;const{title:b,subtitle:p,image:o,departments:r,successTitle:y,successSubtitle:j,successButtonText:N,className:v}=t;m.useMemo(()=>r.length?r.flatMap(l=>l.teamtailor_ids?.map(Number)??[]):[],[r]);const{data:w}=G({}),_=K(w??[]),S=m.useMemo(()=>r.length>
10&&r[0]?.teamtailor_ids?.[0]||"",[r]),I={firstName:"",lastName:"",email:"",resume:[],department:S},M=async({firstName:l,lastName:n,email:C,resume:F,department:T})=>{try{await new U(g).submitProspect({first_name:l,last_name:n,email:C,resume:[F[0]],department_id:parseInt(T,10)}),u(!0)}catch(f){P(f),h({severity:"critical",title:s("general.error"),message:s("general.error_unexpected")})}},E=l=>{l.stopPropagation(),document.getElementById("section-careers-vacancies")?.scrollIntoView()};return e.jsx("div",{className:"wrapper",children:e.jsxs("div",{className:x("flex flex-col md:flex-row items-stretch",v),id:"prospect-form",children:[o&&e.jsx("div",{className:"overflow-hidden md:basis-2/5 flex-shrink-0",children:e.jsx(z,{className:"object-cover h-full w-full",data:{src:o.src,width:675,height:675,crop:"center"},alt:o.alt})}),e.jsx("div",{className:x("px-6 py-8 bg-primary md:p-12 border border-primary md:border-t flex flex-col justify-center w-full",o&&"border-t-0 md:border-l-0 md:basis-3/5 min-h-[750px]"),children:c?e.jsxs("div",{className:"w-full h-full flex flex-col gap-8 justify-center items-center",children:[e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(i,{variant:"display-two",className:"typography--title-three italic font-light",children:y}),e.jsx(i,{variant:"body-md",children:j})]}),e.jsx(B,{onClick:E,children:N})]}):e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(i,{variant:"display-two",className:"typography--title-three italic font-light",children:b}),p&&e.jsx(i,{variant:"body-md",className:"md:mb-2",children:p}),e.jsxs(a,{onSubmit:M,defaultValues:I,className:"flex flex-col h-full",validationSchema:R,children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-12 gap-y-6",children:[e.jsx(a.Input,{name:"firstName",placeholder:s("account.first_name"),filled:!0}),e.jsx(a.Input,{name:"lastName",placeholder:s("account.last_name"),filled:!0}),e.jsx(a.Input,{name:"email",placeholder:s("account.email_address"),filled:!0}),e.jsx(a.Select,{name:"department",placeholder:"Select department",options:_.map(l=>({label:l.name,value:l.id.toString()}))})]}),e.jsxs("div",{className:"flex flex-col gap-3 mt-6 mb-8",children:[e.jsx(i,{variant:"body-sm",children:"Upload your CV:"}),e.jsx(a.FileUpload,{name:"resume",accept:{"application/pdf":[".pdf"]},maxSize:1024*1024*5})]}),e.jsx(a.Submit,{className:"md:mt-4 self-end w-full",size:"lg",children:s("action.submit")})]})]})})]})})},X=({data:t,...c})=>{const{getFlag:u}=A();return u("careers_v2_endpoint")?e.jsx(Y,{data:t,...c}):e.jsx(L,{data:t,...c})};export{X as ProspectForm};
2//# sourceMappingURL=ProspectForm-D-q6p9AU.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.