PageSourceSearch

https://plattform.greenteams-netzwerk.eco/_next/static/chunks/pages/setup/profile-99043eccf3168b15.js

js greenteams-netzwerk.eco collected 2026-10-04 04:18:29 UTC 7,260 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3265],{40764:function(e,r,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/setup/profile",function(){return a(22711)}])},36541:function(e,r,a){"use strict";a.d(r,{D:function(){return PortalSpecificFieldsProvider},J:function(){return usePortalSpecificFields}});var t=a(11527),l=a(50959);let n=(0,l.createContext)({signup:[],setup:[]}),PortalSpecificFieldsProvider=e=>{let{children:r,data:a}=e,[i]=(0,l.useState)(a);return(0,t.jsx)(n.Provider,{value:i,children:r})},usePortalSpecificFields=()=>(0,l.useContext)(n)},22711:function(e,r,a){"use strict";a.r(r),a.d(r,{__N_SSP:function(){return J},default:function(){return L}});var t=a(11527),l=a(89874),n=a(90990),i=a(61289),o=a(36541),s=a(38827),u=a(69115),c=a(47987),d=a(50959),p=a(30632),f=a(1753),v=a(32031),m=a(28128),g=a(1669);let generateAvatar=async e=>{let{name:r,backgroundColor:a}=e,{data:t}=await g.Z.get("/api/frontend/v0/avatar/generate",{params:{name:r,backgroundColor:a}});return t};var _=["#4FD1C5","#63B3ED","#68D391","#76E4F7","#0987A0","#A7ABB0","#B794F4","#CBD5E0","#F687B3","#F6AD55","#F6E05E","#FC8181"],x=a(22897),h=a(43049),j=a(98842),b=a(41181),C=a(82103),P=a(78220),A=a(19147),y=a(68491),k=a(24669),F=a.n(k),S=a(96569),w=a(96007),N=a(10145),E=a(56549),T=a.n(E),q=a(63295),D=a(54429),I=a(23715),z=a(23735),O=a(58510),M=a(20318),R=a(29490),Z=a(18776),B=a(53257),K=a(25651),U=a(35068);let X=a(41162);var AvatarModal_ColorRadio=e=>{let{value:r,isChecked:a}=e,{getInputProps:l,htmlProps:n}=(0,K.x)(e),i=l();return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(U.x,{...n,"aria-label":X.name(r)[1],as:"label",children:[(0,t.jsx)("input",{...i}),(0,t.jsx)(U.x,{backgroundColor:r,borderRadius:"full",className:a?"ring-2 ring-black ring-offset-2":"",cursor:"pointer",h:"40px",tabIndex:0,w:"40p
1x"})]})})},ProfileForm_AvatarModal=e=>{let{isOpen:r,onClose:a,setAvatar:n,setAvatarColor:i,avatar:o,avatarColor:s,firstName:u}=e,c=(0,l.useTranslations)("common"),p=(0,l.useTranslations)("setup/profile/avatar-modal"),m=(0,d.useRef)(null),onPickAvatarColor=async e=>{if(!u)return;let r=await generateAvatar({name:u,backgroundColor:e});i(e),r&&n(r)},{getRootProps:g,getRadioProps:x}=(0,q.a)({onChange:onPickAvatarColor}),h=g(),onSubmitAvatar=async()=>{let e={avatar:o,avatar_color:s};e.avatar&&!/^data:/.test(e.avatar)&&delete e.avatar,await (0,v.ar)(e),a()};return(0,t.jsxs)(D.u_,{isOpen:r,onClose:a,size:{base:"full",sm:"xs"},children:[(0,t.jsx)(I.Z,{}),(0,t.jsxs)(z.h,{children:[(0,t.jsx)(O.f,{p:6,children:(0,t.jsxs)(f.Z,{alignItems:"center",children:[(0,t.jsx)(N.q,{backgroundColor:s,size:"xl",src:o}),(0,t.jsx)(M.z,{alignSelf:"stretch",id:"upload-avatar-image-btn",onClick:e=>{m.current&&(e.preventDefault(),m.current.click())},variant:"outline",children:p("uploadImage")}),(0,t.jsx)("input",{accept:".jpg, .png","aria-labelledby":"upload-avatar-image-btn",onChange:e=>{var r;if(!e.target||!e.target.files)return;let a=null===(r=e.target)||void 0===r?void 0:r.files[0];if(!a)return;let t=new FileReader;t.onload=e=>{var r;let a=null===(r=e.target)||void 0===r?void 0:r.result;T()(a)&&n(a)},t.readAsDataURL(a)},ref:m,style:{display:"none"},type:"file"}),(0,t.jsx)(R.x,{fontSize:"sm",children:p("orSelectColor")}),(0,t.jsx)(Z.k,{...h,flexWrap:"wrap",gap:6,justify:"center",p:1,children:_.map(e=>{let r=x({value:e});return(0,d.createElement)(AvatarModal_ColorRadio,{...r,isChecked:e===s,key:"avatar-color-".concat(e)})})})]})}),(0,t.jsxs)(B.m,{children:[(0,t.jsx)(M.z,{mr:4,onClick:a,variant:"outline",children:c("cancel")}),(0,t.jsx)(M.z,{colorScheme:"brand",onClick:onSubmitAvatar,children:c("save")})]})]})]})};let onKeyPress=e=>r=>{"Enter"===r.key&&e()};var ProfileForm_AvatarInput=e=>{let{setAvatar:r,setAvatarColor:a,avatar:l,avatarColor:n,firstName:i}=e,{isOpen:o,onOpen:s,onClose:u}=(0,S.q)(),c=(0,w.m)("AvatarInput");return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(N.q,{_hover:{opacity:.8,transition:"0.2s ease"},"aria-describedby":"avatar-description","aria-labelledby":"avatar-label",backgroundColor:n,onClick:s,onKeyUp:onKeyPress(s),size:"xl",src:l,sx:c,tabIndex:0}),(0,t.jsx)(ProfileForm_AvatarModal,{avatar:l,avatarColor:n,firstName:i,isOpen:o,onClose:u,setAvatar:r,setAvatarColor:a})]})};v.Rk.pick({first_name:!0,description:!0}).partial();var Profile_ProfileForm=()=>{let{userProfile:e}=(0,m.G)(),{signup:r}=(0,o.J)(),a=r.filter(e=>!e.hide_in_setup),{first_name:n,description:v,avatar:g,avatar_color:k}=e,S=!g&&!k,w=!g&&k,{submitStep:N}=(0,i.k)(),{errors:E}=(0,A.a)(),T=(0,h.r)(),q=(0,C.XN)(T,P.q.Setup,P.ON.Profile),{register:D,handleSubmit:I,control:z}=(0,p.cI)({defaultValues:{...(0,C.Ss)(e,q),...(0,C.Ss)(e,a),first_name:n,description:v||void 0}}),O=(0,p.qo)({control:z,name:"first_name"}),[M,R]=(0,d.useState)(g||void 0),[Z,B]=(0,d.useState)((()=>{if(!w)return k?"#".concat(k):_[0]})());(0,d.useEffect)(()=>{if(w||g)return;let createDefaultAvatar=async()=>{if(!Z)return;let e=await generateAvatar({name:n,backgroundColor:Z});e&&R(e)};createDefaultAvatar()},[]);let K=(0,l.useTranslations)("setup/profile/profile-form"),U=(0,l.useTranslations)("setup/common"),X=(0,l.useTranslations)("common"),J=F()(e.managed_tags)?e.managed_tags[0]:void 0;return(0,t.jsx)("form",{"aria-label":U("completeProfile"),id:"setup-step-form",onSubmit:I(e=>{let r=(0,C.w)(e,q,J),t=(0,C.w)(r,a,J);S&&(t.avatar=M,t.avatar_color=Z),N(t)}),children:(0,t.jsxs)(f.Z,{size:"lg",children:[(0,t.jsxs)(s.NI,{children:[(0,t.jsx)(u.l,{id:"avatar-label",children:K("avatar.label")}),(0,t.jsxs)(c.K,{alignItems:"center",direction:["column","row"],gap:6,children:[(0,t.jsx)(ProfileForm_AvatarInput,{avatar:M,avatarColor:Z,firstName:O,setAvatar:R,setAvatarColor:B}),(0,t.jsx)(s.Q6,{id:"avatar-description",children:K("avatar.helper")})]})]}),(()=>{let e=[{name:"first_name",type:b.sq.Text,label:X("profileMenu.firstName"),in_signup:!0,required:!0,multiple:!1,legend:null,header:null,placeholder:"",is_group_header:!1,parent_group_field_name:null,display_required_field_names:null,choices:null}];return(0,t.jsx)(x.Z,{control:z,defaultFields:e,errors:E,fieldOverrides:q.filter(e=>"description"!==e.name),register:D})})(),a.length?a.map(e=>(0,t.jsx)(j.e,{control:z,error:(0,y.zQ)(E,e.name),field:e,managedTag:J,register:D},e.name)):null,(()=>{let e=[{name:"description",type:b.sq.Textarea,label:K("aboutMe.label"),in_signup:!0,required:!1,multiple:!1,legend:K("aboutMe.helper"),header:null,placeholder:"",is_group_header:!1,parent_group_field_name:null,display_required_field_names:null,choices:null}];return(0,t.jsx)(x.Z,{control:z,defaultFields:e,errors:E,fieldOverrides:q.filter(e=>"description"===e.name),register:D})})()]})})};let Profile=e=>{let{userProfile:r,portalSpecificSignupProfileFields:a}=e,n=(0,l.useTranslations)("setup/common"),{first_name:s,last_name:u}=r,c=u?"".concat(s," ").concat(u):s,d=n("heyUser",{user:c});return(0,t.jsx)(i.T,{commonStepName:P.ON.Profile,dynamicFields:a,stepTitle:d,userProfile:r,children:(0,t.jsx)(o.D,{data:{signup:a,setup:[]},children:(0,t.jsx)(Profile_ProfileForm,{})})})};Profile.getLayout=e=>(0,t.jsx)(n.Z,{children:e});var J=!0,L=Profile}},function(e){e.O(0,[9774,2402,6017,4640,1860,9163,3616,5686,8638,7344,2897,2888,179],function(){return e(e.s=40764)}),_N_E=e.O()}]);
2//# sourceMappingURL=profile-99043eccf3168b15.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.