import{bH as t,aI as l,ao as a}from"./app-k0jcl5PQ.js";import{F as g}from"./kLXBNYk1.chunk.js";const E=["Teacher","Librarian / Teacher Librarian","Curriculum Coordinator","Digital Technology Coordinator","SSO / SLSO","IT","Head of Department","Head of Subject","Assistant Principal","Deputy Principal","Principal","Business Manager"],y=["Teacher","Librarian / Teacher Librarian","IT/LRC","e-Learning/ICT Coordinator","Head of Key Stage","Head of Department","Subject Lead","Assistant Head Teacher","Deputy Head Teacher","Head Teacher"],m=["Teacher","Librarian / Teacher Librarian","Head of Department","Instructional Technology Specialist","Curriculum Coordinator","School Leadership","District Leadership","Academic Coach","Principal","IT / IT Specialist"],b=["Teacher","Librarian / Teacher Librarian","Curriculum Leader","e-Learning Coordinator","IT","Head of Department","Head of Faculty","Learning Support","Learning Assistant","Deputy Principal","Assistant Principal","Principal"],O=["Teacher","Librarian / Teacher Librarian","Educational Assistant (EA)","Learning Support Teacher / Resource Teacher","Department Head / Manager","Curriculum Coordinator / Consultant","School Counsellor / Guidance Counsellor","Vice-Principal","Principal","Superintendent","Director of Education"],C=["Professor","Lecturer","Course Coordinator / Administrator","Digital Learning Manager","Tutor","Teaching Fellow","Librarian","Learning Technologist","Teaching Assistant","Researcher","IT"],R=["Professor","Lecturer","Course Coordinator / Administrator","Digital Learning Manager","Tutor","Teaching Fellow","Librarian","Learning Technologist","Teacher","Teaching Assistant","Researcher","IT"],H={[t.AU]:E,[t.NZ]:b,[t.UK]:y,[t.US]:m,[t.CA]:O},J={[t.AU]:C,[t.UK]:R};function p(e){var i;const r=(i=e.countryCode)==null?void 0:i.toLowerCase();return e.isTertiary?J[r]||C:H[r]||m}function v(e){return(e==null?void 0:e.toLowerCase().includes("student"))||(e==null?void 0:e.toLowerCase().includes("parent"))}const o="OTHER";function L(e,r){return r.includes(e)?e:e?o:""}function K(e){const{error:r,onChange:i,countryCode:S,isTertiary:f}=e,c=p({countryCode:S,isTertiary:f}),u=L(e.initialValue,c),[s,d]=l.useState(u),[_,h]=l.useState(u===o?e.initialValue:"");l.useEffect(()=>{d(L(e.initialValue,c))},[e.initialValue]);function I(n){d(n.target.value),h(""),i(n.target.value===o?"":n.target.value)}function x(n){h(n.target.value),i(n.target.value)}const T=s===o;return a.jsxs("div",{className:"form-group",children:[a.jsxs("label",{htmlFor:e.id,className:e.labelClassName,children:["Job title",e.required&&a.jsx("span",{className:"text-danger",children:"*"})]}),a.jsxs("div",{className:"mb-2",children:[a.jsxs("select",{id:e.id,name:e.id,className:`form-select ${e.size==="lg"?"form-select-lg":""} ${s.length?"text-dark":"text-secondary"} ${!!r&&"is-invalid"}`,value:s,placeholder:"Role",onChange:I,children:[a.jsx("option",{value:"",disabled:!0,className:"text-secondary",children:e.placeholder?e.placeholder:a.jsx(a.Fragment,{children:"What do you do?"})}),c.map((n,A)=>a.jsx("option",{value:n,className:"text-dark",children:n},A)),a.jsx("option",{value:o,className:"text-dark",children:"Other"})]}),!!r&&!T&&a.jsx(g,{name:e.id,children:r})]}),T&&a.jsxs("div",{className:"mb-3",children:[a.jsx("input",{className:`form-control ${e.size==="lg"?"form-select-lg":""} ${!!r&&"is-invalid"}`,type:"text",value:_,placeholder:"What do you do?",autoFocus:!0,onChange:x}),!!r&&a.jsx(g,{name:e.id,children:r})]})]})}export{K as J,v as i};
//# sourceMappingURL=D41e4O-3.chunk.js.map
