1import{t as e}from"./jsx-runtime-CZRUk6N2.js";import{o as t,w as n,y as r}from"./components-CNow_GKA.js";import{a as i}from"./lib-DUFFNWxz.js";import{t as a}from"./href-CbFzpbGh.js";import"./toast-DTRa9Xjc.js";import{t as o}from"./close-16-DVwFbL1b.js";import{t as s}from"./clsx-DB0hHKMi.js";import{r as c,t as l}from"./csrf-hinhoIs6.js";import{a as u}from"./hooks-Bpy7ET8Q.js";import{t as d}from"./autocomplete-5CP_FrHT.js";import{t as f}from"./button-BVdYoD6m.js";import{n as p}from"./use-tracking-C10o8QBU.js";import{t as m}from"./cv-Bmq1VBqE.js";import{n as h,t as g}from"./modal-DT72u0IG.js";import"./next-role-client-action-BlXoXmmR.js";import{Fragment as _,useState as v}from"https://assets.finn.no/npm/react/v19/react.production.min.js";var y=e(),b=String.raw,x=[`FULL_TIME`,`PART_TIME`,`SUMMER`];b` 2 mutation SavePreferredRoles( 3 $preferredRolesInput: PreferredRolesInput! 4 $preferredRoleTypesInput: PreferredRoleTypesInput! 5 ) { 6 savePreferredRoles(input: $preferredRolesInput) { 7 preferredRoles { 8 title 9 } 10 } 11 savePreferredRoleTypes(input: $preferredRoleTypesInput) { 12 preferredRoleTypes { 13 type 14 } 15 } 16 } 17`;var S=t(function(){let e=r(),[t,b]=v(!0);u(t);let S=n(`routes/profile/next-job`),C=S?.profile.preferredRoles,w=S?.profile.preferredRoleTypes,[T,E]=v(``),[D,O]=v(C?.map(e=>e.title)??[]),[k,A]=v(w?.[0]?.type??``),j=i(),M=j.state===`submitting`,N=c(),P=j.data?.errors?.type?.[0]??``,F=S?.employmentTypes.filter(e=>x.includes(e.type)),I=p();return(0,y.jsx)(g,{open:t,title:`Ãnsker for neste jobb`,onOpenChange:e=>{b(e)},onAnimationEnd:t=>{t||e(a(`/profile/next-job`),{preventScrollReset:!0})},footer:(0,y.jsxs)(`div`,{className:`flex gap-16 justify-between flex-row-reverse w-full`,children:[(0,y.jsxs)(`div`,{className:`ml-auto flex gap-16 flex-row-reverse`,children:[(0,y.jsx)(f,{type:`submit`,primary:!0,loading:M,onClick:()=>{I(`JJP_ev16`)},form:`next-role-form`,children:C?.[0]?`Lagre endringene`:`Lagre`}),(0,y.jsx)(h,{asChild:!0,children:(0,y.jsx)(f,{secondary:!0,type:`button`,loading:M,children:`Avbryt`})})]}),C?.[0]?(0,y.jsx)(f,{type:`button`,negative:!0,quiet:!0,loading:M,onClick:()=>{j.submit({csrfToken:N},{method:`DELETE`,action:a(`/profile/next-job/next-role`),preventScrollReset:!0})},children:`Slett`}):null]}),children:(0,y.jsxs)(j.Form,{method:`POST`,className:`mb-4 space-y-24`,autoComplete:`off`,preventScrollReset:!0,id:`next-role-form`,children:[(0,y.jsx)(l,{}),(0,y.jsx)(d,{name:`title`,label:`Jeg vil jobbe som`,invalid:!!j.data?.errors?.selectedTitles?.length,helpText:j.data?.errors?.selectedTitles?.[0],placeholder:`Skredder, spÃ¥kone eller astronaut`,onSelect:e=>{O(t=>[...t,e])},onChange:e=>{E(e)},value:T,type:`job-title`,multiSelect:!0,selected:D}),(0,y.jsx)(`div`,{className:`flex gap-8 flex-wrap`,children:D.map(e=>(0,y.jsxs)(_,{children:[(0,y.jsx)(`input`,{type:`hidden`,name:`selectedTitle`,value:e}),(0,y.jsx)(`p`,{className:`sr-only`,"aria-live":`polite`,children:e}),(0,y.jsxs)(`button`,{type:`button`,onClick:()=>{O(t=>t.filter(t=>t!==e))},"aria-label":`Fjern ${e}`,className:s(m.element.pill,`flex gap-4 items-center`,`!s-bg-primary s-text-inverted hover:!s-bg-primary-hover active:!s-bg-primary-active focusable transition-colors`),children:[(0,y.jsx)(`span`,{children:e}),(0,y.jsx)(o,{"aria-hidden":!0})]})]},e))}),(0,y.jsxs)(`fieldset`,{"aria-invalid":!!P,"aria-describedby":P?`employment-type__hint`:void 0,"aria-errormessage":P?`employment-type__hint`:void 0,children:[(0,y.jsx)(`legend`,{className:`label mb-4`,children:`Ansettelsestype`}),(0,y.jsx)(`div`,{className:s(`flex gap-8 flex-wrap rounded-4 p-4`,{"border s-border-negative":!!P}),children:F?.map(e=>(0,y.jsxs)(`div`,{className:`flex items-center gap-8`,children:[(0,y.jsx)(`input`,{type:`radio`,name:`type`,value:e.type,checked:k===e.type,onChange:e=>{A(e.target.value)},className:`sr-only peer`,id:`employment-type-${e.type}`}),(0,y.jsx)(`label`,{htmlFor:`employment-type-${e.type}`,className:s(m.element.pill,`cursor-pointer focusable hover:s-bg-selected-hover active:s-bg-selected-active transition-colors peer-focus-visible:outline
17!outline-2 !s-outline-focus outline-offset-2`,{"!s-bg-primary !s-text-inverted !hover:s-bg-primary-hover !active:s-bg-primary-active":k===e.type}),children:e.label})]},e.type))}),!!P&&(0,y.jsx)(`div`,{className:`helpText helpText--invalid mt-4`,id:`employment-type__hint`,children:P})]})]})})});export{S as t};
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.