import{S as e,s as t,j as a,o as i,l,n as s,aJ as r,w as n,aK as o}from"./index-DVx3XUkT.js";import{j as c,r as d}from"./react-B_SyE9nW.js";import{F as p,P as f,C as u,a as x}from"./PhotoUpIco-CBJj1q9f.js";import{F as m}from"./FldAutocomplete-DdzXexOn.js";import{F as j}from"./FldDate-Cly9BGP_.js";import{F as h}from"./FldText-CoGyGXSJ.js";import{F as g}from"./FldTextSelect-CYrn0aFm.js";import{M,a as C,I as z,h as b}from"./index-HT-5AD7E.js";import{B as v}from"./BlogIco-DxRlVvZ7.js";import{U as I}from"./ItemLoading-B0qbhEL4.js";import{u as S}from"./GenericAvatarHeader-DO7pCYOO.js";import{E as y}from"./EditIco-sjndGYzv.js";import{P as F,A as N}from"./styles-CouVAG0q.js";import{S as E}from"./Stack-DWxbwU3r.js";function O(t){return c.jsxs(e,{...t,children:[c.jsx("circle",{cx:"12",cy:"12",r:"11.5",fill:"#c30"}),c.jsx("path",{fill:"#000",d:"M18.5 11.96c-.33-.21-.29-.19-.2-.56.1-.42.3-.58.71-.49.16.03.21-.06.2-.21-.01-.26-.01-.51 0-.77.04-1.36-1.05-3.86-4.17-3.83-.32 0-.61-.05-.9-.19-.93-.47-1.93-.66-2.96-.63-.51.01-.51.03-.52-.46.12-1.24-.88-3.37-3.28-3.49C5.71 1.23 4.3 2.51 4 3.85c-.4 1.76.37 3.28 1.85 3.94.23.1.27.16.12.39-2.17 3.32-.9 7.77 2.69 9.43.2.09.38.21.54.36 3.26 2.95 7.68 1.08 8.7-2.14.05-.16.14-.23.29-.29.74-.31 1.19-.86 1.27-1.66.09-.82-.25-1.48-.96-1.92z"}),c.jsx("path",{fill:"#fff",d:"M7.57 12.2c.44-.09.88-.07 1.32.03 1.16.26 2.18-.76 1.95-1.92-.06-.31.05-.18.08-.16.72.51 1.52.75 2.4.75h3.06c.14 0 .24.02.33.14 2.22 3.11.6 6.94-2.62 7.78-2.37.73-5.17-.85-5.83-3.2-.1-.36.01-.37-.36-.42-.67-.09-1.22-.59-1.34-1.25-.12-.66.23-1.44 1.01-1.75zM18.12 13.4c-.06-.36-.14-.83-.26-1.18.54.06 1.02.57 1.13 1.17.12.66-.18 1.31-.74 1.6-.03.03-.06.03-.09.01-.09-.03.03-.07-.04-1.6z"}),c.jsx("path",{fill:"#fe7f09",d:"M14.52 15.64c-.36.03-.71.08-1.06-.03-.29-.17-.3-.44-.25-.72.16-.83.33-1.67.5-2.5.04-.2.14-.44.38-.44.25 0 .34.23.38.46.07.24.26 1.86.34 2.48.05.42-.09.74-.29.75z"}),c.jsx("path",{fill:"#000",d:"M12.17 16.36c-.12-.11-.21-.23-.09-.38.14-.16.27-.08.4.03.81.68 1.76.68 2.58 0 .12-.1.25-.19.38-.05.14.15.06.29-.07.4-.94.86-2.34.82-3.2 0zM15.28 12.89a.569.569 0 01-.55-.55c0-.31.27-.55.59-.54.31.01.55.27.54.56a.57.57 0 01-.58.53zM12.46 12.93a.569.569 0 01-.55-.55c0-.31.27-.55.59-.54.31.01.55.27.54.56-.01.3-.28.54-.58.53z"})]})}function w(t){return c.jsxs(e,{...t,children:[c.jsx("circle",{cx:"12",cy:"12",r:"11.5",fill:"#c30"}),c.jsx("path",{fill:"#000",d:"M19.47 13.89c-.08.8-.52 1.36-1.27 1.66-.15.06-.24.13-.29.29-1.03 3.21-5.45 5.09-8.7 2.14-.17-.15-.34-.27-.54-.36a6.438 6.438 0 01-3.74-5.5c-.02-.12-.02-.25-.02-.38V1.6h8.52c2.93 0 5.3 2.38 5.3 5.31v5.22c.55.43.81 1.03.74 1.76z"}),c.jsx("path",{fill:"#fff",d:"M7.57 12.21c.44-.09.88-.07 1.33.03 1.16.26 2.45-.42 1.87-2.04l5.15.04c.14 0 .71.68.79.8 2.22 3.11.6 6.94-2.62 7.78-2.37.73-5.17-.85-5.83-3.2-.1-.36.01-.37-.36-.42a1.55 1.55 0 01-1.34-1.25c-.12-.66.23-1.44 1.01-1.74 0-.01 0 0 0 0zM18.12 13.41c-.06-.36-.14-.82-.26-1.18.54.06 1.02.57 1.13 1.17.12.66-.18 1.31-.74 1.6-.03.03-.05.03-.09.01-.08-.04.03-.08-.04-1.6z"}),c.jsx("path",{fill:"#fe7f09",d:"M14.52 15.64c-.36.03-.71.08-1.06-.03-.29-.17-.3-.44-.25-.72.16-.83.33-1.67.5-2.5.04-.2.14-.44.38-.44.25 0 .34.23.38.46.07.24.26 1.86.34 2.48.05.42-.09.74-.29.75z"}),c.jsx("path",{fill:"#000",d:"M12.18 16.37c-.12-.11-.21-.23-.08-.38.14-.16.27-.08.4.03.81.68 1.76.68 2.58 0 .12-.1.25-.19.38-.05.14.15.06.28-.07.4-.96.85-2.35.81-3.21 0zM12.34 12.9a.558.558 0 01-.53-.55.545.545 0 111.09.02c-.02.29-.27.53-.56.53zm2.94 0a.569.569 0 01-.55-.55c0-.31.27-.55.59-.54.3.01.55.27.54.56-.01.29-.28.53-.58.53z"})]})}function A(t){return c.jsxs(e,{...t,children:[c.jsx("circle",{cx:"12",cy:"12",r:"11.5",fill:"#C30"}),c.jsx("path",{fill:"#000",d:"M20.62 13.2a1.9 1.9 0 01-1.27 1.66c-.15.06-.24.13-.29.29a5.32 5.32 0 01-8.7 2.14 2.12 2.12 0 00-.54-.36 6.44 6.44 0 01-3.74-5.5c0-.02-.05-.77-.02-1.53a.82.82 0 01-.37-.2L.98 9.18C.87 9.17.8 9.07.81 8.96l.04-.33c.01-.11.11-.18.22-.17l4.61.51a7.15 7.15 0 015.62-6.28l-.01-.06c-.01-.24.32-.45.74-.48.41-.03.75.14.78.36h.15a7.2 7.2 0 017.31 7.07c0 .06-.12.13-.35.19.08.03.12.06.1.08.06.2.1.41.1.62 0 .32-.08.63-.23.94v.03c.54.43.8 1.03.73 1.76z"}),c.jsx("path",{fill:"#FFF",d:"M8.72 11.52c.44-.09.88-.07 1.33.03 1.16.26 2.45-.42 1.87-2.04l5.15.04c.14 0 .71.68.79.8a4.92 4.92 0 01-2.62 7.78 4.85 4.85 0 01-5.83-3.2c-.1-.36.01-.37-.36-.42a1.55 1.55 0 01-1.34-1.25 1.58 1.58 0 011.01-1.74c0-.01 0 0 0 0zm10.59 2.8c.04.02.06.02.09-.01.56-.29.86-.94.74-1.6-.11-.59-.59-1.1-1.13-1.17.12.35.2.82.26 1.18.07 1.52-.04 1.56.04 1.6z"}),c.jsx("path",{fill:"#FE7F09",d:"M15.67 14.95c-.36.03-.71.08-1.06-.03-.29-.17-.3-.44-.25-.72l.5-2.5c.04-.2.14-.44.38-.44.25 0 .34.23.38.46.07.24.26 1.86.34 2.48.05.42-.09.74-.29.75z"}),c.jsx("path",{fill:"#000",d:"M13.33 15.68c-.12-.11-.21-.23-.08-.38.14-.16.27-.08.4.03.81.68 1.76.68 2.58 0 .12-.1.25-.19.38-.05.14.15.06.28-.07.4-.96.85-2.36.82-3.21 0zM13.49 12.21a.56.56 0 01-.53-.55.54.54 0 111.09.02.57.57 0 01-.56.53zM16.43 12.21a.57.57 0 01-.55-.55c0-.31.27-.55.59-.54.3.01.55.27.54.56-.01.29-.28.53-.58.53z"})]})}function P(t){return c.jsxs(e,{...t,children:[c.jsx("circle",{cx:"12",cy:"12",r:"11.5",fill:"#c30"}),c.jsx("path",{fill:"#000",d:"M19.47 13.89c-.02.18-.07.82-.69 1.32v5.36s-1.15-.04-2.86-1.33a6.898 6.898 0 01-4.09 1.33c-1.51 0-2.9-.48-4.04-1.3-1.87 1.39-2.9 1.3-2.9 1.3l.01-8.78c.11-3.18 2.88-6.98 6.99-6.99.97 0 3.14.27 4.92 2.31 1.57.42 2.41 1.19 2.44 1.89.02.37-.05.82-.73 1.29.06.2.28 1.05.26 1.88.52.43.76 1.01.69 1.72z"}),c.jsx("path",{fill:"#fff",d:"M7.57 12.21c.44-.09.88-.07 1.33.03 1.16.26 2.18-.76 1.95-1.92-.06-.31.05-.18.08-.16.72.51 1.52.75 2.4.75h3.06c.14 0 .24.02.33.15 2.22 3.11.6 6.94-2.62 7.78-2.37.73-5.17-.85-5.83-3.2-.1-.36.01-.37-.36-.42a1.55 1.55 0 01-1.34-1.25c-.13-.68.22-1.46 1-1.76 0-.01 0 0 0 0zm10.59 2.8c.04.02.06.02.09-.01.56-.29.86-.94.74-1.6-.11-.59-.59-1.1-1.13-1.17.12.35.2.82.26 1.18.07 1.52-.04 1.56.04 1.6z"}),c.jsx("path",{fill:"#fe7f09",d:"M14.52 15.64c-.36.03-.71.08-1.06-.03-.29-.17-.3-.44-.25-.72.16-.83.33-1.67.5-2.5.04-.2.14-.44.38-.44.25 0 .34.23.38.46.07.24.26 1.86.34 2.48.05.42-.09.74-.29.75z"}),c.jsx("path",{fill:"#000",d:"M12.18 16.37c-.12-.11-.21-.23-.08-.38.14-.16.27-.08.4.03.81.68 1.76.68 2.58 0 .12-.1.25-.19.38-.05.14.15.06.28-.07.4-.96.85-2.35.81-3.21 0zm.71-4.01a.551.551 0 00-.52-.56.544.544 0 10.52.56zm2.97 0a.554.554 0 00-.54-.56.562.562 0 00-.59.54c0 .3.25.55.55.55.3.01.57-.23.58-.53z"})]})}function L(t){return c.jsxs(e,{...t,children:[c.jsx("circle",{cx:"12",cy:"12",r:"11.5",fill:"#c30"}),c.jsx("path",{fill:"#000",d:"M21.13 10.41c0 5.46-4.42 9.88-9.88 9.88-5.45 0-9.88-4.42-9.88-9.88 0-4.42 3.35-9.88 9.88-9.88 5.46 0 9.88 4.42 9.88 9.88z"}),c.jsx("path",{fill:"#fff",d:"M8.26 15.63c-.12-.35.01-.44-.37-.42-1.33.07-2.09-2.29-.33-3.01.44-.09.88-.07 1.32.03 1.02.23 1.93-.53 1.98-1.52.8.62 2.2.43 2.67-.08 1.09.83 2.35.26 2.35.26.15.71.74 1.25 1.47 1.33 2.29 6.39-6.91 9.72-9.09 3.41z"}),c.jsx("path",{fill:"#fe7f09",d:"M14.52 15.64c-.36.03-.71.08-1.06-.03-.29-.17-.3-.44-.25-.72.16-.83.33-1.67.5-2.5.04-.2.14-.44.38-.44.25 0 .34.23.38.46.07.24.26 1.86.34 2.48.05.42-.09.74-.29.75z"}),c.jsx("path",{fill:"#000",d:"M12.18 16.37c-.12-.11-.21-.23-.08-.38.14-.16.27-.08.4.03.81.68 1.76.68 2.58 0 .12-.1.25-.19.38-.05.14.15.06.28-.07.4-.96.85-2.35.81-3.21 0zm.71-4.01a.551.551 0 00-.52-.56.544.544 0 10.52.56zm2.97 0a.554.554 0 00-.54-.56.562.562 0 00-.59.54c0 .3.25.55.55.55.3.01.57-.23.58-.53z"})]})}const B={"user1.jpg":c.jsx(O,{}),"user2.jpg":c.jsx(w,{}),"user3.jpg":c.jsx(A,{}),"user4.jpg":c.jsx(P,{}),"user5.jpg":c.jsx(L,{})},_=t("div")`
  display: grid;
  grid-template-columns: 1fr 1fr;
  justify-content: space-evenly;
  justify-items: center;
  align-content: space-evenly;
  align-items: center;
  width: fit-content;
  gap: 24px;
  margin: auto;

  & {
    .MuiButtonBase-root {
      width: 100px;
      height: 100px;
      padding: 0;

      &:first-child {
        border: 1px solid ${a.brownLight};
        width: 96px;
        height: 96px;

        & label {
          position: absolute;
          border-radius: 50%;
          width: 96px;
          height: 96px;
        }

        & .MuiSvgIcon-root {
          width: 35px;
          height: 35px;
          fill: ${a.brownLight};
        }
      }

      &:not(:first-child) {
        .MuiSvgIcon-root {
          width: 100%;
          height: auto;
        }
      }
    }
  }
`;const k=i((function(){const e=d.useContext(I),{getCropperStore:{onHandleUploadClick:t},onHandleImgClick:a}=e;return c.jsxs(M,{open:e.isProfilePicture,onClose:l,PaperProps:{"data-test":"enj-form-signup-picture-selection"},children:[c.jsx(C,{size:"small",color:"black",weight:"bold",maxWidth:"180px",text:s("profilePicture")}),c.jsx(C,{size:"mini",color:"lightGray",margin:"10px 0",text:s("selectPicture")}),c.jsxs(_,{"data-test":"enj-form-signup-picture-area",children:[c.jsx(p,{id:"enj-btn-profile-img-upload",onChange:a=>{e.setImageChanged(!0),t(a,1)},children:c.jsx(z,{component:"span",children:c.jsx(f,{})})}),e.getAvatars.map((({url:t,name:i})=>c.jsx(z,{onClick:()=>(async(t,i="")=>{const l=await r(t);await a(l,!0),e.setDefaultPictureName(i),e.setImageChanged(!0),n()})(t,i),children:B[i]},i)))]})]})})),D=t("img")`
  width: 100%;
  height: 100%;
  object-fit: cover;
`;const T=i((function({register:e=!0}){const t=d.useContext(I),[a,i]=d.useState(""),{onClickEditPicture:l,form:{picture:s}}=t;return d.useEffect((()=>{const e=(null==s?void 0:s.value)??"";e instanceof File?o(e,i):i(e)}),[null==s?void 0:s.value]),c.jsxs(F,{className:e?"":"enj-avatar",children:[c.jsx(N,{className:e?"":"enj-avatar",children:a?c.jsx(D,{loading:"lazy",src:a||"",alt:"user picture"}):c.jsx(P,{})}),c.jsx(z,{"data-test":"enj-form-signup-picture-edit",onClick:l,disabled:!t.isSecondStep&&e,children:c.jsx(y,{})})]})})),U=[{value:"COMMUNICATION_GENDER_NEUTRAL",label:s("communicationNeutral")},{value:"COMMUNICATION_GENDER_MASCULINE",label:s("communicationMasculine")},{value:"COMMUNICATION_GENDER_FEMENINE",label:s("communicationFeminine")}],H=e=>e?{}:{"& .MuiOutlinedInput-notchedOutline":{borderColor:a.red},"& .MuiFormLabel-root":{color:a.red}};const R=i((function(){const e=d.useContext(I),{form:{first_name:t,last_name:a,birth_date:i,picture:l,country:r,city:n,web_url:o,profile_name:p},onCitiesChanged:f,getCropperStore:M,onHandleImgClick:z}=e,{getCurrentCropImage:y,getImgsToCrop:F,setCurrentCropImage:N,deleteImageFromCrops:O,onHandleCropImage:w,onHandleDeleteAllImages:A}=M;d.useEffect((()=>{const t=null==l?void 0:l.value;if(t&&!(t instanceof File)){const a="string"==typeof t?t:S;a&&e.onHandleImgClick(a,!0)}}),[]);const P=d.useMemo((()=>F.find((e=>e.id===y))),[y,F]);return c.jsxs(c.Fragment,{children:[c.jsxs(E,{sx:{alignItems:"center",p:"0 1em"},children:[c.jsx(C,{color:"lightGray",alignSelf:"flex-start",size:"mini",margin:"0 0 0 14px",text:s("pictureProfile")}),c.jsx(T,{register:!1}),c.jsx(h,{required:!0,validateOnBlur:!0,fieldState:p,hiddenLabel:!1,label:s("profileName"),sx:H(p.value)}),c.jsx(h,{required:!0,validateOnBlur:!0,fieldState:t,hiddenLabel:!1,label:s("firstname"),sx:H(t.value)}),c.jsx(h,{required:!0,validateOnBlur:!0,fieldState:a,hiddenLabel:!1,label:s("lastname"),sx:H(a.value)}),c.jsx(j,{required:!0,validateOnBlur:!0,fieldState:i,hiddenLabel:!1,label:s("birthdate"),placeholder:"dd/mm/aaaa",sx:H(i.value)}),c.jsx(g,{required:!0,validateOnBlur:!0,fieldState:r,hiddenLabel:!1,label:s("country"),options:e.countries,sx:H(r.value)}),c.jsx(m,{required:!0,validateOnBlur:!0,hiddenLabel:!1,label:s("city"),fieldState:n,options:e.cities,renderOption:(e,t)=>c.jsx("li",{...e,children:c.jsxs(b,{gutterBottom:!0,sx:{"&":{fontSize:"13px"}},children:[t.label," (",t.data,")"]})}),onChangeInput:f,placeholder:s("writeYourCity"),sx:H(n.value)}),c.jsx(h,{fieldState:o,label:s("webBlog"),hiddenLabel:!1,placeholder:"https://miblog.com",InputProps:{endAdornment:c.jsx(v,{})}})]}),c.jsx(k,{}),c.jsx(u,{onClickAccept:()=>{z((null==P?void 0:P.croppedImage)??(null==P?void 0:P.image),!1,(()=>e.setImageChanged(!0)))},src:P,extension:e.getExtension,aspectRatio:x.NORMAL,changeAspectRatioAction:!1,images:F,onDelete:O,onChange:N,onCropImage:w,onClose:A,limit:1,forProfile:!0,forOneImage:!0})]})}));export{T as A,k as P,R as a,U as c,H as g};