/*! For license information please see main.4c14c83d.chunk.js.LICENSE.txt */ (this["webpackJsonpkitest-client"]=this["webpackJsonpkitest-client"]||[]).push([[0],{7:function(e,t,a){"use strict";(function(e){a.d(t,"a",(function(){return c})),a.d(t,"b",(function(){return p})),a.d(t,"d",(function(){return l})),a.d(t,"e",(function(){return h})),a.d(t,"f",(function(){return r})),a.d(t,"g",(function(){return o})),a.d(t,"h",(function(){return d})),a.d(t,"i",(function(){return u})),a.d(t,"j",(function(){return m})),a.d(t,"k",(function(){return b})),a.d(t,"l",(function(){return g})),a.d(t,"c",(function(){return j}));var i,n;a(766);let c=function(e){return e.Raw="raw_orig",e.RawApplication="raw_app",e.RawZ="raw_z",e.PositionZ="position_z",e.CompetencyZ="competency_z",e.CompetencyAC="competency_ac",e.PositionAC="position_ac",e.PT="competency_pt",e}({});const s=(null===(i=e)||void 0===i||null===(n=Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}))||void 0===n?void 0:n.REACT_APP_SERVER_URL)||"",l={default:"dd.MM.yyyy",variant:"d.M.yyyy"},r="de-DE",o={year:"numeric",month:"2-digit",day:"2-digit"},d={...o,hour:"2-digit",minute:"2-digit"},u={birthday:/^\s*(3[01]|[12][0-9]|0?[1-9])\.(1[012]|0?[1-9])\.((?:19|20)\d{2})\s*$/,date:/^(?:(?:[0-2]\d|[3][0-1]|\d)\.(?:[0][1-9]|[1][0-2]|\d)\.\d*|\d*-(?:[0][1-9]|[1][0-2]|\d)-(?:[0-2]\d|[3][0-1]|\d))$/,description:/^\S+$/,email:/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,gender:/^.*(m\u00e4nnlich|weiblich|divers).*$/,hexCode:/^#([0-9A-F]{3}){1,2}$/i,name:/^[\u00C0-\u017F\sa-zA-Z,.'-]+$/i,nameWithNum:/^[\u00C0-\u017Fa-zA-Z0-9,.'-]+$/i,nameWithNumAndSpecial:/^[a-zA-Z0-9!@#~$%\xa7^&*\xb0()_+\-=[\]{};':"\\|,.<>/?]*$/,password:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&"\xa7/()=])[A-Za-z\d@$!%*?&"\xa7/()=]{8,}$/,phone:/^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s./0-9]*$/,sid:/^[0-9]*$/,wholeNumber:/^0*[1-9][0-9]*$/},b={branding:"Branding",color:"Farbe",dataSharing:"Daten teilen",description:"Beschreibung",eulaSurvey:"EULA-Umfrage",exportType:"Export-Typ",longName:"Name",Offices:"Einheiten",reports:"Reports",revaluation:"Umwertung",shortName:"Abk\xfcrzung",showResults:"Ergebnisse",type:"Typ",grades:"Noten",points:"Punkte",percentiles:"Prozentr\xe4nge",validFrom:"G\xfcltig von",validUntil:"G\xfcltig bis",status:"Status",location:"Standort",note:"Anmerkung"},j={OT:"Leistung",AC:"M\xfcndliches Verfahren",PT:"Pers\xf6nlichkeit"},p=["#F94144","#d15bbd","#F3722C","#F8961E","#F9844A","#F9C74F","#90BE6D","#43AA8B","#4D908E","#577590","#277DA1"],m=(e,t)=>"mock"===s?t:"".concat(s).concat(e),h=()=>{window.location.href;return new URL(window.location.href).origin},g={email:e=>u.email.test(e),name:e=>u.name.test(e),gender:e=>u.gender.test(e),birthday:e=>u.birthday.test(e)}}).call(this,a(174))},765:function(e,t,a){},954:function(e,t,a){},955:function(e,t,a){"use strict";a.r(t);a(646),a(669);var i=a(35),n=a.n(i),c=a(37),s=a(426),l=a(321),r=a(196),o=a(985),d=a(989),u=a(11),b=a.n(u),j=a(210),p=a(312),m=a.n(p),h=a(13),g=a(27),x=a(0),f=a.n(x),O=a(627),v=a(53),y=(a(765),a(338)),w=a.n(y);var N=a(23),C=a(24),S=(a(229),a(10)),k=a(7);var I={async getCustomers(){const e=await b.a.get(Object(k.j)("/api/customer/all","/api/customer/all"));return Promise.resolve(e.data.data)},async getCustomerById(e){const t=await b.a.get(Object(k.j)("/api/customer/".concat(e),"/api/customer/".concat(e)));return Promise.resolve(t.data.data)},async updateCustomer(e){let{id:t,longName:a,shortName:i,color:n,showResults:c,revaluation:s,reports:l}=e;const r=await b.a.put(Object(k.j)("/api/customer","/api/customer"),{id:t,longName:a,shortName:i,color:n,showResults:c,revaluation:s,reports:l});return Promise.resolve(r.data)},async createCustomer(e){const t=await b.a.post(Object(k.j)("/api/customer","/api/customer"),{data:e});return Promise.resolve(t.data)},async deleteCustomer(e){const t=await b.a.delete(Object(k.j)("/api/customer/".concat(e),"/api/customer/".concat(e)));return Promise.resolve(t.data)},async getAllOffices(){const e=await b.a.get(Object(k.j)("/api/office/all","/api/office/all"));return Promise.resolve(e.data.data)},async getCustomerOffices(e){const t=await b.a.get(Object(k.j)("/api/office/customer/".concat(e),"/api/office/customer/".concat(e)));return Promise.resolve(t.data.data)},async getOfficeById(e){const t=await b.a.get(Object(k.j)("/api/office/".concat(e),"/api/office/".concat(e)));return Promise.resolve(t.data.data)},async createOffice(e){const t=await b.a.put(Object(k.j)("/api/office","/api/office"),{data:e});return Promise.resolve(t.data)},async deleteOffice(e){const t=await b.a.delete(Object(k.j)("/api/office/".concat(e),"/api/office/".concat(e)));return Promise.resolve(t.data)},async updateOffice(e){let{id:t,longName:a,shortName:i,color:n,customerId:c}=e;const s=await b.a.put(Object(k.j)("/api/office","/api/office"),{id:t,longName:a,shortName:i,color:n,customerId:c});return Promise.resolve(s.data)},async getUsers(e){const t=await b.a.get(Object(k.j)("/api/customer/".concat(e,"/user"),"/api/customer/".concat(e,"/user")));return Promise.resolve(t.data)},async updateUser(e,t,a){const i=await b.a.post(Object(k.j)("/api/customer/".concat(e,"/user/").concat(t),"/api/customer/".concat(e,"/user/").concat(t)),{data:a});return Promise.resolve(i.data)},async deleteUser(e,t){const a=await b.a.delete(Object(k.j)("/api/customer/".concat(e,"/user/").concat(t),"/api/customer/".concat(e,"/user/").concat(t)));return Promise.resolve(a.data)},async getAllRvTypes(){const e=await b.a.get(Object(k.j)("/api/position/rvtype","/api/position/rvtype"));return Promise.resolve(e.data.data)},async getAllCompetencies(){const e=await b.a.get(Object(k.j)("/api/competency/all","/api/competency/all"));return Promise.resolve(e.data.data)},async createOrUpdateCompetency(e){let{id:t,shortName:a,longName:i,description:n,type:c}=e;const s=await b.a.put(Object(k.j)("/api/competency","/api/competency"),{id:t,shortName:a,longName:i,description:n,type:c});return Promise.resolve(s.data)},async deleteCompetency(e){const t=await b.a.delete(Object(k.j)("/api/competency/".concat(e),"/api/competency/".concat(e)));return Promise.resolve(t.data)}};var z={async getProjects(){const e=await b.a.get(Object(k.j)("/api/project","/api/project"));return Promise.resolve(e.data)},async getProjectPositions(e){const t=await b.a.get(Object(k.j)("/api/project/position/".concat(e),"/api/project/position/".concat(e)));return Promise.resolve(t.data)},async createProjectPosition(e,t,a){const i=await b.a.post(Object(k.j)("/api/position/".concat(e),"/api/position/".concat(e)),{data:t,details:a});return Promise.resolve(i.data)},async deleteProjectPosition(e){const t=await b.a.delete(Object(k.j)("/api/position/".concat(e),"/api/position/".concat(e)));return Promise.resolve(t.data)},async getUserOffices(e){const t=await b.a.get(Object(k.j)("/api/user/offices/".concat(e),"/api/user/offices/".concat(e)));return Promise.resolve(t.data.data)},async deleteProject(e){const t=await b.a.delete(Object(k.j)("/api/project/".concat(e),"/api/project/".concat(e)));return Promise.resolve(t.data)},async getProjectById(e){const t=await b.a.get(Object(k.j)("/api/project/".concat(e),"/api/project/".concat(e)));return Promise.resolve(t.data.data)},async updateProject(e){let{id:t,longName:a,shortName:i,validFrom:n,validUntil:c,Offices:s,eulaSurvey:l,exportType:r,branding:o,dataSharing:d,customerId:u}=e;const j=await b.a.put(Object(k.j)("/api/project","/api/project"),{id:t,longName:a,shortName:i,validFrom:n,validUntil:c,Offices:s,exportType:r,eulaSurvey:l,branding:o,dataSharing:d,customerId:u});return Promise.resolve(j.data)},async archiveProject(e){const t=await b.a.delete(Object(k.j)("/api/project/archive/".concat(e),"/api/project/archive/".concat(e)));return Promise.resolve(t.data)},async recalculateProject(e){const t=await b.a.put(Object(k.j)("/api/project/recalculate","/api/project/recalculate"),{projectId:e});return Promise.resolve(t.data)}};const D={async getAllNorms(){const e=await b.a.get(Object(k.j)("/api/norm/all","/api/norm/all"));return Promise.resolve(e.data)},async getNorm(e){const t=await b.a.get(Object(k.j)("/api/norm/".concat(e),"/api/norm/".concat(e)));return Promise.resolve(t.data)},async removeNormLink(e,t){const a=await b.a.delete(Object(k.j)("/api/norm/unlink/".concat(e,"/").concat(t),"/api/norm/unlink/".concat(e,"/").concat(t)));return Promise.resolve(a.data)},async createNorm(e,t,a){const i=await b.a.post(Object(k.j)("/api/norm/new","/norm/new"),{longName:e,shortName:t,description:a});return Promise.resolve(i.data)},async deleteNorm(e){const t=await b.a.delete(Object(k.j)("/api/norm/delete/".concat(e),"/norm/delete/".concat(e)));return Promise.resolve(t.data)},async updateNorm(e,t,a,i){const n=await b.a.put(Object(k.j)("/api/norm/update","/norm/update"),{normId:e,longName:t,shortName:a,description:i});return Promise.resolve(n.data)},async createNormLinks(e,t,a){const i=await b.a.post(Object(k.j)("/api/norm/link","/norm/link"),{normId:e,rawValueIds:t,deleteRawValueIds:a});return Promise.resolve(i.data)}};var P,A,T,F,B,R,E,U,W,L,M,G,V,_,K,q,H,Z,J,$,Y,X,Q,ee,te,ae,ie,ne,ce,se,le,re,oe,de,ue,be,je,pe,me,he,ge,xe,fe,Oe,ve,ye,we,Ne,Ce,Se,ke,Ie,ze;let De=(P=Object(S.b)("get all customers"),A=Object(S.b)("get customer by id"),T=Object(S.b)("create customer"),F=Object(S.b)("delete customer"),B=Object(S.b)("get all offices"),R=Object(S.b)("get customer offices"),E=Object(S.b)("get office by id"),U=Object(S.b)("create office"),W=Object(S.b)("clear offices"),L=Object(S.b)("delete office"),M=Object(S.b)("get users of customer"),G=Object(S.b)("update user"),V=Object(S.b)("delete user"),_=Object(S.b)("get project by id"),K=Object(S.b)("get all rvTypes"),q=Object(S.b)("get all norms"),H=Object(S.b)("get all competencies"),Z=class{constructor(){Object(N.a)(this,"fetchedCustomer",J,this),Object(N.a)(this,"fetchedCustomers",$,this),Object(N.a)(this,"fetchedOffice",Y,this),Object(N.a)(this,"fetchedOffices",X,this),Object(N.a)(this,"fetchedPositions",Q,this),Object(N.a)(this,"fetchedProject",ee,this),Object(N.a)(this,"fetchedProjects",te,this),Object(N.a)(this,"fetchedUsers",ae,this),Object(N.a)(this,"fetchedRvTypes",ie,this),Object(N.a)(this,"fetchedCompetencies",ne,this),Object(N.a)(this,"fetchedNorms",ce,this),Object(N.a)(this,"fetchedNormRvTypes",se,this),Object(N.a)(this,"isFetchingCustomerData",le,this),Object(N.a)(this,"isFetchingOfficeData",re,this),Object(N.a)(this,"isFetchingProjectData",oe,this),Object(N.a)(this,"isFetchingCompetencyData",de,this),Object(N.a)(this,"isFetchingRvTypeData",ue,this),Object(N.a)(this,"isFetchingNormData",be,this),Object(N.a)(this,"getCustomers",je,this),Object(N.a)(this,"getCustomerById",pe,this),Object(N.a)(this,"createCustomer",me,this),Object(N.a)(this,"deleteCustomer",he,this),Object(N.a)(this,"getAllOffices",ge,this),Object(N.a)(this,"getCustomerOffices",xe,this),Object(N.a)(this,"getOfficeById",fe,this),Object(N.a)(this,"createOffice",Oe,this),Object(N.a)(this,"clearOffices",ve,this),Object(N.a)(this,"deleteOffice",ye,this),Object(N.a)(this,"getUsers",we,this),Object(N.a)(this,"updateUser",Ne,this),Object(N.a)(this,"deleteUser",Ce,this),Object(N.a)(this,"getProjectById",Se,this),Object(N.a)(this,"getAllRvTypes",ke,this),Object(N.a)(this,"getAllNorms",Ie,this),Object(N.a)(this,"getAllCompetencies",ze,this),this.fetchedCustomer={},this.fetchedCustomers=[],this.fetchedOffice={},this.fetchedOffices=[],this.fetchedPositions=[],this.fetchedProject={},this.fetchedProjects=[],this.fetchedUsers=[],this.fetchedRvTypes=[],this.fetchedCompetencies=[],this.fetchedNorms=[],this.fetchedNormRvTypes=[],this.isFetchingCustomerData=!1,this.isFetchingOfficeData=!1,this.isFetchingProjectData=!1,this.isFetchingCompetencyData=!1,this.isFetchingRvTypeData=!1,this.isFetchingNormData=!1}},J=Object(C.a)(Z.prototype,"fetchedCustomer",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),$=Object(C.a)(Z.prototype,"fetchedCustomers",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Y=Object(C.a)(Z.prototype,"fetchedOffice",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),X=Object(C.a)(Z.prototype,"fetchedOffices",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Q=Object(C.a)(Z.prototype,"fetchedPositions",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ee=Object(C.a)(Z.prototype,"fetchedProject",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),te=Object(C.a)(Z.prototype,"fetchedProjects",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ae=Object(C.a)(Z.prototype,"fetchedUsers",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ie=Object(C.a)(Z.prototype,"fetchedRvTypes",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ne=Object(C.a)(Z.prototype,"fetchedCompetencies",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ce=Object(C.a)(Z.prototype,"fetchedNorms",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),se=Object(C.a)(Z.prototype,"fetchedNormRvTypes",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),le=Object(C.a)(Z.prototype,"isFetchingCustomerData",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),re=Object(C.a)(Z.prototype,"isFetchingOfficeData",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),oe=Object(C.a)(Z.prototype,"isFetchingProjectData",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),de=Object(C.a)(Z.prototype,"isFetchingCompetencyData",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ue=Object(C.a)(Z.prototype,"isFetchingRvTypeData",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),be=Object(C.a)(Z.prototype,"isFetchingNormData",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),je=Object(C.a)(Z.prototype,"getCustomers",[P],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return()=>{this.isFetchingCustomerData=!0,Object(S.g)("Get all customers",(async()=>{this.fetchedCustomers=await I.getCustomers(),this.isFetchingCustomerData=!1}))}}}),pe=Object(C.a)(Z.prototype,"getCustomerById",[A],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return e=>(this.isFetchingCustomerData=!0,Object(S.g)("get customer by id",(async()=>{this.fetchedCustomer=await I.getCustomerById(e),this.isFetchingCustomerData=!1})),this.fetchedCustomer)}}),me=Object(C.a)(Z.prototype,"createCustomer",[T],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return e=>(this.isFetchingCustomerData=!0,Object(S.g)("Create customer",(async()=>{this.fetchedCustomers=await I.createCustomer(e),this.isFetchingCustomerData=!1})),this.fetchedCustomers)}}),he=Object(C.a)(Z.prototype,"deleteCustomer",[F],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return e=>(this.isFetchingCustomerData=!0,Object(S.g)("Delete customer by id",(async()=>{this.fetchedCustomers=await I.deleteCustomer(e),this.isFetchingCustomerData=!1})),this.fetchedCustomers)}}),ge=Object(C.a)(Z.prototype,"getAllOffices",[B],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return()=>{this.isFetchingOfficeData=!0,Object(S.g)("get all offices",(async()=>{this.fetchedOffices=await I.getAllOffices(),this.isFetchingOfficeData=!1}))}}}),xe=Object(C.a)(Z.prototype,"getCustomerOffices",[R],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return e=>{this.isFetchingOfficeData=!0,Object(S.g)("get customer offices",(async()=>{this.fetchedOffices=await I.getCustomerOffices(e),this.isFetchingOfficeData=!1}))}}}),fe=Object(C.a)(Z.prototype,"getOfficeById",[E],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return e=>{this.isFetchingOfficeData=!0,Object(S.g)("get office by id",(async()=>{this.fetchedOffice=await I.getOfficeById(e),this.isFetchingOfficeData=!1}))}}}),Oe=Object(C.a)(Z.prototype,"createOffice",[U],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return e=>{this.isFetchingOfficeData=!0,Object(S.g)("create office",(async()=>{await I.createOffice(e),this.isFetchingOfficeData=!1}))}}}),ve=Object(C.a)(Z.prototype,"clearOffices",[W],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return()=>{this.isFetchingOfficeData=!0,Object(S.g)("clear Offices",(async()=>{this.fetchedOffices=[],this.isFetchingOfficeData=!1}))}}}),ye=Object(C.a)(Z.prototype,"deleteOffice",[L],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return e=>{this.isFetchingCustomerData=!0,Object(S.g)("delete office",(async()=>{await I.deleteOffice(e),this.isFetchingCustomerData=!1}))}}}),we=Object(C.a)(Z.prototype,"getUsers",[M],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return e=>{this.isFetchingCustomerData=!0,Object(S.g)("Get Users of customer",(async()=>{this.fetchedUsers=await I.getUsers(e),this.isFetchingCustomerData=!1}))}}}),Ne=Object(C.a)(Z.prototype,"updateUser",[G],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return(e,t,a)=>{this.isFetchingCustomerData=!0,Object(S.g)("Update User",(async()=>{this.fetchedUsers=await I.updateUser(e,t,a),this.isFetchingCustomerData=!1}))}}}),Ce=Object(C.a)(Z.prototype,"deleteUser",[V],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return(e,t)=>{this.isFetchingCustomerData=!0,Object(S.g)("Delete User",(async()=>{this.fetchedUsers=await I.deleteUser(e,t),this.isFetchingCustomerData=!1}))}}}),Se=Object(C.a)(Z.prototype,"getProjectById",[_],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return e=>{this.isFetchingProjectData=!0,Object(S.g)("Get project by id",(async()=>{this.fetchedProject=await z.getProjectById(e),this.isFetchingProjectData=!1}))}}}),ke=Object(C.a)(Z.prototype,"getAllRvTypes",[K],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return()=>{this.isFetchingRvTypeData=!0,Object(S.g)("get all rvTypes",(async()=>{this.fetchedRvTypes=await I.getAllRvTypes(),this.isFetchingRvTypeData=!1}))}}}),Ie=Object(C.a)(Z.prototype,"getAllNorms",[q],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return()=>{this.isFetchingNormData=!0,Object(S.g)("get all norms",(async()=>{const e=await D.getAllNorms();1e3===e.status_code&&e.data&&(this.fetchedNorms=e.data,this.fetchedNormRvTypes=this.fetchedNorms.map((e=>{var t;return null===e||void 0===e||null===(t=e.RawValues)||void 0===t?void 0:t.map((e=>null===e||void 0===e?void 0:e.RvTypes[0]))})).flat()),this.isFetchingNormData=!1}))}}}),ze=Object(C.a)(Z.prototype,"getAllCompetencies",[H],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return()=>{this.isFetchingCompetencyData=!0,Object(S.g)("get all competencies",(async()=>{this.fetchedCompetencies=await I.getAllCompetencies(),this.isFetchingCompetencyData=!1}))}}}),Z);var Pe=Object(x.createContext)(new De),Ae=a(140),Te=a(139),Fe=a.n(Te),Be=a(427),Re=a.n(Be);let Ee=function(e){return e.grades="grades",e.points="points",e.percentiles="percentiles",e}({});function Ue(){return{id:"",customerId:"",longName:"",shortName:"",validFrom:"",validUntil:"",eulaSurvey:"",branding:!1,dataSharing:!1,exportType:Ee.grades,Offices:[{id:"",customerId:"",longName:"",shortName:"",color:"",Projects:[],Positions:[],Customer:{},Application:{},Activity:{}}],Positions:[{id:"",projectId:"",longName:"",shortName:"",level:0,mJobNormParam:0,PosComps:[],Project:{},Norm:{}}]}}var We=a(986),Le=a(1001),Me=a(1002),Ge=a(987),Ve=a(80),_e=a(434),Ke=a(1011),qe=a(1012),He=a(361);let Ze=function(e){return e[e.SUCCESS=1e3]="SUCCESS",e[e.FAIL=5e3]="FAIL",e[e.EXISTS=1009]="EXISTS",e[e.NOTFOUND=4e3]="NOTFOUND",e}({});const Je=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return{...e&&{variant:e},preventDuplicate:!0,anchorOrigin:{horizontal:"right",vertical:"bottom"}}};var $e={async checkConflicts(e){const t=await b.a.request({url:Object(k.j)("/api/import/conflicts","/conflicts"),method:"POST",data:e});return await Promise.resolve(t.data.data)},async importParticipants(e,t){const a=await b.a.put(Object(k.j)("/api/import/new","/api/import/new"),{participants:e,file:t},{});return Promise.resolve(a.data)},async addApplication(e,t,a,i,n){const c=await b.a.put(Object(k.j)("/api/import/ui","/api/import/ui"),{participantId:e,positionId:t,officeId:a,validFrom:i,validTo:n});return Promise.resolve(c.data)},async importAcData(e,t,a,i,n,c){const s=await b.a.post(Object(k.j)("/api/import/ac","/api/import/ac"),{positionId:e,eventId:t,groupId:a,date:i,participants:n,competencies:c});return Promise.resolve(s.data)}};var Ye,Xe,Qe,et,tt,at,it,nt,ct,st,lt,rt,ot,dt,ut,bt,jt,pt,mt,ht,gt,xt,ft,Ot,vt,yt,wt={async createOrUpdate(e){const t=await b.a.put(Object(k.j)("/api/user","/api/user"),{data:e});return Promise.resolve(t.data)},async loginUser(e){const t=await b.a.request({url:Object(k.j)("/api/login/","/api/login"),method:"POST",data:e});return Promise.resolve(t.data)},async getUser(){const e=await b.a.request({url:Object(k.j)("/api/user","/api/user"),method:"GET"});return Promise.resolve(e.data)},async getUsers(){const e=await b.a.get(Object(k.j)("/api/user/all","/api/user/all"));return Promise.resolve(e.data.data)},async deleteUser(e){const t=await b.a.delete(Object(k.j)("/api/user/".concat(e),"/api/user/".concat(e)));return Promise.resolve(t.data)},async updateUser(e){const t=await b.a.put(Object(k.j)("/api/user","/api/user"),{data:e});return Promise.resolve(t.data)},async changeNavPrefs(e){const t=await b.a.request({url:Object(k.j)("/api/user/updateNavPref/".concat(e),"/api/user/updateNavPref/".concat(e)),method:"PUT"});return Promise.resolve(t.data)}};let Nt=(Ye=Object(S.b)("set User"),Xe=Object(S.b)("map user role"),Qe=Object(S.b)("get current user"),et=Object(S.b)("get all users"),tt=Object(S.b)("login User"),at=Object(S.b)("delete user"),it=Object(S.b)("update user"),nt=Object(S.b)("change navigation preferences"),ct=class{constructor(){Object(N.a)(this,"fetchedUsers",st,this),Object(N.a)(this,"isfetchingData",lt,this),Object(N.a)(this,"loggedIn",rt,this),Object(N.a)(this,"isAdmin",ot,this),Object(N.a)(this,"isSupport",dt,this),Object(N.a)(this,"isAdminSupport",ut,this),Object(N.a)(this,"isCustomer",bt,this),Object(N.a)(this,"user",jt,this),Object(N.a)(this,"userRole",pt,this),Object(N.a)(this,"setUser",mt,this),Object(N.a)(this,"getRoleString",ht,this),Object(N.a)(this,"getUser",gt,this),Object(N.a)(this,"getUsers",xt,this),Object(N.a)(this,"login",ft,this),Object(N.a)(this,"deleteUser",Ot,this),Object(N.a)(this,"updateUser",vt,this),Object(N.a)(this,"changeNavPrefs",yt,this),this.fetchedUsers=[],this.isfetchingData=!1,this.loggedIn=!1,this.isAdmin=!1,this.isSupport=!1,this.isAdminSupport=!1,this.isCustomer=!1,this.user={},this.userRole=0}},st=Object(C.a)(ct.prototype,"fetchedUsers",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),lt=Object(C.a)(ct.prototype,"isfetchingData",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),rt=Object(C.a)(ct.prototype,"loggedIn",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ot=Object(C.a)(ct.prototype,"isAdmin",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),dt=Object(C.a)(ct.prototype,"isSupport",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ut=Object(C.a)(ct.prototype,"isAdminSupport",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),bt=Object(C.a)(ct.prototype,"isCustomer",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),jt=Object(C.a)(ct.prototype,"user",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),pt=Object(C.a)(ct.prototype,"userRole",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),mt=Object(C.a)(ct.prototype,"setUser",[Ye],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){let a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e.user=t,e.loggedIn=a,e.userRole=Number(t.roleId),e.isAdmin=1===Number(t.roleId),e.isSupport=2===Number(t.roleId),e.isAdminSupport=1===Number(t.roleId)||2===Number(t.roleId),e.isCustomer=3===Number(t.roleId)}}}),ht=Object(C.a)(ct.prototype,"getRoleString",[Xe],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return e=>({1:"admin",2:"support",3:"customer",4:"assistant"}[e.roleId])}}),gt=Object(C.a)(ct.prototype,"getUser",[Qe],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return()=>{Object(S.g)("Get current user",(async()=>{const e=await wt.getUser();this.setUser(e)}))}}}),xt=Object(C.a)(ct.prototype,"getUsers",[et],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return()=>{this.isfetchingData=!0,Object(S.g)("Get all users",(async()=>{this.fetchedUsers=await wt.getUsers(),this.isfetchingData=!1}))}}}),ft=Object(C.a)(ct.prototype,"login",[tt],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return async e=>{const t=await wt.loginUser(e),{token:a}=t;if(a){localStorage.setItem("jwtToken",a),b.a.defaults.headers.common.Authorization=a;const e=m()(a);return this.setUser({id:e.id,firstName:e.firstName,lastName:e.lastName,email:e.email,roleId:e.roleId,reports:e.reports,revaluation:e.revaluation,showResults:e.showResults,navPref:e.navPref}),await Promise.resolve(!0)}return delete b.a.defaults.headers.common.Authorization,await Promise.resolve(!1)}}}),Ot=Object(C.a)(ct.prototype,"deleteUser",[at],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return e=>{this.isfetchingData=!0,Object(S.g)("Delete User",(async()=>{this.fetchedUsers=await wt.deleteUser(e),this.isfetchingData=!1}))}}}),vt=Object(C.a)(ct.prototype,"updateUser",[it],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return e=>{this.isfetchingData=!0,Object(S.g)("Update User",(async()=>{this.fetchedUsers=await wt.updateUser(e),this.isfetchingData=!1}))}}}),yt=Object(C.a)(ct.prototype,"changeNavPrefs",[nt],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return e=>{Object(S.g)("Change navigation preferences",(async()=>{const t=await wt.changeNavPrefs(e);this.setUser({...this.user,navPref:t.navPref},!0)}))}}}),ct);var Ct=Object(x.createContext)(new Nt),St=a(630),kt=a(79),It=a(1031),zt=a(1);const Dt=Object(s.a)((e=>Object(l.a)({root:{maxWidth:"250px"},red:{color:e.palette.error.main},green:{color:e.palette.success.main}})));var Pt=Object(h.a)((e=>{let{allowKeyboardControl:t=!0,autoOk:a=!0,cancelBtnText:i="Abbrechen",disablePast:n=!1,disableFuture:c=!1,initialDate:s=new Date,label:l,maxDate:r=new Date("2100-01-01"),maxDateMessage:o="Maximaldatum ung\xfcltig",minDate:d=new Date("1900-01-01"),minDateMessage:u="Minimaldatum ung\xfcltig",okBtnText:b="OK",openTo:p="date",processDate:m}=e;const h=Dt(),[g,f]=Object(x.useState)(s);return Object(zt.jsx)(kt.a,{utils:St.a,locale:j.a,children:Object(zt.jsx)(It.a,{fullWidth:!0,className:h.root,allowKeyboardControl:t,openTo:p,autoOk:a,cancelLabel:Object(zt.jsx)("span",{className:h.red,children:i}),disablePast:n,disableFuture:c,format:k.d.default,initialFocusedDate:s,label:l,maxDate:r,maxDateMessage:o,minDate:d,minDateMessage:u,okLabel:Object(zt.jsx)("span",{className:h.green,children:b}),onChange:e=>(e=>{f(e),m(e)})(e),value:g,variant:"dialog"})})})),At=a(562);const Tt=Object(s.a)((e=>Object(l.a)({root:{width:"100%",height:"100%",padding:e.spacing(2),boxSizing:"border-box","& > * + *":{marginTop:e.spacing(2)}}})));var Ft=Object(h.a)((()=>{const e=Tt();return Object(zt.jsx)("div",{className:e.root,"data-cy":"loading",children:Object(zt.jsx)(At.a,{color:"secondary"})})})),Bt=a(430),Rt=a(431),Et=a(435),Ut=a(547),Wt=a(556),Lt=a(406),Mt=a(1034);const Gt=Object(s.a)((e=>Object(l.a)({selector:{width:"100%",minWidth:"220px"},hint:{textAlign:"center",color:e.palette.warning.main}}))),Vt={office:{},project:{},position:{}};var _t=Object(h.a)((e=>{var t,a,i;let{offices:n,invisibleProjects:c,existingApplications:s,onChange:l,projectUnselectable:r,positionUnselectable:o}=e;const d=Gt(),[u,b]=Object(x.useState)(Vt),j=e=>{const t=f(null===e||void 0===e?void 0:e.Projects);let a={},i={};if(1===(null===t||void 0===t?void 0:t.length)){a=t[0];const n=O(e,a);1===(null===n||void 0===n?void 0:n.length)&&(i=n[0])}b({office:e,project:a,position:i}),l&&l({office:{object:e},project:{object:a,reset:!a},position:{object:i,reset:!i}})},p=e=>{b({...u,project:e,position:{}}),l&&l({project:{object:e},position:{reset:!0}})},m=e=>{b({...u,position:e}),l&&l({position:{object:e}})},h=e=>{var t,a,i;const n=null===u||void 0===u||null===(t=u.office)||void 0===t||null===(a=t.Projects)||void 0===a?void 0:a.find((t=>t.id===e.target.value));null!==u&&void 0!==u&&null!==(i=u.office)&&void 0!==i&&i.id&&n&&p(n)},g=e=>{var t,a,i,n;const c=null===u||void 0===u||null===(t=u.project)||void 0===t||null===(a=t.Positions)||void 0===a?void 0:a.find((t=>t.id===e.target.value));null!==u&&void 0!==u&&null!==(i=u.office)&&void 0!==i&&i.id&&null!==u&&void 0!==u&&null!==(n=u.project)&&void 0!==n&&n.id&&c&&m(c)},f=e=>e?e.filter((e=>!(null!==c&&void 0!==c&&c.map((e=>e.id)).includes(e.id)))):void 0,O=(e,t)=>{var a;return null===t||void 0===t||null===(a=t.Positions)||void 0===a?void 0:a.filter((t=>!(null!==s&&void 0!==s&&s.find((a=>a.Office.id===e.id&&a.Position.id===t.id)))))};return Object(zt.jsxs)(Lt.a,{className:d.selector,children:[(v=n,null!==v&&void 0!==v&&v.length?(u.office.id||1!==v.length||j(v[0]),Object(zt.jsx)(Bt.a,{fullWidth:!0,children:Object(zt.jsx)(Mt.a,{fullWidth:!0,id:"office-select",options:v,getOptionLabel:e=>(null===e||void 0===e?void 0:e.longName)||"",value:u.office,onChange:(e,t)=>{(e=>{if(!e)return;const t=null===n||void 0===n?void 0:n.find((t=>t.id===e.id));t&&j(t)})(t)},noOptionsText:"Keine Einheit",size:"small",renderInput:e=>Object(zt.jsx)(Wt.a,{...e,color:"secondary",label:"Einheit"}),groupBy:e=>{var t;return(null===(t=e.Customer)||void 0===t?void 0:t.longName)||""}})})):Object(zt.jsx)("p",{className:d.hint,children:"Keine Einheiten verf\xfcgbar"})),(null===u||void 0===u||null===(t=u.office)||void 0===t?void 0:t.id)&&!r&&(e=>{if(null===u||void 0===u||!u.office)return;const t=f(e);return null!==t&&void 0!==t&&t.length?(u.project.id||1!==t.length||p(t[0]),Object(zt.jsxs)(Bt.a,{fullWidth:!0,children:[Object(zt.jsx)(Rt.a,{id:"project-select-label",children:"Projekt"}),Object(zt.jsx)(Et.a,{value:u.project.id||"",labelId:"project-select-label",id:"project-select",onChange:h,children:null===t||void 0===t?void 0:t.map(((e,t)=>Object(zt.jsx)(Ut.a,{value:e.id,children:e.longName},t)))})]})):Object(zt.jsx)("p",{className:d.hint,children:"F\xfcr diese Einheit sind keine Projekte verf\xfcgbar"})})(null===u||void 0===u||null===(a=u.office)||void 0===a?void 0:a.Projects),(null===u||void 0===u||null===(i=u.project)||void 0===i?void 0:i.id)&&!o&&(()=>{if(null===u||void 0===u||!u.project)return;const e=O(u.office,u.project);return null!==e&&void 0!==e&&e.length?(u.position.id||1!==e.length||m(e[0]),Object(zt.jsxs)(Bt.a,{fullWidth:!0,children:[Object(zt.jsx)(Rt.a,{id:"position-select-label",children:"Position"}),Object(zt.jsx)(Et.a,{value:u.position.id||"",labelId:"position-select-label",id:"position-select",onChange:g,children:e.map(((e,t)=>Object(zt.jsx)(Ut.a,{value:e.id,children:e.longName},t)))})]})):Object(zt.jsx)("p",{className:d.hint,children:"F\xfcr dieses Projekt sind keine Positionen verf\xfcgbar"})})()]});var v}));const Kt=Object(s.a)((e=>Object(l.a)({root:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center"},title:{textAlign:"center",boxSizing:"border-box"},red:{color:e.palette.error.main},green:{color:e.palette.success.main},actions:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end"},content:{width:"400px",padding:e.spacing(2),display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:e.spacing(2)},datePickers:{display:"flex",flexDirection:"row",gap:e.spacing(4)},requestButton:{width:"fit-content"}}))),qt={office:{},project:{},position:{}};var Ht=Object(h.a)((e=>{let{close:t,open:a,data:i}=e;const n=Kt(),c=Object(v.f)(),{user:s}=Object(x.useContext)(Ct),{enqueueSnackbar:l}=Object(g.b)(),{getUserOffices:r}=z,[o,d]=Object(x.useState)([]),[u,b]=Object(x.useState)(!1),[j,p]=Object(x.useState)(qt),[m,h]=Object(x.useState)({validFrom:Object(Ke.a)(),validUntil:Object(qe.a)(new Date,{weeks:1})}),f=()=>{p(qt),t()},O=()=>Object(He.a)(m.validUntil,m.validFrom)&&Object(He.a)(m.validUntil,new Date)&&Object(He.a)(m.validFrom,new Date),y=(e,t)=>{h({...m,[e]:t}),O()||l("Das Startdatum muss vor dem Enddatum liegen | Nur zuk\xfcnftige Daten m\xf6glich",Je("error"))};return Object(x.useEffect)((()=>{(async()=>{if(!i)return;b(!0);const e=await r(s.id);e&&d(e),b(!1)})()}),[]),Object(zt.jsxs)(We.a,{transitionDuration:100,className:n.root,open:a,onClose:f,children:[Object(zt.jsx)(Le.a,{className:n.title,children:"Bewerbung Hinzuf\xfcgen"}),Object(zt.jsx)(Me.a,{}),Object(zt.jsxs)(Ge.a,{className:n.content,children:[Object(zt.jsx)(Ve.a,{children:"W\xe4hlen Sie eine Position"}),Object(zt.jsx)(_t,{offices:o,existingApplications:null===i||void 0===i?void 0:i.Applications,onChange:e=>{var t,a,i;p({office:null!==(t=e.office)&&void 0!==t&&t.object?e.office.object:j.office,project:null!==(a=e.project)&&void 0!==a&&a.object?e.project.object:j.project,position:null!==(i=e.position)&&void 0!==i&&i.object?e.position.object:j.position})}}),Object(zt.jsx)(Ve.a,{children:"W\xe4hlen Sie einen Zeitraum"}),Object(zt.jsxs)("div",{className:n.datePickers,children:[Object(zt.jsx)(Pt,{disablePast:!0,label:"G\xfcltig von",minDate:Object(Ke.a)(),initialDate:m.validFrom,processDate:e=>y("validFrom",e)}),Object(zt.jsx)(Pt,{disablePast:!0,label:"G\xfcltig bis",minDate:Object(qe.a)(m.validFrom,{days:1}),initialDate:m.validUntil,processDate:e=>y("validUntil",e)})]}),u?Object(zt.jsx)(Ft,{}):Object(zt.jsx)(_e.a,{fullWidth:!0,size:"small",variant:"contained",color:"secondary",type:"submit",className:n.requestButton,disabled:!Object.values(j).every((e=>null===e||void 0===e?void 0:e.id))||!O(),onClick:async()=>{if(!Object.values(j).every((e=>null===e||void 0===e?void 0:e.id))||!i)return;b(!0);1e3===(await $e.addApplication(null===i||void 0===i?void 0:i.id,j.position.id,j.office.id,m.validFrom,m.validUntil)).status_code?(l("Bewerbung hinzugef\xfcgt",Je("success")),c.go(0)):(l("Bewerbung konnte nicht hinzugef\xfcgt werden",Je("error")),f()),b(!1)},children:"Bewerbung Hinzuf\xfcgen"})]})]})})),Zt=a(353),Jt=a(629),$t=a(603);const Yt=e=>Object(Zt.a)(Object(Jt.a)(e,k.d.default,new Date))?Object(Jt.a)(e,k.d.default,new Date):Object(Zt.a)(Object(Jt.a)(e,k.d.variant,new Date))?Object(Jt.a)(e,k.d.variant,new Date):new Date(e),Xt=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.toLocaleDateString(k.f,t?k.h:k.g)},Qt=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a="";try{const i=Yt(e);if(!Object(Zt.a)(i))throw new Error("Invalid Date");a=Xt(i,t)}catch(i){console.log(i),a=e}return a},ea=e=>{let t="";if("string"!==typeof e)throw new Error("Date is not a string");const a=Yt(e);try{if(!Object(Zt.a)(a))throw new Error("Invalid Date");t="".concat(Xt(Object($t.a)(a,1))," 23:59:59 Uhr")}catch(i){console.log(i)}return t},ta={run:{created:"Erstellt",valid:"Aktiv",started:"Gestartet",complete:"Abgeschlossen",incomplete:"Nicht abgeschlossen",expired:"Abgelaufen"},application:{created:"Erstellt",pending:"Teilnahme ausstehend",complete:"Test abgeschlossen",incomplete:"Frist abgelaufen",abort:"L\xf6schanfrage gestellt",support:"Supportfall in Bearbeitung"},event:{created:"Erstellt",pending:"Best\xe4tigt",complete:"Durchgef\xfchrt",abort:"Storniert"},group:{valid:"Offen",complete:"Abgeschlossen",abort:"Storniert"}},aa=(e,t,a)=>{let i="";switch(e){case"run":i=ta.run[t];break;case"application":i=a?ta.application.support:ta.application[t];break;case"event":i=ta.event[t];break;case"group":i=ta.group[t]}return i};let ia=function(e){return e.created="created",e.pending="pending",e.complete="complete",e.abort="abort",e}({});var na={async getAllEvents(){const e=await b.a.get(Object(k.j)("/api/event/all","/api/event/all"));return 1e3===e.data.status_code?Promise.resolve(e.data):Promise.reject("error")},async getEvent(e){const t=await b.a.get(Object(k.j)("/api/event/".concat(e),"/api/event/".concat(e)));return 1e3===t.data.status_code?Promise.resolve(t.data.data):Promise.reject("error")},async deleteEvent(e){const t=await b.a.delete(Object(k.j)("/api/event/".concat(e),"/api/event/".concat(e)));return 1e3===t.data.status_code?Promise.resolve(t.data):Promise.reject("error")},async updateEvent(e){var t,a,i;const n=await b.a.put(Object(k.j)("/api/event","/api/event"),{eventId:e.id,projectId:null===(t=e.Project)||void 0===t?void 0:t.id,officeId:null===(a=e.Office)||void 0===a?void 0:a.id,userId:null===(i=e.User)||void 0===i?void 0:i.id,note:e.note,date:e.date,location:e.location,status:e.status,groupNames:e.groupNames});return Promise.resolve(n.data)},async updateGroupStatus(e,t){const a=await b.a.put(Object(k.j)("/api/event/".concat(e),"/api/event/".concat(e)),{status:t});return Promise.resolve(a.data)}};const ca=Object(s.a)((e=>Object(l.a)({root:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center"},title:{textAlign:"center",boxSizing:"border-box"},red:{color:e.palette.error.main},green:{color:e.palette.success.main},fullWidth:{widht:"100%"},content:{width:"400px",padding:e.spacing(2),display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:e.spacing(2)},siblings:{display:"flex",flexDirection:"row",gap:e.spacing(4)},requestButton:{width:"fit-content"}})));var sa=Object(h.a)((e=>{var t,a;let{close:i,open:n,minGroups:c=1,maxGroups:s=2,users:l}=e;const r=ca(),o=Object(x.useContext)(Ct),d=Object(v.f)(),{enqueueSnackbar:u}=Object(g.b)(),[b,j]=Object(x.useState)({groupNames:["Vormittag","Nachmittag"],status:ia.created,date:Xt(Object(Ke.a)()),location:""}),p=()=>b.Office&&b.Project&&b.User&&b.status&&b.date&&b.location&&b.groupNames.length>=c&&b.groupNames.length<=s,m=(e,t)=>{const a=b.groupNames;a[t]=e.target.value,j({...b,groupNames:a})};return Object(zt.jsxs)(We.a,{transitionDuration:100,className:r.root,open:n,onClose:()=>{j({...b,Office:void 0,Project:void 0,User:void 0}),i()},children:[Object(zt.jsx)(Le.a,{className:r.title,children:"Termin Erstellen"}),Object(zt.jsx)(Me.a,{}),Object(zt.jsxs)(Ge.a,{className:r.content,children:[Object(zt.jsx)(_t,{positionUnselectable:!0,offices:o.user.Offices?o.user.Offices:[],onChange:e=>{var t,a,i,n;j({...b,Office:null!==(t=e.office)&&void 0!==t&&t.reset||null!==(a=e.office)&&void 0!==a&&a.object?e.office.object:b.Office,Project:null!==(i=e.project)&&void 0!==i&&i.reset||null!==(n=e.project)&&void 0!==n&&n.object?e.project.object:b.Project})}}),Object(zt.jsxs)(Bt.a,{fullWidth:!0,children:[Object(zt.jsx)(Rt.a,{id:"user-select-label",children:"Moderator*in"}),Object(zt.jsx)(Et.a,{value:(null===b||void 0===b||null===(t=b.User)||void 0===t?void 0:t.id)||"",labelId:"user-select-label",id:"user-select",onChange:e=>{const t=l.find((t=>t.id===e.target.value));j({...b,User:t})},children:l.map(((e,t)=>Object(zt.jsxs)(Ut.a,{value:e.id,children:[e.firstName," ",e.lastName]},t)))})]}),Object(zt.jsxs)("div",{className:r.siblings,children:[Object(zt.jsx)(Pt,{disablePast:!0,label:"Datum *",minDate:Object(Ke.a)(),initialDate:Object(Ke.a)(),processDate:e=>{j({...b,date:Xt(e)})}}),Object(zt.jsx)(Wt.a,{value:null===(a=b.groupNames)||void 0===a?void 0:a.length,onChange:e=>{var t;const a=k.i.wholeNumber.test(e.target.value),i=+e.target.value,n=is;n&&(e.target.value="".concat(i),u("Gruppenanzahl muss zwischen ".concat(c," und ").concat(s," liegen"),Je("error")));const l=a&&!n?i:s,r=b.groupNames?null===(t=b.groupNames)||void 0===t?void 0:t.length:0;let o=b.groupNames;var d;if(lr)for(let c=r;c{const e=[];if(b.groupNames)for(let t=0;tm(e,t),value:b.groupNames[t],fullWidth:!0},t));return e})(),Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,id:"location",label:"Standort",onChange:e=>{j({...b,location:e.target.value})}}),Object(zt.jsx)(Wt.a,{fullWidth:!0,multiline:!0,id:"note",label:k.k.note,onChange:e=>{j({...b,note:e.target.value})}}),Object(zt.jsxs)(Bt.a,{fullWidth:!0,children:[Object(zt.jsx)(Rt.a,{id:"status-select-label",children:"Status *"}),Object(zt.jsx)(Et.a,{value:b.status,labelId:"status-select-label",id:"status-select",onChange:e=>j({...b,status:e.target.value}),children:Object.values(ia).map(((e,t)=>Object(zt.jsx)(Ut.a,{value:e,children:aa("event",e)},t)))})]}),Object(zt.jsx)(_e.a,{fullWidth:!0,size:"small",variant:"contained",color:"secondary",type:"submit",className:r.requestButton,disabled:!p(),onClick:async()=>{if(!p())return;1e3===(await na.updateEvent({id:"",...b})).status_code?d.go(0):u("Termin konnte nicht erstellt werden",Je("error"))},children:"Termin Erstellen"})]})]})})),la=a(564),ra=a(553),oa=a(546),da=a(433),ua=a(557),ba=a(595),ja=a(988),pa=a(96),ma=a.n(pa);var ha={async getAllSurveys(){const e=await b.a.request({url:Object(k.j)("/api/survey","/survey"),method:"GET"});return 1e3===e.data.status_code?Promise.resolve(e.data):Promise.reject("error")},async duplicateSurvey(e,t){const a=await b.a.put(Object(k.j)("/api/survey/add","/api/survey/add"),{surveyId:e,details:t});return Promise.resolve(a.data)},async createSurvey(e,t,a,i,n){const c=await b.a.post(Object(k.j)("/api/survey/new","/api/survey/new"),{description:e,sid:t,barrier:a?1:0,rawValueIds:i,type:n});return Promise.resolve(c.data)},async getSurvey(e){const t=await b.a.get(Object(k.j)("/api/survey/".concat(e),"/survey/".concat(e)));return Promise.resolve(t.data)},async updateSurvey(e,t){const a=await b.a.put(Object(k.j)("/api/survey/edit","/survey/edit"),{surveyId:e,details:t});return Promise.resolve(a.data)},async deleteSurvey(e){const t=await b.a.delete(Object(k.j)("/api/survey/delete/".concat(e),"/survey/delete/".concat(e)));return Promise.resolve(t.data)},async getCorrectAnswers(e){const t=await b.a.get(Object(k.j)("/api/survey/sid/".concat(e),"/survey/sid/".concat(e)));return Promise.resolve(t.data)},async createCorrectAnswer(e,t,a){const i=await b.a.post(Object(k.j)("/api/survey/createAnswer","/survey/createAnswer"),{sid:e,answerTitle:t,answerSolution:a});return Promise.resolve(i.data)},async editCorrectAnswer(e,t,a){const i=await b.a.put(Object(k.j)("/api/survey/editAnswer","/survey/editAnswer"),{id:e,title:t,solution:a});return Promise.resolve(i.data)},async deleteCorrectAnswer(e){await b.a.delete(Object(k.j)("/api/survey/deleteAnswer/".concat(e),"/survey/deleteAnswer/".concat(e)));return Promise.resolve(!0)},async removeSurveyLink(e,t){const a=await b.a.delete(Object(k.j)("/api/survey/unlink/".concat(e,"/").concat(t),"/survey/unlink/".concat(e,"/").concat(t)));return Promise.resolve(a.data)},async createSurveyLinks(e,t,a){const i=await b.a.post(Object(k.j)("/api/survey/link","/survey/link"),{surveyId:e,rawValueIds:t,deleteRawValueIds:a});return Promise.resolve(i.data)}},ga=function(e){return e[e.initial=0]="initial",e[e.details=1]="details",e[e.continue=2]="continue",e}(ga||{});const xa={initial:{title:"Umfrage w\xe4hlen",description:"W\xe4hlen Sie die Umfrage die Sie duplizieren m\xf6chten"},details:{title:"Details festlegen",description:"Bestimmen Sie eine Umfrage-ID, einen Umfragenamen und den Barrierestatus."},continue:{title:"Umfrage erstellen",description:"Sind Sie sicher, dass Sie die Umfrage erstellen wollen?"}},fa=Object(s.a)((e=>Object(l.a)({root:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center"},form:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center",gap:e.spacing(1)},formControl:{width:"50%",minWidth:"200px",userSelect:"none"},actions:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end"},title:{textAlign:"center",boxSizing:"border-box"},description:{textAlign:"center",boxSizing:"border-box",padding:e.spacing(2),margin:"0px"},surveyDetails:{display:"flex",alignItems:"center",justifyContent:"center",gap:e.spacing(1),textAlign:"center",boxSizing:"border-box",margin:"0px"},content:{padding:e.spacing(2),display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:e.spacing(2)},table:{width:"80%"},row:{},rowName:{fontWeight:"bold"},cell:{width:"50%"},lastRow:{border:"none"},btn:{minWidth:"200px"},red:{color:e.palette.error.main},yellow:{color:e.palette.warning.main},lightYellow:{color:e.palette.warning.light},green:{color:e.palette.success.main}})));var Oa=Object(h.a)((e=>{let{open:t,close:a,data:i}=e;const n=fa(),c=Object(v.f)(),s=i,{enqueueSnackbar:l}=Object(g.b)(),{duplicateSurvey:r}=ha,[o,d]=Object(x.useState)(ga.initial),[u,b]=Object(x.useState)(""),[j,p]=Object(x.useState)(xa.initial.title.toUpperCase()),[m,h]=Object(x.useState)(xa.initial.description),[f,O]=Object(x.useState)({sid:"",description:"",barrier:0}),y=()=>{a(),d(0),b(""),p(xa.initial.title),h(xa.initial.description),O({sid:"",description:"",barrier:0})},w=e=>{const t="next"===e?o+1:o-1;ga[t]&&(d(t),p(xa[ga[t]].title),h(xa[ga[t]].description))},N=()=>{f.barrier?O({...f,barrier:0}):O({...f,barrier:1})};return Object(zt.jsxs)(We.a,{transitionDuration:100,className:n.root,open:t,onClose:y,children:[Object(zt.jsx)(Le.a,{className:n.title,children:j}),Object(zt.jsx)(Me.a,{component:"span"}),Object(zt.jsx)(Ve.a,{className:n.description,children:m}),Object(zt.jsx)(Me.a,{component:"span"}),Object(zt.jsxs)(Ge.a,{className:n.content,children:[Object(zt.jsx)(zt.Fragment,{children:u&&Object(zt.jsxs)(la.a,{size:"small",className:n.table,children:[Object(zt.jsxs)(ra.a,{className:n.row,children:[Object(zt.jsx)(oa.a,{align:"left",className:"".concat(n.rowName," ").concat(n.cell),children:"Vorlage:"}),Object(zt.jsx)(oa.a,{align:"right",className:n.cell,children:null===s||void 0===s?void 0:s.filter((e=>e.id===u))[0].description})]}),2===o&&f.sid&&Object(zt.jsxs)(ra.a,{className:n.row,children:[Object(zt.jsx)(oa.a,{align:"left",className:"".concat(n.rowName," ").concat(n.cell),children:"Umfrage-ID:"}),Object(zt.jsx)(oa.a,{align:"right",className:n.cell,children:f.sid})]}),2===o&&f.description&&Object(zt.jsxs)(ra.a,{className:n.row,children:[Object(zt.jsx)(oa.a,{align:"left",className:"".concat(n.rowName," ").concat(n.cell),children:"Umfragename:"}),Object(zt.jsx)(oa.a,{align:"right",className:n.cell,children:f.description})]}),2===o&&Object(zt.jsxs)(ra.a,{className:n.row,children:[Object(zt.jsx)(oa.a,{align:"left",className:"".concat(n.rowName," ").concat(n.lastRow," ").concat(n.cell),children:"Barriereumfrage:"}),Object(zt.jsx)(oa.a,{align:"right",className:"".concat(n.lastRow," ").concat(n.cell),children:0===f.barrier?"nein":"ja"})]})]})}),0===o&&Object(zt.jsx)(da.a,{className:n.form,row:!0,children:Object(zt.jsxs)(Bt.a,{color:"secondary",fullWidth:!0,className:n.formControl,children:[Object(zt.jsx)(Rt.a,{id:"surveys",children:"Umfrage w\xe4hlen"}),Object(zt.jsx)(Et.a,{autoWidth:!0,onChange:e=>{b("".concat(e.target.value))},children:null===s||void 0===s?void 0:s.sort(((e,t)=>e.description.localeCompare(t.description))).map(((e,t)=>Object(zt.jsx)(Ut.a,{value:e.id,children:e.description},t)))})]})}),1===o&&Object(zt.jsxs)(da.a,{className:n.form,row:!0,children:[Object(zt.jsx)(Bt.a,{className:n.formControl,children:Object(zt.jsx)(Wt.a,{color:"secondary",type:"number",label:"Umfrage-ID",value:f.sid,inputProps:{min:0,max:999999},onChange:e=>{var t;t=e.target.value,k.i.sid.test(t)&&t.length<=6&&!isNaN(Number(t))&&O({...f,sid:t})}})}),Object(zt.jsx)(Bt.a,{className:n.formControl,children:Object(zt.jsx)(Wt.a,{color:"secondary",label:"Umfragename",value:f.description,onChange:e=>{var t;t=e.target.value,O({...f,description:t.replace(" ","")})}})}),Object(zt.jsx)(ua.a,{label:"Barriereumfrage",labelPlacement:"end",control:Object(zt.jsx)(ba.a,{color:"secondary",onChange:N,checked:1===f.barrier}),className:n.formControl})]}),2===o&&Object(zt.jsx)(_e.a,{className:n.btn,onClick:()=>{(async()=>{1e3===(await r(u,f)).status_code?(l("Umfrage erfolgreich erstellt",Je("success")),c.go(0)):(l("Umfrage konnte nicht erstellt werden",Je("error")),y())})()},color:"secondary",variant:"contained",size:"small",startIcon:Object(zt.jsx)(ma.a,{className:n.lightYellow}),children:"Best\xe4tigen"})]}),Object(zt.jsx)(Me.a,{component:"span"}),Object(zt.jsx)(ja.a,{className:n.actions,children:(()=>{const e=Object.keys(ga).length/2-1;return Object(zt.jsxs)(zt.Fragment,{children:[o>0&&Object(zt.jsx)(_e.a,{className:n.yellow,onClick:()=>w("back"),color:"default",variant:"text",size:"small",children:"Zur\xfcck"}),u&&o{0===o?w("next"):6===f.sid.length&&f.description.length>0&&k.i.sid.test(f.sid)&&k.i.description.test(f.description)?null!==s&&void 0!==s&&s.map((e=>e.sid)).includes(f.sid)?l("Die Umfrage-ID existiert schon",Je("error")):w("next"):l("Die Umfrage-ID oder der Umfragename sind nicht g\xfcltig",Je("error"))},color:"default",variant:"text",size:"small",children:"Weiter"}),Object(zt.jsx)(_e.a,{className:n.red,onClick:y,color:"default",variant:"text",size:"small",children:"Abbrechen"})]})})()})]})})),va=a(963),ya=a(959),wa=function(e){return e[e.initial=0]="initial",e[e.continue=1]="continue",e}(wa||{});const Na={initial:{title:"Kompetenz erstellen",description:"Definieren Sie eine neue Kompetenz"},edit:{title:"Kompetenz anpassen",description:"Passen Sie Attribute der Kompetenz an"},continue:{title:"Daten \xdcberpr\xfcfen",description:"Sind Sie sicher, dass Sie die Kompetenz speichern wollen?"}},Ca={fail:"Die Daten sind nicht g\xfcltig"},Sa={success:"Speichern erfolgreich",fail:"Kompetenz konnte nicht gespeichert werden"},ka={success:"L\xf6schen erfolgreich",fail:"L\xf6schen fehlgeschlagen"},Ia={continue:"Weiter",back:"Zur\xfcck",confirm:"Best\xe4tigen",abort:"Abbrechen",delete:"L\xf6schen"},za={delete:'Schreiben Sie "L\xf6schen"'},Da={delete:"l\xf6schen"},Pa={ot:"Online-Test",ac:"M\xfcndliches Verfahren",pt:"Pers\xf6nlichkeit"},Aa=Object(s.a)((e=>Object(l.a)({root:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center"},actions:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end"},title:{textAlign:"center",boxSizing:"border-box"},description:{textAlign:"center",boxSizing:"border-box",padding:e.spacing(2),margin:"0px"},content:{padding:e.spacing(4),display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},elementContainer:{width:"20vw",paddingBottom:e.spacing(3),boxSizing:"border-box"},btn:{minWidth:"200px"},red:{color:e.palette.error.main},yellow:{color:e.palette.warning.main},lightYellow:{color:e.palette.warning.light},green:{color:e.palette.success.main},delete:{boxSizing:"border-box",backgroundColor:e.palette.primary.light,color:e.palette.error.main,border:"1px solid ".concat(e.palette.error.main),"&:hover":{backgroundColor:e.palette.error.main,color:e.palette.primary.light}}})));var Ta=Object(h.a)((e=>{let{open:t,close:a,data:i}=e;const n=Aa(),c=Object(v.f)(),{createOrUpdateCompetency:s,deleteCompetency:l}=I,{enqueueSnackbar:r}=Object(g.b)(),[o,u]=Object(x.useState)(!1),[b,j]=Object(x.useState)(""),[p,m]=Object(x.useState)(!1),[h,f]=Object(x.useState)(null),[O,y]=Object(x.useState)(wa.initial),[w,N]=Object(x.useState)((null!==i&&void 0!==i&&i.id?Na.edit.title:Na.initial.title).toUpperCase()),[C,S]=Object(x.useState)(null!==i&&void 0!==i&&i.id?Na.edit.description:Na.initial.description),[z,D]=Object(x.useState)({...i}),P=()=>{a(),y(0),N(Na.initial.title.toUpperCase()),S(Na.initial.description),D({id:"",longName:"",shortName:"",description:"",type:"OT"})},A=async e=>{if(f(e.currentTarget),p){if(b.toLowerCase()===Da.delete){await l(z.id)?(r(ka.success,Je("success")),c.go(0)):(r(ka.fail,Je("error")),c.go(0))}}else u(!0)},T=e=>{const t="next"===e?O+1:O-1;wa[t]&&(y(t),N(Na[wa[t]].title),S(Na[wa[t]].description))},F=(e,t)=>{D({...z,[t]:e})};return Object(zt.jsxs)(We.a,{transitionDuration:100,className:n.root,open:t,onClose:P,children:[Object(zt.jsx)(Le.a,{className:n.title,children:w}),Object(zt.jsx)(Me.a,{component:"span"}),Object(zt.jsx)(Ve.a,{className:n.description,children:C}),Object(zt.jsx)(Me.a,{component:"span"}),Object(zt.jsxs)(Ge.a,{className:n.content,children:[Object(zt.jsxs)(d.a,{container:!0,spacing:1,className:n.elementContainer,children:[Object(zt.jsx)(d.a,{item:!0,xs:6,children:Object(zt.jsx)(Wt.a,{disabled:O>0,label:k.k.longName,onChange:e=>{F(e.target.value,"longName")},value:z.longName})}),Object(zt.jsx)(d.a,{item:!0,xs:6,children:Object(zt.jsx)(Wt.a,{disabled:O>0,label:k.k.shortName,onChange:e=>{F(e.target.value,"shortName")},value:z.shortName})}),Object(zt.jsx)(d.a,{item:!0,xs:6,children:Object(zt.jsx)(Wt.a,{disabled:O>0,label:k.k.description,onChange:e=>{F(e.target.value,"description")},value:z.description})}),Object(zt.jsxs)(d.a,{item:!0,xs:6,children:[Object(zt.jsx)(Rt.a,{id:"competency-typw-select-label",children:k.k.type}),Object(zt.jsxs)(Et.a,{labelId:"competency-typw-select-label",fullWidth:!0,disabled:O>0,value:z.type,onChange:e=>{F(e.target.value,"type")},children:[Object(zt.jsx)(Ut.a,{value:"OT",children:Pa.ot}),Object(zt.jsx)(Ut.a,{value:"AC",children:Pa.ac}),Object(zt.jsx)(Ut.a,{value:"PT",children:Pa.pt})]})]})]}),1===O&&Object(zt.jsx)(zt.Fragment,{children:Object(zt.jsx)(_e.a,{className:n.btn,onClick:()=>{(async()=>{1e3===(await s(z)).status_code?(r(Sa.success,Je("success")),c.go(0)):(r(Sa.fail,Je("error")),P())})()},color:"secondary",variant:"contained",size:"small",startIcon:Object(zt.jsx)(ma.a,{className:n.lightYellow}),children:Ia.confirm})})]}),Object(zt.jsx)(Me.a,{component:"span"}),Object(zt.jsx)(ja.a,{className:n.actions,children:(()=>{const e=Object.keys(wa).length/2-1;return Object(zt.jsxs)(zt.Fragment,{children:[O>0&&Object(zt.jsx)(_e.a,{className:n.yellow,onClick:()=>T("back"),color:"default",variant:"text",size:"small",children:Ia.back}),0===O&&Object(zt.jsxs)(zt.Fragment,{children:[i.id&&Object(zt.jsx)(_e.a,{variant:"outlined",onClick:A,className:"".concat(p&&n.delete),children:Ia.delete}),Object(zt.jsx)(va.a,{anchorEl:h,open:o,children:Object(zt.jsx)(ya.a,{onClickAway:()=>u(!1),children:Object(zt.jsx)(Wt.a,{size:"small",value:b,variant:"filled",label:za.delete,onChange:e=>{return t=e.currentTarget.value,j(t),void(t.toLowerCase()===Da.delete&&(m(!0),u(!1)));var t}})})})]}),O{0===O||k.i.name.test(z.shortName)&&k.i.name.test(z.longName)&&k.i.description.test(z.description)?T("next"):r(Ca.fail,Je("error"))},color:"default",variant:"text",size:"small",children:Ia.continue}),Object(zt.jsx)(_e.a,{className:n.red,onClick:P,color:"default",variant:"text",size:"small",children:Ia.abort})]})})()})]})})),Fa=a(558),Ba=a(598),Ra=a(154),Ea=a.n(Ra),Ua=a(608),Wa=a.n(Ua),La=a(628);var Ma=()=>{const{updateCustomer:e,deleteCustomer:t,updateOffice:a,deleteOffice:i}=I,{updateProject:n,deleteProject:c}=z,{deleteEvent:s,updateEvent:l}=na;return{updateCustomerItem:async(t,i)=>{let c=!1,s="customer"===t?e:"office"===t?a:"project"===t?n:"event"===t?l:()=>{};return 1e3===(await s(i)).status_code&&(c=!0),c},deleteCustomerItem:async(e,a)=>{let n=!1,l="customer"===e?t:"office"===e?i:"project"===e?c:"event"===e?s:()=>{};return 1e3===(await l(a.id)).status_code&&(n=!0),n},validate:e=>{let t=[];return Object.entries(e).forEach((e=>{let[a,i]=e;"id"!==a&&"customerId"!==a&&("boolean"!==typeof i&&(!i||Array.isArray(i)&&0===i.length)&&t.push("".concat(k.k[a]?k.k[a]:a," darf nicht leer sein")),"color"!==a||"string"!==typeof i||k.i.hexCode.test(i)||t.push("Farbcode ung\xfcltig"))})),t}}};const Ga=e=>e&&"comparisonKey"in e&&"format"in e&&"items"in e,Va=Object(s.a)((e=>Object(l.a)({root:{color:e.palette.error.main},red:{boxSizing:"border-box",backgroundColor:e.palette.primary.light,border:"1px solid ".concat(e.palette.error.main),"&:hover":{backgroundColor:e.palette.error.main,color:e.palette.primary.light}}})));var _a=Object(h.a)((e=>{let{fullWidth:t=!1,noVerify:a=!1,compareString:i,buttonName:n,description:c,callback:s}=e;const l=Va(),[r,o]=f.a.useState(null),[d,u]=Object(x.useState)(!1),[b,j]=Object(x.useState)(a?i:""),[p,m]=Object(x.useState)(a);return Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)(_e.a,{fullWidth:t,variant:"outlined",size:"small",onClick:async e=>{o(e.currentTarget),p?b.toLowerCase()===i&&s(!0):u(!0)},className:"".concat(p&&l.red," ").concat(l.root),children:n}),Object(zt.jsx)(va.a,{anchorEl:r,open:d,children:Object(zt.jsx)(ya.a,{onClickAway:()=>u(!1),children:Object(zt.jsx)(Wt.a,{style:{width:"".concat(9*c.length,"px")},size:"small",value:b,variant:"filled",label:c,onChange:e=>{return t=e.currentTarget.value,j(t),void(t.toLowerCase()===i&&(m(!0),u(!1)));var t}})})})]})}));const Ka={save:{success:"Speichern erfolgreich",fail:"Speichern fehlgeschlagen"},delete:{success:"L\xf6schen erfolgreich",fail:"L\xf6schen fehlgeschlagen"}},qa={button:{delete:"L\xf6schen",confirm:"\xdcbernehmen"},auto:{noOption:"Keine Auswahlm\xf6glichkeiten"},text:{delete:'Geben Sie "l\xf6schen" ein'}},Ha="l\xf6schen",Za=Object(s.a)((e=>Object(l.a)({grid:{gap:e.spacing(1),alignItems:"center",justifyContent:"center",flexDirection:"column",maxWidth:"450px"},title:{textAlign:"center",boxSizing:"border-box",width:"100%"},content:{paddingTop:e.spacing(2),paddingBottom:e.spacing(3),boxSizing:"border-box"},border:{borderRadius:"5px",boxSizing:"border-box"},marginBot:{marginBottom:"20px"},padding:{padding:"10px"},center:{display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box"},details:{display:"flex",alignItems:"center",gap:e.spacing(2)},colorPicker:{position:"relative",zIndex:100},closeX:{position:"absolute",cursor:"pointer",userSelect:"none",top:"1%",right:"1%",color:"grey"},palette:{cursor:"pointer"},actions:{width:"100%",display:"flex",alignItems:"center",justifyContent:"flex-end",gap:e.spacing(2)},btn:{display:"flex",alingItems:"center",justifyContent:"flex-end"},autocomplete:{width:"100%",marginTop:e.spacing(1),marginBottom:e.spacing(1)},select:{width:"100%"},red:{boxSizing:"border-box",backgroundColor:e.palette.primary.light,color:e.palette.error.main,border:"1px solid ".concat(e.palette.error.main),"&:hover":{backgroundColor:e.palette.error.main,color:e.palette.primary.light}},green:{color:e.palette.success.main}})));var Ja=Object(h.a)((e=>{let{customerId:t,items:a,title:i,type:n,open:c,close:s}=e;const l=Za(),r=Object(x.useContext)(Pe),o=Object(v.f)(),{enqueueSnackbar:u}=Object(g.b)(),{fetchedOffices:b,getCustomerOffices:j}=r,[p,m]=Object(x.useState)(!1),[h,f]=Object(x.useState)(null),[O,y]=Object(x.useState)({}),{updateCustomerItem:w,deleteCustomerItem:N,validate:C}=Ma(),S=Object(x.useCallback)((()=>{let e={...O};if(a.forEach((t=>{var a,i;Ga(t.options)?e[t.name]=t.options.defaultState?t.options.defaultState:null===(a=t.options)||void 0===a||null===(i=a.items)||void 0===i?void 0:i.find((e=>e[t.options.comparisonKey]===t.value)):e[t.name]=t.value})),e.hasOwnProperty("customerId")){const a=window.sessionStorage.getItem("custId");e.customerId=t||(a||"")}y({...e})}),[]);Object(x.useEffect)((()=>S()),[S]),Object(x.useEffect)((()=>{const e=window.sessionStorage.getItem("custId");j(t||(e||""))}),[t,j]);const I=e=>{var t,a,i;return e.options&&Ga(e.options)?null!==(t=e.options)&&void 0!==t&&t.dependencies?e.options.dependencies.handler(e,null===(i=e.options.dependencies.states)||void 0===i?void 0:i.map((e=>O[e]))):null===(a=e.options)||void 0===a?void 0:a.items:[]},z=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"{{",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"}}";if(0===e.length)throw new Error("format string can't be empty!");do{const n=e.indexOf(a),c=e.indexOf(i);if(n<0||c<0)throw new Error("expected token not found! begin token index: ".concat(n,"; end token index: ").concat(c));const s=e.slice(n+2,c);e=e.replace("{{".concat(s,"}}"),t[s])}while(e.indexOf(a)>=0);return e},D=async()=>{const e={};a.forEach((t=>{var a;t.options&&null!==(a=t.options)&&void 0!==a&&a.unvalidated||(e[t.name]=O[t.name])}));const t=C(e);if(t.length>0)t.forEach((e=>{u(e,Je("error"))}));else{await w(n,O)?u(Ka.save.success,Je("success")):u(Ka.save.fail,Je("error")),o.go(0)}},P=async e=>{if(e){await N(n,O)?(u(Ka.delete.success,Je("success")),o.push("/customer")):(u(Ka.delete.fail,Je("error")),o.go(0))}},A=e=>{f(e.currentTarget),m(!p)},T=(e,t)=>{const i={};a.forEach((e=>{var a,n;null!==(a=e.options)&&void 0!==a&&null!==(n=a.dependencies)&&void 0!==n&&n.states.includes(t)&&(i[e.name]=void 0)})),y({...O,[t]:e,...i})},F=(e,t)=>{var a;let i=Object(zt.jsx)(zt.Fragment,{});const n=(e,t)=>{let a=12;if(!t||"fullWidth"in t&&!t.fullWidth)switch(e){case"date":case"color":case"default":a=6}return a},c=a=>Object(zt.jsx)(d.a,{item:!0,xs:n(e.type,e.options),children:a},t);switch(e.type){case"name":case"default":var s,r;if(!e.options||e.options)i=c(Object(zt.jsx)(Wt.a,{multiline:null===(s=e.options)||void 0===s?void 0:s.multiline,required:!(null!==(r=e.options)&&void 0!==r&&r.unvalidated),fullWidth:!0,margin:"dense",label:k.k[e.name],onChange:t=>{T(t.target.value,e.name)},value:O[e.name]}));break;case"color":i=c(Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)(Wt.a,{fullWidth:!0,required:!(null!==(a=e.options)&&void 0!==a&&a.unvalidated),margin:"dense",label:k.k[e.name],value:O[e.name],onChange:t=>{T(t.target.value,e.name)},InputProps:{endAdornment:Object(zt.jsx)(Fa.a,{position:"start",children:Object(zt.jsx)(Wa.a,{color:"secondary",onClick:A,className:l.palette})})}}),Object(zt.jsx)(va.a,{anchorEl:h,open:p,children:Object(zt.jsx)(ya.a,{onClickAway:()=>m(!1),children:Object(zt.jsx)(La.a,{className:l.colorPicker,onChange:e=>{return t=e.hex,y({...O,color:t}),void m(!1);var t},colors:k.b})})})]}));break;case"boolean":i=c(Object(zt.jsx)(ua.a,{label:k.k[e.name],control:Object(zt.jsx)(ba.a,{color:"secondary",checked:O[e.name],onChange:t=>{T(t.target.checked,e.name)}})}));break;case"select":switch(e.name){case"exportType":i=c(Object(zt.jsxs)(Bt.a,{className:l.select,children:[Object(zt.jsx)(Rt.a,{id:"".concat(e.name,"-selectlabel"),children:k.k[e.name]}),Object(zt.jsx)(Et.a,{labelId:"".concat(e.name,"-selectlabel"),id:"".concat(e.name,"-select"),defaultValue:e.value||Ee.grades,onChange:t=>{T("".concat(t.target.value),e.name)},children:Object.values(Ee).map(((e,t)=>Object(zt.jsx)(Ut.a,{value:e,children:k.k[e]},t)))})]}));break;case"status":i=c(Object(zt.jsxs)(Bt.a,{className:l.select,children:[Object(zt.jsx)(Rt.a,{id:"".concat(e.name,"-selectlabel"),children:k.k[e.name]}),Object(zt.jsx)(Et.a,{labelId:"".concat(e.name,"-selectlabel"),id:"".concat(e.name,"-select"),defaultValue:e.value||ia.created,onChange:t=>{T("".concat(t.target.value),e.name)},children:Object.values(ia).map(((t,a)=>Object(zt.jsx)(Ut.a,{disabled:t!==ia.pending||e.value!==ia.created,value:t,children:aa("event",t)},a)))})]}));break;default:var o;if(Ga(e.options)&&(!e.options.dependencies||e.options.dependencies.states.every((e=>O[e]))))i=c(Object(zt.jsxs)(Bt.a,{className:l.select,children:[Object(zt.jsx)(Rt.a,{id:"".concat(e.name,"-selectlabel"),children:e.options.title}),Object(zt.jsx)(Et.a,{labelId:"".concat(e.name,"-selectlabel"),id:"".concat(e.name,"-select"),defaultValue:e.value,value:O[e.name]?O[e.name].id:"",required:!e.options.unvalidated,onChange:t=>{T(I(e).find((a=>a[e.options.comparisonKey]===t.target.value)),e.name)},children:null===(o=I(e))||void 0===o?void 0:o.map(((t,a)=>Object(zt.jsx)(Ut.a,{value:t[e.options.comparisonKey],children:z(e.options.format,t)},a)))})]}))}break;case"multiselect":const t=e.value,n="Offices"===e.name?b:[];i=c(Object(zt.jsx)(Mt.a,{size:"small",multiple:!0,className:l.autocomplete,defaultValue:null===n||void 0===n?void 0:n.filter((e=>null===t||void 0===t?void 0:t.map((e=>e.id)).includes(e.id))),options:n,groupBy:e=>{var t;return null!==e&&void 0!==e&&null!==(t=e.Customer)&&void 0!==t&&t.longName?e.Customer.longName:""},getOptionLabel:e=>e.longName||"",filterSelectedOptions:!0,noOptionsText:qa.auto.noOption,onChange:(t,a)=>{T(a,e.name)},renderTags:(e,t)=>e.map(((e,a)=>Object(zt.jsx)(Ba.a,{size:"small",...t({index:a}),label:e.longName,color:"secondary",icon:Object(zt.jsx)(Ea.a,{})},a))),renderInput:t=>{var a;return Object(zt.jsx)(Wt.a,{...t,InputLabelProps:{required:!(null!==(a=e.options)&&void 0!==a&&a.unvalidated)},color:"primary",label:k.k[e.name]})}}));break;case"date":i=c(Object(zt.jsx)("span",{style:{flexGrow:"1"},children:Object(zt.jsx)(Pt,{label:k.k[e.name],initialDate:O[e.name],processDate:t=>{T(new Date(t),e.name)}})}))}return i};return Object(zt.jsx)(We.a,{transitionDuration:100,open:c,onClose:()=>{s(),S()},children:Object(zt.jsxs)(d.a,{className:l.grid,children:[Object(zt.jsx)(Le.a,{children:Object(zt.jsx)(d.a,{className:l.title,children:Object(zt.jsx)(zt.Fragment,{children:Object(zt.jsx)(d.a,{item:!0,xs:11,children:Object(zt.jsx)(Ve.a,{variant:"h5",id:"dialog-title",children:i})})})})}),Object(zt.jsx)(d.a,{children:Object(zt.jsx)(Me.a,{})}),Object(zt.jsx)(Ge.a,{children:Object(zt.jsx)(d.a,{container:!0,spacing:1,className:l.content,children:a.map(((e,t)=>F(e,t)))})}),Object(zt.jsx)(d.a,{children:Object(zt.jsx)(Me.a,{})}),Object(zt.jsx)(ja.a,{children:Object(zt.jsx)(d.a,{container:!0,item:!0,xs:12,className:l.actions,children:Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)(d.a,{item:!0,className:l.btn,children:O.id&&Object(zt.jsx)(_a,{compareString:Ha,buttonName:qa.button.delete,description:qa.text.delete,callback:P})}),Object(zt.jsx)(d.a,{item:!0,className:l.btn,children:Object(zt.jsx)(_e.a,{className:l.green,variant:"outlined",color:"default",size:"small",onClick:D,children:qa.button.confirm})})]})})})]})})})),$a=a(1003),Ya=a(549),Xa=a(561),Qa=a(552),ei=a(323),ti=a(1013),ai=a(438),ii=a.n(ai);const ni=(e,t)=>{Object(x.useEffect)((()=>{let a=!0;return e().then((e=>{a&&t(e)})),()=>{a=!1}}),[])};var ci=a(991),si=a(1032);const li=e=>{const{children:t,value:a,index:i}=e;return Object(zt.jsx)("div",{hidden:a!==i,children:a===i&&Object(zt.jsx)(Lt.a,{p:3,children:Object(zt.jsx)(Ve.a,{children:t})})})};var ri=Object(h.a)((e=>{let{headers:t,children:a}=e;const[i,n]=f.a.useState(0);x.Children.count(a);if(x.Children.count(a){n(t)},centered:!0,children:t.map((e=>Object(zt.jsx)(ci.a,{label:e})))})}),(()=>{const e=x.Children.toArray(a);return t.map(((t,a)=>Object(zt.jsx)(li,{value:i,index:a,children:e[a]})))})()]})})),oi=a(1e3);const di=Object(s.a)((e=>Object(l.a)({root:{alignItems:"center",display:"flex",flexDirection:"column",justifyContent:"flex-start",width:"auto",height:"auto"},red:{color:e.palette.error.main},green:{color:e.palette.success.main}})));var ui=Object(h.a)((e=>{let{open:t,newNorm:a,handleClose:i,handleNormReset:n}=e;const c=di();return Object(zt.jsxs)(We.a,{open:t,onClose:i,onBackdropClick:i,children:[Object(zt.jsx)(Le.a,{children:"Norm wechseln"}),Object(zt.jsx)(Ge.a,{children:Object(zt.jsx)(oi.a,{children:"Bei einem Wechsel der Norm geht der aktuelle Fortschritt verloren"})}),Object(zt.jsxs)(ja.a,{children:[Object(zt.jsx)(_e.a,{onClick:i,variant:"text",className:c.red,children:"Abbrechen"}),Object(zt.jsx)(_e.a,{onClick:()=>n(a),variant:"text",className:c.green,children:"Norm Wechseln"})]})]})})),bi=function(e){return e[e.initial=0]="initial",e[e.continue=1]="continue",e}(bi||{});const ji={initial:{title:"Position erstellen",description:"Definieren Sie eine neue Position."},continue:{title:"Daten \xfcberpr\xfcfen",description:"Sind Sie sicher, dass Sie die Position erstellen wollen?"},delete:{compare:"l\xf6schen",description:'Geben Sie "l\xf6schen" ein'}},pi={competency:"Kompetenz",weight:"Gewichtung\xa0(%)"},mi={empty:"- Bitte w\xe4hlen -"},hi={reset:"Reset",continue:"Weiter",back:"Zur\xfcck",confirm:"Best\xe4tigen",abort:"Abbrechen",delete:"L\xf6schen"},gi={longName:"Name",shortName:"Abk\xfcrzung"},xi={competency:"Bitte w\xe4hlen Sie eine Kompetenz",rvType:"Bitte w\xe4hlen Sie eine Aufgabengruppe",compSum:"Die Summe der Kompetenz-Gewichtungen muss 100% ergeben",rvTypeSum:"Bitte ordnen Sie jeder \xdcbung mindestens eine Kompetenz zu",rvTypeSumRev:"Bitte ordnen Sie jeder Kompetenz mindestens eine \xdcbung zu",shortName:"Abk\xfcrzung ung\xfcltig",longName:"Name ung\xfcltig"},fi={success:"L\xf6schen erfolgreich",fail:"L\xf6schen fehlgeschlagen",conflict:"Es existieren Bewerbungen auf diese Position"},Oi={success:"Speichern erfolgreich",fail:"Speichern fehlgeschlagen"},vi={competency:{type:"number",step:1,max:100,min:1}},yi=Object(s.a)((e=>Object(l.a)({root:{alignItems:"center",display:"flex",flexDirection:"column",justifyContent:"flex-start",width:"auto",height:"auto",minWidth:"550px",minHeight:"600px",maxHeight:"90vh"},floatingButton:{position:"absolute",bottom:60,right:25,backgroundColor:"rgba(0,0,0,0)"},centered:{display:"block",marginLeft:"auto",marginRight:"auto",marginTop:e.spacing(2),width:"20%"},autocomplete:{width:"100%"},actions:{alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"flex-end"},title:{boxSizing:"border-box",textAlign:"center"},description:{boxSizing:"border-box",margin:"0px",padding:e.spacing(2),textAlign:"center"},content:{padding:e.spacing(2),boxSizing:"border-box",width:"100%"},divider:{width:"100%"},detailBox:{display:"flex",alignItems:"center",justifyContent:"center",caretColor:e.palette.common.white},details:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",paddingBottom:e.spacing(2),gap:e.spacing(4),boxSizing:"border-box"},detail:{minWidth:"150px"},select:{width:"120px",minWidth:"100px",fontSize:"0.8rem",paddingBottom:"15px"},selectEmpty:{fontStyle:"italic"},table:{boxShadow:e.shadows[1],width:"fit-content"},header:{width:"fit-content",maxWidth:"120px",color:e.palette.primary.light,fontSize:"0.85rem"},confirmBox:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},confirm:{marginTop:e.spacing(2),minWidth:"200px"},btnBox:{alignItems:"center",display:"flex",justifyContent:"center",width:"100%",caretColor:e.palette.common.white},tableBox:{alignItems:"center",display:"flex",flexDirection:"column",justifyContent:"center",width:"100%"},tableCell:{fontSize:"0.85rem",padding:e.spacing(.5)},input:{caretColor:e.palette.common.black},sum:{fontWeight:"bold"},red:{color:e.palette.error.main},yellow:{color:e.palette.warning.main},lightYellow:{color:e.palette.warning.light},green:{color:e.palette.success.main}}))),wi={competencyId:""},Ni={rvTypeId:""},Ci={rows:[wi],columns:[Ni]},Si={competencyId:"",weight:1,posCompRvs:[{rvTypeId:"",selected:0}]},ki={shortName:"",longName:""},Ii={comp:0,rvTypes:[0]},zi={current:{},new:{}};var Di=Object(h.a)((e=>{let{open:t,close:a,data:i}=e;const n=yi(),c=Object(v.f)(),s=Object(x.useContext)(Pe),{getAllCompetencies:l,getAllRvTypes:r,getAllNorms:o,fetchedCompetencies:d,fetchedProject:u,fetchedNorms:b}=s,{createProjectPosition:j,deleteProjectPosition:p}=z,{enqueueSnackbar:m}=Object(g.b)(),[h,f]=Object(x.useState)(ji.initial.title.toUpperCase()),[O,y]=Object(x.useState)(ji.initial.description),[w,N]=Object(x.useState)(!1),[C,S]=Object(x.useState)(bi.initial),[I,D]=Object(x.useState)(Ci),[P,A]=Object(x.useState)(Ii),[T,F]=Object(x.useState)([Si]),[B,R]=Object(x.useState)([]),[E,U]=Object(x.useState)({current:{},new:{}}),[W,L]=Object(x.useState)(ki),[M]=Object(x.useState)(!!i),[G,V]=Object(x.useState)([]),[_,K]=Object(x.useState)(),{getAllSurveys:q}=ha;ni((async()=>{const{data:e}=await q();return e}),(e=>{if(V(e||[]),e&&i){const t=e.find((e=>e.id===(null===i||void 0===i?void 0:i.ptSurveyId)));K(t)}}));const H=()=>{S(bi.initial)},Z=()=>{H(),F([Si]),D(Ci),A(Ii),U(zi),R([])},J=()=>{H(),K(void 0)},$=e=>{S(bi.initial),F([Si]),D(Ci),A(Ii),U({current:e,new:{}}),R([...new Map(e.RawValues.map((e=>[e.RvTypes[0].id,e.RvTypes[0]]))).values()]),N(!1)},Y=()=>{a(),S(bi.initial),f(ji.initial.title),y(ji.initial.description)},X=async e=>{if(e){const e=(await p(i.id)).status_code;1e3===e?(m(fi.success,Je("success")),c.go(0)):m(1009===e?"".concat(fi.fail," ").concat(fi.conflict):fi.fail,Je("error"))}},Q=async()=>{const e={};ee()&&(e.ot={positionData:T,normId:E.current.id}),_&&(e.pt={surveyId:_.id});1e3===(await j(u.id,e,W)).status_code?(m(Oi.success,Je("success")),c.go(0)):m(Oi.fail,Je("error"))},ee=()=>Object.keys(E.current).length>0,te=e=>{let t=!1;if(console.log(E),_&&(t=!0),Object.keys(E.current).length||!_){t=(()=>{let e=!0,t=[];return T.forEach((a=>{let i=0;a.competencyId||(e=!1,t.push(xi.competency)),a.posCompRvs.forEach((a=>{i+=a.selected,a.rvTypeId||(e=!1,t.push(xi.rvType))})),0===i&&(e=!1,t.push(xi.rvTypeSumRev))})),100!==P.comp&&(e=!1,t.push(xi.compSum)),P.rvTypes.forEach((a=>{0===a&&(e=!1,t.push(xi.rvTypeSum))})),e||t.forEach((e=>{m(e,Je("error"))})),{valid:e,errors:[...new Set(t)]}})().valid}if(t){const t="next"===e?C+1:C-1;bi[t]&&(S(t),f(ji[bi[t]].title),y(ji[bi[t]].description))}},ae=(e,t,a,i)=>{const n=I.rows[a].competencyId;switch(t){case"competency":let t=[...T];t[a]={...t[a],weight:e>0?e:1,competencyId:n},F(t);break;case"posComp":if(null!==i){let t=[...T],n={...t[a]},c=[...n.posCompRvs],s={...c[i]};s.selected=e,c[i]=s,n.posCompRvs=c,t[a]=n,F(t)}}},ie=e=>{let t=[...I.rows],a=[...I.columns],i=[...T],n=[...P.rvTypes];if(I.rows.map((e=>e.competencyId)).includes(""))m(xi.competency,Je("warning"));else if(I.columns.map((e=>e.rvTypeId)).includes(""))m(xi.rvType,Je("warning"));else switch(e){case"row":if(I.rows.length"OT"===e.type)).length){t.push(wi),D({...I,rows:t});let e=Si,a=I.columns.map((e=>({rvTypeId:e.rvTypeId,selected:0})));e.posCompRvs=[...a],F([...i,{...e}])}break;case"column":I.columns.length{let t=[...e.posCompRvs,{selected:0,rvTypeId:""}];e.posCompRvs=t})),F([...i]))}};Object(x.useEffect)((()=>{l()}),[l]),Object(x.useEffect)((()=>{r()}),[r]),Object(x.useEffect)((()=>{o()}),[o]),Object(x.useEffect)((()=>{(()=>{const e=I.columns.map(((e,t)=>{let a=T.map((e=>{var a,i;return null!==(a=e.posCompRvs[t])&&void 0!==a&&a.selected?null===(i=e.posCompRvs[t])||void 0===i?void 0:i.selected:0})).reduce(((e,t)=>e+t));return 0===a?0:Number((1/a).toFixed(2))})).flat(1),t=Number(T.map((e=>e.weight)).reduce(((e,t)=>e+t)).toFixed(2));A({rvTypes:e,comp:t})})()}),[T]),Object(x.useEffect)((()=>{i&&(e=>{const{shortName:t,longName:a,PosComps:n,Norm:c}=e;if(L({shortName:t,longName:a}),n&&n.length>0){const e=[];n.forEach((t=>t.PosCompRvs.forEach((t=>{e.includes(t.rvTypeId)||e.push(t.rvTypeId)}))));const t=n.map((t=>({competencyId:t.competencyId,weight:Math.floor(100*t.weight),posCompRvs:e.map((e=>({rvTypeId:e,selected:t.PosCompRvs.map((e=>e.rvTypeId)).includes(e)?1:0})))})));F(t),D({columns:e.map((e=>({rvTypeId:e}))),rows:n.map((e=>({competencyId:e.competencyId})))})}if(c){U({...E,current:c});const e=b.find((e=>{var t;return e.id===(null===i||void 0===i||null===(t=i.Norm)||void 0===t?void 0:t.id)}));e&&R([...new Map(e.RawValues.map((e=>[e.RvTypes[0].id,e.RvTypes[0]]))).values()])}})(i)}),[]);const ne=()=>Object(zt.jsxs)(ra.a,{children:[Object(zt.jsx)(oa.a,{className:n.tableCell,size:"small",children:Object(zt.jsx)(Ve.a,{className:n.header,children:pi.weight})}),Object(zt.jsx)(oa.a,{size:"small",className:n.tableCell,children:Object(zt.jsx)(Ve.a,{className:n.header,children:pi.competency})}),I.columns.map(((e,t)=>{var a,i;return Object(zt.jsx)(oa.a,{className:n.tableCell,size:"small",children:Object(zt.jsxs)(Et.a,{disabled:M||!I.rows.some((e=>e.competencyId.length>0))||C>0||!(null!==E&&void 0!==E&&null!==(a=E.current)&&void 0!==a&&a.id),className:"".concat(n.select," ").concat(n.header),fullWidth:!0,value:I.columns[t].rvTypeId?I.columns[t].rvTypeId:"-",onChange:e=>((e,t)=>{const a=e.target.value;let i=[...I.columns],n=[...T];i[t]={...i[t],rvTypeId:a},D({...I,columns:i}),n.forEach((e=>{const i=e.posCompRvs;i[t]={...i[t],rvTypeId:a}})),F(n)})(e,t),children:[!I.columns[t].rvTypeId&&Object(zt.jsx)(Ut.a,{value:"-",children:Object(zt.jsx)("span",{className:n.selectEmpty,children:mi.empty})}),null===B||void 0===B||null===(i=B.filter((t=>e.rvTypeId===t.id||!I.columns.map((e=>e.rvTypeId)).includes(t.id))))||void 0===i?void 0:i.map(((e,t)=>Object(zt.jsx)(Ut.a,{value:"".concat(e.id),children:e.longName},t)))]})})}))]}),ce=()=>Object(zt.jsxs)(zt.Fragment,{children:[I.rows.map(((e,t)=>{var a;return Object(zt.jsxs)(ra.a,{children:[Object(zt.jsx)(oa.a,{className:n.tableCell,size:"small",children:Object(zt.jsx)(Wt.a,{className:n.input,disabled:M||!I.rows[t].competencyId||C>0,onChange:e=>ae(Number(e.currentTarget.value),"competency",t,null),value:T[t].weight,size:"small",inputProps:vi.competency})}),Object(zt.jsx)(oa.a,{className:n.tableCell,size:"small",children:Object(zt.jsxs)(Et.a,{disabled:M||C>0||!Object.keys(null===E||void 0===E?void 0:E.current).length,fullWidth:!0,value:I.rows[t].competencyId?I.rows[t].competencyId:"-",onChange:e=>((e,t)=>{const a=e.target.value;let i=[...I.rows],n=[...T];i[t]={...i[t],competencyId:a},D({...I,rows:i}),n[t]={...n[t],competencyId:a},F(n)})(e,t),className:n.select,children:[!I.rows[t].competencyId&&Object(zt.jsx)(Ut.a,{value:"-",children:Object(zt.jsx)("span",{className:n.selectEmpty,children:mi.empty})}),null===d||void 0===d||null===(a=d.filter((t=>"OT"===t.type&&(e.competencyId===t.id||!I.rows.map((e=>e.competencyId)).includes(t.id)))))||void 0===a?void 0:a.map(((e,t)=>Object(zt.jsx)(Ut.a,{value:"".concat(e.id),children:e.longName},t)))]})}),I.columns.map(((e,a)=>{var i,c;return Object(zt.jsx)(oa.a,{className:n.tableCell,padding:"checkbox",size:"small",align:"center",children:Object(zt.jsx)(ba.a,{size:"small",disabled:M||!e.rvTypeId||!I.rows[t].competencyId||C>0,checked:1===(null===(i=T[t])||void 0===i||null===(c=i.posCompRvs[a])||void 0===c?void 0:c.selected),onChange:e=>ae(e.target.checked?1:0,"posComp",t,a)})},a)}))]},t)})),Object(zt.jsx)(ra.a,{children:Object(zt.jsxs)(oa.a,{size:"small",className:"".concat(n.tableCell," ").concat(n.sum," ").concat(100===P.comp?n.green:P.comp<100?n.yellow:n.red),children:[P.comp.toFixed(1).toString().replace(".",",")," %"]})})]}),se=()=>Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)("div",{className:n.tableBox,children:Object(zt.jsxs)(Bt.a,{className:n.select,children:[Object(zt.jsx)(Rt.a,{id:"survey-select-label",children:"Umfrage"}),Object(zt.jsxs)(Et.a,{disabled:M||C>0,labelId:"survey-select-label",value:(null===_||void 0===_?void 0:_.id)||"",onChange:e=>{const t=G.find((t=>t.id===e.target.value));K(t)},children:[Object(zt.jsx)(Ut.a,{value:"",children:"-"}),G&&G.filter((e=>"PT"===e.type)).map((e=>Object(zt.jsx)(Ut.a,{value:e.id,children:e.description})))]})]})}),!M&&0===C&&Object(zt.jsx)($a.a,{className:n.floatingButton,color:"default",size:"small",onClick:J,children:Object(zt.jsx)(ti.a,{})})]}),le=()=>{var e;return Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsxs)("div",{className:n.tableBox,children:[Object(zt.jsxs)(Bt.a,{className:n.select,children:[Object(zt.jsx)(Rt.a,{id:"norm-select-label",children:"Norm"}),Object(zt.jsxs)(Et.a,{labelId:"norm-select-label",value:(null===E||void 0===E||null===(e=E.current)||void 0===e?void 0:e.id)||"-",autoWidth:!0,onChange:e=>(e=>{const t=b.find((t=>t.id===e.target.value));t&&(0===Object.keys(E.current).length?$(t):(U({...E,new:t}),N(!0)))})(e),disabled:M,children:[Object(zt.jsx)(Ut.a,{value:"-",children:"-"}),null===b||void 0===b?void 0:b.map((e=>Object(zt.jsx)(Ut.a,{value:e.id,children:Object(zt.jsx)(Ya.a,{title:e.description,children:Object(zt.jsx)("span",{children:e.longName})})},e.id)))]})]}),Object(zt.jsxs)("div",{className:n.btnBox,children:[Object(zt.jsxs)(la.a,{className:n.table,size:"small",children:[Object(zt.jsx)(Xa.a,{children:ne()}),Object(zt.jsx)(Qa.a,{children:ce()})]}),!M&&C<=0&&Object(zt.jsx)(ei.a,{size:"small",color:"secondary",onClick:()=>ie("column"),children:Object(zt.jsx)(ii.a,{})})]}),!M&&C<=0&&Object(zt.jsx)(ei.a,{size:"small",color:"secondary",onClick:()=>ie("row"),children:Object(zt.jsx)(ii.a,{})})]}),!M&&0===C&&Object(zt.jsx)($a.a,{className:n.floatingButton,color:"default",size:"small",onClick:Z,children:Object(zt.jsx)(ti.a,{})})]})};return Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsxs)(We.a,{fullScreen:!0,transitionDuration:100,classes:{paper:n.root},open:t,onClose:Y,children:[!M&&Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)(Le.a,{className:n.title,children:h}),Object(zt.jsx)(Me.a,{className:n.divider,component:"span"}),Object(zt.jsx)(Ve.a,{className:n.description,children:O}),Object(zt.jsx)(Me.a,{className:n.divider,component:"span"})]}),Object(zt.jsxs)(Ge.a,{className:n.content,children:[Object(zt.jsx)("div",{className:n.detailBox,children:Object(zt.jsxs)("div",{className:n.details,children:[Object(zt.jsx)(Wt.a,{className:"".concat(n.input," ").concat(n.detail),onChange:e=>L({...W,longName:e.currentTarget.value}),label:gi.longName,value:W.longName,disabled:M||C>0}),Object(zt.jsx)(Wt.a,{className:"".concat(n.input," ").concat(n.detail),onChange:e=>L({...W,shortName:e.currentTarget.value}),label:gi.shortName,value:W.shortName,disabled:M||C>0})]})}),(()=>{const e={headers:[],components:[]};return i?(i.Norm&&(e.headers.push(k.c.OT),e.components.push(le())),i.ptSurveyId&&(e.headers.push(k.c.PT),e.components.push(se()))):(e.headers=[k.c.OT,k.c.PT],e.components=[le(),se()]),Object(zt.jsx)(ri,{headers:e.headers,children:e.components})})(),1===C&&Object(zt.jsx)("div",{className:n.confirmBox,children:Object(zt.jsx)(_e.a,{className:n.confirm,onClick:Q,color:"secondary",variant:"contained",size:"small",startIcon:Object(zt.jsx)(ma.a,{className:n.lightYellow}),children:hi.confirm})})]}),Object(zt.jsx)(Me.a,{className:n.divider,component:"span"}),Object(zt.jsx)(ja.a,{className:n.actions,children:(()=>{const e=Object.keys(bi).length/2-1;return Object(zt.jsxs)(zt.Fragment,{children:[!M&&Object(zt.jsxs)(zt.Fragment,{children:[C>0&&Object(zt.jsx)(_e.a,{className:n.yellow,onClick:()=>te("back"),color:"default",variant:"text",size:"small",children:hi.back}),Cte("next"),color:"default",variant:"text",size:"small",children:hi.continue})]}),M&&Object(zt.jsx)(_a,{compareString:ji.delete.compare,buttonName:hi.delete,description:ji.delete.description,callback:X}),Object(zt.jsx)(_e.a,{className:n.red,onClick:Y,color:"default",variant:"text",size:"small",children:hi.abort})]})})()})]}),Object(zt.jsx)(ui,{open:w,newNorm:E.new,handleClose:()=>N(!1),handleNormReset:e=>$(e)})]})})),Pi=a(609),Ai=a.n(Pi),Ti=a(610),Fi=a.n(Ti);const Bi=Object(s.a)((e=>({form:{width:"100%",maxWidth:"400px",marginTop:e.spacing(3)},submit:{margin:e.spacing(3,0,2)},align:{textAlign:"left"},autocomplete:{width:"100%"},pass:{cursor:"pointer"},btnContainer:{display:"flex",alignItems:"center",justifyContent:"space-between"}})));var Ri=Object(h.a)((e=>{let{user:t}=e;const a=Bi(),i=Object(v.f)(),n=Object(x.useContext)(Pe),{createOrUpdate:c,deleteUser:s}=wt,{enqueueSnackbar:l}=Object(g.b)(),{fetchedCustomers:r,getCustomers:o,clearOffices:u,fetchedOffices:b}=n,[j,p]=Object(x.useState)(t),[m,h]=Object(x.useState)(!1),[f,O]=Object(x.useState)(r.find((e=>e.id===j.customerId))),[y,w]=Object(x.useState)({roleId:!1,customerId:!1,officeIds:!1,firstName:!1,lastName:!1,email:!1,phone:!1,password:!1});return Object(x.useEffect)((()=>{o()}),[o]),Object(zt.jsx)("form",{className:a.form,onSubmit:e=>{e.preventDefault(),(()=>{const e={roleId:!j.roleId,customerId:"3"===j.roleId&&!j.customerId,officeIds:"3"===j.roleId&&!j.officeIds.length,firstName:!j.firstName||!k.i.name.test(j.firstName),lastName:!j.lastName||!k.i.name.test(j.lastName),email:!j.email||!k.i.email.test(j.email),phone:Boolean(j.phone&&!k.i.phone.test(j.phone)),password:!j.password||!k.i.password.test(j.password)};w(e)})(),(async e=>{const{data:t,status_code:a}=await c(e);if(1e3===a)switch(t){case"created":l("Account hinzugef\xfcgt",Je("success")),i.go(0);break;case"updated":l("Account angepasst",Je("success")),i.go(0);break;case"conflict":case"invalid":l("Account konnte nicht erstellt werden",Je("error")),i.go(0);break;default:Object.entries(t).forEach((e=>{let[t,a]=e;l(a,Je("error"))}))}else l("Entschuldigung, da ist etwas schiefgelaufen",Je("error"))})(j)},noValidate:!0,children:Object(zt.jsxs)(d.a,{container:!0,spacing:2,children:[Object(zt.jsx)(d.a,{item:!0,xs:12,sm:6,children:Object(zt.jsx)(Wt.a,{autoComplete:"off",name:"firstName",variant:"outlined",required:!j.id,fullWidth:!0,color:"secondary",id:"firstName",label:"Vorname",error:y.firstName,value:j.firstName,onChange:e=>{p({...j,firstName:e.target.value}),w({...y,firstName:!e.target.value})}})}),Object(zt.jsx)(d.a,{item:!0,xs:12,sm:6,children:Object(zt.jsx)(Wt.a,{autoComplete:"off",variant:"outlined",required:!j.id,fullWidth:!0,color:"secondary",id:"lastName",label:"Nachname",error:y.lastName,value:j.lastName,name:"Nachname",onChange:e=>{p({...j,lastName:e.target.value}),w({...y,lastName:!e.target.value})}})}),Object(zt.jsx)(d.a,{item:!0,xs:12,children:Object(zt.jsx)(Wt.a,{autoComplete:"off",variant:"outlined",required:!j.id,fullWidth:!0,id:"email",color:"secondary",label:"E-Mail-Adresse",error:y.email,value:j.email,name:"email",onChange:e=>{p({...j,email:e.target.value}),w({...y,email:!e.target.value})}})}),Object(zt.jsx)(d.a,{item:!0,xs:12,children:Object(zt.jsx)(Ya.a,{title:"mind: 8 Zeichen | Gro\xdf- und Kleinbuchstaben | Zahlen | Sonderzeichen",placement:"right",enterDelay:1e3,children:Object(zt.jsx)(Wt.a,{autoComplete:"off",variant:"outlined",required:!j.id,fullWidth:!0,color:"secondary",name:"password",label:"Passwort",error:!j.id&&y.password,value:j.password,type:m?"text":"password",id:"password",onChange:e=>{p({...j,password:e.target.value}),w({...y,password:!e.target.value})},InputProps:{endAdornment:Object(zt.jsx)(Fa.a,{position:"end",onClick:()=>h(!m),children:m?Object(zt.jsx)(Ai.a,{color:"disabled",className:a.pass}):Object(zt.jsx)(Fi.a,{color:"disabled",className:a.pass})})}})})}),Object(zt.jsx)(d.a,{item:!0,xs:12,children:Object(zt.jsx)(Wt.a,{autoComplete:"off",variant:"outlined",fullWidth:!0,color:"secondary",name:"phone",label:"Telefonnummer",error:y.phone,value:j.phone,type:"tel",id:"phone",onChange:e=>{p({...j,phone:e.target.value}),w({...y,phone:!e.target.value})}})}),Object(zt.jsxs)(d.a,{item:!0,xs:12,children:[Object(zt.jsx)(Rt.a,{id:"label",children:"Rolle"}),Object(zt.jsxs)(Et.a,{labelId:"label",fullWidth:!0,label:"Rolle",className:a.align,value:j.roleId,error:y.roleId,onChange:e=>{p({...j,roleId:"".concat(e.target.value)}),w({...y,roleId:!e.target.value})},children:[Object(zt.jsx)(Ut.a,{value:"1",children:"Administrator*in"}),Object(zt.jsx)(Ut.a,{value:"2",children:"Support"}),Object(zt.jsx)(Ut.a,{value:"3",children:"Kunde"}),Object(zt.jsx)(Ut.a,{value:"4",children:"Berater*in"})]})]}),"3"===j.roleId&&Object(zt.jsxs)(d.a,{item:!0,xs:12,children:[Object(zt.jsx)(Rt.a,{id:"label",children:"Kund*in"}),Object(zt.jsx)(Et.a,{fullWidth:!0,labelId:"label",id:"customer",label:"Kunde",value:j.customerId,error:y.customerId,onChange:e=>{p({...j,customerId:e.target.value}),O(null===r||void 0===r?void 0:r.filter((t=>t.id===e.target.value))[0]),w({...y,customerId:!e.target.value})},children:null===r||void 0===r?void 0:r.map(((e,t)=>Object(zt.jsx)(Ut.a,{value:e.id,children:e.longName},t)))})]}),"3"===j.roleId&&j.customerId.length>0&&(null===f||void 0===f?void 0:f.Offices)instanceof Array&&Object(zt.jsx)(d.a,{item:!0,xs:12,children:Object(zt.jsx)(Mt.a,{fullWidth:!0,multiple:!0,className:a.autocomplete,id:"tags-outlined",options:null===f||void 0===f?void 0:f.Offices,value:null===f||void 0===f?void 0:f.Offices.filter((e=>j.officeIds.includes(e.id))),getOptionLabel:e=>(null===e||void 0===e?void 0:e.longName)||"",filterSelectedOptions:!0,noOptionsText:"Keine Einheit",onChange:(e,t)=>{p({...j,officeIds:t.map((e=>e.id))}),w({...y,officeIds:!t})},renderInput:e=>Object(zt.jsx)(Wt.a,{...e,InputLabelProps:{required:!0},variant:"outlined",color:"secondary",label:"Einheiten"})},j.customerId)}),Object(zt.jsxs)(d.a,{container:!0,item:!0,xs:12,className:a.btnContainer,children:[j.id&&Object(zt.jsx)(d.a,{item:!0,xs:5,children:Object(zt.jsx)(_a,{fullWidth:!0,compareString:"l\xf6schen",buttonName:"L\xf6schen",description:"L\xf6schen Sie den Account",callback:async()=>{const{status_code:e}=await s(j.id);1e3===e?(l("Account hinzugef\xfcgt",Je("success")),i.go(0)):l("L\xf6schen fehlgeschlagen",Je("error"))}})}),Object(zt.jsx)(d.a,{item:!0,xs:j.id?5:12,children:Object(zt.jsx)(_e.a,{fullWidth:!0,size:"small",variant:"contained",color:"secondary",type:"submit",children:j.id?"Speichern":"Registrieren"})})]})]})})}));const Ei=Object(s.a)((e=>Object(l.a)({root:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center"},title:{textAlign:"center",boxSizing:"border-box"},red:{color:e.palette.error.main},green:{color:e.palette.success.main},actions:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end"},content:{padding:e.spacing(2),display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:e.spacing(2)}})));var Ui=Object(h.a)((e=>{let{user:t,close:a,open:i}=e;const n=Ei(),[c]=Object(x.useState)({id:(null===t||void 0===t?void 0:t.id)||"",firstName:(null===t||void 0===t?void 0:t.firstName)||"",lastName:(null===t||void 0===t?void 0:t.lastName)||"",password:"",email:(null===t||void 0===t?void 0:t.email)||"",phone:(null===t||void 0===t?void 0:t.phone)||"",roleId:null!==t&&void 0!==t&&t.roleId?String(t.roleId):"",customerId:"3"===String(null===t||void 0===t?void 0:t.roleId)&&null!==t&&void 0!==t&&t.Offices?null===t||void 0===t?void 0:t.Offices[0].customerId:"",officeIds:null!==t&&void 0!==t&&t.Offices?null===t||void 0===t?void 0:t.Offices.map((e=>e.id)):[]});return Object(zt.jsxs)(We.a,{transitionDuration:100,className:n.root,open:i,onClose:a,children:[Object(zt.jsx)(Le.a,{className:n.title,children:c.id?"Benutzer*in bearbeiten":"Benutzer*in registrieren"}),Object(zt.jsx)(Me.a,{}),Object(zt.jsx)(Ge.a,{className:n.content,children:Object(zt.jsx)(Ri,{user:c})})]})}));const Wi=Object(s.a)((e=>Object(l.a)({root:{width:"100%",paddingTop:e.spacing(3),boxSizing:"border-box",caretColor:e.palette.primary.main},"@global":{".MuiTableCell-head":{backgroundColor:"".concat(e.palette.secondary.main)},".MuiTableCell-head .MuiCheckbox-colorSecondary.Mui-checked":{color:"#FFF"}}})));var Li=Object(h.a)((e=>{let{tableButtons:t,addApplicationButton:a,addCustomerButton:i,addEventButton:n,addOfficeButton:c,addPositionButton:s,addProjectButton:l,addSurveyButton:r,addSurveyFunction:o,addUserButton:d,columnFilter:u,columns:b,data:j,dense:p,detailPanel:m,dialogData:h,editCompetencyButton:g,exportCsv:O,fontColor:v,fontSize:y,headerColor:w,headerFontColor:N,hideContainer:C,isDeletable:S,isEditable:k,isLoading:I,onRowAdd:z,onRowClick:D,onRowsDelete:P,onRowUpdate:A,pageSize:T,pagingFilter:F,searchFilter:B,selectable:R,selection:E,singleCollapse:U,title:W,userList:L}=e;const M=Wi(),G=f.a.useRef(j),[V,_]=Object(x.useState)(!1),[K,q]=Object(x.useState)(Array(null===t||void 0===t?void 0:t.length)),H={open:V,close:()=>_(!1),data:j},Z={open:V,close:()=>_(!1),data:{id:"",longName:"",shortName:"",description:"",type:"OT"}},J={open:V,close:()=>_(!1)},$={items:[{type:"id",name:"id",value:""},{type:"name",name:"longName",value:""},{type:"default",name:"shortName",value:""},{type:"color",name:"color",value:""},{type:"boolean",name:"showResults",value:!1},{type:"boolean",name:"revaluation",value:!1},{type:"boolean",name:"reports",value:!1}],type:"customer",title:"Kunde erstellen",open:V,close:()=>_(!1)},Y={items:[{type:"id",name:"id",value:""},{type:"name",name:"longName",value:""},{type:"default",name:"shortName",value:""},{type:"default",name:"eulaSurvey",value:""},{type:"date",name:"validFrom",value:new Date},{type:"date",name:"validUntil",value:new Date},{type:"multiselect",name:"Offices",value:[]},{type:"select",name:"exportType",value:"grades"},{type:"boolean",name:"branding",value:!1},{type:"boolean",name:"dataSharing",value:!1},{type:"id",name:"customerId",value:""}],type:"project",title:"Projekt erstellen",open:V,close:()=>_(!1)},X={items:[{type:"id",name:"id",value:""},{type:"name",name:"longName",value:""},{type:"default",name:"shortName",value:""},{type:"color",name:"color",value:""},{type:"id",name:"customerId",value:""}],type:"office",title:"Einheit erstellen",open:V,close:()=>_(!1)},Q={open:V,close:()=>_(!1),data:j},ee={open:V,close:()=>_(!1),data:h},te={open:V,close:()=>_(!1),data:h,users:L||[]},ae=e=>({tooltip:e,icon:()=>Object(zt.jsx)(Fe.a,{}),isFreeAction:!0,onClick:()=>_(!0)});let ie=[g&&ae("Kompetenz erstellen"),i&&ae("Kunde erstellen"),c&&ae("Einheit erstellen"),s&&ae("Position erstellen"),l&&ae("Projekt erstellen"),r&&ae("Bestehende Umfrage duplizieren"),d&&ae("Benutzer*in hinzuf\xfcgen"),a&&ae("Bewerbung hinzuf\xfcgen"),n&&ae("Event erstellen")];var ne;t&&(ie=null===(ne=ie)||void 0===ne?void 0:ne.concat(t.map(((e,a)=>({...e,onClick:()=>{const e=Array(t.length);e[a]=!0,q(e)}})))));return Object(zt.jsxs)("div",{className:M.root,children:[Object(zt.jsx)(Re.a,{localization:{pagination:{labelDisplayedRows:"{from}-{to} von {count}",labelRowsSelect:"Eintr\xe4ge",firstTooltip:"Erste Seite",previousTooltip:"Vorherige Seite",nextTooltip:"N\xe4chste Seite",lastTooltip:"Letzte Seite"},toolbar:{searchPlaceholder:"Suche",searchTooltip:"Suche",nRowsSelected:e=>e===j.length?"Alle Teilnehmer*innen ausgew\xe4hlt (".concat(e,")"):"".concat(e," Teilnehmer*innen ausgew\xe4hlt")},header:{actions:"Aktion"},body:{emptyDataSourceMessage:"Keine Elemente gefunden",filterRow:{filterTooltip:"Filter"},editRow:{deleteText:"Element l\xf6schen?",cancelTooltip:"Abbrechen",saveTooltip:"Speichern"},deleteTooltip:"L\xf6schen",editTooltip:"Bearbeiten"}},title:W,columns:(y&&b.forEach((e=>{e.cellStyle={...e.cellStyle,fontSize:"0.8rem"}})),v&&b.forEach((e=>{e.cellStyle={...e.cellStyle,color:v}})),b),data:j,isLoading:I,onRowClick:D,detailPanel:m,editable:{isDeletable:S,isEditable:k,onRowDelete:P,onRowUpdate:A,onRowAdd:z},onSelectionChange:e=>{(e=>{G.current=e})(e)},options:{actionsColumnIndex:-1,detailPanelType:U?"single":"multiple",emptyRowsWhenPaging:!1,filtering:u,headerStyle:{backgroundColor:w||"#008dcf",color:N||"#fff"},padding:p?"dense":"default",pageSize:T||5,pageSizeOptions:[5,10,20,50,100],paginationType:"stepped",paging:F,search:B,selection:R,showTitle:"string"===typeof W&&W.length>0,tableLayout:"auto"},components:{Container:e=>C?Object(zt.jsx)("div",{...e}):Object(zt.jsx)(Ae.a,{...e})},actions:ie}),g&&Object(zt.jsx)(Ta,{...Z}),i&&Object(zt.jsx)(Ja,{...$}),c&&Object(zt.jsx)(Ja,{...X}),s&&Object(zt.jsx)(Di,{...J}),l&&Object(zt.jsx)(Ja,{...Y}),r&&Object(zt.jsx)(Oa,{...H}),d&&Object(zt.jsx)(Ui,{...Q}),a&&Object(zt.jsx)(Ht,{...ee}),n&&Object(zt.jsx)(sa,{...te}),t&&t.map(((e,a)=>Object(zt.jsx)(e.popup,{open:K[a],close:()=>{const e=Array(t.length);e[a]=!1,q(e)},data:e.data})))]})})),Mi=a(1036);const Gi=Object(s.a)((e=>({root:{display:"flex",flexDirection:"column",alignItems:"center",paddingBottom:e.spacing(3)},pageHeader:{fontSize:"1.5rem",fontFamily:"Open Sans",lineHeight:"1.334",fontWeight:"normal",margin:"0"},avatar:{margin:e.spacing(1),backgroundColor:e.palette.secondary.main}})));var Vi=Object(h.a)((e=>{let{heading:t,children:a}=e;const i=Gi();return Object(zt.jsxs)("div",{className:i.root,children:[Object(zt.jsx)(Mi.a,{className:i.avatar,children:a}),Object(zt.jsx)("h1",{className:i.pageHeader,children:t})]})}));const _i=Object(s.a)((e=>({root:{maxWidth:"1100px",width:"100%",fontFamily:"Open Sans",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start"}})));function Ki(e){const{loggedIn:t}=Object(x.useContext)(Ct),a=window.location.pathname;t&&"/"!==a&&"/router"!==a&&window.localStorage.setItem("path",a);const i=_i();return Object(zt.jsx)("div",{className:i.root,children:e.children})}var qi=Object(h.a)((()=>{const e=Object(x.useContext)(Pe),{getAllCompetencies:t,fetchedCompetencies:a}=e,[i,n]=Object(x.useState)(!1),[c,s]=Object(x.useState)({id:"",longName:"",shortName:"",description:"",type:"OT"});Object(x.useEffect)((()=>{t()}),[]);const l={editCompetencyButton:!0,onRowClick:(e,t)=>{s(t),n(!0)},pagingFilter:!0,searchFilter:!0,columns:[{title:"Name",field:"longName",type:"string",defaultSort:"asc"},{title:"Abk\xfcrzung",field:"shortName",type:"string"},{title:"Beschreibung",field:"description",type:"string"},{title:"Typ",field:"type",type:"string"}],data:a.length>0?JSON.parse(JSON.stringify(a)):[]};return Object(zt.jsxs)(Ki,{children:[Object(zt.jsx)(Vi,{heading:"Kompetenzen",children:Object(zt.jsx)(w.a,{})}),Object(zt.jsx)(Li,{dense:!0,...l}),c.id&&i&&Object(zt.jsx)(Ta,{open:i,close:()=>n(!1),data:c})]})})),Hi=a(996),Zi=a(1014),Ji=a(611),$i=a.n(Ji);var Yi={async getAnonId(e){const t=await b.a.post(Object(k.j)("/api/hash","/api/hash"),{...e});return Promise.resolve(t.data)}};const Xi=Object(s.a)((e=>Object(l.a)({container:{maxWidth:"400px"},heading:{display:"flex",flexDirection:"column",alignItems:"center",paddingBottom:e.spacing(3)},pageHeader:{fontFamily:"Open Sans",lineHeight:"1.334",fontWeight:"normal",margin:"0"},form:{width:"100%",maxWidth:"300px",marginTop:e.spacing(3)},btnBox:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center"},btn:{margin:"0.5rem"},copy:{cursor:"pointer"}})));var Qi=Object(h.a)((()=>{const e=Xi(),{getAnonId:t}=Yi,{enqueueSnackbar:a}=Object(g.b)(),[i,n]=Object(x.useState)({firstName:"",lastName:"",birthday:new Date}),[c,s]=Object(x.useState)(""),l=(e,t)=>{e.preventDefault(),n({...i,[t]:e.target.value})};return Object(zt.jsx)("form",{className:e.form,children:Object(zt.jsxs)(d.a,{container:!0,spacing:2,className:e.container,children:[Object(zt.jsx)(d.a,{item:!0,xs:12,children:Object(zt.jsx)(Wt.a,{variant:"outlined",fullWidth:!0,size:"small",id:"firstName",color:"secondary",placeholder:"Firstname",name:"firstName",value:i.firstName,onChange:e=>l(e,"firstName")})}),Object(zt.jsx)(d.a,{item:!0,xs:12,children:Object(zt.jsx)(Wt.a,{variant:"outlined",fullWidth:!0,size:"small",id:"lastName",color:"secondary",placeholder:"Lastname",name:"lastName",value:i.lastName,onChange:e=>l(e,"lastName")})}),Object(zt.jsx)(d.a,{item:!0,xs:12,children:Object(zt.jsx)(Pt,{label:"Birthday",processDate:e=>(e=>{n({...i,birthday:e})})(e)})}),Object(zt.jsx)(d.a,{item:!0,xs:12,children:Object(zt.jsx)(Wt.a,{variant:"standard",fullWidth:!0,size:"small",id:"hash",color:"secondary",placeholder:"Hash",name:"hash",value:c,InputProps:{endAdornment:Object(zt.jsx)(Fa.a,{position:"end",children:Object(zt.jsx)($i.a,{className:e.copy,onClick:()=>{c?(navigator.clipboard.writeText(c),a("Hash copied",Je())):a("Convert first",Je())}})})}})}),Object(zt.jsxs)(d.a,{item:!0,xs:12,className:e.btnBox,children:[Object(zt.jsx)(_e.a,{fullWidth:!0,variant:"outlined",color:"primary",className:e.btn,onClick:()=>{n({firstName:"",lastName:"",birthday:new Date}),s("")},children:"Clear"}),Object(zt.jsx)(_e.a,{fullWidth:!0,variant:"contained",color:"secondary",className:e.btn,onClick:async()=>{const e=await t(i);e&&s(e.data)},children:"Convert"})]})]})})})),en=a(339),tn=a.n(en);const an=Object(s.a)((e=>Object(l.a)({container:{maxWidth:"400px"},heading:{display:"flex",flexDirection:"column",alignItems:"center",paddingBottom:e.spacing(3)},pageHeader:{fontFamily:"Open Sans",lineHeight:"1.334",fontWeight:"normal",margin:"0"},form:{width:"100%",maxWidth:"300px",marginTop:e.spacing(3)},btnBox:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center"},btn:{margin:"0.5rem"}})));var nn=Object(h.a)((()=>{const e=tn()(),t=an(),[a,i]=Object(x.useState)({token:"",uuid:""}),n=(e,t)=>{e.preventDefault(),i({...a,[t]:e.target.value})};return Object(zt.jsx)("form",{className:t.form,children:Object(zt.jsxs)(d.a,{container:!0,spacing:2,className:t.container,children:[Object(zt.jsx)(d.a,{item:!0,xs:12,children:Object(zt.jsx)(Wt.a,{variant:"outlined",fullWidth:!0,size:"small",id:"token",color:"secondary",placeholder:"Token",name:"token",value:a.token,onChange:e=>n(e,"token")})}),Object(zt.jsx)(d.a,{item:!0,xs:12,children:Object(zt.jsx)(Wt.a,{variant:"outlined",fullWidth:!0,size:"small",id:"uuid",color:"secondary",placeholder:"UUID",name:"uuid",value:a.uuid,onChange:e=>n(e,"uuid")})}),Object(zt.jsxs)(d.a,{item:!0,xs:12,className:t.btnBox,children:[Object(zt.jsx)(_e.a,{fullWidth:!0,variant:"outlined",color:"primary",className:t.btn,onClick:()=>{i({uuid:"",token:""})},children:"Clear"}),Object(zt.jsx)(_e.a,{fullWidth:!0,variant:"contained",color:"secondary",className:t.btn,onClick:t=>{t.preventDefault(),a.token.length>0&&0===a.uuid.length?i({...a,uuid:e.toUUID(a.token)}):a.uuid.length>0&&0===a.token.length&&i({...a,token:e.fromUUID(a.uuid)})},children:"Convert"})]})]})})}));var cn=Object(h.a)((()=>{const[e,t]=Object(x.useState)("uuid");return Object(zt.jsxs)(Ki,{children:[Object(zt.jsx)(Vi,{heading:"Konverter",children:Object(zt.jsx)(Zi.a,{})}),Object(zt.jsxs)(Hi.a,{size:"small",color:"primary","aria-label":"outlined primary button group",children:[Object(zt.jsx)(_e.a,{color:"uuid"===e?"secondary":"primary",variant:"uuid"===e?"contained":"outlined",onClick:()=>t("uuid"),children:"UUID - Token"}),Object(zt.jsx)(_e.a,{color:"hash"===e?"secondary":"primary",variant:"hash"===e?"contained":"outlined",onClick:()=>t("hash"),children:"Data - Hash"})]}),"uuid"===e&&Object(zt.jsx)(nn,{}),"hash"===e&&Object(zt.jsx)(Qi,{})]})})),sn=a(1015),ln=a(342),rn=a.n(ln),on=a(340),dn=a.n(on),un=a(341),bn=a.n(un);const jn=Object(s.a)((()=>Object(l.a)({root:{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"100%",border:"2px solid black"},inside:{width:"100%",height:"100%",borderRadius:"100%",border:"2px solid white",boxSizing:"border-box"}})));var pn=Object(h.a)((e=>{let{color:t}=e;const a=jn();return Object(zt.jsx)("div",{className:a.root,children:Object(zt.jsx)(Ya.a,{title:t,children:Object(zt.jsx)("div",{className:a.inside,style:{backgroundColor:t}})})})}));const mn=Object(s.a)((e=>Object(l.a)({root:{width:"20px",height:"20px",display:"flex",padding:"3px",alignItems:"center",justifyContent:"center",borderRadius:"100%",borderColor:"black"},green:{color:e.palette.success.main,borderColor:e.palette.success.dark},border:{border:"2px solid",backgroundColor:"ghost-white"}})));var hn=Object(h.a)((e=>{let{title:t="",icon:a,enabled:i,dense:n}=e;const c=mn();return Object(zt.jsx)(Ya.a,{title:t,children:Object(zt.jsx)("div",{className:"".concat(!n&&c.border," ").concat(c.root," ").concat(i&&c.green," "),children:a})})}));var gn=Object(h.a)((()=>{const e=Object(v.f)(),t=Object(x.useContext)(Pe),{fetchedCustomers:a,getCustomers:i}=t;Object(x.useEffect)((()=>{i()}),[i]);const n={addCustomerButton:!0,searchFilter:!0,onRowClick:(t,a)=>{e.push("/customer/".concat(a.id))},columns:[{title:"Name",field:"longName",width:"50%"},{title:"Abk\xfcrzung",field:"shortName",width:"50%"},{title:"Farbe",field:"color",render:e=>Object(zt.jsx)(pn,{color:e.color})},{title:"Ergebnis",field:"showResults",type:"boolean",render:e=>Object(zt.jsx)(hn,{dense:!0,title:"showResults",enabled:e.showResults,icon:Object(zt.jsx)(dn.a,{})})},{title:"Umrechnung",field:"revaluation",type:"boolean",render:e=>Object(zt.jsx)(hn,{dense:!0,title:"revaluation",enabled:e.revaluation,icon:Object(zt.jsx)(bn.a,{})})},{title:"Bericht",field:"reports",type:"boolean",render:e=>Object(zt.jsx)(hn,{dense:!0,title:"reports",enabled:e.reports,icon:Object(zt.jsx)(rn.a,{})})}],data:JSON.parse(JSON.stringify(a))};return Object(zt.jsxs)(Ki,{children:[Object(zt.jsx)(Vi,{heading:"Kunden",children:Object(zt.jsx)(sn.a,{})}),Object(zt.jsx)(Li,{dense:!0,...n})]})})),xn=a(992),fn=a(994),On=a(993),vn=a(345),yn=a.n(vn),wn=a(346),Nn=a.n(wn),Cn=a(104),Sn=a.n(Cn),kn=a(344),In=a.n(kn),zn=a(343),Dn=a.n(zn);const Pn={abbreviation:"Abk\xfcrzung:",color:"Farbe:",settings:{root:"Einstellungen:",results:"Ergebnisse anzeigen",revaluation:"Umrechnung",reports:"Bericht"}},An=Object(s.a)((e=>({details:{width:"100%"},settings:{display:"flex",alignItems:"center",gap:e.spacing(1)},tablerow:{display:"flex",marginTop:"3px"},button:{marginTop:"50px"},avatar:{margin:"3px",backgroundColor:e.palette.secondary.main},avatarBox:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:e.spacing(2),userSelect:"none"},display:{display:"flex",justifyContent:"center"},customerName:{fontSize:"2rem",margin:"0",marginLeft:"7px"},vcard:{width:"100%",height:"35%",display:"flex",flexDirection:"column",boxSizing:"border-box",alignItems:"flex-start",borderTop:"1px solid ".concat(e.palette.secondary.main),borderBottom:"1px solid ".concat(e.palette.secondary.main),borderRadius:"1px",padding:e.spacing(3)},editIcon:{cursor:"pointer"},icons:{position:"absolute",display:"inline",bottom:"0px"},label:{minWidth:"250px",textAlign:"left",margin:"0",padding:e.spacing(.5)},customerIcon:{position:"relative",bottom:"34px",left:"3%",display:"flex",cursor:"pointer"},green:{color:e.palette.success.main},fromUntil:{display:"flex",alignItems:"center",justifyContent:"flex-start"},chip:{width:"fit-content"},offices:{maxWidth:"150px"},officesHeading:{display:"flex",justifyContent:"space-between"},officesContent:{display:"flex",flexDirection:"column",gap:e.spacing(.5),overflow:"visible"},dots:{padding:"0 5px"}})));var Tn=Object(h.a)((e=>{let{match:t}=e;const a=t.params.id,i=An(),n=Object(v.f)(),{isAdminSupport:c}=Object(x.useContext)(Ct),{fetchedCustomer:s,isFetchingCustomerData:l,getCustomerById:r}=Object(x.useContext)(Pe),[o,d]=Object(x.useState)(!1),[u,b]=Object(x.useState)(!1),j=e=>{e.stopPropagation(),b(!u)};Object(x.useEffect)((()=>{r(a),window.sessionStorage.setItem("custId",a)}),[r,a]);const p={customerId:a,items:[{type:"id",name:"id",value:s.id},{type:"name",name:"longName",value:s.longName},{type:"default",name:"shortName",value:s.shortName},{type:"color",name:"color",value:s.color},{type:"boolean",name:"showResults",value:s.showResults},{type:"boolean",name:"revaluation",value:s.revaluation},{type:"boolean",name:"reports",value:s.reports}],type:"customer",title:"Kunde editieren",open:o,close:()=>d(!1)},m={addOfficeButton:!0,title:"Offices",searchFilter:!1,onRowClick:(e,t)=>{n.push("/office/".concat(t.id))},columns:[{title:"Name",field:"longName"},{title:"Abk\xfcrzung",field:"shortName"},{title:"Farbe",field:"color",render:e=>Object(zt.jsx)(pn,{color:e.color})}],data:s.id?JSON.parse(JSON.stringify(null===s||void 0===s?void 0:s.Offices)):[]},h={title:"Projekte",searchFilter:!1,addProjectButton:!0,onRowClick:(e,t)=>{n.push("/project/".concat(t.id))},columns:[{title:"Name",field:"longName"},{title:"Abk\xfcrzung",field:"shortName"},{title:"G\xfcltigkeit",field:"validFrom",render:e=>Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsxs)("div",{className:i.fromUntil,children:[Object(zt.jsx)(Ve.a,{children:Qt(e.validFrom)}),Object(zt.jsx)(Ve.a,{children:"-"})]}),Object(zt.jsx)("div",{className:i.fromUntil,children:Object(zt.jsx)(Ve.a,{children:Qt(e.validUntil)})})]})},{title:"Eula-Umfrage",field:"eulaSurvey"},{title:"Branding",field:"branding",type:"boolean",render:e=>Object(zt.jsx)(hn,{dense:!0,title:"branding",enabled:e.branding,icon:Object(zt.jsx)(Dn.a,{})})},{title:"Daten teilen",field:"dataSharing",type:"boolean",render:e=>Object(zt.jsx)(hn,{dense:!0,title:"dataSharing",enabled:e.dataSharing,icon:Object(zt.jsx)(In.a,{})})},{title:"Offices",field:"Offices",render:e=>{var t;return Object(zt.jsxs)(xn.a,{className:i.offices,expanded:u,onClick:j,TransitionProps:{timeout:2},children:[Object(zt.jsxs)(fn.a,{className:i.officesHeading,expandIcon:Object(zt.jsx)(yn.a,{}),children:[Object(zt.jsx)(Ba.a,{className:i.chip,label:e.Offices[0].shortName,size:"small",variant:"outlined"},e.Offices[0].id),e.Offices.length>1&&Object(zt.jsxs)(Ve.a,{className:i.dots,children:["+",e.Offices.length-1]})]}),Object(zt.jsx)(On.a,{className:i.officesContent,children:null===e||void 0===e||null===(t=e.Offices)||void 0===t?void 0:t.filter(((e,t)=>0!==t)).map(((e,t)=>Object(zt.jsx)(Ba.a,{className:i.chip,label:e.shortName,size:"small",variant:"outlined"},t)))})]})}}],data:s.id?JSON.parse(JSON.stringify(null===s||void 0===s?void 0:s.Projects)):[]};return Object(zt.jsxs)(Ki,{children:[!l&&null!==s&&void 0!==s&&s.id?Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsxs)("div",{className:i.vcard,"data-cy":"info-vcard",children:[Object(zt.jsxs)("div",{className:i.avatarBox,children:[Object(zt.jsxs)("div",{className:i.display,children:[Object(zt.jsx)(Mi.a,{className:i.avatar,"data-cy":"info-avatar",children:Object(zt.jsx)(Nn.a,{})}),Object(zt.jsx)(Ve.a,{className:i.customerName,children:s.longName})]}),c&&Object(zt.jsxs)("div",{className:i.editIcon,children:[Object(zt.jsx)(Ya.a,{title:"Kunden editieren",children:Object(zt.jsx)(ei.a,{size:"medium",onClick:()=>d(!0),children:Object(zt.jsx)(Sn.a,{})})}),Object(zt.jsx)(Ja,{...p})]})]}),Object(zt.jsxs)("div",{className:i.details,children:[Object(zt.jsxs)("div",{className:i.tablerow,children:[Object(zt.jsx)(Ve.a,{className:i.label,children:Pn.abbreviation}),Object(zt.jsx)(Ba.a,{color:"secondary",className:i.chip,label:s.shortName,size:"small"})]}),Object(zt.jsxs)("div",{className:i.tablerow,children:[Object(zt.jsx)(Ve.a,{className:i.label,children:Pn.color}),Object(zt.jsx)("div",{children:Object(zt.jsx)(Ya.a,{title:s.color,arrow:!0,children:Object(zt.jsx)(pn,{color:s.color})})})]}),Object(zt.jsxs)("div",{className:i.tablerow,children:[Object(zt.jsx)(Ve.a,{className:i.label,children:Pn.settings.root}),Object(zt.jsxs)("div",{className:i.settings,children:[Object(zt.jsx)(hn,{title:Pn.settings.results,icon:Object(zt.jsx)(dn.a,{}),enabled:null===s||void 0===s?void 0:s.showResults}),Object(zt.jsx)(hn,{title:Pn.settings.revaluation,icon:Object(zt.jsx)(bn.a,{}),enabled:null===s||void 0===s?void 0:s.revaluation}),Object(zt.jsx)(hn,{title:Pn.settings.reports,icon:Object(zt.jsx)(rn.a,{}),enabled:null===s||void 0===s?void 0:s.reports})]})]})]})]}),Object(zt.jsx)(Li,{dense:!0,...m}),Object(zt.jsx)(Li,{dense:!0,...h})]}):Object(zt.jsx)(Ft,{}),Object(zt.jsx)(_e.a,{color:"secondary",variant:"contained",size:"large",onClick:()=>{n.push("/customer")},className:i.button,children:"Zur\xfcck zur Kundenansicht"})]})})),Fn=a(171),Bn=a.n(Fn),Rn=a(612),En=a.n(Rn),Un=a(261),Wn=a.n(Un),Ln=a(214);let Mn=function(e){return e.valid="valid",e.complete="complete",e.abort="abort",e}({});var Gn=a(263),Vn=a(1010);const _n=Object(s.a)((e=>Object(l.a)({formControl:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"flex-start",margin:e.spacing(2),gap:e.spacing(3)},modal:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start",position:"absolute",top:"40%",left:"65%",transform:"translate(-50%, -50%)",minWidth:"400px",backgroundColor:"white",padding:e.spacing(2),borderRadius:"5px"},red:{color:e.palette.error.main},green:{color:e.palette.success.main},warning:{color:e.palette.warning.main},tableContainer:{margin:e.spacing(1)},tableHeader:{fontSize:"1rem",fontWeight:"bolder",backgroundColor:"whitesmoke"}})));var Kn=Object(h.a)((e=>{var t,a,i;let{uploadResponse:n,close:c,open:s}=e;const l=_n();return Object(zt.jsx)(Gn.a,{open:s,onClose:c,onBackdropClick:c,children:Object(zt.jsxs)(Lt.a,{className:l.modal,children:[Object(zt.jsxs)(Vn.a,{component:Ae.a,className:l.tableContainer,children:[Object(zt.jsxs)(la.a,{size:"small","aria-label":"feedback-success",children:[Object(zt.jsx)(Xa.a,{children:Object(zt.jsx)(ra.a,{children:Object(zt.jsx)(oa.a,{className:"".concat(l.tableHeader," ").concat(l.green),children:"Erfolgreich"})})}),Object(zt.jsx)(Qa.a,{children:Object(zt.jsx)(ra.a,{children:null===n||void 0===n||null===(t=n.success)||void 0===t?void 0:t.map(((e,t)=>Object(zt.jsxs)(oa.a,{children:[e.firstName," ",e.lastName]},t)))})})]}),Object(zt.jsxs)(la.a,{size:"small","aria-label":"Feedback-exist",children:[Object(zt.jsx)(Xa.a,{children:Object(zt.jsx)(ra.a,{children:Object(zt.jsx)(oa.a,{className:"".concat(l.tableHeader," ").concat(l.warning),children:"Existent"})})}),Object(zt.jsx)(Qa.a,{children:Object(zt.jsx)(ra.a,{children:null===n||void 0===n||null===(a=n.exist)||void 0===a?void 0:a.map(((e,t)=>Object(zt.jsxs)(oa.a,{children:[e.firstName," ",e.lastName]},t)))})})]}),Object(zt.jsxs)(la.a,{size:"small","aria-label":"Feedback-error",children:[Object(zt.jsx)(Xa.a,{children:Object(zt.jsx)(ra.a,{children:Object(zt.jsx)(oa.a,{className:"".concat(l.tableHeader," ").concat(l.red),children:"Fehler"})})}),Object(zt.jsx)(Qa.a,{children:Object(zt.jsx)(ra.a,{children:null===n||void 0===n||null===(i=n.error)||void 0===i?void 0:i.map(((e,t)=>Object(zt.jsxs)(oa.a,{children:[e.firstName," ",e.lastName]},t)))})})]})]}),Object(zt.jsx)(_e.a,{onClick:c,variant:"outlined",size:"small",className:l.red,children:"Schlie\xdfen"})]})})}));const qn=Object(s.a)((()=>Object(l.a)({input:{display:"none"},btn:{whiteSpace:"nowrap"}})));var Hn=Object(h.a)((e=>{let{buttonText:t,description:a,filetypes:i,callback:n}=e;const c=qn();let s;return Object(zt.jsxs)("div",{children:[a&&Object(zt.jsx)(Ve.a,{children:a}),Object(zt.jsx)("input",{accept:i,className:c.input,id:"raised-button-file",type:"file",ref:e=>s=e,onChange:()=>{n(s.files[0])}}),Object(zt.jsx)("label",{htmlFor:"raised-button-file",children:t?Object(zt.jsx)(_e.a,{className:c.btn,color:"secondary",variant:"contained",component:"span",size:"small",startIcon:Object(zt.jsx)(Wn.a,{}),children:t}):Object(zt.jsx)(ei.a,{component:"span",size:"small",children:Object(zt.jsx)(Wn.a,{})})})]})}));const Zn=Object(s.a)((e=>Object(l.a)({formControl:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"flex-start",margin:e.spacing(2),gap:e.spacing(3)},modal:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start",position:"absolute",top:"40%",left:"65%",transform:"translate(-50%, -50%)",width:"fit-content",backgroundColor:"white",padding:e.spacing(2),borderRadius:"5px"},red:{color:e.palette.error.main},green:{color:e.palette.success.main},warning:{textAlign:"center",width:"100%",color:e.palette.warning.main},filename:{marginBottom:e.spacing(2),color:e.palette.warning.main},group:{color:e.palette.info.main},btnBox:{width:"100%",display:"flex",justifyContent:"space-between"}})));var Jn=Object(h.a)((e=>{let{open:t,position:a={},positions:i=[],group:n={},close:c,handlePosition:s,upload:l}=e;const r=Zn(),[o,d]=Object(x.useState)({}),u=()=>{c(),d({})};return Object(zt.jsx)(Gn.a,{open:t,onClose:c,onBackdropClick:c,children:Object(zt.jsxs)(Lt.a,{className:r.modal,children:[Object(zt.jsx)(Ve.a,{variant:"h6",className:r.group,children:null===n||void 0===n?void 0:n.longName}),Object(zt.jsx)(Ve.a,{variant:"body1",children:"Bitte W\xe4hlen Sie eine Position und eine Datei"}),Object(zt.jsx)(Bt.a,{className:r.formControl,children:i.length?Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)(Et.a,{fullWidth:!0,value:a.id||"",onChange:e=>s(i.find((t=>t.id===e.target.value))||{}),children:i.map(((e,t)=>Object(zt.jsx)(Ut.a,{value:e.id,children:e.longName},t)))}),Object(zt.jsx)(Hn,{buttonText:"Datei w\xe4hlen",filetypes:".csv, .xlsx, .xlsm, .xls",callback:e=>{(e=>{d(e)})(e)}})]}):Object(zt.jsx)("p",{className:r.warning,children:"Keine Positionen f\xfcr den Import verf\xfcgbar"})}),Object(zt.jsx)(Ve.a,{variant:"body2",className:r.filename,children:null===o||void 0===o?void 0:o.name}),Object(zt.jsxs)(Lt.a,{className:r.btnBox,children:[Object(zt.jsx)(_e.a,{onClick:u,variant:"outlined",size:"small",className:r.red,children:"Abbrechen"}),Object(zt.jsx)(_e.a,{disabled:!a.id||!(null!==o&&void 0!==o&&o.name),onClick:()=>{l(o),u()},variant:"outlined",size:"small",className:r.green,children:"Ergebnisse importieren"})]})]})})}));const $n={location:"Standort:",date:"Datum:",project:"Projekt:",user:"Moderator*in:",status:"Status:"},Yn={upload:"Ergebnisse importieren",cancel:"Termin stornieren"},Xn=Object(s.a)((e=>({infoBox:{width:"100%",height:"auto"},tablerow:{display:"flex",marginTop:"3px"},button:{marginTop:"50px"},avatar:{margin:"3px",backgroundColor:e.palette.secondary.main},avatarBox:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:e.spacing(2),userSelect:"none"},display:{display:"flex",justifyContent:"center",textAlign:"left",margin:"0",marginBottom:"10px"},headline:{fontSize:"2rem",textAlign:"left"},vcard:{width:"100%",minHeight:"35%",display:"flex",flexDirection:"column",boxSizing:"border-box",alignItems:"flex-start",borderTop:"1px solid ".concat(e.palette.secondary.main),borderBottom:"1px solid ".concat(e.palette.secondary.main),borderRadius:"1px",padding:e.spacing(3)},input:{minWidth:"250px",margin:"0",textAlign:"left",padding:e.spacing(.5)},label:{minWidth:"250px",textAlign:"left",margin:"0",padding:e.spacing(.5)},chip:{width:"fit-content"},icon:{cursor:"pointer",color:e.palette.info.main},disabled:{color:e.palette.info.light},note:{width:"100%",margin:"1em",padding:"1rem",boxSizing:"border-box",gap:e.spacing(1)},noteFiels:{boxSizing:"border-box"}})));var Qn=Object(h.a)((e=>{var t,a,i,n,c;let{match:s}=e;const l=s.params.id,r=Xn(),o=Object(v.f)(),{isAdminSupport:d,user:u,fetchedUsers:b,getUsers:j}=Object(x.useContext)(Ct),{enqueueSnackbar:p}=Object(g.b)(),{getEvent:m,updateGroupStatus:h}=na,{importAcData:f}=$e,[O,y]=Object(x.useState)({settings:!1,upload:!1,feedback:!1}),[w,N]=Object(x.useState)({}),[C,S]=Object(x.useState)({}),[k,I]=Object(x.useState)({}),[z,D]=Object(x.useState)(!1),[P,A]=Object(x.useState)({}),T={customerId:k.id,items:[{type:"id",name:"id",value:k.id},{type:"select",name:"status",value:k.status},{type:"default",name:"location",value:k.location,options:{fullWidth:!0}},{type:"default",name:"note",value:(null===k||void 0===k?void 0:k.note)||"",options:{unvalidated:!0,fullWidth:!0,multiline:!0}},{type:"date",name:"date",value:k.date},{type:"select",name:"Office",value:k.Office?k.Office.id:"",options:{format:"{{longName}}",comparisonKey:"id",title:"Einheit",items:u.Offices?u.Offices:[]}},{type:"select",name:"Project",value:k.Project?k.Project.id:"",options:{format:"{{longName}}",comparisonKey:"id",title:"Projekt",defaultState:k.Project,items:u.Offices?u.Offices.map((e=>e.Projects)).flat(2).filter(((e,t,a)=>e&&a.findIndex((t=>(null===t||void 0===t?void 0:t.id)===e.id))===t)):[],dependencies:{states:["Office"],handler:(e,t)=>t[0].Projects}}},{type:"select",name:"User",value:k.User?k.User.id:"",options:{format:"{{firstName}} {{lastName}}",comparisonKey:"id",title:"Moderator*in",defaultState:k.User,items:null===b||void 0===b?void 0:b.filter((e=>4===Number(e.roleId)))}}],type:"event",title:"Termin Bearbeiten",open:O.settings,close:()=>F("settings",!1)},F=(e,t)=>{y({...O,[e]:t})},B=e=>{if(e){D(!0);const t={read:{type:"binary",cellDates:!0},json:{skipHidden:!0,header:"A",blankrows:!1,dateNF:"dd/mm/yyyy"},sheetName:"Gesamt\xfcbersicht",columns:{basic:["B","C","D","E","I","J","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],meta:["B"],competencies:["L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]},rows:{headers:[23],meta:[20,21,22],participants:Array.from(Array(19).keys()).slice(1)}},a={headers:(e,a)=>t.rows.headers.includes(a),meta:(e,a)=>t.rows.meta.includes(a),participants:(e,a)=>t.rows.participants.includes(a),competencies:e=>{const a=e.filter(((e,a)=>t.rows.headers.includes(a)))[0];return Object.entries(a).filter((e=>{let[a,i]=e;return t.columns.competencies.includes(a)&&0!==i&&""!==i})).reduce(((e,t)=>{let[i,n]=t;return e[n]=a[i],e}),{})}},i=new FileReader;i.readAsBinaryString(e),i.onload=async e=>{const i=e.target.result,n=Object(Ln.a)(i,t.read).Sheets[t.sheetName],c=Ln.b.sheet_to_json(n,t.json),s=JSON.parse(JSON.stringify(c));if(!n)return D(!1),void p('Dokument enth\xe4lt nicht die Seite "'.concat(t.sheetName,'"'),Je("error"));try{const e={headers:s.filter(a.headers).map((e=>[...t.columns.basic.map((t=>e[t]))])).flat(1),meta:s.filter(a.meta).map((e=>[...t.columns.basic.map((t=>e[t]))])).flat(1),participants:s.filter(a.participants).map((e=>[...t.columns.basic.map((t=>e[t]))])).filter((e=>e[0]))},i={participants:e.participants.map((t=>t.reduce(((t,a,i)=>({...t,[e.headers[i]]:a})),{}))),date:new Date(e.meta[0]),competencies:a.competencies(s)};let n;if(Xt(i.date)!==Qt(k.date)?n="Termin Datum stimmt nicht \xfcberein":i.participants&&0!==i.participants.length?i.competencies&&0!==Object.keys(i.competencies).length?i||(n="Datei konnte nicht ausgelesen werden"):n="Es konntent keine Kompetenzen ausgelesen werden":n="Es konnten keine Teilnehmer ausgelesen werden",n)p(n,Je("error")),D(!1);else{const e=await f(w.id,k.id,C.id,i.date,i.participants,i.competencies);e&&1e3===e.status_code?(p("Verarbeitung erfolgreich",Je("success")),(e=>{A(e),y({...O,upload:!1,feedback:!0})})(e.data)):(p("Fehler bei der Verarbeitung",Je("error")),y({...O,upload:!1})),D(!1)}}catch(l){D(!1),p("Fehler bei der Dokumentverarbeitung",Je("error"))}}}};Object(x.useEffect)((()=>{(async()=>{const e=await m(l);e&&I(e)})(),j()}),[]);const R={title:"Gruppen",isLoading:z,searchFilter:!1,columns:[{title:"Gruppe",field:"longName"},{title:"Status",field:"status",render:e=>Object(zt.jsx)(Ve.a,{children:aa("group",e.status)})},{title:"Ergebnisimport",align:"right",render:e=>Object(zt.jsx)(Ya.a,{title:Yn.upload,children:Object(zt.jsx)("span",{children:Object(zt.jsx)(ei.a,{size:"small",onClick:()=>{var t;null!==(t=e)&&void 0!==t&&t.id&&(S(t),y({...O,upload:!0}))},disabled:e.status!==Mn.valid,className:e.status!==Mn.valid?r.disabled:r.icon,children:Object(zt.jsx)(Wn.a,{})})})},e.id)},{title:"Stornierung",align:"left",render:e=>Object(zt.jsx)(Ya.a,{title:Yn.cancel,children:Object(zt.jsx)("span",{children:Object(zt.jsx)(ei.a,{size:"small",onClick:()=>(async e=>{1e3===(await h(e,Mn.abort)).status_code?p("Gruppe storniert",Je("success")):p("Gruppe konnte nicht storniert werden",Je("error")),o.go(0)})(e.id),disabled:e.status!==Mn.valid,className:e.status!==Mn.valid?r.disabled:r.icon,children:Object(zt.jsx)(En.a,{})})})},e.id)}],data:k.id?JSON.parse(JSON.stringify(null===k||void 0===k?void 0:k.Groups)):[]};return Object(zt.jsxs)(Ki,{children:[null!==k&&void 0!==k&&k.id?Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsxs)("div",{className:r.vcard,"data-cy":"info-vcard",children:[Object(zt.jsxs)("div",{className:r.avatarBox,children:[Object(zt.jsxs)("div",{className:r.display,children:[Object(zt.jsx)(Mi.a,{className:r.avatar,"data-cy":"info-avatar",children:Object(zt.jsx)(Bn.a,{})}),Object(zt.jsx)(Ve.a,{className:r.headline,children:"Einheit: ".concat(null===k||void 0===k||null===(t=k.Office)||void 0===t?void 0:t.longName)})]}),d&&Object(zt.jsxs)("div",{className:r.icon,children:[Object(zt.jsx)(Ya.a,{title:"Termin editieren",children:Object(zt.jsx)(ei.a,{onClick:()=>F("settings",!0),children:Object(zt.jsx)(Sn.a,{})})}),Object(zt.jsx)(Ja,{...T})]})]}),Object(zt.jsxs)("div",{className:r.infoBox,children:[Object(zt.jsxs)("div",{className:r.tablerow,children:[Object(zt.jsx)(Ve.a,{className:r.label,children:$n.project}),Object(zt.jsx)(Ve.a,{className:r.input,children:null===k||void 0===k||null===(a=k.Project)||void 0===a?void 0:a.longName})]}),Object(zt.jsxs)("div",{className:r.tablerow,children:[Object(zt.jsx)(Ve.a,{className:r.label,children:$n.location}),Object(zt.jsx)(Ve.a,{className:r.input,children:null===k||void 0===k?void 0:k.location})]}),Object(zt.jsxs)("div",{className:r.tablerow,children:[Object(zt.jsx)(Ve.a,{className:r.label,children:$n.user}),Object(zt.jsxs)(Ve.a,{className:r.input,children:[null===k||void 0===k||null===(i=k.User)||void 0===i?void 0:i.firstName," ",null===k||void 0===k||null===(n=k.User)||void 0===n?void 0:n.lastName]})]}),Object(zt.jsxs)("div",{className:r.tablerow,children:[Object(zt.jsx)(Ve.a,{className:r.label,children:$n.date}),Object(zt.jsx)(Ve.a,{className:r.input,children:Qt(k.date)})]}),Object(zt.jsxs)("div",{className:r.tablerow,children:[Object(zt.jsx)(Ve.a,{className:r.label,children:$n.status}),Object(zt.jsx)(Ve.a,{className:r.input,children:aa("event",null===k||void 0===k?void 0:k.status)})]})]})]}),Object(zt.jsx)(Li,{dense:!0,...R}),Object(zt.jsx)(Jn,{position:w,positions:null===(c=k.Project)||void 0===c?void 0:c.Positions,group:C,open:O.upload,close:()=>F("upload",!1),handlePosition:e=>N(e),upload:e=>B(e)}),Object(zt.jsx)(Kn,{uploadResponse:P,close:()=>{F("feedback",!1),A({}),o.go(0)},open:O.feedback}),k.note&&Object(zt.jsxs)(Ae.a,{className:r.note,children:[Object(zt.jsx)(Ve.a,{className:r.headline,children:"Anmerkung"}),Object(zt.jsx)(Wt.a,{multiline:!0,defaultValue:k.note,disabled:!0,fullWidth:!0,className:r.noteFiels})]})]}):Object(zt.jsx)(Ft,{}),Object(zt.jsx)(_e.a,{color:"secondary",variant:"contained",size:"large",onClick:()=>{o.push("/events")},className:r.button,children:"Zur\xfcck zu Termin\xfcbersicht"})]})})),ec=a(1016);const tc={1:"VFA",2:"RSA",3:"RIA",4:"VIA"},ac=e=>{let{rawValues:t,tableButtons:a,onRowClick:i,hideLongName:n,hideShortName:c,hideForm:s,hideLevel:l,hideEvalType:r}=e;const o=e=>{switch(e){case"MC":return"Multiple Choice";case"MS":return"Multiple Select";case"FQ":return"Fehlerquotient";case"PT":return"Pers\xf6nlichkeitsskalen";default:return"Fehlerhafter Aufgabentyp (".concat(e,")")}},d=[];return n||d.push({title:"Name",field:"longName"}),c||d.push({title:"Abk\xfcrzung",field:"shortName"}),s||d.push({title:"Parallel-Form",field:"form"}),l||d.push({title:"Niveau",field:"level",render:e=>"Level ".concat(null===e||void 0===e?void 0:e.level," (z.B. ").concat(tc[null===e||void 0===e?void 0:e.level],")")}),r||d.push({title:"Aufgabentyp",field:"localizedEvalType"}),Object(zt.jsx)(Li,{dense:!0,isLoading:!t,title:"Rohwerte",tableButtons:a||[],columns:d,data:t?t.map((e=>({...e,localizedEvalType:o(e.evalType)}))):[],onRowClick:i,pagingFilter:!0,pageSize:5})},ic={async getAllRawValues(){const e=await b.a.get(Object(k.j)("/api/rv/get","rv/get"));return Promise.resolve(e.data)},async getRawValue(e){const t=await b.a.get(Object(k.j)("/api/rv/".concat(e),"rv/".concat(e)));return Promise.resolve(t.data)},async createOrUpdateRawValue(e,t){const a=await b.a.put(Object(k.j)("/api/rv/update","rv/update"),{...e,rvTypeId:t});return Promise.resolve(a.data)},async deleteRawValue(e){const t=await b.a.delete(Object(k.j)("/api/rv/delete/".concat(e),"rv/delete/".concat(e)));return Promise.resolve(t.data)}};var nc=a(997),cc=a(998),sc=a(966),lc=a(960),rc=a(1005),oc=a(560);const dc=e=>{const{chosenTitle:t,choicesTitle:a,chosen:i,choices:n,titleKey:c,initialSearch:s,setChosen:l}=e,[r,o]=Object(x.useState)([]),[u,b]=Object(x.useState)([...i]),[j,p]=Object(x.useState)([...n]),m=Object(x.useState)(s||""),h=Object(x.useState)(s||""),g=v(r,u),f=v(r,j);function O(e,t){return e.filter((e=>-1===t.indexOf(e)))}function v(e,t){return e.filter((e=>-1!==t.indexOf(e)))}const y=e=>()=>{const t=r.indexOf(e),a=[...r];-1===t?a.push(e):a.splice(t,1),o(a)},w=e=>v(r,e).length,N=e=>()=>{var t,a;w(e)===e.length?o(O(r,e)):o((t=r,a=e,[...t,...O(a,t)]))},C=(e,t,a)=>Object(zt.jsxs)(nc.a,{children:[Object(zt.jsx)(cc.a,{style:{padding:"2px 1px"},avatar:Object(zt.jsx)(ba.a,{onClick:N(t),checked:w(t)===t.length&&0!==t.length,indeterminate:w(t)!==t.length&&0!==w(t),disabled:0===t.length,inputProps:{"aria-label":"all items selected"}}),title:e,subheader:"".concat(w(t),"/").concat(t.length," selected")}),Object(zt.jsx)(Me.a,{}),Object(zt.jsx)(Wt.a,{label:"Suche",style:{width:260,marginLeft:20,marginRight:20},value:a[0],onChange:e=>a[1](e.target.value)}),Object(zt.jsx)(sc.a,{style:{width:300,height:230,overflow:"auto"},dense:!0,component:"div",role:"list",children:t.map(((e,t)=>{const a="transfer-list-all-item-".concat(e,"-label");return Object(zt.jsxs)(lc.a,{role:"listitem",button:!0,onClick:y(e),children:[Object(zt.jsx)(rc.a,{children:Object(zt.jsx)(ba.a,{checked:-1!==r.indexOf(e),tabIndex:-1,disableRipple:!0,inputProps:{"aria-labelledby":a}})}),Object(zt.jsx)(oc.a,{id:a,primary:e[c]})]},"item".concat(t,".").concat(e[c]))}))})]});return Object(zt.jsxs)(d.a,{container:!0,spacing:2,justify:"center",alignItems:"center",children:[Object(zt.jsx)(d.a,{item:!0,children:C(t,u.filter((e=>e[c].toLowerCase().includes(m[0].toLowerCase()))),m)}),Object(zt.jsx)(d.a,{item:!0,children:Object(zt.jsxs)(d.a,{container:!0,direction:"column",alignItems:"center",children:[Object(zt.jsx)(_e.a,{style:{marginLeft:.5,marginRight:.5},variant:"outlined",size:"small",onClick:()=>{p(j.concat(g));const e=O(u,g);b(e),o(e),l(e)},disabled:0===g.length,"aria-label":"move selected right",children:">"}),Object(zt.jsx)(_e.a,{style:{marginLeft:.5,marginRight:.5},variant:"outlined",size:"small",onClick:()=>{const e=u.concat(f);b(e),l(e),p(O(j,f)),o(O(r,f))},disabled:0===f.length,"aria-label":"move selected left",children:"<"})]})}),Object(zt.jsx)(d.a,{item:!0,children:C(a,j.filter((e=>e[c].toLowerCase().includes(h[0].toLowerCase()))),h)})]})},uc=Object(s.a)((e=>({root:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center"},title:{textAlign:"center",boxSizing:"border-box"},content:{width:"400px",padding:e.spacing(2),display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:e.spacing(2)},button:{marginTop:"15px"}}))),bc=e=>{let{open:t,close:a,data:i}=e;const{handleCreateLink:n,rvRelevantStart:c,irrelevantIds:s,rawValues:l}=i,r=uc(),{getAllRawValues:o}=ic,[d,u]=Object(x.useState)(),[b,j]=Object(x.useState)([...l]);return ni((async()=>{const{data:e}=await o();return e}),(e=>{if(e){const t=e.filter((e=>void 0===s.find((t=>t===e.id))));u(t)}})),Object(zt.jsxs)(We.a,{transitionDuration:100,className:r.root,open:t,onClose:()=>{a()},children:[Object(zt.jsx)(Le.a,{className:r.title,children:"Verkn\xfcpfungen Bearbeiten"}),Object(zt.jsx)(Me.a,{}),Object(zt.jsx)(Ge.a,{children:d?Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)(dc,{titleKey:"longName",chosenTitle:"Aktuell Verlinkt",choicesTitle:"Verf\xfcgbare Rohwerte",chosen:l,choices:d,initialSearch:c,setChosen:j}),Object(zt.jsx)(_e.a,{color:"secondary",variant:"contained",size:"medium",fullWidth:!0,className:r.button,onClick:()=>{n(b.map((e=>e.id)),l.filter((e=>!b.find((t=>t.id===e.id)))).map((e=>e.id)))},children:"Verkn\xfcpfen"})]}):Object(zt.jsx)(Ft,{})})]})},jc=Object(s.a)((e=>({root:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center"},title:{textAlign:"center",boxSizing:"border-box"},content:{width:"400px",padding:e.spacing(2),display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:e.spacing(2)},button:{marginTop:"15px"}}))),pc=e=>{let{open:t,close:a,data:i}=e;const n=i,c=jc(),s=Object(v.f)(),{enqueueSnackbar:l}=Object(g.b)(),{createNorm:r,deleteNorm:o,updateNorm:d}=D,[u,b]=Object(x.useState)(null===n||void 0===n?void 0:n.longName),[j,p]=Object(x.useState)(null===n||void 0===n?void 0:n.shortName),[m,h]=Object(x.useState)(null===n||void 0===n?void 0:n.description),f=()=>u&&u.length>0&&j&&j.length>0&&m&&m.length>0;return Object(zt.jsxs)(We.a,{transitionDuration:100,className:c.root,open:t,onClose:a,children:[Object(zt.jsxs)(Le.a,{children:["Norm ",n?"Bearbeiten":"Erstellen"]}),Object(zt.jsx)(Me.a,{}),Object(zt.jsxs)(Ge.a,{children:[Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,label:"Name",value:u,onChange:e=>{b(e.target.value)}}),Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,label:"Abk\xfcrzung",value:j,onChange:e=>{p(e.target.value)}}),Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,label:"Beschreibung",value:m,onChange:e=>{h(e.target.value)}}),Object(zt.jsx)(_e.a,{className:c.button,fullWidth:!0,size:"small",variant:"contained",color:"secondary",type:"submit",onClick:async()=>{if(f())if(n){(await d(n.id,u,j,m)).status_code===Ze.SUCCESS?s.go(0):l("Norm konnte nicht aktualisiert werden",Je("error"))}else{const e=await r(u,j,m);e.status_code===Ze.SUCCESS&&e.data?s.push("/norm/".concat(e.data.id)):l("Norm konnte nicht gespeichert werden",Je("error"))}},disabled:!f(),children:"Speichern"}),n&&Object(zt.jsx)(_a,{buttonName:"L\xf6schen",callback:async()=>{if(!n)return;(await o(n.id)).status_code===Ze.SUCCESS?s.push("/norm"):l("Norm konnte nicht gel\xf6scht werden",Je("error"))},compareString:"l\xf6schen",description:"Geben Sie 'L\xf6schen' ein"})]})]})},mc=Object(s.a)((e=>({root:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center"},title:{textAlign:"center",boxSizing:"border-box"},content:{width:"400px",padding:e.spacing(2),display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:e.spacing(2)},button:{marginTop:"15px"}}))),hc=e=>{let{open:t,close:a,handleUnlink:i,rawValue:n}=e;const c=mc();return Object(zt.jsxs)(We.a,{transitionDuration:100,className:c.root,open:t,onClose:()=>{a()},children:[Object(zt.jsx)(Le.a,{className:c.title,children:"Verkn\xfcpfung Entfernen"}),Object(zt.jsx)(Me.a,{}),Object(zt.jsx)(Ge.a,{children:Object(zt.jsx)(_a,{buttonName:"Entfernen",callback:()=>i(n.id),compareString:"entfernen",description:"Geben Sie 'entfernen' ein"})})]})},gc=Object(s.a)((e=>({label:{minWidth:"250px",textAlign:"left",margin:"0",padding:e.spacing(.5)},chip:{width:"fit-content"}}))),xc=Object(s.a)((e=>({details:{width:"100%"},overviewCard:{width:"100%",display:"flex",flexDirection:"column",boxSizing:"border-box",alignItems:"flex-start",borderTop:"1px solid ".concat(e.palette.secondary.main),borderBottom:"1px solid ".concat(e.palette.secondary.main),borderRadius:"1px",padding:e.spacing(3)},editIcon:{cursor:"pointer"},avatar:{margin:"3px",backgroundColor:e.palette.secondary.main},avatarBox:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:e.spacing(2),userSelect:"none"},display:{display:"flex",justifyContent:"center"},title:{fontSize:"2rem",margin:"0",marginLeft:"7px"},tablerow:{display:"flex",marginTop:"3px"},label:{minWidth:"250px",textAlign:"left",margin:"0",padding:e.spacing(.5)}})));var fc=e=>{let{icon:t,title:a,displays:i,allowEdits:n=!1,editTooltip:c,onEdit:s}=e;const l=xc();return Object(zt.jsx)(zt.Fragment,{children:Object(zt.jsxs)("div",{className:l.overviewCard,children:[Object(zt.jsxs)("div",{className:l.avatarBox,children:[Object(zt.jsxs)("div",{className:l.display,children:[Object(zt.jsx)(Mi.a,{className:l.avatar,children:t}),Object(zt.jsx)(Ve.a,{className:l.title,children:a})]}),n&&Object(zt.jsx)("div",{className:l.editIcon,children:Object(zt.jsx)(Ya.a,{title:c||"Bearbeiten",children:Object(zt.jsx)(ei.a,{size:"medium",onClick:s,children:Object(zt.jsx)(Sn.a,{})})})})]}),Object(zt.jsx)("div",{className:l.details,children:i.map(((e,t)=>Object(zt.jsxs)("div",{className:l.tablerow,children:[Object(zt.jsx)(Ve.a,{className:l.label,children:e.title}),e.display]},"_detailsOverviewDisplay".concat(t))))})]})})};const Oc=Object(s.a)((e=>({button:{marginTop:"50px"}}))),vc=e=>{let{match:{params:{id:t}}}=e;const a=Object(v.f)(),i=Oc(),{isAdmin:n}=Object(x.useContext)(Ct),{getNorm:c,createNormLinks:s,removeNormLink:l}=D,{enqueueSnackbar:r}=Object(g.b)(),[o,d]=Object(x.useState)(),[u,b]=Object(x.useState)(!1),[j,p]=Object(x.useState)();ni((async()=>await c(t)),(e=>{d(null===e||void 0===e?void 0:e.data)}));return Object(zt.jsxs)(Ki,{children:[o?Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)(fc,{icon:Object(zt.jsx)(ec.a,{}),displays:[{title:"Abk\xfcrzung",display:Object(zt.jsx)(Ve.a,{children:o.shortName})},{title:"Beschreibung",display:Object(zt.jsx)(Ve.a,{children:o.description})}],title:o.longName,allowEdits:n,editTooltip:"Norm Bearbeiten",onEdit:()=>{b(!u)}}),Object(zt.jsx)(ac,{rawValues:o.RawValues,tableButtons:[{tooltip:"Rohwert mit Norm verlinken",icon:()=>Object(zt.jsx)(Fe.a,{}),popup:bc,data:{handleCreateLink:async(e,t)=>{if(!o)return;(await s(o.id,e,t)).status_code===Ze.SUCCESS?a.go(0):r("Verkn\xfcpfung konnte nicht erstellt werden",Je("error"))},irrelevantIds:o.RawValues.map((e=>e.id)),rawValues:o.RawValues},isFreeAction:!0,disabled:!n}],onRowClick:(e,t)=>{n&&p(t)}}),Object(zt.jsx)(pc,{close:()=>{b(!1)},open:u,data:o})]}):Object(zt.jsx)(Ft,{}),Object(zt.jsx)(_e.a,{color:"secondary",variant:"contained",size:"large",onClick:()=>{a.push("/norm")},className:i.button,children:"Zur\xfcck zur Norm\xfcbersicht"}),j&&Object(zt.jsx)(hc,{rawValue:j,close:()=>p(void 0),open:Boolean(j),handleUnlink:async e=>{if(!o)return;(await l(e,o.id)).status_code===Ze.SUCCESS?a.go(0):r("Verkn\xfcpfung konnte nicht entfernt werden",Je("error"))}})]})},yc={abbreviation:"Abk\xfcrzung:",color:"Farbe:"},wc=Object(s.a)((e=>({infoBox:{width:"100%"},tablerow:{display:"flex",marginTop:"3px"},button:{marginTop:"50px"},avatar:{margin:"3px",backgroundColor:e.palette.secondary.main},avatarBox:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:e.spacing(2),userSelect:"none"},display:{display:"flex",justifyContent:"center"},customerName:{fontSize:"2rem",margin:"0",marginLeft:"7px"},vcard:{width:"100%",height:"35%",display:"flex",flexDirection:"column",boxSizing:"border-box",alignItems:"flex-start",borderTop:"1px solid ".concat(e.palette.secondary.main),borderBottom:"1px solid ".concat(e.palette.secondary.main),borderRadius:"1px",padding:e.spacing(3)},input:{minWidth:"250px",margin:"0",textAlign:"left",padding:e.spacing(.5)},editIcon:{cursor:"pointer"},icons:{position:"absolute",display:"inline",bottom:"0px"},label:{minWidth:"250px",textAlign:"left",margin:"0",padding:e.spacing(.5)},customerIcon:{position:"relative",bottom:"34px",left:"3%",display:"flex",cursor:"pointer"},chip:{width:"fit-content"}})));var Nc=Object(h.a)((e=>{let{match:t}=e;const a=t.params.id,i=wc(),n=Object(v.f)(),{isAdminSupport:c}=Object(x.useContext)(Ct),{fetchedOffice:s,getOfficeById:l,fetchedCustomer:r}=Object(x.useContext)(Pe),[o,d]=f.a.useState(!1),u={customerId:r.id,items:[{type:"id",name:"id",value:s.id},{type:"name",name:"longName",value:s.longName},{type:"default",name:"shortName",value:s.shortName},{type:"color",name:"color",value:s.color}],type:"office",title:"Office editieren",open:o,close:()=>d(!1)};Object(x.useEffect)((()=>{l(a)}),[]);const b={title:"Projekte",searchFilter:!1,columns:[{title:"Name",field:"longName"},{title:"Abk\xfcrzung",field:"shortName"},{title:"G\xfcltig von",field:"validFrom"},{title:"G\xfcltig bis",field:"validUntil"}],data:s.id?JSON.parse(JSON.stringify(null===s||void 0===s?void 0:s.Projects)):[]},j={title:"Positionen",searchFilter:!1,columns:[{title:"Name",field:"longName"},{title:"Abk\xfcrzung",field:"shortName"}],data:s.id?JSON.parse(JSON.stringify(null===s||void 0===s?void 0:s.Positions)):[]};return Object(zt.jsxs)(Ki,{children:[null!==s&&void 0!==s&&s.id?Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsxs)("div",{className:i.vcard,"data-cy":"info-vcard",children:[Object(zt.jsxs)("div",{className:i.avatarBox,children:[Object(zt.jsxs)("div",{className:i.display,children:[Object(zt.jsx)(Mi.a,{className:i.avatar,"data-cy":"info-avatar",children:Object(zt.jsx)(Ea.a,{})}),Object(zt.jsx)(Ve.a,{className:i.customerName,children:s.longName})]}),c&&Object(zt.jsxs)("div",{className:i.editIcon,children:[Object(zt.jsx)(Ya.a,{title:"Office editieren",children:Object(zt.jsx)(ei.a,{onClick:()=>d(!0),children:Object(zt.jsx)(Sn.a,{})})}),Object(zt.jsx)(Ja,{...u})]})]}),Object(zt.jsxs)("div",{className:i.infoBox,children:[Object(zt.jsxs)("div",{className:i.tablerow,children:[Object(zt.jsx)(Ve.a,{className:i.label,children:yc.abbreviation}),Object(zt.jsx)(Ba.a,{className:i.chip,label:s.shortName,size:"small",variant:"outlined"})]}),Object(zt.jsxs)("div",{className:i.tablerow,children:[Object(zt.jsx)(Ve.a,{className:i.label,children:yc.color}),Object(zt.jsx)("div",{className:i.input,children:Object(zt.jsx)(Ya.a,{title:s.color,arrow:!0,children:Object(zt.jsx)(pn,{color:s.color})})})]})]})]}),Object(zt.jsx)(Li,{dense:!0,...b}),Object(zt.jsx)(Li,{dense:!0,...j})]}):Object(zt.jsx)(Ft,{}),Object(zt.jsx)(_e.a,{color:"secondary",variant:"contained",size:"large",onClick:()=>{n.push("/".concat(null!==r&&void 0!==r&&r.id?"customer/".concat(r.id):""))},className:i.button,children:"Zur\xfcck zu Kundendetails"})]})})),Cc=a(1017),Sc=a(262),kc=a.n(Sc),Ic=a(621),zc=a.n(Ic),Dc=a(347),Pc=a.n(Dc),Ac=a(439),Tc=a.n(Ac),Fc=a(216),Bc=a.n(Fc);const Rc={async addParticipants(e){const t=await b.a.post(Object(k.j)("/api/import","/AddParticipants"),e,{});return Promise.resolve(t.data)},async getParticpants(){const e=await b.a.get(Object(k.j)("/api/participant/all","/api/participant/all"));return Promise.resolve(e.data.data)},async getParticpantById(e){const t=await b.a.get(Object(k.j)("/api/participant/".concat(e),"/api/participant/".concat(e)));return 1e3===t.data.status_code?Promise.resolve(t.data.data):Promise.reject()},async updateParticipant(e){const t=await b.a.put(Object(k.j)("/api/participant","/api/participant"),{...e});return Promise.resolve(t.data)},async saveAcImportResult(e){const t=await b.a.post(Object(k.j)("/api/participants/acimport/save","/api/participants/acimport/save"),{participants:e});return Promise.resolve(t)},async updateRawValue(e,t){const a=await b.a.put(Object(k.j)("/api/application/rawvalue","/api/application/rawvalue"),{applicationId:e,resultId:t.rwId,newValue:t.value});return 1e3===a.data.status_code?Promise.resolve(a.data.data):Promise.reject()},async updateApplicationDates(e,t,a,i){const n=await b.a.put(Object(k.j)("/api/application/dates","/api/application/dates"),{participantId:e,applicationId:t,validFrom:a,validUntil:i});return Promise.resolve(n.data)},async archiveApplication(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const t=await b.a.get(Object(k.j)("/api/application/archive/".concat(e),"/api/application/archive/".concat(e)));return Promise.resolve(t.data)},async recalculateApplication(e){const t=await b.a.put(Object(k.j)("/api/application/recalculate/".concat(e),"/api/application/recalculate/".concat(e)));return Promise.resolve(t.data)},async exportParticipants(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const i=await b.a.put(Object(k.j)("/api/export/".concat(e),"/api/export/".concat(e)),{participantIds:t||[]});return i&&i.data.data?4e3===i.data.status_code?Promise.resolve(i.data.status_code):(function(e,t){const a="data:text/csv;charset=utf-8,\ufeff".concat(e.map((e=>e.join(";"))).join("\n")),i=document.createElement("a");i.download=t,i.href=encodeURI(a),i.click(),i.remove()}(i.data.data,"".concat(Xt(new Date)).concat(a?"_".concat(a):"","_kitest_export.csv")),Promise.resolve(i.data)):Promise.reject(5e3)},async getReport(e,t,a){const i=await b.a.get(Object(k.j)("/api/export/report/".concat(e),"/api/export/report/".concat(e))),n="data:application/pdf;base64,".concat(i.data.data),c=document.createElement("a"),s="Report-".concat(a,"_").concat(t,".pdf");return c.href=n,c.download=s,c.click(),c.remove(),Promise.resolve(i.data)},async getActivities(e){const t=await b.a.get(Object(k.j)("/api/activity/".concat(e),"/api/activity/".concat(e)));return Promise.resolve(t.data.data)},async addComment(e,t){const a=await b.a.put(Object(k.j)("/api/activity/comment/add/".concat(e),"/api/activity/comment/add/".concat(e)),{data:{...t}});return Promise.resolve(a.data.data)},async updateComment(e,t,a){const i=await b.a.put(Object(k.j)("/api/activity/comment/update/".concat(e,"/").concat(t),"/api/activity/comment/update/".concat(e,"/").concat(t)),{data:{...a}});return 1e3===i.data.status_code?Promise.resolve(i.data.data):Promise.reject()},async updateSupportStatus(e,t,a){const i=await b.a.put(Object(k.j)("/api/support/update","/api/support/update"),{id:e,severity:t,level:a});return Promise.resolve(i.data)},async invalidateRun(e,t){const a=await b.a.put(Object(k.j)("/api/participant/invalidate/run","/api/participant/invalidate/run"),{participantId:e,runId:t});return Promise.resolve(a.data)},async replaceRun(e,t,a,i){const n=await b.a.put(Object(k.j)("/api/participant/replace/run","/api/participant/replace/run"),{participantId:e,runId:t,surveyId:a,validUntil:i});return Promise.resolve(n.data)},async getAlternativeSurveys(e,t){const a=await b.a.get(Object(k.j)("/api/participant/alt/run/".concat(e,"/").concat(t),"/api/participant/alt/run/".concat(e,"/").concat(t)));return 1e3===a.data.status_code?Promise.resolve(a.data):Promise.reject()},async saveCheckSum(e,t){const a=await b.a.post(Object(k.j)("/api/applications/checksum/save","/api/applications/checksum/save"),{data:{checksum:t,applicationId:e}});return Promise.resolve(a)},async getCheckSum(e){const t=await b.a.get(Object(k.j)("/api/applications/checksum/".concat(e),"/api/applications/checksum/".concat(e)));return Promise.resolve(t.data)}};var Ec,Uc,Wc,Lc,Mc,Gc,Vc,_c,Kc,qc,Hc,Zc,Jc,$c,Yc,Xc,Qc,es,ts,as,is,ns=Rc;let cs=(Ec=Object(S.b)("add participants"),Uc=Object(S.b)("get all participants"),Wc=Object(S.b)("get participant by id"),Lc=Object(S.b)("get Activities"),Mc=Object(S.b)("add Comment"),Gc=Object(S.b)("delete Comment"),Vc=Object(S.b)("Update Supportstatus"),_c=class{constructor(){Object(N.a)(this,"fetchedActivities",Kc,this),Object(N.a)(this,"fetchedAddParticipants",qc,this),Object(N.a)(this,"fetchedParticipant",Hc,this),Object(N.a)(this,"fetchedParticipants",Zc,this),Object(N.a)(this,"isDoneFetchingActivities",Jc,this),Object(N.a)(this,"isfetchingData",$c,this),Object(N.a)(this,"addParticipants",Yc,this),Object(N.a)(this,"getParticipants",Xc,this),Object(N.a)(this,"getParticipantById",Qc,this),Object(N.a)(this,"getActivities",es,this),Object(N.a)(this,"addComment",ts,this),Object(N.a)(this,"updateComment",as,this),Object(N.a)(this,"updateSupportStatus",is,this),this.fetchedActivities=[],this.fetchedAddParticipants=[],this.fetchedParticipant={},this.fetchedParticipants=[],this.isDoneFetchingActivities=!1,this.isfetchingData=!1}},Kc=Object(C.a)(_c.prototype,"fetchedActivities",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),qc=Object(C.a)(_c.prototype,"fetchedAddParticipants",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Hc=Object(C.a)(_c.prototype,"fetchedParticipant",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Zc=Object(C.a)(_c.prototype,"fetchedParticipants",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Jc=Object(C.a)(_c.prototype,"isDoneFetchingActivities",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),$c=Object(C.a)(_c.prototype,"isfetchingData",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Yc=Object(C.a)(_c.prototype,"addParticipants",[Ec],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return e=>{this.isfetchingData=!0,Object(S.g)("Add participants to System",(async()=>{this.fetchedAddParticipants=await ns.addParticipants(e),this.isfetchingData=!1}))}}}),Xc=Object(C.a)(_c.prototype,"getParticipants",[Uc],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return()=>{this.isfetchingData=!0,Object(S.g)("Get all participants from System",(async()=>{this.fetchedParticipants=await ns.getParticpants(),this.isfetchingData=!1}))}}}),Qc=Object(C.a)(_c.prototype,"getParticipantById",[Wc],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return e=>{this.isfetchingData=!0,Object(S.g)("Get single participant from System",(async()=>{this.fetchedParticipant=await ns.getParticpantById(e),this.isfetchingData=!1}))}}}),es=Object(C.a)(_c.prototype,"getActivities",[Lc],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return e=>{Object(S.g)("Get participant activities",(async()=>{this.fetchedActivities=await ns.getActivities(e)}))}}}),ts=Object(C.a)(_c.prototype,"addComment",[Mc],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return(e,t)=>{this.isfetchingData=!0,Object(S.g)("Add comment to participant",(async()=>{const a=await ns.addComment(e,t);return this.isfetchingData=!1,a}))}}}),as=Object(C.a)(_c.prototype,"updateComment",[Gc],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return(e,t,a)=>{this.isfetchingData=!0,Object(S.g)("Delete participant comment",(async()=>{const i=await ns.updateComment(e,t,a);return this.isfetchingData=!1,i}))}}}),is=Object(C.a)(_c.prototype,"updateSupportStatus",[Vc],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return(e,t,a)=>{this.isfetchingData=!0,Object(S.g)("Update run supportStatus",(async()=>{const i=await ns.updateSupportStatus(e,t,a);return this.isfetchingData=!1,i}))}}}),_c);var ss=Object(x.createContext)(new cs),ls=a(1030);const rs={alphabetically(e,t){const a=t||"";return(e||"").length-a.length}},os={byFullName:(e,t)=>e.split(" ").map((e=>(null===t||void 0===t?void 0:t.firstName.toLowerCase().includes(e.toLowerCase()))||(null===t||void 0===t?void 0:t.lastName.toLowerCase().includes(e.toLowerCase())))).every((e=>e))},ds={application:(e,t)=>aa("event",t.status).toLowerCase().includes(e.toLowerCase())};const us=Object(s.a)((e=>({comment:{display:"flex",flexDirection:"column",marginTop:e.spacing(1),textAlign:"left",width:"100%"},submitBox:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",boxSizing:"border-box"},submitFilter:{display:"flex",flexDirection:"row",overFlow:"hidden"},checkInternal:{width:"6rem"},officeSelect:{width:"14rem"},button:{},autocomplete:{width:"100%"}})));var bs=Object(h.a)((()=>{const e=us(),{user:t,isAdminSupport:a}=Object(x.useContext)(Ct),{getActivities:i,fetchedParticipant:n,addComment:c}=Object(x.useContext)(ss),[s,l]=Object(x.useState)(!1),[r,o]=Object(x.useState)(""),[d,u]=Object(x.useState)(!1),[b,j]=Object(x.useState)([]),[p,m]=Object(x.useState)([]),[h,g]=Object(x.useState)([]),[f,O]=Object(x.useState)([]);return Object(x.useEffect)((()=>{i(n.id)}),[i,n]),Object(x.useEffect)((()=>{t.Offices&&j(t.Offices)}),[t]),Object(x.useEffect)((()=>{t.Customers&&g(t.Customers)}),[t]),Object(x.useEffect)((()=>{r.length>0&&p.length>0||s||f.length>0?u(!0):u(!1)}),[u,d,r.length,p.length,s,f.length]),Object(zt.jsxs)(Ki,{children:[Object(zt.jsx)(Wt.a,{multiline:!0,placeholder:"Kommentar eingeben...",className:e.comment,rows:5,variant:"outlined",fullWidth:!0,color:"secondary",margin:"normal",value:r,inputProps:{maxLength:1e3},helperText:"".concat(r.length,"/",1e3),"data-cy":"info-comment-textfield",onChange:e=>o(e.currentTarget.value)}),Object(zt.jsxs)("div",{className:e.submitBox,children:[Object(zt.jsxs)("form",{className:e.submitFilter,children:[a&&Object(zt.jsx)(ua.a,{className:e.checkInternal,checked:s,"data-cy":"info-comment-intern",onChange:()=>l(!s),control:Object(zt.jsx)(ba.a,{name:"checkedC"}),label:"intern"}),!s&&Object(zt.jsx)(Bt.a,{variant:"outlined",color:"secondary","data-cy":"info-comment-office",className:e.officeSelect,id:"office",fullWidth:!0,children:Object(zt.jsx)(Mt.a,{size:"small",className:e.autocomplete,disabled:f.length>0,filterSelectedOptions:!0,getOptionLabel:e=>(null===e||void 0===e?void 0:e.shortName)||"",groupBy:e=>{var t;return null!==e&&void 0!==e&&null!==(t=e.Customer)&&void 0!==t&&t.longName?e.Customer.longName:""},id:"customer-select",multiple:!0,noOptionsText:"Keine Einheit",options:b,value:p,onChange:(e,t)=>{m(t)},renderTags:(e,t)=>e.map(((e,a)=>Object(zt.jsx)(Ba.a,{size:"small",...t({index:a}),label:e.longName,color:"secondary",icon:Object(zt.jsx)(Ea.a,{})}))),renderInput:e=>Object(zt.jsx)(Wt.a,{required:!0,...e,variant:"outlined",color:"secondary",label:"Einheiten"})})}),!s&&a&&Object(zt.jsx)(Bt.a,{variant:"outlined",color:"secondary","data-cy":"info-comment-customer",className:e.officeSelect,id:"customer",fullWidth:!0,children:Object(zt.jsx)(Mt.a,{size:"small",disabled:p.length>0,multiple:!0,className:e.autocomplete,id:"tags-outlined",options:h,value:f,getOptionLabel:e=>(null===e||void 0===e?void 0:e.shortName)||"",filterSelectedOptions:!0,noOptionsText:"Kein Kunde",onChange:(e,t)=>{O(t)},renderTags:(e,t)=>e.map(((e,a)=>Object(zt.jsx)(Ba.a,{size:"small",...t({index:a}),label:e.longName,color:"secondary",icon:Object(zt.jsx)(Nn.a,{})}))),renderInput:e=>Object(zt.jsx)(Wt.a,{required:!0,...e,variant:"outlined",color:"secondary",label:"Kunde"})})})]}),Object(zt.jsx)(_e.a,{disabled:!d,color:"secondary",variant:"contained",component:"span","data-cy":"info-comment-btn",className:e.button,onClick:()=>{const e=c(n.id,{message:r,offices:p,customers:f,internal:s});o(""),null!==e&&i(n.id)},children:"Kommentieren"})]})]})}));const js=Object(s.a)((e=>({root:{display:"flex",flexDirection:"column",justifyContent:"center","& .MuiInputBase-root.Mui-disabled":{color:e.palette.secondary.dark}},messageButtonBox:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",padding:e.spacing(1),width:"100%",boxSizing:"border-box"},edit:{fontSize:"0.7rem",textTransform:"none",padding:"0 3px",color:e.palette.success.main},delete:{fontSize:"0.7rem",textTransform:"none",padding:"0 3px",color:e.palette.error.main},message:{width:"100%",padding:e.spacing(2),boxSizing:"border-box"},textField:{margin:e.spacing(1),caretColor:"black",backgroundColor:"white"}})));var ps=Object(h.a)((e=>{var t;let{comment:a}=e;const i=js(),{user:n}=Object(x.useContext)(Ct),{enqueueSnackbar:c}=Object(g.b)(),{fetchedParticipant:s,updateComment:l}=Object(x.useContext)(ss),[r,o]=Object(x.useState)(!1),[d,u]=Object(x.useState)(a.message);return Object(zt.jsxs)("div",{className:i.root,children:[Object(zt.jsx)(Wt.a,{multiline:!0,variant:"outlined",value:d,disabled:!r,inputRef:e=>e&&r&&e.focus(),className:i.textField,onChange:e=>u(e.currentTarget.value)}),(null===a||void 0===a||null===(t=a.User)||void 0===t?void 0:t.id)!==n.id||a.system?Object(zt.jsx)(zt.Fragment,{}):Object(zt.jsxs)(Hi.a,{size:"small",variant:"text",className:i.messageButtonBox,children:[Object(zt.jsx)(_e.a,{variant:"text",className:i.edit,onClick:()=>{r?d.length>0?(l(s.id,a.id,{message:d,delete:!1}),o(!1)):c("Der Kommentar muss mindestens ein zeichen enthalten",Je("info")):o(!0)},children:r?"Speichern":"Bearbeiten"}),Object(zt.jsx)(_e.a,{variant:"text",className:i.delete,onClick:()=>r?o(!1):l(s.id,a.id,{message:d,delete:!0}),children:r?"Abbrechen":"L\xf6schen"})]})]},a.id)}));const ms=Object(s.a)((e=>({chip:{fontSize:"0.7rem",margin:"1px",boxSizing:"border-box"}}))),hs={cell:{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",maxWidth:"200px"},chip:{system:{backgroundColor:"DarkKhaki",color:"white"},internal:{backgroundColor:"CadetBlue",color:"white"}}};var gs=Object(h.a)((()=>{const e=ms(),{isAdminSupport:t}=Object(x.useContext)(Ct),{fetchedActivities:a}=Object(x.useContext)(ss),i=(t,a)=>Object(zt.jsx)(Ya.a,{title:t.join(" | "),children:Object(zt.jsx)(Ba.a,{className:e.chip,style:hs.chip[a],label:"+ ".concat(t.length),size:"small",..."office"===a&&{variant:"outlined"},..."customer"===a&&{color:"secondary"}},"overflow")}),n={headerColor:"white",headerFontColor:"#008dcf",fontSize:"0.9rem",fontColor:"DimGray",hideContainer:!0,columnFilter:!0,pagingFilter:!0,detailPanel:e=>Object(zt.jsx)(ps,{comment:e}),dense:!0,columns:[{title:"Benutzer*in",field:"User",width:"70%",type:"string",cellStyle:hs.cell,customFilterAndSearch:(e,t)=>os.byFullName(e,null===t||void 0===t?void 0:t.User),render:e=>Object(zt.jsx)("span",{children:1===Number(e.system)?"System":"".concat(null!==e&&void 0!==e&&e.User?"".concat(e.User.firstName," ").concat(e.User.lastName):"- Benutzer*in gel\xf6scht -")})},{title:"Erstellt",field:"createdAt",width:"10%",type:"date",dateSetting:{locale:k.f},sorting:!0,defaultSort:"desc",render:e=>(e=>Object(zt.jsx)(Ya.a,{title:Qt(e.createdAt,!0),children:Object(zt.jsx)("span",{children:Object(ls.a)(new Date(e.createdAt),{locale:j.a})})}))(e),cellStyle:hs.cell},...t?[{title:"Einrichtung",field:"Offices",width:"10%",customFilterAndSearch:(e,t)=>t.Offices.map((t=>t.longName.toLowerCase().includes(e)||t.shortName.toLowerCase().includes(e))).some((e=>!0===e)),render:t=>(t=>{const a=t.Offices.slice(3);return Object(zt.jsxs)(zt.Fragment,{children:[t.Offices.slice(0,3).map((t=>Object(zt.jsx)(Ya.a,{title:t.shortName,children:Object(zt.jsx)(Ba.a,{className:e.chip,label:t.shortName,size:"small",variant:"outlined"},t.id)}))),a.length>0&&i(a.map((e=>null===e||void 0===e?void 0:e.shortName)),"office")]})})(t),cellStyle:hs.cell},{title:"Kunde",field:"Offices",width:"10%",customFilterAndSearch:(e,t)=>t.Offices.map((t=>{var a,i;return(null===t||void 0===t||null===(a=t.Customer)||void 0===a?void 0:a.longName.toLowerCase().includes(e.toLowerCase()))||(null===t||void 0===t||null===(i=t.Customer)||void 0===i?void 0:i.shortName.toLowerCase().includes(e.toLowerCase()))})).some((e=>!0===e)),render:t=>(t=>{const a=t.Offices.map((e=>e.Customer)),n=null===a||void 0===a?void 0:a.filter(((e,t,a)=>a.findIndex((t=>t.id===e.id))===t)),c=n.slice(0,3),s=n.slice(3);return Object(zt.jsxs)(zt.Fragment,{children:[null===c||void 0===c?void 0:c.map((t=>Object(zt.jsx)(Ya.a,{title:t.longName,children:Object(zt.jsx)(Ba.a,{className:e.chip,label:t.shortName,size:"small",color:"secondary"},t.id)}))),(null===s||void 0===s?void 0:s.length)>0&&i(s.map((e=>null===e||void 0===e?void 0:e.shortName)),"customer")]})})(t),cellStyle:hs.cell},{title:"Intern",field:"internal",width:"5%",lookup:{0:"\xd6ffentlich",1:"Intern"},render:t=>(t=>Object(zt.jsx)(Ba.a,{label:t.internal?"Intern":"\xd6ffentlich",size:"small",className:e.chip,style:t.internal?{}:hs.chip.internal},t.id))(t)},{title:"Typ",field:"system",width:"5%",lookup:{0:"Kommentar",1:"System"},render:t=>(t=>Object(zt.jsx)(Ba.a,{label:t.system?"System":"Kommentar",size:"small",className:e.chip,style:t.system?{}:hs.chip.system},t.id))(t)}]:[]],data:a?JSON.parse(JSON.stringify(a)):[]};return Object(zt.jsxs)(Ki,{children:[Object(zt.jsx)(Li,{...n}),Object(zt.jsx)(bs,{})]})})),xs=a(309),fs=a(613),Os=a.n(fs),vs=a(349),ys=a.n(vs),ws=a(348),Ns=a.n(ws);const Cs={compare:"archiv",description:'Geben Sie "archiv" ein',buttonName:{active:"Aufheben",inactive:"Archivieren"}},Ss={abort:"Abbrechen"},ks={archive:{inactive:"Bewerbung archivieren?",active:"Freigabe aufheben?"}},Is=Object(s.a)((e=>Object(l.a)({formControl:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-start",margin:e.spacing(1),gap:e.spacing(4)},modal:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start",position:"absolute",top:"50%",left:"75%",transform:"translate(-50%, -50%)",width:"fit-content",backgroundColor:"white",padding:e.spacing(2),borderRadius:"5px"},btn:{color:e.palette.primary.light},btnBox:{width:"100%",display:"flex",justifyContent:"space-between"}})));var zs=Object(h.a)((e=>{let{active:t,disabled:a=!1,open:i,close:n,archive:c}=e;const s=Is();return Object(zt.jsx)(Gn.a,{open:i,onClose:n,onBackdropClick:n,children:Object(zt.jsxs)(Lt.a,{className:s.modal,children:[Object(zt.jsx)(Ve.a,{variant:"h6",children:t?ks.archive.active:ks.archive.inactive}),Object(zt.jsx)(Bt.a,{className:s.formControl,children:Object(zt.jsxs)(Lt.a,{className:s.btnBox,children:[Object(zt.jsx)(_e.a,{disabled:a,onClick:n,variant:"contained",color:"secondary",className:s.btn,children:Ss.abort}),a?Object(zt.jsx)(Ft,{}):Object(zt.jsx)(_a,{noVerify:t,compareString:Cs.compare,buttonName:t?Cs.buttonName.active:Cs.buttonName.inactive,description:Cs.description,callback:e=>{e&&c()}})]})})]})})})),Ds=a(215),Ps=a(602),As=a(1037);let Ts=function(e){return e.created="created",e.pending="pending",e.complete="complete",e.incomplete="incomplete",e.abort="abort",e}({});function Fs(){return{id:"",status:Ts.created,type:"",eula:new Date,barrier:!1,validFrom:"",validUntil:"",lastCorrespondence:new Date,officeId:"",participantId:"",archive:!1,Position:{},Results:[],Office:{},createdAt:"",updatedAt:new Date}}var Bs=function(e){return e[e.initial=0]="initial",e[e.continue=1]="continue",e}(Bs||{});const Rs={initial:{title:"G\xfcltigkeitszeitraum w\xe4hlen",description:"W\xe4hlen Sie den neuen G\xfcltigkeitszeitraum f\xfcr die gew\xe4hlte Bewerbung"},continue:{title:"G\xfcltigkeitszeitraum \xe4ndern",description:"Sind Sie sicher, dass Sie den G\xfcltigkeitszeitraum der Bewerbung \xe4ndern wollen?"}},Es=Object(s.a)((e=>Object(l.a)({root:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center"},actions:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end"},title:{textAlign:"center",boxSizing:"border-box"},description:{textAlign:"center",boxSizing:"border-box",padding:e.spacing(2),margin:"0px"},content:{padding:e.spacing(2),display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:e.spacing(2)},table:{width:"80%"},row:{},cell:{minWidth:"50%"},lastRow:{border:"none"},btn:{minWidth:"200px"},italic:{fontStyle:"italic",fontSize:"0.9rem",color:e.palette.grey[500]},bold:{fontWeight:"bold"},crossed:{textDecoration:"line-through"},red:{color:e.palette.error.main},yellow:{color:e.palette.warning.main},lightYellow:{color:e.palette.warning.light},green:{color:e.palette.success.main}})));var Us=Object(h.a)((e=>{let{participantId:t,application:a=Fs(),open:i,toggleDialog:n}=e;const c=Es(),{enqueueSnackbar:s}=Object(g.b)(),{updateApplicationDates:l}=ns,r={validFrom:new Date(a.validFrom),validUntil:new Date(a.validUntil)},[o,d]=Object(x.useState)(Bs.initial),[u,b]=Object(x.useState)(r),[j,p]=Object(x.useState)(Rs.initial.title.toUpperCase()),[m,h]=Object(x.useState)(Rs.initial.description),f=()=>{n(),d(0),b(r),p(Rs.initial.title),h(Rs.initial.description)},O=(e,t)=>{const a="validFrom"===e?t:u.validFrom,i="validUntil"===e?t:u.validUntil;Object(Ds.a)(a,i)?b({...u,[e]:t}):s("Das Enddatum muss muss nach dem Startdatum liegen",Je("error"))},v=e=>{const t="next"===e?o+1:o-1;Bs[t]&&(d(t),p(Rs[Bs[t]].title),h(Rs[Bs[t]].description))};return Object(zt.jsxs)(We.a,{transitionDuration:100,className:c.root,open:i,onClose:f,children:[Object(zt.jsx)(Le.a,{className:c.title,children:j}),Object(zt.jsx)(Me.a,{component:"span"}),Object(zt.jsx)(Ve.a,{className:c.description,children:m}),Object(zt.jsx)(Me.a,{component:"span"}),Object(zt.jsxs)(Ge.a,{className:c.content,children:[1===o&&Object(zt.jsx)(zt.Fragment,{children:Object(zt.jsxs)(la.a,{size:"small",className:c.table,children:[u.validFrom&&Object(zt.jsxs)(ra.a,{className:c.row,children:[Object(zt.jsx)(oa.a,{align:"left",className:"".concat(c.bold," ").concat(c.cell),children:"G\xfcltig von:"}),Object(zt.jsxs)(oa.a,{align:"center",className:c.cell,children:[Object(zt.jsx)("span",{className:"".concat(c.bold," ").concat(c.red),children:"Alt: "}),Object(zt.jsx)("span",{className:c.crossed,children:Xt(r.validFrom)})]}),Object(zt.jsxs)(oa.a,{align:"center",className:c.cell,children:[Object(zt.jsxs)("span",{className:"".concat(c.bold," ").concat(c.green),children:["Neu:"," "]}),Xt(u.validFrom)]})]}),u.validUntil&&Object(zt.jsxs)(ra.a,{className:c.row,children:[Object(zt.jsx)(oa.a,{align:"left",className:"".concat(c.bold," ").concat(c.cell),children:"G\xfcltig bis:"}),Object(zt.jsxs)(oa.a,{align:"center",className:c.cell,children:[Object(zt.jsx)("span",{className:"".concat(c.bold," ").concat(c.red),children:"Alt: "}),Object(zt.jsx)("span",{className:c.crossed,children:Xt(r.validUntil)})]}),Object(zt.jsxs)(oa.a,{align:"center",className:c.cell,children:[Object(zt.jsxs)("span",{className:"".concat(c.bold," ").concat(c.green),children:["Neu:"," "]}),Xt(u.validUntil)]})]})]})}),0===o&&(()=>{const e={validFrom:["created","incomplete"],validUntil:["created","incomplete","pending"]};return Object(zt.jsxs)(zt.Fragment,{children:[e.validFrom.includes(a.status)?Object(zt.jsx)(Pt,{label:"Von",initialDate:r.validFrom,processDate:e=>{O("validFrom",e)},disablePast:!0,minDate:new Date,maxDate:Object(As.a)(u.validUntil,{days:1})}):Object(zt.jsx)(Ve.a,{className:c.italic,children:"- Startdatum nicht w\xe4hlbar -"}),e.validUntil.includes(a.status)?Object(zt.jsx)(Pt,{label:"Bis",initialDate:r.validUntil,processDate:e=>{O("validUntil",e)},disablePast:!0,minDate:r.validUntil}):Object(zt.jsx)(Ve.a,{className:c.italic,children:"- Enddatum nicht w\xe4hlbar -"})]})})(),1===o&&Object(zt.jsx)(_e.a,{className:c.btn,onClick:()=>{(async()=>{1e3===(await l(t,a.id,u.validFrom,u.validUntil)).status_code?(s("G\xfcltigkeitszeitraum erfolgreich ge\xe4ndert",Je("success")),window.location.href="/participant/".concat(t)):(s("G\xfcltigkeitszeitraum konnte nicht g\xe4ndert werden",Je("error")),f())})()},color:"secondary",variant:"contained",size:"small",startIcon:Object(zt.jsx)(ma.a,{className:c.lightYellow}),children:"Best\xe4tigen"})]}),Object(zt.jsx)(Me.a,{component:"span"}),Object(zt.jsx)(ja.a,{className:c.actions,children:(()=>{const e=Object.keys(Bs).length/2-1;return Object(zt.jsxs)(zt.Fragment,{children:[o>0&&Object(zt.jsx)(_e.a,{className:c.yellow,onClick:()=>v("back"),color:"default",variant:"text",size:"small",children:"Zur\xfcck"}),(!Object(Ps.a)(u.validFrom,r.validFrom)||!Object(Ps.a)(u.validUntil,r.validUntil))&&ov("next"),color:"default",variant:"text",size:"small",children:"Weiter"}),Object(zt.jsx)(_e.a,{className:c.red,onClick:f,color:"default",variant:"text",size:"small",children:"Abbrechen"})]})})()})]})}));const Ws=Object(s.a)((e=>Object(l.a)({formControl:{margin:e.spacing(1),gap:e.spacing(4)},modal:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",position:"absolute",top:"50%",left:"75%",transform:"translate(-50%, -50%)",width:"fit-content",backgroundColor:"white",padding:e.spacing(2),borderRadius:"5px"},btn:{color:e.palette.primary.light},btnBox:{width:"100%",display:"flex",justifyContent:"space-between"}})));var Ls=Object(h.a)((e=>{let{open:t,close:a,application:i}=e;const n=Ws(),{recalculateApplication:c}=ns,{enqueueSnackbar:s}=Object(g.b)(),l=Object(v.f)();return Object(zt.jsx)(Gn.a,{open:t,onClose:a,onBackdropClick:a,children:Object(zt.jsxs)(Lt.a,{className:n.modal,children:[Object(zt.jsx)(Ve.a,{variant:"h6",children:"Werte Neu Berechnen"}),Object(zt.jsx)(Bt.a,{className:n.formControl,children:Object(zt.jsx)(Lt.a,{className:n.btnBox,children:Object(zt.jsx)(_e.a,{onClick:async()=>{await c(i.id)?(l.go(0),s("Z-Werte wurden erneut berechnet",Je("success"))):s("Fehler bei der Neuberechnung",Je("error")),a()},variant:"contained",color:"secondary",className:n.btn,children:"Best\xe4tigen"})})})]})})}));const Ms={tool:{menu:"Men\xfc",edit:{application:"Bewerbungsfrist anpassen"},archive:{application:{inactive:"Freigabe aufheben",active:"Zur archivierung freigeben"}},recalculate:{application:"Ergebnisse neu berechnen"}},noti:{archive:{active:{success:"Bewerbung zur Archivierung freigegeben",fail:"Archivierung fehlgeschlagen"},inactive:{success:"Freigabe aufgehoben",fail:"Aufheben fehlgeschlagen"}}}},Gs=Object(s.a)((e=>({root:{},menuItem:{width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(3)},red:{color:e.palette.error.main},yellow:{color:e.palette.warning.main},grey:{color:e.palette.info.main}}))),Vs={root:!1,edit:!1,archive:!1,recalculate:!1};var _s=e=>{let{participantId:t,application:a}=e;const i=Object(v.f)(),n=Gs(),{enqueueSnackbar:c}=Object(g.b)(),{archiveApplication:s}=ns,[l,r]=Object(x.useState)(),[o,d]=Object(x.useState)(Vs),u=(e,t,a)=>{a&&a.stopPropagation(),d({...o,[e]:t}),r(void 0)};return Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)(Ya.a,{title:Ms.tool.menu,enterDelay:1e3,children:Object(zt.jsx)(ei.a,{size:"small",onClick:e=>{e.stopPropagation(),r(e.currentTarget),d({...o,root:!o.root})},children:Object(zt.jsx)(Pc.a,{className:n.grey})})}),Object(zt.jsxs)(xs.a,{anchorEl:l,keepMounted:!0,open:Boolean(l),onClose:e=>u("root",!1,e),children:[Object(zt.jsx)(Ya.a,{title:Ms.tool.edit.application,enterDelay:1e3,children:Object(zt.jsxs)(Ut.a,{onClick:e=>u("edit",!0,e),className:n.menuItem,children:[Object(zt.jsx)(Os.a,{className:n.grey}),"G\xfcltigkeit"]})}),Object(zt.jsx)(Ya.a,{enterDelay:1e3,title:a.archive?Ms.tool.archive.application.inactive:Ms.tool.archive.application.active,children:Object(zt.jsxs)(Ut.a,{className:n.menuItem,onClick:e=>u("archive",!0,e),children:[Object(zt.jsx)(Ns.a,{className:a.archive?n.yellow:n.grey}),"Archivierung"]})}),Object(zt.jsx)(Ya.a,{title:Ms.tool.recalculate.application,enterDelay:1e3,children:Object(zt.jsxs)(Ut.a,{onClick:e=>u("recalculate",!0,e),className:n.menuItem,children:[Object(zt.jsx)(ys.a,{className:n.grey}),"Berechnung"]})})]}),o.edit&&Object(zt.jsx)(Us,{participantId:t||"",application:a,open:o.edit,toggleDialog:()=>u("edit",!1)}),o.archive&&Object(zt.jsx)(zs,{active:a.archive,open:o.archive,close:()=>u("archive",!1),archive:async()=>{1e3===(await s(null===a||void 0===a?void 0:a.id)).status_code?(c(Ms.noti.archive[null!==a&&void 0!==a&&a.archive?"inactive":"active"].success,Je("success")),i.go(0)):(c(Ms.noti.archive[null!==a&&void 0!==a&&a.archive?"active":"inactive"].success,Je("error")),d(Vs))}}),o.recalculate&&Object(zt.jsx)(Ls,{open:o.recalculate,close:()=>u("recalculate",!1),application:a})]})},Ks=function(e){return e[e.initial=0]="initial",e[e.continue=1]="continue",e}(Ks||{});const qs={initial:{title:"Stammdaten \xe4ndern",description:"Passen Sie die Stammdaten an"},continue:{title:"Stammdaten Speichern",description:"Sind Sie sicher, dass Sie die angepassten Stammdaten Speichern wollen?"}},Hs={birthday:"Geburtsdatum",email:"E-Mail-Adresse",firstName:"Vorname",gender:"Geschlecht",lastName:"Nachname"},Zs={divers:"divers",female:"weiblich",male:"m\xe4nnlich"},Js=Object(s.a)((e=>Object(l.a)({root:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center"},form:{width:"80%",display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center",gap:e.spacing(1)},formControl:{width:"100%",userSelect:"none"},actions:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end"},title:{textAlign:"center",boxSizing:"border-box"},description:{textAlign:"center",boxSizing:"border-box",padding:e.spacing(2),margin:"0px"},surveyDetails:{display:"flex",alignItems:"center",justifyContent:"center",gap:e.spacing(1),textAlign:"center",boxSizing:"border-box",margin:"0px"},content:{padding:e.spacing(2),display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:e.spacing(2)},table:{width:"80%"},row:{},rowName:{fontWeight:"bold"},cell:{width:"50%"},lastRow:{border:"none"},btn:{minWidth:"200px"},red:{color:e.palette.error.main},yellow:{color:e.palette.warning.main},lightYellow:{color:e.palette.warning.light},green:{color:e.palette.success.main},grey:{color:"grey"}})));var $s=Object(h.a)((e=>{let{open:t,toggleDialog:a,participant:i}=e;const n=Js(),{enqueueSnackbar:c}=Object(g.b)(),{updateParticipant:s}=ns,[l,r]=Object(x.useState)(Ks.initial),[o,u]=Object(x.useState)(qs.initial.title.toUpperCase()),[b,j]=Object(x.useState)(qs.initial.description),[p,m]=Object(x.useState)({id:i.id,firstName:i.firstName,lastName:i.lastName,birthday:new Date(i.birthday),gender:i.gender,email:i.email,supportStatus:i.supportStatus}),h=()=>{a(),r(0),u(qs.initial.title),j(qs.initial.description)},f=e=>{const t="next"===e?l+1:l-1;Ks[t]&&(r(t),u(qs[Ks[t]].title),j(qs[Ks[t]].description))},O=async()=>{if((()=>{let e=!1;return k.l.birthday(Xt(p.birthday))&&k.l.name(p.firstName)&&k.l.name(p.lastName)&&k.l.email(p.email)&&k.l.gender(p.gender)&&(e=!0),e})()){1e3===(await s(p)).status_code?(c("Stammdaten erfolgreich ge\xe4ndert",Je("success")),window.location.href="/participant/".concat(i.id)):(c("Stammdaten konnten nicht ge\xe4ndert werden",Je("error")),h())}else c("Stammdaten sind nicht g\xfcltig",Je("error"))};return Object(zt.jsxs)(We.a,{transitionDuration:100,className:n.root,open:t,onClose:h,children:[Object(zt.jsx)(Le.a,{className:n.title,children:o}),Object(zt.jsx)(Me.a,{component:"span"}),Object(zt.jsx)(Ve.a,{className:n.description,children:b}),Object(zt.jsx)(Me.a,{component:"span"}),Object(zt.jsxs)(Ge.a,{className:n.content,children:[0===l&&Object(zt.jsx)(da.a,{className:n.form,row:!0,children:Object(zt.jsxs)(d.a,{container:!0,spacing:2,children:[Object(zt.jsx)(d.a,{item:!0,xs:6,children:Object(zt.jsx)(Bt.a,{className:n.formControl,children:Object(zt.jsx)(Wt.a,{color:"secondary",label:"Vorname",value:p.firstName,onChange:e=>m({...p,firstName:"".concat(e.target.value)})})})}),Object(zt.jsx)(d.a,{item:!0,xs:6,children:Object(zt.jsx)(Bt.a,{className:n.formControl,children:Object(zt.jsx)(Wt.a,{color:"secondary",label:"Nachname",value:p.lastName,onChange:e=>m({...p,lastName:"".concat(e.target.value)})})})}),Object(zt.jsx)(d.a,{item:!0,xs:6,children:Object(zt.jsx)(Bt.a,{className:n.formControl,children:Object(zt.jsx)(Pt,{processDate:e=>m({...p,birthday:e}),label:"Geburtsdatum",openTo:"year",disableFuture:!0,initialDate:p.birthday})})}),Object(zt.jsx)(d.a,{item:!0,xs:6,children:Object(zt.jsxs)(Bt.a,{color:"secondary",fullWidth:!0,className:n.formControl,children:[Object(zt.jsx)(Rt.a,{id:"gender_label",children:"Geschlecht"}),Object(zt.jsx)(Et.a,{labelId:"gender_label",autoWidth:!0,value:p.gender,onChange:e=>m({...p,gender:"".concat(e.target.value)}),children:Object.entries(Zs).map(((e,t)=>{let[a,i]=e;return Object(zt.jsx)(Ut.a,{value:i,children:i},t)}))})]})}),Object(zt.jsx)(d.a,{item:!0,xs:6,children:Object(zt.jsx)(Bt.a,{className:n.formControl,children:Object(zt.jsx)(Wt.a,{color:"secondary",label:"E-Mail-Adresse",value:p.email,onChange:e=>m({...p,email:"".concat(e.target.value)})})})})]})}),1===l&&Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)(la.a,{size:"small",className:n.table,children:Object(zt.jsx)(Qa.a,{children:Object.entries(p).map(((e,t)=>{let[a,i]=e;return"id"!==a?Object(zt.jsxs)(ra.a,{className:n.row,children:[Object(zt.jsx)(oa.a,{align:"left",className:n.rowName,children:"".concat(Hs[a],":")}),Object(zt.jsx)(oa.a,{align:"right",children:"birthday"===a?Xt(i):i})]},t):null}))})}),Object(zt.jsx)(_e.a,{className:n.btn,onClick:()=>{O()},color:"secondary",variant:"contained",size:"small",startIcon:Object(zt.jsx)(ma.a,{className:n.lightYellow}),children:"Best\xe4tigen"})]})]}),Object(zt.jsx)(Me.a,{component:"span"}),Object(zt.jsx)(ja.a,{className:n.actions,children:(()=>{const e=Object.keys(Ks).length/2-1;return Object(zt.jsxs)(zt.Fragment,{children:[l>0&&Object(zt.jsx)(_e.a,{className:n.yellow,onClick:()=>f("back"),color:"default",variant:"text",size:"small",children:"Zur\xfcck"}),lf("next"),color:"default",variant:"text",size:"small",children:"Weiter"}),Object(zt.jsx)(_e.a,{className:n.red,onClick:h,color:"default",variant:"text",size:"small",children:"Abbrechen"})]})})()})]})})),Ys=a(614),Xs=a.n(Ys),Qs=a(615),el=a.n(Qs),tl=a(631);let al=function(e){return e.created="created",e.valid="valid",e.started="started",e.complete="complete",e.incomplete="incomplete",e.expired="expired",e}({});function il(){return{id:"",token:"",status:al.created,barrier:!1,supportStatus:"",accessible:"",dataSharing:!1,invitedAt:new Date,completedAt:new Date,lastRemindedAt:new Date,valid:1,validFrom:new Date,validUntil:new Date,participantId:"",systemUsed:"",browserUsed:"",surveyId:""}}const nl={initial:{title:"Was wollen Sie tun?",description:"W\xe4hlen Sein eine Aktion f\xfcr den Gew\xe4hlten Test"},invalidate:{title:"Test entwerten",description:"Sind Sie sicher dass Sie den Test entwerten wollen?"},replace:{title:"Test w\xe4hlen",description:"W\xe4hlen Sie einen alternativen Test, um den aktuellen Test zu ersetzen"},continue:{title:"Test ersetzen",description:"Sind Sie sicher, dass Sie den aktuellen Test durch den gew\xe4hlten Test ersetzen wollen?"}},cl={invalidate:{confirm:"Der bisherige Test und alle dazu geh\xf6rigen Ergebnisse werden entwertet"},replace:{confirm:"Der bisherige Test sowie dessen Ergebnisse werden entwertet und durch den neue Test ersetzt"}},sl=Object(s.a)((e=>Object(l.a)({root:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center"},actions:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end"},title:{textAlign:"center",boxSizing:"border-box"},description:{textAlign:"center",boxSizing:"border-box",padding:e.spacing(2),margin:"0px"},content:{padding:e.spacing(2),display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:e.spacing(2)},container:{display:"flex",justifyContent:"space-around"},form:{textAlign:"left",minWidth:"200px"},table:{maxWidth:"80%"},row:{},rowName:{fontWeight:"bold"},btn:{minWidth:"200px"},red:{color:e.palette.error.main},yellow:{color:e.palette.warning.main},lightYellow:{color:e.palette.warning.light},green:{color:e.palette.success.main},grey:{color:"grey"}})));var ll=Object(h.a)((e=>{let{participantId:t,run:a=il(),open:i,toggleDialog:n}=e;const c=sl(),s=Object(v.f)(),{getAlternativeSurveys:l,invalidateRun:r,replaceRun:o}=ns,{enqueueSnackbar:d}=Object(g.b)(),[u,b]=Object(x.useState)(nl.initial.title.toUpperCase()),[j,p]=Object(x.useState)(nl.initial.description),[m,h]=Object(x.useState)(new Date),[f,O]=Object(x.useState)(!1),[y,w]=Object(x.useState)(!1),[N,C]=Object(x.useState)(!1),[S,k]=Object(x.useState)(!1),[I,z]=Object(x.useState)(""),[D,P]=Object(x.useState)([]),A=(e,t)=>{switch(t){case"title":b(nl[e].title.toUpperCase());break;case"description":p(nl[e].description)}},T=()=>{n(),A("initial","title"),A("initial","description"),k(!1),C(!1),w(!1),O(!1)},F=()=>{w(!0),A("continue","title"),A("continue","description")},B=()=>{A("replace","title"),A("replace","description"),k(!0)},R=()=>{A("invalidate","title"),A("invalidate","description"),C(!0)},E=async()=>{if(a.id){var e;if(1e3===(await o(t,a.id,I,Object(tl.a)(m,"yyyy-MM-dd"))).status_code)d("Run (".concat(null===(e=a.Survey)||void 0===e?void 0:e.description,") ersetzt"),Je("success"));else d("Aktualisierung fehlgeschlagen",Je("error"));s.go(0)}};Object(x.useEffect)((()=>{(async()=>{const{data:e}=await l(t,a.id);e&&P(e)})()}),[]);return Object(zt.jsxs)(We.a,{transitionDuration:100,className:c.root,open:i,onClose:T,children:[Object(zt.jsx)(Le.a,{className:c.title,children:u}),Object(zt.jsx)(Me.a,{component:"span"}),Object(zt.jsx)(Ve.a,{className:c.description,children:j}),Object(zt.jsx)(Me.a,{component:"span"}),Object(zt.jsxs)(Ge.a,{className:c.content,children:[Object(zt.jsxs)(la.a,{size:"small",className:c.table,children:[(null===a||void 0===a?void 0:a.Survey)&&Object(zt.jsxs)(ra.a,{className:c.row,children:[Object(zt.jsx)(oa.a,{align:"left",className:c.rowName,children:"Aktueller Test:"}),Object(zt.jsx)(oa.a,{align:"right",children:"".concat(a.Survey.description," | ").concat(a.Survey.sid)})]}),I&&Object(zt.jsxs)(ra.a,{className:c.row,children:[Object(zt.jsx)(oa.a,{align:"left",className:c.rowName,children:"Ersetzen durch:"}),Object(zt.jsx)(oa.a,{align:"right",children:"".concat(null===D||void 0===D?void 0:D.filter((e=>e.id===I))[0].description," | ").concat(null===D||void 0===D?void 0:D.filter((e=>e.id===I))[0].sid)})]}),f&&Object(zt.jsxs)(ra.a,{className:c.row,children:[Object(zt.jsx)(oa.a,{align:"left",className:c.rowName,children:"G\xfcltigkeit:"}),Object(zt.jsx)(oa.a,{align:"right",children:"".concat(Xt(new Date)," - ").concat(Xt(m))})]})]}),N&&!S&&(()=>{return Object(zt.jsx)(Ya.a,{title:(e="invalidate",i="confirm",cl[e][i]),children:Object(zt.jsx)(_e.a,{className:c.btn,onClick:()=>(async()=>{if(a.id){var e;1e3===(await r(t,a.id)).status_code?d("Run (".concat(null===(e=a.Survey)||void 0===e?void 0:e.description,") entwertet"),Je("success")):d("Fehler bei der Entwertung",Je("error")),s.go(0)}})(),color:"secondary",variant:"contained",size:"small",startIcon:Object(zt.jsx)(ma.a,{className:c.lightYellow}),children:"Best\xe4tigen"})});var e,i})(),S&&!N&&Object(zt.jsx)(zt.Fragment,{children:S&&y?Object(zt.jsx)(_e.a,{className:c.btn,onClick:E,color:"secondary",variant:"contained",size:"small",startIcon:Object(zt.jsx)(ma.a,{className:c.lightYellow}),children:"Best\xe4tigen"}):Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsxs)(Bt.a,{className:c.form,children:[Object(zt.jsx)(Rt.a,{id:"surveys",children:"Umfrage w\xe4hlen"}),Object(zt.jsx)(Et.a,{labelId:"surveys",label:"Umfrage W\xe4hlen",onChange:e=>{return t="".concat(e.target.value),void z(t);var t},children:D.map(((e,t)=>Object(zt.jsx)(Ut.a,{value:e.id,children:e.description},t)))})]}),I.length>0&&Object(zt.jsx)(Pt,{label:"G\xfcltigkeit",processDate:e=>{O(!0),h(e)},disablePast:!0,minDate:new Date})]})}),!S&&!N&&Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)(_e.a,{className:c.btn,onClick:R,color:"secondary",variant:"contained",size:"small",startIcon:Object(zt.jsx)(Xs.a,{}),children:"Test entwerten"}),Object(zt.jsx)(_e.a,{className:c.btn,onClick:B,color:"secondary",variant:"contained",size:"small",startIcon:Object(zt.jsx)(el.a,{}),children:"Test ersetzen"})]})]}),Object(zt.jsx)(Me.a,{component:"span"}),Object(zt.jsx)(ja.a,{className:c.actions,children:Object(zt.jsxs)(zt.Fragment,{children:[S&&!N&&!y&&f&&Object(zt.jsx)(_e.a,{className:c.green,onClick:F,color:"default",variant:"text",size:"small",children:"Weiter"}),Object(zt.jsx)(_e.a,{className:c.red,onClick:T,color:"default",variant:"text",size:"small",children:"Abbrechen"})]})})]})})),rl=a(617),ol=a.n(rl),dl=a(620),ul=a.n(dl),bl=a(618),jl=a.n(bl),pl=a(619),ml=a.n(pl),hl=a(616),gl=a.n(hl);const xl={zToGrade(e){if(null===e)return null;const t=3.5-e;return Math.round(100*(t+Number.EPSILON))/100},zToPoint(e){if(null===e)return null;const t=1.15*e**3-2.093*e**2+13*e+63.349,a=Math.round(100*(t+Number.EPSILON))/100;return a>100?100:a<0?0:a},zToPercentile(e){if(null===e)return null;const t=.9,a=344e-6,i=.019527,n=.198654,c=.115194;let s=0;return s=e<0?.5/(1+n*(0-e/t)+c*(0-e/t)**2+a*(0-e/t)**3+i*(0-e/t)**4)**4*100:100*(1-.5/(1+n*(e/t)+c*(e/t)**2+a*(e/t)**3+i*(e/t)**4)**4),Math.round(s)},result(e,t,a){var i;if(null===e)return null;let n;switch(t){case"grades":n=this.zToGrade(e);break;case"points":n=this.zToPoint(e);break;case"percentiles":n=this.zToPercentile(e);break;case"raw":n=e}return a?null===(i=n)||void 0===i?void 0:i.toFixed(2):n},noBreak:e=>e.replace("-","\u2011").replace(" ","\xa0"),round:e=>null===e?null:Math.round(e)},fl=Object(s.a)((e=>Object(l.a)({root:{},mainTable:{display:"flex",flexDirection:"column",alignItems:"center",boxSizing:"border-box"},table:{},tableRow:{display:"flex",flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between"},tableCell:{border:"none"},tableHeader:{color:"white",height:"25px",display:"flex",alignItems:"center",justifyContent:"space-between"},totalContainer:{display:"flex",paddingTop:"1rem",boxSizing:"border-box"},total:{fontWeight:600,fontSize:"1rem",borderTop:"1px solid lightgrey"},totalResult:{textAlign:"end"},btnGroup:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",padding:e.spacing(1)},downloadContainer:{width:"200px",height:"50px",display:"flex",alignItems:"center",justifyContent:"center"},btn:{margin:e.spacing(1)},input:{padding:"none",paddingLeft:e.spacing(1)},diaBtnBox:{display:"flex",alignItems:"center",justifyContent:"space-around"},white:{color:e.palette.primary.light},red:{color:e.palette.error.main},date:{textAlign:"center",paddingBottom:e.spacing(2)}})));var Ol=Object(h.a)((e=>{var t,a;let{acResults:i,acFinalResult:n}=e;const c=e=>"".concat(Math.round(100*e),"%"),s=fl();return Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsxs)(Ve.a,{className:s.date,children:["Teilnahmedatum:"," ",null!==n&&void 0!==n&&null!==(t=n.Group)&&void 0!==t&&null!==(a=t.Event)&&void 0!==a&&a.date?Qt(null===n||void 0===n?void 0:n.Group.Event.date):"Kein Datum verf\xfcgbar"]}),Object(zt.jsx)(Vn.a,{children:Object(zt.jsxs)(la.a,{className:s.table,size:"small","aria-label":"simple table",children:[Object(zt.jsx)(Xa.a,{children:Object(zt.jsx)(ra.a,{children:Object(zt.jsx)(oa.a,{className:s.tableHeader,children:Object(zt.jsx)(Ve.a,{children:"Kompetenzen"})})})}),Object(zt.jsx)(Qa.a,{children:null===i||void 0===i?void 0:i.map(((e,t)=>{var a;const i=c(e.value);return Object(zt.jsxs)(ra.a,{className:s.tableRow,children:[Object(zt.jsx)(Ya.a,{title:i,children:Object(zt.jsx)(oa.a,{className:s.tableCell,children:null===(a=e.typeObject)||void 0===a?void 0:a.longName})}),Object(zt.jsx)(oa.a,{className:s.tableCell,children:i})]},t)}))})]})}),Object(zt.jsx)(Vn.a,{className:s.totalContainer,children:Object(zt.jsx)(la.a,{className:s.table,size:"small","aria-label":"simple table",style:{width:"100%"},children:Object(zt.jsx)(Qa.a,{children:Object(zt.jsxs)(ra.a,{children:[Object(zt.jsx)(oa.a,{className:"".concat(s.tableCell," ").concat(s.total),children:"Gesamtergebnis:"}),Object(zt.jsx)(oa.a,{className:"".concat(s.tableCell," ").concat(s.total," ").concat(s.totalResult),children:c(null!==n&&void 0!==n&&n.value?n.value:0)})]},null===n||void 0===n?void 0:n.id)})})})]})}));const vl=Object(s.a)((e=>Object(l.a)({root:{},btnBox:{display:"flex",alignItems:"center",justifyContent:"space-around"}})));var yl=e=>{let{open:t,title:a="",close:i,save:n}=e;const c=vl();return Object(zt.jsxs)(We.a,{transitionDuration:100,open:t,onClose:i,children:[Object(zt.jsx)(Le.a,{children:a}),Object(zt.jsxs)(ja.a,{className:c.btnBox,children:[Object(zt.jsx)(_e.a,{onClick:i,color:"secondary",variant:"outlined",size:"small",children:"Abbrechen"}),Object(zt.jsx)(_e.a,{onClick:n,color:"secondary",variant:"contained",size:"small",children:"Ja"})]})]})};const wl=Object(s.a)((e=>Object(l.a)({root:{},mainTable:{display:"flex",flexDirection:"column",alignItems:"center",boxSizing:"border-box"},table:{},tableRow:{display:"flex",flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between"},tableCell:{border:"none"},tableHeader:{color:"white",height:"25px",display:"flex",alignItems:"center",justifyContent:"space-between"},totalContainer:{display:"flex",paddingTop:"1rem",boxSizing:"border-box"},total:{fontWeight:600,fontSize:"1rem",borderTop:"1px solid lightgrey"},totalResult:{textAlign:"end"},btnGroup:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",padding:e.spacing(1)},downloadContainer:{width:"200px",height:"50px",display:"flex",alignItems:"center",justifyContent:"center"},btn:{margin:e.spacing(1)},input:{padding:"none",paddingLeft:e.spacing(1)},diaBtnBox:{display:"flex",alignItems:"center",justifyContent:"space-around"},white:{color:e.palette.primary.light},red:{color:e.palette.error.main},date:{textAlign:"center",paddingBottom:e.spacing(2)}}))),Nl=e=>{let{ptResults:t}=e;const a=wl();return Object(zt.jsx)(Vn.a,{children:Object(zt.jsxs)(la.a,{className:a.table,size:"small",children:[Object(zt.jsx)(Xa.a,{children:Object(zt.jsx)(ra.a,{children:Object(zt.jsx)(oa.a,{className:a.tableHeader,children:"Pers\xf6nlichkeits-Test Ergebnisse"})})}),Object(zt.jsx)(Qa.a,{children:t.map(((e,t)=>{var i,n;return Object(zt.jsxs)(ra.a,{className:a.tableRow,children:[Object(zt.jsx)(Ya.a,{title:e.value,children:Object(zt.jsx)(oa.a,{className:a.tableCell,children:null===(i=e.typeObject)||void 0===i?void 0:i.longName})}),Object(zt.jsx)(oa.a,{className:a.tableCell,children:null===(n=xl.zToPercentile(e.value))||void 0===n?void 0:n.toFixed(2)})]},t)}))})]})})},Cl=Object(s.a)((e=>Object(l.a)({root:{},mainTable:{display:"flex",flexDirection:"column",alignItems:"center",boxSizing:"border-box"},table:{width:"50%"},tableRow:{display:"flex",flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between"},tableCell:{border:"none"},tableHeader:{color:"white",height:"25px",display:"flex",alignItems:"center",justifyContent:"space-between"},total:{width:"50%",fontWeight:600,fontSize:"1rem",borderTop:"1px solid lightgrey"},btnGroup:{marginTop:e.spacing(1)},downloadContainer:{minWidth:"200px",minHeight:"50px",display:"flex",alignItems:"center",justifyContent:"center",padding:e.spacing(3)},btn:{},input:{padding:"none",paddingLeft:e.spacing(1)},diaBtnBox:{display:"flex",alignItems:"center",justifyContent:"space-around"},white:{color:e.palette.primary.light}})));var Sl=Object(h.a)((e=>{var t,a,i,n,c;let{application:s,participantId:l,firstName:r,lastName:o,showAc:d}=e;const u=Cl(),{isAdminSupport:b}=Object(x.useContext)(Ct),{enqueueSnackbar:j}=Object(g.b)(),{updateRawValue:p}=ns,[m,h]=Object(x.useState)(!1),[f,O]=Object(x.useState)(null!==(t=s.Position.Project)&&void 0!==t&&t.exportType?null===(a=s.Position.Project)||void 0===a?void 0:a.exportType:"grades"),[v,y]=Object(x.useState)(!1),[w,N]=Object(x.useState)({rwId:"",value:""}),[C,S]=Object(x.useState)({csv:!1,rv:!1}),I=null===(i=s.Results)||void 0===i?void 0:i.filter((e=>e.type===k.a.RawApplication)),z=null===(n=s.Results)||void 0===n?void 0:n.filter((e=>e.type===k.a.CompetencyAC)),D=null===(c=s.Results)||void 0===c?void 0:c.filter((e=>e.type===k.a.PT)),P=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];S({...C,[e]:t})},A=e=>{"rv"===e&&(y(!1),N({rwId:"",value:""})),P(e)},T=async()=>{h(!0);1e3!==(await ns.getReport(s.id,r,o)).status_code&&j("Downloadfehler",Je("error")),h(!1)},F=async()=>{var e,t;if(h(!0),null===s||void 0===s||null===(e=s.Position)||void 0===e||null===(t=e.Project)||void 0===t||!t.id)return;const a=await ns.exportParticipants(s.Position.Project.id,[l],s.Position.Project.longName);let i="Es sind keine Ergebnisse verf\xfcgbar",n="warning";a&&(4e3===a?i="Keine Bewerbungen zum exportieren vorhanden":(i="Export erfolgreich",n="success")),j(i,Je(n)),h(!1)},B=()=>{var e,t,a,i,n;return Object(zt.jsxs)(Vn.a,{component:Ae.a,className:u.mainTable,children:[b&&Object(zt.jsxs)(Hi.a,{size:"small",variant:"outlined","aria-label":"outlined button group",className:u.btnGroup,children:[Object(zt.jsx)(_e.a,{color:"grades"===f?"secondary":"default",onClick:()=>O("grades"),children:"Noten"}),Object(zt.jsx)(_e.a,{color:"points"===f?"secondary":"default",onClick:()=>O("points"),children:"Punkte"}),Object(zt.jsx)(_e.a,{color:"percentiles"===f?"secondary":"default",onClick:()=>O("percentiles"),children:"Prozentr\xe4nge"}),Object(zt.jsx)(_e.a,{color:"raw"===f?"secondary":"default",onClick:()=>O("raw"),children:"z-Werte"})]}),Object(zt.jsxs)(Vn.a,{style:{display:"flex",padding:"1rem",boxSizing:"border-box"},children:[b&&Object(zt.jsxs)(la.a,{className:u.table,size:"small","aria-label":"simple table",children:[Object(zt.jsx)(Xa.a,{children:Object(zt.jsx)(ra.a,{children:Object(zt.jsxs)(oa.a,{className:u.tableHeader,children:[Object(zt.jsx)(Ve.a,{children:"Rohdaten"}),v?Object(zt.jsxs)("div",{children:[Object(zt.jsx)(Ya.a,{title:"\xc4nderungen speichern",children:Object(zt.jsx)(ei.a,{onClick:()=>P("rv",!0),children:Object(zt.jsx)(gl.a,{className:u.white})})}),Object(zt.jsx)(Ya.a,{title:"Abbrechen",children:Object(zt.jsx)(ei.a,{onClick:()=>A("rv"),children:Object(zt.jsx)(ol.a,{className:u.white})})}),Object(zt.jsx)(yl,{open:C.rv,close:()=>P("rv"),title:"\xc4nderungen speichern?",save:()=>(async(e,t)=>{t.value?await p(e,t)?(j("Rohwert angepasst",Je("success")),window.location.href="/participant/".concat(l)):j("Fehler beim anpassen des Rohwertes",Je("error")):j("Kein Rohwert ver\xe4ndert",Je("info"));A("rv")})(s.id,w)})]}):Object(zt.jsx)(Ya.a,{title:"Rohwerte bearbeiten",children:Object(zt.jsx)(ei.a,{onClick:()=>y(!v),children:Object(zt.jsx)(jl.a,{className:u.white})})})]})})}),Object(zt.jsx)(Qa.a,{children:null===s||void 0===s||null===(e=s.Results)||void 0===e?void 0:e.map(((e,t)=>{var a,i,n,c,s,l,r,o;return Object(zt.jsx)(ra.a,{className:u.tableRow,children:e.type===k.a.RawApplication&&Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)(Ya.a,{title:"Range= ".concat(null===e||void 0===e||null===(a=e.typeObject)||void 0===a?void 0:a.rngMin,"-").concat(null===e||void 0===e||null===(i=e.typeObject)||void 0===i?void 0:i.rngMax," | MW=").concat(null===e||void 0===e||null===(n=e.typeObject)||void 0===n?void 0:n.popM," | SD=").concat(null===e||void 0===e||null===(c=e.typeObject)||void 0===c?void 0:c.popSd),children:Object(zt.jsx)(oa.a,{className:u.tableCell,children:null===e||void 0===e||null===(s=e.typeObject)||void 0===s||null===(l=s.RvTypes[0])||void 0===l?void 0:l.description})}),v&&e.valid&&"number"===typeof e.value?Object(zt.jsx)(Wt.a,{disabled:!(!w.rwId||w.rwId===e.id),size:"small",type:"number",onChange:t=>{var a,i,n,c,s,l;return n=e,c=Number(t.currentTarget.value),s=Number(null===e||void 0===e||null===(a=e.typeObject)||void 0===a?void 0:a.rngMin),l=Number(null===e||void 0===e||null===(i=e.typeObject)||void 0===i?void 0:i.rngMax),void N({rwId:null===n||void 0===n?void 0:n.id,value:String(c>l?l:c{var t;return Object(zt.jsx)(ra.a,{className:u.tableRow,children:"competency_z"===e.type&&Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsxs)(oa.a,{className:u.tableCell,children:[null===e||void 0===e||null===(t=e.typeObject)||void 0===t?void 0:t.longName,":"]}),Object(zt.jsx)(oa.a,{className:u.tableCell,children:xl.result(e.value,f,!0)||"-"})]})},e.id)}))})]})]}),Object(zt.jsx)(Vn.a,{style:{display:"flex",padding:"1rem",boxSizing:"border-box"},children:Object(zt.jsx)(la.a,{className:u.table,size:"small","aria-label":"simple table",style:{width:"100%"},children:Object(zt.jsx)(Qa.a,{children:null===s||void 0===s||null===(a=s.Results)||void 0===a?void 0:a.map((e=>Object(zt.jsx)(ra.a,{children:"position_z"===e.type&&Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)(oa.a,{className:"".concat(u.tableCell," ").concat(u.total),children:"Gesamtergebnis:"}),Object(zt.jsx)(oa.a,{className:"".concat(u.tableCell," ").concat(u.total),children:xl.result(e.value,f,!0)||"-"})]})},e.id)))})})}),Object(zt.jsx)(Lt.a,{className:u.downloadContainer,children:m?Object(zt.jsx)(Ft,{}):Object(zt.jsxs)(Hi.a,{className:u.btnGroup,variant:"contained",size:"small",children:[Object(zt.jsx)(_e.a,{disabled:!b&&!(null!==(i=s.Office.Customer)&&void 0!==i&&i.reports),color:"secondary",className:u.btn,onClick:T,startIcon:Object(zt.jsx)(ml.a,{}),children:"Einzelreport"}),Object(zt.jsx)(_e.a,{disabled:!b&&!(null!==(n=s.Office.Customer)&&void 0!==n&&n.reports),color:"secondary",className:u.btn,onClick:F,endIcon:Object(zt.jsx)(ul.a,{}),children:"CSV-Export"})]})})]})},R={headers:[],components:[]};var E;(null!==I&&void 0!==I&&I.length&&(R.headers.push("Online-Test"),R.components.push(Object(zt.jsx)(B,{}))),null!==z&&void 0!==z&&z.length)&&(R.headers.push("M\xfcndliches Auswahlverfahren"),R.components.push(Object(zt.jsx)(Ol,{acResults:z,acFinalResult:null===(E=s.Results)||void 0===E?void 0:E.find((e=>e.type===k.a.PositionAC))})));return null!==D&&void 0!==D&&D.length&&(R.headers.push("Pers\xf6nlichkeits-Test"),R.components.push(Object(zt.jsx)(Nl,{ptResults:D}))),Object(zt.jsx)(ri,{headers:R.headers,children:R.components})}));const kl=tn()(),Il={tool:{copy:{sid:"Umfrage-ID kopieren",desc:"Umfragename kopieren",link:"Umfragelink kopieren",email:"E-Mail-Adresse kopieren",gender:"Geschlecht kopieren",birthday:"Geburtstag kopieren"},edit:{application:"Bewerbung editieren",run:"Run editieren"},archive:{application:{inactive:"Freigabe aufheben",active:"Zur archivierung freigeben"}},recalculate:{application:"Werte neu berechnen"}},noti:{copy:{token:"Token kopiert",sid:"Umfrage-ID kopiert",desc:"Umfragename kopiert",link:"Umfragelink kopiert",email:"E-Mail-Adresse kopiert",gender:"Geschlecht kopiert",birthday:"Geburtstag kopiert"}},misc:{supp:{minor:"Minor Support",major:"Major Support"},vCard:{birthday:"Geburtstag:",gender:"Geschlecht:",email:"E-Mail-Adresse:",supp:"Supportstatus:"},showResults:{pending:"Es sind noch keine Ergebnisse verf\xfcgbar",support:"Es liegt ein Supportfall vor, die Ergebnisse k\xf6nnen nicht angezeigt werden"}}},zl=Object(s.a)((e=>({avatar:{backgroundColor:e.palette.secondary.main,margin:e.spacing(1)},chip:{backgroundColor:"limegreen",color:"white"},container:{alignItems:"center",display:"flex",flexDirection:"column",fontFamily:"Open Sans",justifyContent:"flex-start",maxWidth:"1180px"},rawdata:{display:"flex",justifyContent:"center"},rawdataText:{margin:"0",paddingRight:"10px"},vcard:{alignItems:"flex-start",borderBottom:"1px solid ".concat(e.palette.secondary.main),borderRadius:"1px",borderTop:"1px solid ".concat(e.palette.secondary.main),boxSizing:"border-box",display:"flex",flexDirection:"column",padding:e.spacing(3),width:"100%"},tablerow:{display:"flex",alignItems:"center",width:"100%"},participantName:{fontSize:"2rem",margin:"0"},participantDetails:{alignItems:"center",display:"flex",justifyContent:"flex-start"},avatarBox:{alignItems:"center",display:"flex",justifyContent:"space-between",paddingBottom:e.spacing(2),userSelect:"none",width:"100%"},infoBox:{width:"100%"},label:{margin:"0",minWidth:"250px",padding:e.spacing(.5),textAlign:"left"},input:{margin:"0",minWidth:"250px",padding:e.spacing(.5),textAlign:"left"},buttons:{display:"flex",justifyContent:"space-evenly",marginBottom:"50px",width:"100%"},gridContainer:{boxSizing:"border-box",padding:"1rem",width:"100%","@global":{".MuiToolbar-root":{display:"none"},".MuiMenu-paper":{marginTop:"45px"}}},comment:{marginTop:"10px",textAlign:"left",width:"100%"},actions:{alignItems:"center",display:"flex"},deleteButton:{cursor:"pointer",padding:"0 10px"},button:{margin:e.spacing(3),width:"fit-content"},results:{display:"flex",justifyContent:"center",fontStyle:"italic"},dropdown:{display:"block",maxWidth:"40%",margin:"10px 0"},fromUntil:{display:"flex",alignItems:"center",justifyContent:"flex-start"},red:{color:e.palette.error.main},yellow:{color:e.palette.warning.main},grey:{color:e.palette.info.main}}))),Dl={maxWidth:"".concat(1e3/7,"px"),overflow:"hidden",textOverflow:"ellipsis"};var Pl=Object(h.a)((e=>{let{match:t}=e;const a=t.params.id,i=Object(k.e)(),{fetchedParticipant:n,isfetchingData:c,getParticipantById:s}=Object(x.useContext)(ss),{isAdminSupport:l}=Object(x.useContext)(Ct),r=Object(v.f)(),o=zl(),{enqueueSnackbar:d}=Object(g.b)(),{updateSupportStatus:u}=ns,[b,j]=Object(x.useState)({}),[p,m]=Object(x.useState)({applicationEdit:!1,applicationArchive:!1,run:!1,participant:!1,recalulate:!1}),h=(e,t)=>{Bc()(t),d(Il.noti.copy[e],Je())},f=async(e,t,a)=>{e.supportStatus;1e3===(await u(e.id,t,a)).status_code?d('Supportfall: "'.concat(e.supportStatus===t?"aufgel\xf6st":t,'"'),Je("success")):d("Aktualisierung fehlgeschlagen",Je("error")),r.go(0)},O=()=>{m({...p,participant:!0})};Object(x.useEffect)((()=>{s(a)}),[s,a]);const y={searchFilter:!1,title:"Bewerbungen",addApplicationButton:l,dialogData:n,detailPanel:e=>{var t;return"complete"===e.status&&!n.supportStatus&&(l||!l&&null!==(t=e.Office.Customer)&&void 0!==t&&t.showResults)?Object(zt.jsx)(Sl,{application:e,participantId:a,firstName:n.firstName,lastName:n.lastName,showAc:!1}):Object(zt.jsx)("div",{className:o.results,children:Object(zt.jsxs)(Ve.a,{children:["- ",n.supportStatus?Il.misc.showResults.support:Il.misc.showResults.pending," -"]})})},onRowClick:(e,t,a)=>a(),columns:[{title:"Position",field:"Position.longName"},{dateSetting:{locale:k.f},field:"createdAt",defaultSort:"asc",title:"Erstellt",sorting:!0,type:"date",render:e=>Object(zt.jsx)("span",{children:Qt(e.createdAt)})},{field:"status",title:"Status",render:e=>{var t;return Object(zt.jsxs)("div",{style:{whiteSpace:"nowrap",display:"inline"},children:[Object(zt.jsx)("span",{style:{paddingRight:"10px"},children:aa("application",e.status,n.supportStatus)}),Object(zt.jsx)("span",{children:null!==(t=e.Results)&&void 0!==t&&t.filter((e=>e.type===k.a.CompetencyAC||e.type===k.a.PositionAC)).length?Object(zt.jsx)(Ba.a,{size:"small",className:o.chip,label:"AC"}):Object(zt.jsx)(zt.Fragment,{})})]})}},{title:"G\xfcltigkeit",render:e=>Object(zt.jsxs)("div",{children:[Object(zt.jsxs)("div",{className:o.fromUntil,children:[Object(zt.jsx)(Ve.a,{children:Qt(e.validFrom)}),Object(zt.jsx)(Ve.a,{children:"-"})]}),Object(zt.jsx)("div",{className:o.fromUntil,children:Object(zt.jsx)(Ve.a,{children:Qt(e.validUntil)})})]})},{title:"Einheit",field:"Office.longName"},{render:e=>l&&Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)(Ya.a,{title:Il.tool.copy.link,children:Object(zt.jsx)(ei.a,{size:"small",onClick:t=>((e,t)=>{const n="".concat(i,"/router?part=").concat(kl.fromUUID(a),"&proj=").concat(kl.fromUUID(t.Position.projectId));e.stopPropagation(),Bc()(n),d(Il.noti.copy.link,Je())})(t,e),children:Object(zt.jsx)(zc.a,{className:o.grey},e.id)})}),Object(zt.jsx)(_s,{participantId:a,application:e})]})}],data:null!==n&&void 0!==n&&n.id?JSON.parse(JSON.stringify(null===n||void 0===n?void 0:n.Applications)):[]},w={title:"Testdurchl\xe4ufe",searchFilter:!1,columns:[{align:"left",cellStyle:{...Dl,cursor:"pointer"},defaultSort:"asc",field:"Survey.description",sorting:!0,title:"Umfrage",type:"string",render:e=>{var t;return Object(zt.jsx)(Ya.a,{title:Il.tool.copy.desc,children:Object(zt.jsx)("span",{onClick:()=>{var t;return h("desc",null===(t=e.Survey)||void 0===t?void 0:t.description)},children:null===(t=e.Survey)||void 0===t?void 0:t.description})})}},{align:"left",cellStyle:{...Dl,cursor:"pointer"},field:"Survey.sid",title:"Umfrage\xa0ID",type:"numeric",render:e=>{var t;return Object(zt.jsx)(Ya.a,{title:Il.tool.copy.sid,children:Object(zt.jsx)("span",{onClick:()=>{var t;return h("sid",null===(t=e.Survey)||void 0===t?void 0:t.sid)},children:null===(t=e.Survey)||void 0===t?void 0:t.sid})})}},{align:"left",cellStyle:Dl,field:"status",title:"Status",render:e=>Object(zt.jsx)(Ya.a,{title:aa("run",e.status),children:Object(zt.jsx)("span",{children:aa("run",e.status)})})},{align:"left",cellStyle:{...Dl,cursor:"pointer"},field:"token",title:"Token",render:e=>Object(zt.jsx)(Ya.a,{title:e.token,children:Object(zt.jsx)("span",{onClick:()=>h("token",e.token),children:e.token})})},{align:"left",cellStyle:Dl,dateSetting:{locale:k.f},field:"validFrom",title:"G\xfcltig\xa0von",type:"date",render:e=>Object(zt.jsx)(Ya.a,{title:Qt(e.validFrom),children:Object(zt.jsx)("span",{children:Qt(e.validFrom)})})},{align:"left",cellStyle:Dl,dateSetting:{locale:k.f},field:"validUntil",title:"G\xfcltig\xa0bis",type:"date",render:e=>Object(zt.jsx)(Ya.a,{title:Qt(e.validUntil),children:Object(zt.jsx)("span",{children:Qt(e.validUntil)})})},{title:"Support",cellStyle:Dl,render:e=>e.valid?Object(zt.jsxs)("div",{children:[Object(zt.jsx)(Ya.a,{title:Il.misc.supp.minor,arrow:!0,children:Object(zt.jsx)(ei.a,{className:"".concat("minor"===e.supportStatus?o.yellow:o.grey),size:"small",onClick:()=>f(e,"minor","run"),children:Object(zt.jsx)(kc.a,{})},e.supportStatus)}),Object(zt.jsx)(Ya.a,{title:Il.misc.supp.major,arrow:!0,children:Object(zt.jsx)(ei.a,{className:"".concat("major"===e.supportStatus?o.red:o.grey),size:"small",onClick:()=>f(e,"major","run"),children:Object(zt.jsx)(Tc.a,{})},e.supportStatus)}),Object(zt.jsx)(Ya.a,{title:Il.tool.edit.run,arrow:!0,children:Object(zt.jsx)(ei.a,{size:"small",onClick:()=>(j(e),void m({...p,run:!0})),children:Object(zt.jsx)(Pc.a,{})},e.valid)})]}):Object(zt.jsx)(Ve.a,{className:o.red,children:"ung\xfcltig"})}],data:null!==n&&void 0!==n&&n.Runs?JSON.parse(JSON.stringify(null===n||void 0===n?void 0:n.Runs)):[]};return Object(zt.jsxs)(Ki,{children:[!c&&null!==n&&void 0!==n&&n.id?Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsxs)("div",{className:o.vcard,"data-cy":"info-vcard",children:[Object(zt.jsxs)("div",{className:o.avatarBox,children:[Object(zt.jsxs)("div",{className:o.participantDetails,children:[Object(zt.jsx)(Mi.a,{className:o.avatar,"data-cy":"info-avatar",children:Object(zt.jsx)(Cc.a,{})}),Object(zt.jsxs)(Ve.a,{className:o.participantName,children:[n.firstName," ",n.lastName]})]}),l&&Object(zt.jsx)(ei.a,{size:"small",onClick:O,children:Object(zt.jsx)(Sn.a,{})})]}),Object(zt.jsxs)("div",{className:o.infoBox,children:[Object(zt.jsxs)("div",{className:o.tablerow,children:[Object(zt.jsx)(Ve.a,{className:o.label,children:Il.misc.vCard.birthday}),Object(zt.jsx)(Ya.a,{title:Il.tool.copy.birthday,children:Object(zt.jsx)(Ve.a,{className:o.input,style:{cursor:"pointer",userSelect:"none"},onClick:()=>{Bc()(Xt(new Date(n.birthday))),d(Il.noti.copy.birthday,Je())},children:Xt(new Date(n.birthday))})})]}),Object(zt.jsxs)("div",{className:o.tablerow,children:[Object(zt.jsx)(Ve.a,{className:o.label,children:Il.misc.vCard.gender}),Object(zt.jsx)(Ya.a,{title:Il.tool.copy.gender,children:Object(zt.jsx)(Ve.a,{className:o.input,style:{cursor:"pointer",userSelect:"none"},onClick:()=>{Bc()(n.gender),d(Il.noti.copy.gender,Je())},children:n.gender})})]}),Object(zt.jsxs)("div",{className:o.tablerow,children:[Object(zt.jsx)(Ve.a,{className:o.label,children:Il.misc.vCard.email}),Object(zt.jsx)(Ya.a,{title:Il.tool.copy.email,children:Object(zt.jsx)(Ve.a,{className:o.input,style:{cursor:"pointer",userSelect:"none"},onClick:()=>{Bc()(n.email),d(Il.noti.copy.email,Je())},children:n.email})})]}),l&&Object(zt.jsxs)("div",{className:o.tablerow,children:[Object(zt.jsx)(Ve.a,{className:o.label,children:Il.misc.vCard.supp}),Object(zt.jsx)(Ya.a,{title:Il.misc.supp.minor,arrow:!0,children:Object(zt.jsx)(ei.a,{className:"".concat("minor"===n.supportStatus?o.yellow:o.grey),size:"small",onClick:()=>f(n,"minor","participant"),children:Object(zt.jsx)(kc.a,{})},n.supportStatus)}),Object(zt.jsx)(Ya.a,{title:Il.misc.supp.major,arrow:!0,children:Object(zt.jsx)(ei.a,{className:"".concat("major"===n.supportStatus?o.red:o.grey),size:"small",onClick:()=>f(n,"major","participant"),children:Object(zt.jsx)(Tc.a,{})},n.supportStatus)})]})]})]}),Object(zt.jsx)(Li,{dense:!0,...y}),!c&&l&&Object(zt.jsx)(Li,{dense:!0,...w}),!c&&Object(zt.jsx)(gs,{})]}):Object(zt.jsx)(Ft,{}),Object(zt.jsx)(_e.a,{color:"secondary",variant:"contained",component:"span","data-cy":"overviewBtn",onClick:()=>{r.push("/participants")},className:o.button,children:"Zur\xfcck zur \xdcbersicht"}),p.run&&b&&Object(zt.jsx)(ll,{participantId:a||"",run:b&&b,open:p.run,toggleDialog:()=>m({...p,run:!1})}),p.participant&&n&&Object(zt.jsx)($s,{open:p.participant,toggleDialog:()=>m({...p,participant:!1}),participant:n})]})})),Al=a(350),Tl=a.n(Al);const Fl={compare:"archiv",description:'Geben Sie "archiv" ein',buttonName:"Archivieren"},Bl=Object(s.a)((e=>Object(l.a)({formControl:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-start",margin:e.spacing(1),gap:e.spacing(4)},modal:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start",position:"absolute",top:"25%",left:"75%",transform:"translate(-50%, -50%)",width:"fit-content",backgroundColor:"white",padding:e.spacing(2),borderRadius:"5px"},btn:{color:e.palette.primary.main,minWidth:"fit-content"},btnBox:{width:"100%",display:"flex",justifyContent:"space-between"}})));var Rl=Object(h.a)((e=>{let{disabled:t=!1,open:a,close:i,archive:n}=e;const c=Bl();return Object(zt.jsx)(Gn.a,{open:a,onClose:i,onBackdropClick:i,children:Object(zt.jsxs)(Lt.a,{className:c.modal,children:[Object(zt.jsx)(Ve.a,{variant:"h6",children:"Projektdaten archivieren?"}),Object(zt.jsx)(Bt.a,{className:c.formControl,children:Object(zt.jsxs)(Lt.a,{className:c.btnBox,children:[Object(zt.jsx)(_e.a,{disabled:t,onClick:i,color:"secondary",size:"small",variant:"outlined",className:c.btn,children:"Abbrechen"}),t?Object(zt.jsx)(Ft,{}):Object(zt.jsx)(_a,{compareString:Fl.compare,buttonName:Fl.buttonName,description:Fl.description,callback:e=>{e&&n()}})]})})]})})}));const El={compare:"berechnen",description:'Geben Sie "berechnen" ein',buttonName:"Neuberechnen"},Ul=Object(s.a)((e=>Object(l.a)({formControl:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-start",margin:e.spacing(1),gap:e.spacing(4)},modal:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start",position:"absolute",top:"25%",left:"75%",transform:"translate(-50%, -50%)",width:"fit-content",backgroundColor:"white",padding:e.spacing(2),borderRadius:"5px"},btn:{color:e.palette.primary.main,minWidth:"fit-content"},btnBox:{width:"100%",display:"flex",justifyContent:"space-around"}})));var Wl=Object(h.a)((e=>{let{disabled:t=!1,open:a,close:i,recalculate:n}=e;const c=Ul();return Object(zt.jsx)(Gn.a,{open:a,onClose:i,onBackdropClick:i,children:Object(zt.jsxs)(Lt.a,{className:c.modal,children:[Object(zt.jsx)(Ve.a,{variant:"h6",children:"Projektergebnisse neuberechnen?"}),Object(zt.jsx)(Bt.a,{className:c.formControl,children:Object(zt.jsxs)(Lt.a,{className:c.btnBox,children:[Object(zt.jsx)(_e.a,{disabled:t,onClick:i,size:"small",color:"secondary",variant:"outlined",className:c.btn,children:"Abbrechen"}),t?Object(zt.jsx)(Ft,{}):Object(zt.jsx)(_a,{compareString:El.compare,buttonName:El.buttonName,description:El.description,callback:e=>{e&&n()}})]})})]})})}));const Ll={abbreviation:"Abk\xfcrzung:",validity:"G\xfcltigkeit:",eulaSurvey:"EULA-Umfrage:",exportType:"Export-Typ:"},Ml=" - ",Gl={success:"Archivierung erfolgreich",error:"Archivierung fehlgeschlagen"},Vl={success:"Neuberechnug erfolgreich",error:"Neuberechnung fehlgeschlagen"},_l=Object(s.a)((e=>({infoBox:{width:"100%"},settings:{display:"flex",alignItems:"center",gap:e.spacing(1)},tablerow:{display:"flex",marginTop:"3px"},button:{marginTop:"50px"},avatar:{margin:"3px",backgroundColor:e.palette.secondary.main},avatarBox:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:e.spacing(2),userSelect:"none"},display:{display:"flex",justifyContent:"center"},customerName:{fontSize:"2rem",margin:"0",marginLeft:"7px"},vcard:{width:"100%",minHeight:"35%",display:"flex",flexDirection:"column",boxSizing:"border-box",alignItems:"flex-start",borderTop:"1px solid ".concat(e.palette.secondary.main),borderBottom:"1px solid ".concat(e.palette.secondary.main),borderRadius:"1px",padding:e.spacing(3)},input:{minWidth:"250px",margin:"0",textAlign:"left",padding:e.spacing(.5)},editIcon:{cursor:"pointer"},icons:{position:"absolute",display:"inline",bottom:"0px"},label:{minWidth:"250px",textAlign:"left",margin:"0",padding:e.spacing(.5)},customerIcon:{position:"relative",bottom:"34px",left:"3%",display:"flex",cursor:"pointer"}})));var Kl=Object(h.a)((e=>{let{match:t}=e;const a=t.params.id,i=_l(),n=Object(v.f)(),{isAdminSupport:c}=Object(x.useContext)(Ct),{fetchedCustomer:s,fetchedProject:l,isFetchingProjectData:r,getProjectById:o,getCustomerOffices:d}=Object(x.useContext)(Pe),{enqueueSnackbar:u}=Object(g.b)(),{archiveProject:b,recalculateProject:j}=z,[p,m]=Object(x.useState)({recalculate:!1,edit:!1,archive:!1,position:!1}),[h,f]=Object(x.useState)(),[O,y]=Object(x.useState)(!1),w=()=>{m({recalculate:!1,edit:!1,archive:!1,position:!1})};Object(x.useEffect)((()=>{o(a)}),[o,a]),Object(x.useEffect)((()=>{const e=window.sessionStorage.getItem("custId");d(s.id?s.id:e||"")}),[d,s.id]);const N={customerId:s.id,items:[{type:"id",name:"id",value:l.id},{type:"name",name:"longName",value:l.longName},{type:"default",name:"shortName",value:l.shortName},{type:"default",name:"eulaSurvey",value:l.eulaSurvey},{type:"date",name:"validFrom",value:l.validFrom},{type:"date",name:"validUntil",value:l.validUntil},{type:"multiselect",name:"Offices",value:l.Offices},{type:"select",name:"exportType",value:l.exportType},{type:"boolean",name:"branding",value:l.branding},{type:"boolean",name:"dataSharing",value:l.dataSharing}],type:"project",title:"Projekt editieren",open:p.edit,close:w},C={addPositionButton:!0,onRowClick:(e,t)=>{f(t),m({...p,position:!0})},title:"Positionen",searchFilter:!1,columns:[{title:"Name",field:"longName"},{title:"Abk\xfcrzung",field:"shortName"}],data:null!==l&&void 0!==l&&l.id?JSON.parse(JSON.stringify(null===l||void 0===l?void 0:l.Positions)):[]};return Object(zt.jsxs)(Ki,{children:[!r&&null!==l&&void 0!==l&&l.id?Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsxs)("div",{className:i.vcard,"data-cy":"info-vcard",children:[Object(zt.jsxs)("div",{className:i.avatarBox,children:[Object(zt.jsxs)("div",{className:i.display,children:[Object(zt.jsx)(Mi.a,{className:i.avatar,"data-cy":"info-avatar",children:Object(zt.jsx)(Tl.a,{})}),Object(zt.jsx)(Ve.a,{className:i.customerName,children:l.longName})]}),c&&Object(zt.jsxs)("div",{className:i.editIcon,children:[Object(zt.jsx)(Ya.a,{title:"Projektneuberechnung",children:Object(zt.jsx)(ei.a,{onClick:()=>m({...p,recalculate:!0}),children:Object(zt.jsx)(ys.a,{})})}),Object(zt.jsx)(Ya.a,{title:"Projektdaten archivieren",children:Object(zt.jsx)(ei.a,{onClick:()=>m({...p,archive:!0}),children:Object(zt.jsx)(Ns.a,{})})}),Object(zt.jsx)(Ya.a,{title:"Office editieren",children:Object(zt.jsx)(ei.a,{onClick:()=>m({...p,edit:!0}),children:Object(zt.jsx)(Sn.a,{})})}),Object(zt.jsx)(Ja,{...N})]})]}),Object(zt.jsxs)("div",{className:i.infoBox,children:[Object(zt.jsxs)("div",{className:i.tablerow,children:[Object(zt.jsx)(Ve.a,{className:i.label,children:Ll.abbreviation}),Object(zt.jsx)(Ve.a,{className:i.input,children:l.shortName})]}),Object(zt.jsxs)("div",{className:i.tablerow,children:[Object(zt.jsx)(Ve.a,{className:i.label,children:Ll.validity}),Object(zt.jsxs)(Ve.a,{className:i.input,children:[Qt(l.validFrom),Ml,Qt(l.validUntil)]})]}),Object(zt.jsxs)("div",{className:i.tablerow,children:[Object(zt.jsx)(Ve.a,{className:i.label,children:Ll.eulaSurvey}),Object(zt.jsx)(Ve.a,{className:i.input,children:l.eulaSurvey})]}),Object(zt.jsxs)("div",{className:i.tablerow,children:[Object(zt.jsx)(Ve.a,{className:i.label,children:Ll.exportType}),Object(zt.jsx)(Ve.a,{className:i.input,children:k.k[l.exportType]})]}),Object(zt.jsxs)("div",{className:i.tablerow,children:[Object(zt.jsx)(Ve.a,{className:i.label,children:"Einstellungen:"}),Object(zt.jsxs)("div",{className:i.settings,children:[Object(zt.jsx)(hn,{title:"Branding",icon:Object(zt.jsx)(Dn.a,{}),enabled:l.branding}),Object(zt.jsx)(hn,{title:"Daten teilen",icon:Object(zt.jsx)(In.a,{}),enabled:l.dataSharing})]})]})]})]}),Object(zt.jsx)(Li,{dense:!0,...C})]}):Object(zt.jsx)(Ft,{}),Object(zt.jsx)(_e.a,{color:"secondary",variant:"contained",size:"large",onClick:()=>{null!==s&&void 0!==s&&s.id&&n.push("/".concat(null!==s&&void 0!==s&&s.id?"customer/".concat(s.id):""))},className:i.button,children:"Zur\xfcck zu Kundendetails"}),h&&p.position&&Object(zt.jsx)(Di,{open:p.position,close:w,data:h}),p.archive&&Object(zt.jsx)(Rl,{disabled:O,open:p.archive,close:w,archive:async()=>{y(!0);1e3===(await b(l.id)).status_code?(u(Gl.success,Je("success")),n.go(0)):u(Gl.error,Je("error")),m({...p,archive:!1}),y(!1)}}),p.recalculate&&Object(zt.jsx)(Wl,{disabled:O,open:p.recalculate,close:w,recalculate:async()=>{y(!0);1e3===(await j(l.id)).status_code?(u(Vl.success,Je("success")),n.go(0)):u(Vl.error,Je("error")),m({...p,recalculate:!1}),y(!1)}})]})})),ql=a(1018);const Hl={async getAllRvTypes(){const e=await b.a.get(Object(k.j)("/api/rvtype/get","/rvtype/get"));return Promise.resolve(e.data)},async getRawValueType(e){const t=await b.a.get(Object(k.j)("/api/rvtype/get/".concat(e),"/rvtype/get/".concat(e)));return console.log(t.data),Promise.resolve(t.data)},async createRvType(e,t,a){const i=await b.a.post(Object(k.j)("/api/rvtype/new","rvtype/new"),{longName:e,shortName:t,description:a});return Promise.resolve(i.data)},async deleteRvType(e){const t=await b.a.delete(Object(k.j)("/api/rvtype/delete/".concat(e),"rvtype/delete/".concat(e)));return Promise.resolve(t.data)},async updateRvType(e){const t=await b.a.put(Object(k.j)("/api/rvtype/update","rvtype/update"),e);return Promise.resolve(t.data)}};var Zl=a(173);const Jl=Object(s.a)((e=>({root:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center"},title:{textAlign:"center",boxSizing:"border-box"},content:{width:"400px",padding:e.spacing(2),display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:e.spacing(2)},button:{marginTop:"15px"}}))),$l=e=>{let{open:t,close:a,data:i}=e;const{rawValue:n,rvTypeId:c}=i||{},s=Jl(),{createOrUpdateRawValue:l,deleteRawValue:r}=ic,{enqueueSnackbar:o}=Object(g.b)(),u=Object(v.f)(),[b,j]=Object(x.useState)({}),[p,m]=Object(x.useState)(null===n||void 0===n?void 0:n.longName),[h,f]=Object(x.useState)(null===n||void 0===n?void 0:n.shortName),[O,y]=Object(x.useState)(null===n||void 0===n?void 0:n.description),[w,N]=Object(x.useState)(null===n||void 0===n?void 0:n.taskType),[C,S]=Object(x.useState)(null===n||void 0===n?void 0:n.evalType),[k,I]=Object(x.useState)(null===n||void 0===n?void 0:n.form),[z,D]=Object(x.useState)(null===n||void 0===n?void 0:n.popM.toString()),[P,A]=Object(x.useState)(null===n||void 0===n?void 0:n.popSd.toString()),[T,F]=Object(x.useState)((null===n||void 0===n?void 0:n.mJobSd)||void 0),[B,R]=Object(x.useState)(null===n||void 0===n?void 0:n.rtt.toString()),[E,U]=Object(x.useState)(null===n||void 0===n?void 0:n.rngMin),[W,L]=Object(x.useState)(null===n||void 0===n?void 0:n.rngMax),[M,G]=Object(x.useState)(null===n||void 0===n?void 0:n.level),[V,_]=Object(x.useState)((null===n||void 0===n?void 0:n.date)||new Date),[K,q]=Object(x.useState)(null===n||void 0===n?void 0:n.sampleSize),H=Object(x.useContext)(Pe),{getAllNorms:Z,fetchedNorms:J}=H;Object(x.useEffect)((()=>{Z()}),[Z]);const $=(e,t)=>{j({...b,[e]:t})},Y=e=>e.slice(e.indexOf(".")+1).length,X=()=>{for(const e of Object.values(b))if(e)return!1;return"string"===typeof c&&void 0!==p&&void 0!==h&&void 0!==O&&void 0!==k&&void 0!==z&&void 0!==P&&void 0!==B&&void 0!==E&&void 0!==W&&void 0!==M&&void 0!==V&&!isNaN(parseFloat(P))&&!isNaN(parseFloat(z))&&!isNaN(parseFloat(B))};return Object(zt.jsxs)(We.a,{transitionDuration:100,className:s.root,open:t,onClose:()=>{a()},children:[Object(zt.jsx)(Le.a,{className:s.title,children:"Rohwert ".concat(n?"Bearbeiten":"Erstellen")}),Object(zt.jsx)(Me.a,{}),Object(zt.jsxs)(Ge.a,{children:[Object(zt.jsxs)(d.a,{container:!0,spacing:2,children:[Object(zt.jsx)(d.a,{item:!0,xs:12,sm:6,children:Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,variant:"outlined",label:"Bezeichnung",value:p,onChange:e=>{m(e.target.value),$("longName",e.target.value.length<1?"Bezeichnung darf nicht leer sein":void 0)},error:!!b.longName,helperText:b.longName})}),Object(zt.jsx)(d.a,{item:!0,xs:12,sm:6,children:Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,variant:"outlined",label:"Abk\xfcrzung",value:h,onChange:e=>{f(e.target.value),$("shortName",e.target.value.length<1?"Abk\xfcrzung darf nicht leer sein":void 0)},error:!!b.shortName,helperText:b.shortName})}),Object(zt.jsx)(d.a,{item:!0,xs:12,children:Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,variant:"outlined",label:"Beschreibung",value:O,onChange:e=>{y(e.target.value),$("description",e.target.value.length<1?"Beschreibung darf nicht leer sein":void 0)},error:!!b.description,helperText:b.description})}),Object(zt.jsx)(d.a,{item:!0,xs:12,sm:6,children:Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,variant:"outlined",label:"Aufgabengruppe",value:w,onChange:e=>{N(e.target.value),$("taskType",e.target.value.length<3?"Aufgabengruppe muss mindestens 3 Zeichen lang sein":void 0)},error:!!b.taskType,helperText:b.taskType})}),Object(zt.jsx)(d.a,{item:!0,xs:12,sm:6,children:Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,variant:"outlined",label:"Parallel-Form",value:k,onChange:e=>{I(e.target.value),$("form",e.target.value.length<1?"Aufgabengruppe darf nicht leer sein":void 0)},error:!!b.form,helperText:b.form})}),Object(zt.jsxs)(d.a,{item:!0,xs:12,children:[Object(zt.jsx)(Rt.a,{id:"evalTypeLabel",children:"Aufgabentyp"}),Object(zt.jsxs)(Et.a,{labelId:"evalTypeLabel",fullWidth:!0,value:C||"",onChange:e=>{var t;t=e.target.value,S(t),$("evalType",t.length<1?"Aufgabentyp darf nicht leer sein":void 0)},children:[Object(zt.jsx)(Ut.a,{value:"MC",children:"Multiple Choice"}),Object(zt.jsx)(Ut.a,{value:"MS",children:"Multiple Select"}),Object(zt.jsx)(Ut.a,{value:"FQ",children:"Fehlerquotient"}),Object(zt.jsx)(Ut.a,{value:"PT",children:"Pers\xf6nlichkeitsskalen"})]})]}),Object(zt.jsxs)(d.a,{item:!0,xs:12,children:[Object(zt.jsx)(Rt.a,{id:"levelLabel",children:"Niveau"}),Object(zt.jsx)(Et.a,{labelId:"levelLabel",fullWidth:!0,label:"Niveau",value:M||"",onChange:e=>{G(e.target.value)},children:J.map(((e,t)=>Object(zt.jsx)(Ut.a,{value:t+1,children:e.longName})))})]}),Object(zt.jsx)(d.a,{item:!0,xs:12,sm:6,children:Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,variant:"outlined",label:"Mittelwert",value:z,onChange:e=>{const t=parseFloat(e.target.value);D(e.target.value),$("popM",Object(Zl.isInteger)(t)?"Mittelwert darf keine ganze Zahl sein":4!==Y(e.target.value)?"Mittelwert muss genau 4 Nachkommastellen haben":t<=0?"Mittelwert muss gr\xf6\xdfer als 0 sein":void 0)},error:!!b.popM,helperText:b.popM})}),Object(zt.jsx)(d.a,{item:!0,xs:12,sm:6,children:Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,variant:"outlined",label:"Standardabweichung",value:P,onChange:e=>{const t=parseFloat(e.target.value);A(e.target.value),$("popSd",Object(Zl.isInteger)(t)?"Standardabweichung darf keine ganze Zahl sein":4!==Y(e.target.value)?"Standardabweichung muss genau 4 Nachkommastellen haben":t<=0?"Standardabweichung muss gr\xf6\xdfer als 0 sein":void 0)},error:!!b.popSd,helperText:b.popSd})}),Object(zt.jsx)(d.a,{item:!0,xs:12,children:Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,variant:"outlined",label:"Retest-Reliabilit\xe4t",value:B,onChange:e=>{const t=parseFloat(e.target.value);R(e.target.value),$("rtt",Object(Zl.isInteger)(t)?"Retest-Reliabilit\xe4t muss eine Zahl mit Nachkommastellen sein":2!==Y(e.target.value)?"Retest-Reliabilit\xe4t muss genau 2 Nachkommastellen haben":t<0||t>1?"Retest-Reliabilit\xe4t muss zwischen 0 und 1 liegen":void 0)},error:!!b.rtt,helperText:b.rtt})}),Object(zt.jsx)(d.a,{item:!0,xs:12,sm:6,children:Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,variant:"outlined",label:"Untergrenze",value:E,type:"number",onChange:e=>{const t=parseFloat(e.target.value);U(t),$("rngMin",Object(Zl.isInteger)(t)?t>=0?void 0:"Untergrenze muss gr\xf6\xdfer als 0 sein":"Untergrenze muss eine ganze Zahl sein")},error:!!b.rngMin,helperText:b.rngMin})}),Object(zt.jsx)(d.a,{item:!0,xs:12,sm:6,children:Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,variant:"outlined",label:"Obergrenze",value:W,type:"number",onChange:e=>{const t=parseFloat(e.target.value);L(t),$("rngMax",Object(Zl.isInteger)(t)?t>0?void 0:"Untergrenze muss gr\xf6\xdfer als 0 sein":"Untergrenze muss eine ganze Zahl sein")},error:!!b.rngMax,helperText:b.rngMax})}),Object(zt.jsx)(d.a,{item:!0,xs:12,children:Object(zt.jsx)(Wt.a,{fullWidth:!0,variant:"outlined",label:"Stichprobengr\xf6\xdfe",value:K,type:"number",onChange:e=>{const t=parseInt(e.target.value);q(t),$("sampleSize",Object(Zl.isInteger)(t)?t>0?void 0:"Stichprobengr\xf6\xdfe muss gr\xf6\xdfer als 0 sein":e.target.value.length>0?"Stichprobengr\xf6\xdfe muss eine ganze Zahl sein":void 0)},error:!!b.sampleSize,helperText:b.sampleSize})}),Object(zt.jsx)(d.a,{item:!0,xs:12,children:Object(zt.jsx)(Pt,{label:"Datum",initialDate:V,processDate:e=>{_(e)}})})]}),Object(zt.jsx)(_e.a,{className:s.button,fullWidth:!0,size:"small",variant:"contained",color:"secondary",type:"submit",onClick:async()=>{if(!X()&&"string"!==typeof c||!z||!P||!B)return;1e3===(await l({id:null===n||void 0===n?void 0:n.id,longName:p,shortName:h,description:O,taskType:w,polarity:"FQ"===C?-1:1,popM:parseFloat(z),popSd:parseFloat(P),mJobSd:T,rtt:parseFloat(B),rngMin:E,rngMax:W,evalType:C,level:M,form:k,date:V,RvTypes:[],sampleSize:K},c)).status_code?u.go(0):o("Rohwert konnte nicht gespeichert werden",Je("error"))},disabled:!X(),children:"Speichern"}),n&&Object(zt.jsx)(_a,{fullWidth:!0,compareString:"l\xf6schen",buttonName:"L\xf6schen",description:"Geben Sie 'l\xf6schen' ein",callback:async()=>{if(null!==n&&void 0!==n&&n.id){1e3===(await r(n.id)).status_code?u.go(0):o("Rohwert konnte nicht gel\xf6scht werden",Je("error"))}}})]})]})},Yl=Object(s.a)((e=>({root:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center"},title:{textAlign:"center",boxSizing:"border-box"},content:{width:"400px",padding:e.spacing(2),display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:e.spacing(2)},button:{marginTop:"15px"},formControl:{width:"50%",minWidth:"200px",userSelect:"none"}}))),Xl=e=>{let{open:t,close:a,rvType:i}=e;const n=Yl(),{deleteRvType:c,updateRvType:s}=Hl,{enqueueSnackbar:l}=Object(g.b)(),r=Object(v.f)(),[o,d]=Object(x.useState)(i.longName),[u,b]=Object(x.useState)(i.shortName),[j,p]=Object(x.useState)(i.description),m=e=>!(null!==e&&void 0!==e&&e.length),h=()=>o.length+u.length+j.length>0;return Object(zt.jsxs)(We.a,{transitionDuration:100,className:n.root,open:t,onClose:()=>{a()},children:[Object(zt.jsx)(Le.a,{className:n.title,children:"Aufgabengruppe Bearbeiten"}),Object(zt.jsx)(Me.a,{}),Object(zt.jsxs)(Ge.a,{children:[Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,value:o,label:"Name",error:m(o),onChange:e=>{d(e.target.value)}}),Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,value:u,label:"Abk\xfcrzung",error:m(u),onChange:e=>{b(e.target.value)}}),Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,value:j,label:"Beschreibung",error:m(j),onChange:e=>{p(e.target.value)}}),Object(zt.jsx)(_e.a,{className:n.button,fullWidth:!0,size:"small",variant:"contained",color:"secondary",type:"submit",onClick:async()=>{if(!i.id||!h())return;await s({id:i.id,longName:o,shortName:u,description:j})?r.go(0):l("Aufgabengruppe konnte nicht gespeichert werden",Je("error"))},disabled:!h(),children:"Absenden"}),Object(zt.jsx)("div",{className:n.button,children:Object(zt.jsx)(_a,{fullWidth:!0,compareString:"l\xf6schen",buttonName:"L\xf6schen",description:'Geben Sie "l\xf6schen" ein',callback:async()=>{await c(i.id)?r.push("/rvtypes"):l("Aufgabengruppe konnte nicht gel\xf6scht werden",Je("error"))}})})]})]})},Ql=Object(s.a)((e=>({button:{marginTop:"50px"}}))),er=e=>{let{match:{params:{id:t}}}=e;const a=Object(v.f)(),i=Ql(),{isAdmin:n}=Object(x.useContext)(Ct),{getRawValueType:c}=Hl,[s,l]=Object(x.useState)(),[r,o]=Object(x.useState)(!1),[d,u]=Object(x.useState)();ni((async()=>{const{data:e}=await c(t);return e}),l);return Object(zt.jsxs)(Ki,{children:[s?Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)(fc,{icon:Object(zt.jsx)(ec.a,{}),displays:[{title:"Abk\xfcrzung",display:Object(zt.jsx)(Ve.a,{children:s.shortName})},{title:"Beschreibung",display:Object(zt.jsx)(Ve.a,{children:s.description})}],title:s.longName,allowEdits:n,editTooltip:"Aufgabengruppe Bearbeiten",onEdit:()=>{o(!r)}}),Object(zt.jsx)(ac,{rawValues:s.RawValues,tableButtons:[{tooltip:"Rohwert erstellen",icon:()=>Object(zt.jsx)(ql.a,{}),popup:$l,isFreeAction:!0,data:{rvTypeId:s.id},disabled:!n}],onRowClick:(e,t)=>{n&&u(t)}}),r&&Object(zt.jsx)(Xl,{open:r,rvType:s,close:()=>o(!1)}),d&&Object(zt.jsx)($l,{close:()=>{u(void 0)},open:!!d,data:{rawValue:d,rvTypeId:s.id}})]}):Object(zt.jsx)(Ft,{}),Object(zt.jsx)(_e.a,{color:"secondary",variant:"contained",size:"large",onClick:()=>{a.push("/rvtypes")},className:i.button,children:"Zur\xfcck zur Aufgabengruppenansicht"})]})};var tr=a(208),ar=a.n(tr);const ir=Object(s.a)((e=>({root:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center"},title:{textAlign:"center",boxSizing:"border-box"},content:{width:"400px",padding:e.spacing(2),display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:e.spacing(2)},button:{marginTop:"15px"}})));var nr=e=>{let{open:t,close:a,data:i}=e;const n=i,c=ir(),{createCorrectAnswer:s}=ha,{enqueueSnackbar:l}=Object(g.b)(),r=Object(v.f)(),[o,d]=Object(x.useState)(""),[u,b]=Object(x.useState)("");return Object(zt.jsxs)(We.a,{transitionDuration:100,className:c.root,open:t,onClose:()=>{a()},children:[Object(zt.jsx)(Le.a,{className:c.title,children:"Musterl\xf6sung Hinzuf\xfcgen"}),Object(zt.jsx)(Me.a,{}),Object(zt.jsxs)(Ge.a,{children:[Object(zt.jsx)(Ve.a,{children:"Geben Sie den Titel der Aufgabe und die L\xf6sung an"}),Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,label:"Titel",onChange:e=>{d(e.target.value)}},"title_field"),Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,label:"L\xf6sung",onChange:e=>{b(e.target.value)}},"solution_field"),Object(zt.jsx)(_e.a,{className:c.button,fullWidth:!0,size:"small",variant:"contained",color:"secondary",type:"submit",onClick:async()=>{(await s(n.sid,o,u)).data?r.go(0):l("L\xf6sung konnte nicht gespeichert werden",Je("error"))},disabled:0===u.length||0===o.length,children:"Speichern"})]})]})};const cr=Object(s.a)((e=>({root:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center"},title:{textAlign:"center",boxSizing:"border-box"},content:{width:"400px",padding:e.spacing(2),display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:e.spacing(2)},button:{marginTop:"15px"}}))),sr=e=>{let{open:t,close:a,answer:i}=e;const n=cr(),{editCorrectAnswer:c,deleteCorrectAnswer:s}=ha,{enqueueSnackbar:l}=Object(g.b)(),r=Object(v.f)(),[o,d]=Object(x.useState)(i.title),[u,b]=Object(x.useState)(i.solution);return Object(zt.jsxs)(We.a,{transitionDuration:100,className:n.root,open:t,onClose:()=>{a()},children:[Object(zt.jsx)(Le.a,{className:n.title,children:"Musterl\xf6sung Bearbeiten"}),Object(zt.jsx)(Me.a,{}),Object(zt.jsxs)(Ge.a,{children:[Object(zt.jsx)(Ve.a,{children:"Geben Sie den Titel der Aufgabe und die L\xf6sung an"}),Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,value:o,label:"Titel",onChange:e=>{d(e.target.value)}},"title_field"),Object(zt.jsx)(Wt.a,{value:u,required:!0,fullWidth:!0,label:"L\xf6sung",onChange:e=>{b(e.target.value)}},"solution_field"),Object(zt.jsx)(_e.a,{className:n.button,fullWidth:!0,size:"small",variant:"contained",color:"secondary",type:"submit",onClick:async()=>{(await c(i.id,o,u)).data?r.go(0):l("L\xf6sung konnte nicht gespeichert werden",Je("error"))},disabled:!u.length||!o.length,children:"Speichern"}),Object(zt.jsx)("div",{className:n.button,children:Object(zt.jsx)(_a,{fullWidth:!0,compareString:"l\xf6schen",buttonName:"L\xf6schen",description:'Geben Sie "l\xf6schen" ein',callback:async()=>{await s(i.id)?r.go(0):l("L\xf6sung konnte nicht gel\xf6scht werden",Je("error"))}})})]})]})};var lr=a(432);const rr=e=>!isNaN(+e)&&+e>=111111&&+e<=999999,or=Object(s.a)((e=>({root:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center"},title:{textAlign:"center",boxSizing:"border-box"},content:{width:"400px",padding:e.spacing(2),display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:e.spacing(2)},button:{marginTop:"15px"},formControl:{width:"50%",minWidth:"200px",userSelect:"none"}}))),dr=e=>{let{open:t,close:a,survey:i}=e;const n=or(),{updateSurvey:c,deleteSurvey:s}=ha,{enqueueSnackbar:l}=Object(g.b)(),r=Object(v.f)(),o=Object(x.useContext)(Pe),{fetchedCustomers:d,getCustomers:u}=o,[b,j]=Object(x.useState)(i.description),[p,m]=Object(x.useState)(i.sid),[h,f]=Object(x.useState)(i.barrier),[O,y]=Object(x.useState)(d.find((e=>e.id===i.customerId))),[w,N]=Object(x.useState)(!1);return Object(x.useEffect)((()=>{u()}),[u]),Object(zt.jsxs)(We.a,{transitionDuration:100,className:n.root,open:t,onClose:()=>{a()},children:[Object(zt.jsx)(Le.a,{className:n.title,children:"Umfrage Bearbeiten"}),Object(zt.jsx)(Me.a,{}),Object(zt.jsxs)(Ge.a,{children:[Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,value:b,label:"Beschreibung",onChange:e=>{j(e.target.value)}},"title_field"),Object(zt.jsx)(Wt.a,{value:p,required:!0,fullWidth:!0,label:"Survey-ID",error:!rr(p),onChange:e=>{m(e.target.value)}},"solution_field"),Object(zt.jsx)(ua.a,{label:"Mehr Optionen",labelPlacement:"end",control:Object(zt.jsx)(ba.a,{color:"secondary",onChange:()=>{N(!w)},checked:w}),className:n.formControl}),w&&Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsxs)(Bt.a,{fullWidth:!0,children:[Object(zt.jsx)(Rt.a,{id:"barrier-select-label",children:"Barriere"}),Object(zt.jsxs)(Et.a,{labelId:"barrier-select-label",id:"barrier-select",value:h,label:"Barriere",onChange:e=>{var t;t=e.target.value,f(t)},children:[Object(zt.jsx)(Ut.a,{value:1,children:"Ja"}),Object(zt.jsx)(Ut.a,{value:0,children:"Nein"})]})]}),Object(zt.jsxs)(Bt.a,{fullWidth:!0,children:[Object(zt.jsx)(Rt.a,{id:"customer-select-label",children:"Kunde"}),Object(zt.jsxs)(Et.a,{labelId:"customer-select-label",id:"customer-select",value:null===O||void 0===O?void 0:O.id,label:"Kunde",disabled:0===d.length,onChange:e=>{var t;(t=e.target.value).length?y(d.find((e=>e.id===t))):y(void 0)},children:[Object(zt.jsx)(Ut.a,{value:"",children:"(Kein Kunde)"},-1),d.map(((e,t)=>Object(zt.jsx)(Ut.a,{value:e.id,children:e.longName},t)))]}),0===d.length&&Object(zt.jsx)(lr.a,{children:"Keine Kunden verf\xfcgbar"})]})]}),Object(zt.jsx)(_e.a,{className:n.button,fullWidth:!0,size:"small",variant:"contained",color:"secondary",type:"submit",onClick:async()=>{if(!i.id)return;await c(i.id,{sid:p,barrier:h,description:b,customerId:null===O||void 0===O?void 0:O.id})?r.go(0):l("Umfrage konnte nicht gespeichert werden",Je("error"))},disabled:!(b.length>0&&rr(p)),children:"Absenden"}),Object(zt.jsx)("div",{className:n.button,children:Object(zt.jsx)(_a,{fullWidth:!0,compareString:"l\xf6schen",buttonName:"L\xf6schen",description:'Geben Sie "l\xf6schen" ein',callback:async()=>{if(!i.id)return void l("Keine Umfragen-ID vorhanden",Je("error"));1e3===(await s(i.id)).status_code?r.push("/survey"):l("Umfrage konnte nicht gel\xf6scht werden",Je("error"))}})})]})]})},ur=Object(s.a)((e=>({button:{marginTop:"50px"}})));var br=Object(h.a)((e=>{var t;let{match:a}=e;const i=a.params.id,n=ur(),{enqueueSnackbar:c}=Object(g.b)(),s=gc(),l=Object(v.f)(),{isAdmin:r}=Object(x.useContext)(Ct),{getSurvey:o,getCorrectAnswers:d,removeSurveyLink:u,createSurveyLinks:b}=ha,[j,p]=Object(x.useState)(),[m,h]=Object(x.useState)(),[f,O]=Object(x.useState)(),[y,w]=Object(x.useState)(!1),[N,C]=Object(x.useState)();ni((async()=>o(i)),(async e=>{p(e.data),e.data&&await S(e.data.sid)}));const S=async e=>{const{data:t}=await d(e);h(t)},I=[{title:"sid",display:Object(zt.jsx)(Ve.a,{className:s.label,children:null===j||void 0===j?void 0:j.sid})},{title:"Barriere",display:Object(zt.jsx)(Ve.a,{className:s.label,children:null!==j&&void 0!==j&&j.barrier?"Ja":"Nein"})},{title:"Kunde",display:Object(zt.jsx)(Ve.a,{className:s.label,children:(null===j||void 0===j||null===(t=j.Customer)||void 0===t?void 0:t.longName)||"\u2014"})},{title:"Umfragentyp",display:Object(zt.jsx)(Ve.a,{className:s.label,children:k.c[(null===j||void 0===j?void 0:j.type)||"OT"]})}],z={onRowClick:(e,t)=>{r&&O(t)},pagingFilter:!0,pageSize:5,tableButtons:[{tooltip:"L\xf6sung Hinzuf\xfcgen",icon:()=>Object(zt.jsx)(Fe.a,{}),isFreeAction:!0,popup:nr,data:j,disabled:!r}],title:"Musterl\xf6sungen",columns:[{title:"Titel",field:"title"},{title:"L\xf6sung",field:"solution"}],data:m};return Object(zt.jsxs)(Ki,{children:[j&&m?Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)(fc,{title:j.description,displays:I,icon:Object(zt.jsx)(ar.a,{}),allowEdits:r,editTooltip:"Umfrage bearbeiten",onEdit:()=>{w(!0)}}),Object(zt.jsxs)(zt.Fragment,{children:["PT"!==j.type&&Object(zt.jsx)(Li,{dense:!0,...z}),Object(zt.jsx)(ac,{rawValues:j.RawValues,onRowClick:(e,t)=>{r&&C(t)},tableButtons:"PT"!==j.type||"PT"===j.type&&0===j.RawValues.length?[{tooltip:"Rohwerte mit Umfrage verlinken",icon:()=>Object(zt.jsx)(Fe.a,{}),popup:bc,data:{handleCreateLink:async(e,t)=>{const a=await b(i,e,t);console.log(a.data),a.status_code===Ze.SUCCESS?l.go(0):c("Verkn\xfcpfung konnte nicht erstellt werden",Je("error"))},rvRelevantStart:j.description.slice(0,3),irrelevantIds:j.RawValues.map((e=>e.id)),rawValues:j.RawValues},isFreeAction:!0,disabled:!r}]:[]})]})]}):Object(zt.jsx)(Ft,{}),Object(zt.jsx)(_e.a,{color:"secondary",variant:"contained",size:"large",onClick:()=>{l.push("/survey")},className:n.button,children:"Zur\xfcck zur Umfragenansicht"}),f&&Object(zt.jsx)(sr,{open:!!f,answer:f,close:()=>O(void 0)}),y&&j&&Object(zt.jsx)(dr,{open:y,survey:j,close:()=>w(!1)}),N&&j&&Object(zt.jsx)(hc,{rawValue:N,open:!!N,close:()=>{C(void 0)},handleUnlink:async()=>{if(!N||!j||!j.id)return;(await u(N.id,j.id)).status_code===Ze.SUCCESS?l.go(0):c("Verkn\xfcpfung konnte nicht entfernt werden",Je("error"))}})]})})),jr=a(351),pr=a.n(jr);var mr=()=>Object(zt.jsxs)("div",{style:{maxWidth:"800px",height:"100vh",margin:"0 auto",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[Object(zt.jsx)(pr.a,{style:{fontSize:"10rem",color:"lightgrey"}}),Object(zt.jsx)("h1",{children:"Oops! ... "}),Object(zt.jsx)("h2",{children:"Das h\xe4tte nicht passieren d\xfcrfen"}),Object(zt.jsx)(Ve.a,{style:{margin:"2rem"},children:"Laden Sie die Seite neu. Sollte das Problem weiterhin bestehen, wenden Sie sich an den Support"}),Object(zt.jsxs)(d.a,{container:!0,direction:"row",justify:"space-around",alignItems:"center",children:[Object(zt.jsx)(d.a,{item:!0,children:Object(zt.jsx)(_e.a,{variant:"outlined",href:"/",children:"Seite neu laden"})}),Object(zt.jsx)(d.a,{item:!0,children:Object(zt.jsx)(_e.a,{variant:"outlined",href:"mailto:support@ki-test.com",children:"Support"})})]})]});var hr,gr,xr,fr,Or,vr,yr,wr=Object(h.a)((()=>{const e=Object(v.f)(),{isAdminSupport:t}=Object(x.useContext)(Ct),{getAllEvents:a}=na,[i,n]=Object(x.useState)([]),[c,s]=Object(x.useState)([]);Object(x.useEffect)((()=>{(async()=>{const{data:e}=await a();e&&n(e)})(),(async()=>{const e=await wt.getUsers();e&&s(e.filter((e=>4===Number(e.roleId))))})()}),[]);const l={pagingFilter:!0,pageSize:100,searchFilter:!0,addEventButton:t,userList:c,onRowClick:(t,a)=>{e.push("/event/".concat(a.id))},columns:[{align:"left",title:"Datum",type:"date",field:"date",sorting:!0,defaultSort:"asc",render:e=>Object(zt.jsx)(Ve.a,{children:Qt(e.date)}),customFilterAndSearch:(e,t)=>Qt(t.date).includes(e)},{align:"left",field:"Office.longName",type:"string",title:"Einheit"},{align:"left",field:"Project.longName",type:"string",title:"Projekt"},{align:"left",title:"Standort",type:"string",field:"location"},{align:"left",title:"Status",type:"string",field:"status",render:e=>Object(zt.jsx)(Ve.a,{children:aa("event",e.status)}),customFilterAndSearch:(e,t)=>ds.application(e,t)},...t?[{title:"Moderator*in",field:"User",customFilterAndSearch:(e,t)=>os.byFullName(e,null===t||void 0===t?void 0:t.User),render:e=>{var t,a;return Object(zt.jsxs)(Ve.a,{children:[null===(t=e.User)||void 0===t?void 0:t.firstName," ",null===(a=e.User)||void 0===a?void 0:a.lastName]})}}]:[]],data:i.length>0?JSON.parse(JSON.stringify(i)):[]};return Object(zt.jsxs)(Ki,{children:[Object(zt.jsx)(Vi,{heading:"Termine",children:Object(zt.jsx)(Bn.a,{})}),Object(zt.jsx)(Li,{dense:!0,...l})]})})),Nr=a(6),Cr=a(971),Sr=a(1009),kr=a(1007),Ir=a(1008),zr=a(1004),Dr=a(1019),Pr=a(622),Ar=a.n(Pr),Tr=a(623),Fr=a.n(Tr),Br=a(3);let Rr=(hr=class{constructor(){Object(N.a)(this,"activeStep",gr,this),Object(N.a)(this,"conflictState",xr,this),Object(N.a)(this,"importState",fr,this),Object(N.a)(this,"mappingState",Or,this),Object(N.a)(this,"selectState",vr,this),Object(N.a)(this,"validationState",yr,this),this.setActiveStep=e=>{this.activeStep=e},this.setMappingState=e=>{this.mappingState={complete:e.complete,duplicates:e.duplicates}},this.setValidationState=e=>{this.validationState={processing:e.processing,complete:e.complete,count:e.count}},this.setConflictState=e=>{this.conflictState={fetching:e.fetching,processing:e.processing,complete:e.complete,count:e.count}},this.setSelectState=e=>{this.selectState={fetched:e.fetched,officeSelected:e.officeSelected,projectSelected:e.projectSelected}},this.setImportState=e=>{this.importState={responseData:e.responseData,fetched:e.fetched,status:e.status}},this.activeStep=0,this.mappingState={complete:!1,duplicates:!1},this.validationState={processing:!1,complete:!1,count:0},this.conflictState={fetching:!1,processing:!1,complete:!1,count:0},this.selectState={fetched:!1,officeSelected:!1,projectSelected:!1},this.importState={responseData:[{participant:{id:"",firstName:"",lastName:"",occurence:""},application:[{positionId:"",officeId:"",occurence:"",status:"",action:""}]}],fetched:!1,status:""}}},gr=Object(C.a)(hr.prototype,"activeStep",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),xr=Object(C.a)(hr.prototype,"conflictState",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),fr=Object(C.a)(hr.prototype,"importState",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Or=Object(C.a)(hr.prototype,"mappingState",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),vr=Object(C.a)(hr.prototype,"selectState",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),yr=Object(C.a)(hr.prototype,"validationState",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),hr);var Er=Object(x.createContext)(new Rr),Ur=a(1033),Wr=a(597),Lr=a(213);const Mr=Object(s.a)((e=>({root:{overflow:"none",maxWidth:"100%"},btn:{margin:"20px",boxSizing:"border-box"},btnBox:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center"},duplicate:{color:"red"},form:{margin:e.spacing(1)},tableContainer:{maxHeight:"40vh",display:"flex",flexDirection:"column",alignItems:"center"},tableHeadCell:{width:"100px"},tableCell:{maxWidth:"100px",minWidth:"100px",padding:"2px 0px 2px 4px",overflowX:"hidden",textOverflow:"ellipsis"},iconTableCell:{overflowX:"hidden",userSelect:"none",paddingTop:"10px",color:"#e39802"},infoIcon:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},header:{fontWeight:600},invalid:{color:"#b60a1c"},button:{margin:"10px"},accordionSummary:{backgroundColor:e.palette.secondary.main},accordion:{marginBottom:".25rem"},accordionDetails:{padding:"0","@global":{".MuiToolbar-root":{minHeight:"10px"}}},paginationLabel:{display:"flex",alignItems:"center",justifyContent:"space between"},total:{backgroundColor:e.palette.secondary.light,color:e.palette.primary.light},conflict:{backgroundColor:e.palette.warning.light,color:e.palette.primary.light},error:{backgroundColor:e.palette.error.light,color:e.palette.primary.light},ok:{backgroundColor:e.palette.success.light,color:e.palette.primary.light},chipBox:{display:"flex",padding:e.spacing(1),gap:e.spacing(1)}})));var Gr=e=>{var t,a,i,n,c,s;let{columns:l,rows:r,positions:o,fileName:d,fileHeaders:u,storeNewRows:b}=e;const j=Mr(),p=Object(x.useContext)(Er),{enqueueSnackbar:m}=Object(g.b)(),{checkConflicts:h}=$e,{activeStep:f,setActiveStep:O,mappingState:v,setMappingState:y,validationState:w,setValidationState:N,conflictState:C,setConflictState:S,importState:I}=p,[z,D]=Object(x.useState)(0),[P]=Object(x.useState)(l),[A,T]=Object(x.useState)(5),[F,B]=Object(x.useState)(r),[R,E]=Object(x.useState)(!1),[U,W]=Object(x.useState)(u),[L,M]=Object(x.useState)({}),G=e=>Object(He.a)(Object(Lr.a)(Yt(e)),Object(Lr.a)(new Date)),V=e=>{const t=e.map((e=>{e.misc.invalid=[];const t=e.misc.positions.map((e=>e.shortName));let a=0;for(const c in e){const s=e[c],l=e.misc.invalid;switch(c){case"lastName":case"firstName":!k.i.name.test(s)&&l.push(c);break;case"email":!k.i.email.test(s)&&l.push(c);break;case"gender":!k.i.gender.test(s)&&l.push(c);break;case"birthday":!k.i.birthday.test(s)&&l.push(c);break;case"validFrom":(!k.i.date.test(s)||!G(s))&&l.push(c);break;case"validUntil":(!k.i.date.test(s)||!G(s)||(i=e.validFrom,n=s,!Object(Ds.a)(Yt(i),Yt(n))))&&l.push(c)}t.includes(c)&&"x"===s&&a++}var i,n;return 0===a&&t.forEach((t=>e.misc.invalid.push(t))),e}));t[0].misc.invalid.length>=6&&m("Enth\xe4lt die Datei eine Kopfzeile? Bitte import Dateien nur ohne Kopfzeile hochladen.",Je("warning")),q(),B(t),O(f)},_=e=>{let t="";switch(e){case"diffMail":t="Teilnehmer*in existiert mit einer anderen E-Mail-Adresse";break;case"diffFirstName":t="Teilnehmer*in existiert mit einem anderen Vornamen";break;case"diffLastName":t="Teilnehmer*in existiert mit einem anderen Nachnamen";break;case"diffBirthday":t="Teilnehmer*in existiert mit einem anderen Geburtsdatum";break;case"nameSwap":t="Teilnehmer*in exisitert bereits mit verdrehtem Vor- und Nachnamen";break;case"mailExist":t="Die E-Mail-Adresse ist bereits vergeben";break;case"exist":t="Teilnehmer*in exisiert bereits";break;case"duplicateMail":t="Die E-Mail-Adresse ist innerhalb der Datei f\xfcr verschiedene Teilnehmer*innen vorhanden";break;case"diffGender":t="Teilnehmer*in existiert bereits mit anderem Geschlecht"}return t},K=()=>{const e=(()=>{const e=Object.keys(l).length;return(null===U||void 0===U?void 0:U.filter((e=>""!==e)).length)===e})(),t=(null===U||void 0===U?void 0:U.filter(((e,t)=>(null===U||void 0===U?void 0:U.indexOf(e))!==t))).length>0;y({complete:e,duplicates:t})},q=()=>{const e=(()=>{let e=!0,t=0;return F.forEach((a=>{a.misc.invalid.length>0&&(t++,e=!1)})),{complete:e,count:t}})();N({processing:!1,complete:e.complete,count:e.count})},H=()=>{const e=(()=>{let e=!0,t=0;return F.forEach((a=>{void 0!==a.misc.conflict&&"ok"!==a.misc.conflict&&""!==a.misc.conflict&&(t++,e=!1)})),{complete:e,count:t}})();S({fetching:!1,processing:!1,complete:e.complete,count:e.count})},Z=(e,t,a)=>{if(!isNaN(e)&&t&&a){const i=F;i[e][t]=a,B(i)}},J=()=>{const e=Object.keys(L).length>1;v.complete&&!v.duplicates&&e&&!R&&(((e,t)=>{const a=e.map((e=>{const a={};return Object.entries(e).forEach((e=>{let[i,n]=e;if("misc"!==i&&i.length){const e=t[i];a[e.id]=n}else"misc"===i&&(a.misc=n)})),a}));a.forEach((e=>{const t=o.map((e=>e.shortName));Object.entries(e).forEach((a=>{let[i,n]=a;if(t.includes(i))n.length>0?e[i]="x":e[i]="-";else if("gender"===i)switch(n.toLowerCase()){case"m":case"m\xe4nnlich":e[i]="m\xe4nnlich";break;case"w":case"weiblich":e[i]="weiblich";break;case"d":case"divers":e[i]="divers"}}))})),B(a),E(!0)})(F,L),b(F),N({processing:!0,complete:w.complete,count:w.count}),D(z))};return Object(x.useEffect)((()=>{b(F)}),[b,F]),Object(x.useEffect)((()=>{const e=Object.keys(L).length>1;!v.complete||v.duplicates||e||(()=>{const e=Object.keys(F[0]),t={};e.forEach(((e,a)=>{"misc"!==e&&(t[e]={id:U[a],name:l[U[a]]})})),M(t)})()})),Object(x.useEffect)((()=>{const e=Object.keys(L).length>1;v.complete&&!v.duplicates&&e&&3===f&&J()})),Object(x.useEffect)((()=>{4===f&&C.processing&&!C.fetching&&(S({fetching:!0,processing:C.processing,complete:C.complete,count:C.count}),(async e=>{if(V(e),w.complete){const t=await h(e);t&&B(t),H()}})(F))})),Object(x.useEffect)((()=>{3!==f&&4!==f||!w.processing||V(F)})),Object(x.useEffect)((()=>{f>=4&&!w.complete&&O(3)})),Object(x.useEffect)((()=>{I.fetched&&O(6)})),Object(x.useEffect)((()=>{3===f&&w.complete&&0===w.count&&(S({fetching:C.fetching,processing:!0,complete:C.complete,count:C.count}),O(4))}),[f,C,O,S,w]),Object(x.useEffect)((()=>{5===f&&0===(null===F||void 0===F?void 0:F.filter((e=>{var t;return"ok"===(null===e||void 0===e||null===(t=e.misc)||void 0===t?void 0:t.conflict)})).length)&&O(4)}),[f,O,F]),Object(zt.jsxs)("div",{className:j.root,children:[Object(zt.jsxs)(Vn.a,{className:j.tableContainer,component:Ae.a,children:[Object(zt.jsxs)(la.a,{size:"small",stickyHeader:!0,children:[Object(zt.jsx)(Xa.a,{children:Object(zt.jsx)(ra.a,{children:2===f?Object.keys(l).map(((e,t)=>{var a,i,n,c;return Object(zt.jsx)(oa.a,{className:"".concat(j.tableHeadCell," ").concat(j.tableCell),children:Object(zt.jsx)(Bt.a,{color:"secondary",fullWidth:!0,className:j.form,children:Object(zt.jsxs)(Et.a,{defaultValue:"",autoWidth:!0,value:U[t],onChange:e=>{"string"===typeof e.target.value&&((e,t)=>{const a=U;a[t]=e,W(a),K()})(e.target.value,t)},children:[Object(zt.jsx)(Ut.a,{value:"",children:"-"}),null===(a=Object.entries(P))||void 0===a||null===(i=a.filter((e=>{let[a]=e;return U.indexOf(a)===t})))||void 0===i?void 0:i.map(((e,t)=>{let[a,i]=e;return Object(zt.jsx)(Ut.a,{value:a||"",children:i||""},t)})),null===(n=Object.entries(P))||void 0===n||null===(c=n.filter((e=>{let[t]=e;return!U.includes(t)})))||void 0===c?void 0:c.map(((e,t)=>{let[a,i]=e;return Object(zt.jsx)(Ut.a,{value:a||"",children:i||""},t)}))]})})},t)})):Object(zt.jsx)(zt.Fragment,{children:(3===f||4===f||5===f)&&v.complete&&L?Object.entries(L).map(((e,t)=>{let[a,i]=e;return Object(zt.jsx)(oa.a,{variant:"head",className:j.tableCell,children:Object(zt.jsx)(zt.Fragment,{children:i.name})},t)})):Object(zt.jsx)(zt.Fragment,{})})})}),Object(zt.jsx)(Qa.a,{children:2===f?F.slice(z*A,z*A+A).map(((e,t)=>{var a,i;return Object(zt.jsx)(ra.a,{children:null===(a=Object.entries(e))||void 0===a||null===(i=a.filter((e=>{let[t]=e;return"misc"!==t})))||void 0===i?void 0:i.map(((t,a)=>{let[i]=t;return Object(zt.jsx)(oa.a,{className:j.tableCell,children:Object(zt.jsx)(zt.Fragment,{children:e[i]})},a)}))},t)})):3===f?null===F||void 0===F||null===(t=F.filter((e=>{var t,a;return(null===(t=e.misc)||void 0===t||null===(a=t.invalid)||void 0===a?void 0:a.length)>0})))||void 0===t||null===(a=t.slice(z*A,z*A+A))||void 0===a?void 0:a.map((e=>{var t;return Object(zt.jsx)(ra.a,{children:Object.entries(e).map(((t,a)=>{let[i]=t;var n,c,s,l,r;return"misc"!==i?Object(zt.jsx)(oa.a,{className:j.tableCell,children:Object(zt.jsx)(Wt.a,{variant:"outlined",margin:"dense",defaultValue:F[null===(n=e.misc)||void 0===n?void 0:n.id][i],label:null!==(c=e.misc)&&void 0!==c&&null!==(s=c.invalid)&&void 0!==s&&s.includes(i)?"Ung\xfcltig":"",error:null===(l=e.misc)||void 0===l||null===(r=l.invalid)||void 0===r?void 0:r.includes(i),onChange:t=>{var a;Z(null===(a=e.misc)||void 0===a?void 0:a.id,i,t.target.value)}})},a):Object(zt.jsx)(zt.Fragment,{})}))},null===(t=e.misc)||void 0===t?void 0:t.id)})):4===f&&!C.processing&&!C.fetching&&F.length>0?null===F||void 0===F||null===(i=F.filter((e=>{var t;return"ok"!==(null===e||void 0===e||null===(t=e.misc)||void 0===t?void 0:t.conflict)})))||void 0===i||null===(n=i.slice(z*A,z*A+A))||void 0===n?void 0:n.map((e=>Object(zt.jsx)(ra.a,{children:Object.entries(e).map(((t,a)=>{let[i]=t;return"misc"!==i?Object(zt.jsx)(oa.a,{className:j.tableCell,children:Object(zt.jsx)(Wt.a,{variant:"outlined",margin:"dense",defaultValue:F[e.misc.id][i],onChange:t=>{var a;Z(null===(a=e.misc)||void 0===a?void 0:a.id,i,t.target.value)}})},a):"misc"===i?Object(zt.jsx)(oa.a,{className:j.iconTableCell,children:Object(zt.jsx)(Ya.a,{title:_(e[i].conflict),placement:"left",children:Object(zt.jsx)(kc.a,{className:j.infoIcon,fontSize:"large"})})},a):Object(zt.jsx)(Ft,{})}))},e.misc.id))):5===f&&F.length>0?null===F||void 0===F||null===(c=F.filter((e=>"ok"===e.misc.conflict)))||void 0===c||null===(s=c.slice(z*A,z*A+A))||void 0===s?void 0:s.map(((e,t)=>{var a,i;return Object(zt.jsx)(ra.a,{children:null===(a=Object.entries(e))||void 0===a||null===(i=a.filter((e=>{let[t]=e;return"misc"!==t})))||void 0===i?void 0:i.map(((t,a)=>{let[i,n]=t;return Object(zt.jsx)(oa.a,{className:j.tableCell,children:"x"===n?Object(zt.jsx)(Ur.a,{checked:!0}):"-"===n?Object(zt.jsx)(Ur.a,{checked:!1,disabled:!0}):Object(zt.jsx)(zt.Fragment,{children:e[i]})},a)}))},t)})):Object(zt.jsx)(zt.Fragment,{})})]}),4===f&&Object(zt.jsx)(_e.a,{color:"secondary",className:j.button,variant:"outlined",onClick:()=>{var e;const t=null===F||void 0===F||null===(e=F.filter((e=>"ok"!==e.misc.conflict)))||void 0===e?void 0:e.map((e=>{const t={...e};return t.conflict=_(t.misc.conflict),delete t.misc,t})),a=new Date,i="".concat(a.getFullYear().toString().substring(-2)).concat(("0"+(a.getMonth()+1)).slice(-2)).concat(("0"+a.getDate()).slice(-2));"".concat(i,"_Konflikte_").concat(d.split(".")[0]);if(t.length>0)throw new Error("unavailable");m("Keine Konflikte gefunden.",Je("warning"))},children:"Download .CSV"})]}),Object(zt.jsx)(Wr.a,{rowsPerPageOptions:[5,10,25],component:"div",count:r.length,rowsPerPage:A,labelRowsPerPage:"Eintr\xe4ge pro Seite",labelDisplayedRows:()=>Object(zt.jsxs)("div",{className:j.paginationLabel,children:[Object(zt.jsxs)("div",{className:j.chipBox,children:[(3===f||4===f)&&Object(zt.jsx)(Ba.a,{label:"".concat(3===f?F.filter((e=>{var t,a;return(null===(t=e.misc)||void 0===t||null===(a=t.invalid)||void 0===a?void 0:a.length)>0})).length:4===f?null===F||void 0===F?void 0:F.filter((e=>{var t;return"ok"!==(null===e||void 0===e||null===(t=e.misc)||void 0===t?void 0:t.conflict)})).length:r.length," ").concat(3===f?"Fehler":4===f?"Konflikte":""),size:"small",className:"".concat(j.total," ").concat(3===f?j.error:4===f?j.conflict:"")}),f>4&&f<6&&Object(zt.jsx)(Ba.a,{label:"".concat(null===F||void 0===F?void 0:F.filter((e=>{var t,a,i;return 0===(null===e||void 0===e||null===(t=e.misc)||void 0===t||null===(a=t.invalid)||void 0===a?void 0:a.length)&&"ok"===(null===e||void 0===e||null===(i=e.misc)||void 0===i?void 0:i.conflict)})).length," OK"),size:"small",className:j.ok}),Object(zt.jsx)(Ba.a,{label:"".concat(F.length," Gesamt"),size:"small",className:j.total})]}),Object(zt.jsxs)(Ve.a,{children:["Seite ",z+1]})]}),page:z,onChangePage:(e,t)=>{D(t)},onChangeRowsPerPage:e=>{T(Number(e.target.value)),D(0)}})]})};const Vr=Object(s.a)((e=>({tableContainer:{maxHeight:"300px",boxSizing:"border-box"},tableCell:{maxWidth:"100px",minWidth:"100px",padding:"2px 0px 2px 4px",overflowX:"hidden",textOverflow:"ellipsis"},accordionSummary:{backgroundColor:e.palette.secondary.main},accordionDetails:{padding:"0","@global":{".MuiToolbar-root":{minHeight:"10px"}}}})));var _r=e=>{let{positions:t,rows:a}=e;const i=Object(x.useContext)(Er),n=Vr(),{activeStep:c,importState:s}=i,[l,r]=Object(x.useState)(0),[o,d]=Object(x.useState)(5),u=(e,t)=>{let a="";if("participant"===e)switch(t){case"new":a="Neu angelegt";break;case"exist":a="Besteht bereits"}else if("application"===e)switch(t){case"new":a="Neu angelegt";break;case"exist":a="Besteht bereits";break;case"extended":a="Teilnahmefrist angepasst";break;case"rejected":a="Teilnahmefrist konnte nicht angepasst werden"}return a};return Object(zt.jsx)(Ki,{children:Object(zt.jsxs)(Vn.a,{className:n.tableContainer,component:Ae.a,children:[s.fetched&&6===c&&s.responseData instanceof Array&&s.responseData.slice(l*o,l*o+o).map(((e,a)=>Object(zt.jsxs)(xn.a,{children:[Object(zt.jsx)(fn.a,{expandIcon:Object(zt.jsx)(yn.a,{color:"secondary"}),"aria-controls":"panel1a-content",id:"panel1a-header",children:Object(zt.jsx)(la.a,{size:"small",stickyHeader:!0,children:Object(zt.jsx)(Qa.a,{children:Object(zt.jsxs)(ra.a,{children:[Object(zt.jsxs)(oa.a,{variant:"head",children:[e.participant.firstName," ",e.participant.lastName]}),Object(zt.jsx)(oa.a,{variant:"head",align:"right",children:u("participant",e.participant.occurence)})]})})})}),Object(zt.jsx)(On.a,{children:Object(zt.jsxs)(la.a,{size:"small",stickyHeader:!0,children:[Object(zt.jsx)(Xa.a,{children:Object(zt.jsxs)(ra.a,{children:[Object(zt.jsx)(oa.a,{variant:"head",children:"Bewerbung"}),Object(zt.jsx)(oa.a,{variant:"head",children:"Status"})]})}),Object(zt.jsx)(Qa.a,{children:e.application.map(((e,a)=>{var i;return Object(zt.jsxs)(ra.a,{children:[Object(zt.jsx)(oa.a,{children:null===t||void 0===t||null===(i=t.filter((t=>t.id===e.positionId)))||void 0===i?void 0:i.map((e=>e.longName))}),Object(zt.jsx)(oa.a,{children:u("application",e.occurence)})]},a)}))})]})})]},a))),Object(zt.jsx)(Wr.a,{rowsPerPageOptions:[5,10,25],component:"div",count:a.length,rowsPerPage:o,labelRowsPerPage:"Eintr\xe4ge pro Seite",labelDisplayedRows:()=>"Seite ".concat(l+1),page:l,onChangePage:(e,t)=>r(t),onChangeRowsPerPage:e=>{d(parseInt(e.target.value,10)),r(0)}})]})})};const Kr=Object(s.a)((e=>({warning:{color:e.palette.warning.main},success:{color:e.palette.success.main},results:{fontSize:"1.5rem",fontFamily:"Open Sans",lineHeight:"1.334",fontWeight:"normal"},box:{margin:"5px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},workbench:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start",width:"100%",margin:e.spacing(2,0)},infoBox:{maxWidth:"400px",padding:"5px",margin:"10px",color:"grey"},tableBox:{height:"100%",width:"100%",margin:e.spacing(2,0)},buttonBox:{display:"flex",flexDirection:"row",alingItems:"center",justifyContent:"center",gap:"20px"},selectBox:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10px",width:"170px"},instructionBox:{borderTop:"1px solid ".concat(e.palette.secondary.dark),borderBottom:"1px solid ".concat(e.palette.secondary.dark),marginTop:e.spacing(1),padding:e.spacing(0,1)},stepper:{width:"50vw",minWidth:"600px",background:"none"},infoItem:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:"20px"},instructions:{fontWeight:600,color:e.palette.secondary.dark,marginTop:e.spacing(1),marginBottom:e.spacing(1)},align:{textAlign:"left",fontWeight:"bold",margin:"5px 0",minWidth:200},resetBtn:{color:"grey"}}))),qr=Object(Nr.a)({alternativeLabel:{top:10,left:"calc(-50% + 16px)",right:"calc(50% + 16px)"},active:{"& $line":{borderColor:"#008DCF"}},completed:{"& $line":{borderColor:"#309134"}},line:{borderColor:"#eaeaf0",borderTopWidth:3,borderRadius:1}})(Cr.a),Hr=Object(s.a)({root:{color:"#eaeaf0",display:"flex",height:22,alignItems:"center"},active:{color:"#e8ac34"},circle:{width:8,height:8,borderRadius:"50%",backgroundColor:"currentColor"},completed:{color:"#309134",border:"2px solid #309134",borderRadius:"50%",zIndex:1,fontSize:18}});function Zr(e){let{active:t,completed:a}=e;const i=Hr();return Object(zt.jsx)("div",{className:Object(Br.default)(i.root,{[i.active]:t}),children:a?Object(zt.jsx)(Ar.a,{className:i.completed}):Object(zt.jsx)("div",{className:i.circle})})}const Jr=["Projekt w\xe4hlen","Datei w\xe4hlen","Daten zuordnen","Fehler","Konflikte","Import","Zusammenfassung"],$r=["W\xe4hlen Sie eine Einheit und ein Projekt.","W\xe4hlen Sie eine Datei mit den Daten der Teilnehmer*innen aus.","Ordnen Sie den Daten die Entsprechenden Spalten zu.","Korrigieren Sie die fehlerhaften Eintr\xe4ge um fortzufahren.","Beheben Sie die Konflikte oder fahren Sie ohne die Konflikte fort.","Daten importieren","Zusammenfassung der importierten Teilnehmer*innen"];let Yr=new Map([["firstName",["vorname","firstname"]],["lastName",["nachname","lastname"]],["birthday",["geburtstag","birthday","geburtsdatum","geburts-datum"]],["gender",["geschlecht","gender","anrede"]],["validFrom",["g\xfcltig von","gueltig von","valid from","validfrom","einladungsdatum"]],["validUntil",["g\xfcltig bis","gueltig bis","valid until","validuntil","teilnahmefrist"]],["email",["e-mail","email","e mail","mail","e-mail-adresse","email-adresse","emailadresse"]]]);var Xr,Qr,eo,to,ao=Object(h.a)((()=>{var e;const t=Kr(),{user:a}=Object(x.useContext)(Ct),{activeStep:i,setActiveStep:n,mappingState:c,setMappingState:s,validationState:l,setValidationState:r,conflictState:o,setConflictState:d,selectState:u,setSelectState:b,setImportState:j,importState:p}=Object(x.useContext)(Er),{enqueueSnackbar:m}=Object(g.b)(),{getUserOffices:h}=z,[f,O]=Object(x.useState)(Jr),[v,y]=Object(x.useState)(!1),[w,N]=Object(x.useState)(!1),[C,S]=Object(x.useState)(!1),[k,I]=Object(x.useState)(""),[D,P]=Object(x.useState)({}),[A,T]=Object(x.useState)([]),[F,B]=Object(x.useState)([]),[R,E]=Object(x.useState)({id:"",customerId:"",longName:"",shortName:"",color:"",Projects:[],Positions:[],Customer:{},Application:{},Activity:{}}),[U,W]=Object(x.useState)(Ue()),[L,M]=Object(x.useState)([]);null===(e=U.Positions)||void 0===e||e.forEach((e=>{Yr.set(e.shortName,[e.shortName,e.longName])}));const G=()=>{B([]),E({id:"",customerId:"",longName:"",shortName:"",color:"",Projects:[],Positions:[],Customer:{},Application:{},Activity:{}}),W(Ue()),O(Jr),n(0),y(!1),N(!1),S(!1),I(""),P({}),T([]),s({complete:!1,duplicates:!1}),r({processing:!1,complete:!1,count:0}),d({fetching:!1,processing:!1,complete:!1,count:0}),b({fetched:!1,officeSelected:!1,projectSelected:!1}),j({responseData:[{participant:{id:"",firstName:"",lastName:"",occurence:""},application:[{positionId:"",officeId:"",occurence:"",status:"",action:""}]}],fetched:!1,status:""})},V={buttonText:"Datei w\xe4hlen",filetypes:".csv, .xlsx, .xlsm, .xls",callback:e=>{e&&q(e)}},_={columns:D,rows:A,positions:(null===U||void 0===U?void 0:U.Positions)||[],editable:C,fileName:k,fileHeaders:L,next:()=>{n(i+1)},reset:()=>{G()},storeNewRows:e=>{e&&T(e)}},K={rows:p.responseData,positions:(null===U||void 0===U?void 0:U.Positions)||[]},q=e=>{N(!0);const t=()=>{const e={};return U.Positions&&U.Positions.forEach((t=>{e[t.shortName]=t.longName})),e};if(e){I(e.name);const a=new FileReader;a.readAsBinaryString(e),a.onload=async e=>{var a;const l=null===e||void 0===e||null===(a=e.target)||void 0===a?void 0:a.result,r=Object(Ln.a)(l,{type:"binary",raw:!0,cellDates:!0}),o=r.SheetNames[0],d=r.Sheets[o],u=Ln.b.sheet_to_json(d,{defval:"",header:"A",blankrows:!1,dateNF:"dd/mm/yyyy"}),b=JSON.parse(JSON.stringify(u));let j=!1,p=Object.values(b[0]);p=p.map((e=>e.trim()));const h={firstName:"Vorname",lastName:"Nachname",birthday:"Geboren",email:"E\u2011Mail",gender:"Geschlecht",...t(),validFrom:"Teststart",validUntil:"Testende"},g=Object.keys(h);let x=!0;if(p.length>g.length)return m("Die Datei enth\xe4lt zu viele Spalten/Elemente in der Kopfzeile",Je("error")),void G();p.includes("")&&(m("Die Datei enth\xe4lt zu wenige Spalten/Elemente in der Kopfzeile. Bitte weisen Sie die fehlenden Spalten zu.",Je("warning")),x=!1);for(const t of p){if(j)break;for(const e of Yr.values())if(e.find((e=>t.toLowerCase()===e.toLowerCase()))){j=!0;break}}let f=j;if(j){const e=[];for(const t of p){let a="";for(const[e,i]of Yr)if(i.find((e=>t.toLowerCase()===e.toLowerCase()))){a=e;break}""===a&&(f=!1,x&&(x=!1,m("Die Datei enth\xe4lt Spalten/Elemente in der Kopfzeile die nicht zugewiesen werden konnten. Bitte weisen Sie die fehlenden Spalten zu.",Je("warning")))),e.push(a)}M(e),b.shift()}if(Object.keys(h).length!==Object.keys(b[0]).length)return m("Die Datei ist nicht mit dem Projekt kompatibel.",Je("error")),void G();for(const t in b)b[t].misc={id:t,projectId:null===U||void 0===U?void 0:U.id,officeId:null===R||void 0===R?void 0:R.id,positions:null===U||void 0===U?void 0:U.Positions};(e=>{for(const t of e)for(const e in t){const a=t[e];a.length>1&&(t[e]=Qt(a))}})(b),y(!0),N(!1),P(h),T(b),n(i+1),s({...c,complete:f})}}};return Object(x.useEffect)((()=>{F.length||(async()=>{N(!0);const e=await h(a.id.toString());e&&(B(e),b({fetched:!0,officeSelected:u.officeSelected,projectSelected:u.projectSelected})),N(!1)})()}),[F]),Object(zt.jsxs)(Ki,{children:[Object(zt.jsx)(Vi,{heading:"TN-Import",children:Object(zt.jsx)(Dr.a,{})}),Object(zt.jsx)(Sr.a,{alternativeLabel:!0,activeStep:i,connector:Object(zt.jsx)(qr,{}),className:t.stepper,children:f.map((e=>Object(zt.jsx)(kr.a,{children:Object(zt.jsx)(Ir.a,{StepIconComponent:Zr,children:e})},e)))}),Object(zt.jsx)("div",{className:"".concat(t.instructionBox," ").concat(t.box),children:Object(zt.jsx)(Ve.a,{className:t.instructions,children:$r[i]})}),Object(zt.jsxs)("div",{className:t.workbench,children:[i>0&&Object(zt.jsxs)("div",{className:"".concat(t.infoBox," ").concat(t.box),children:[null!==U&&void 0!==U&&U.longName?Object(zt.jsxs)("div",{className:t.infoItem,children:[Object(zt.jsx)(Tl.a,{color:"secondary"}),Object(zt.jsx)(Ve.a,{children:U.longName})]}):Object(zt.jsx)(zt.Fragment,{}),(null===R||void 0===R?void 0:R.longName)&&i>0&&i<6&&Object(zt.jsxs)("div",{className:t.infoItem,children:[Object(zt.jsx)(Ea.a,{color:"secondary"}),Object(zt.jsx)(Ve.a,{children:R.longName})]}),k.length>0&&Object(zt.jsxs)("div",{className:t.infoItem,children:[Object(zt.jsx)(Fr.a,{color:"secondary"}),Object(zt.jsx)(Ve.a,{children:k})]})]}),i>=2&&Object(zt.jsx)("div",{className:"".concat(t.tableBox," ").concat(t.box),children:w?Object(zt.jsx)(Ft,{}):v&&!p.fetched?Object(zt.jsx)(Gr,{..._,editable:C}):i>=6&&p.fetched&&"ok"===p.status?Object(zt.jsx)(_r,{...K}):i>=6&&p.fetched&&"ok"!==p.status&&Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsxs)(Ve.a,{className:t.warning,children:["Das hat leider nicht geklappt! Bitte versuchen Sie es erneut.",Object(zt.jsx)("br",{}),"Wenn der Fehler weiterhin besteht, wenden Sie sich an unseren Support."]}),Object(zt.jsx)(zr.a,{color:"secondary",href:"https://support.ki-test.com",children:"support.ki-test.com"})]})}),0===i&&Object(zt.jsx)("div",{className:t.selectBox,children:u.fetched&&F.length>0&&Object(zt.jsx)(_t,{offices:F,onChange:e=>{var t,a,c,s,l;!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:R,t=arguments.length>1?arguments[1]:void 0;e&&(E(e),t&&W(t)),b({fetched:u.fetched,officeSelected:!!e,projectSelected:!!t})}(null===(t=e.office)||void 0===t?void 0:t.object,null===(a=e.project)||void 0===a?void 0:a.object),null!==(c=e.project)&&void 0!==c&&c.reset||null===(s=e.project)||void 0===s||null===(l=s.object)||void 0===l||!l.id||n(i+1)}})})]}),Object(zt.jsxs)("div",{className:t.buttonBox,children:[i>=1&&Object(zt.jsx)(_e.a,{className:t.resetBtn,onClick:G,disabled:w,size:"small",children:"Zur\xfccksetzen"}),1===i&&Object(zt.jsx)(Hn,{...V}),2===i&&Object(zt.jsx)(_e.a,{color:"secondary",variant:"contained",size:"small",onClick:()=>{c.complete?c.duplicates?m("Jeder Spaltenname kann nur einmal zugeordnet werden.",Je("error")):n(i+1):m("Bitte ordnen Sie jeder Spalte einen Namen zu.",Je("error"))},disabled:w,children:"weiter"}),3===i&&Object(zt.jsx)(_e.a,{color:"secondary",variant:"contained",size:"small",onClick:()=>{r({processing:!0,complete:l.complete,count:l.count})},disabled:w,children:"Erneut \xfcberpr\xfcfen"}),4===i&&Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)(_e.a,{color:"secondary",variant:"contained",size:"small",onClick:()=>{d({fetching:o.fetching,processing:!0,complete:o.complete,count:o.count})},disabled:w,children:"Erneut \xfcberpr\xfcfen"}),Object(zt.jsx)(_e.a,{color:"secondary",variant:"contained",size:"small",onClick:()=>n(5),disabled:w,children:"Weiter"})]}),5===i&&Object(zt.jsx)(_e.a,{color:"secondary",variant:"contained",size:"small",onClick:async()=>{N(!0);const e=await $e.importParticipants(A,k);e&&1e3===e.status_code?(n(6),j({responseData:e.data,fetched:!0,status:"ok"}),N(!1)):(j({...p,fetched:!0,status:"error"}),m("Fehler beim Importieren der Teilnehmer*innen",Je("error")),n(i+1),N(!1))},disabled:w,children:"Teilnehmer*innen importieren"})]})]})})),io=a(995),no=a(548),co=a(625),so=a.n(co);function lo(){return lo=Object.assign?Object.assign.bind():function(e){for(var t=1;t{this.drawerOpen=e},this.drawerOpen=!1}},bo=Object(C.a)(uo.prototype,"drawerOpen",[S.f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),uo);var po=Object(x.createContext)(new jo),mo=a(563),ho=a(624),go=a.n(ho),xo=a(362),fo=a.n(xo),Oo=a(1020),vo=a(1021),yo=a(1022);const wo=Object(s.a)((e=>Object(l.a)({root:{color:e.palette.primary.light,borderRadius:"50%",fontSize:"17px",cursor:"pointer",height:"50px",width:"50px",display:"flex",justifyContent:"center",alignItems:"center"}}))),No=(e,t,a)=>{let i=0;for(const n of e)i=e.charCodeAt(e.indexOf(n))+((i<<5)-i);return"hsl("+i%360+", "+t+"%, "+a+"%)"};var Co=e=>{let{user:t,toggle:a}=e;const i=wo();return Object(zt.jsx)(Lt.a,{className:i.root,style:{backgroundColor:null!==t&&void 0!==t&&t.firstName&&null!==t&&void 0!==t&&t.lastName?No((null===t||void 0===t?void 0:t.firstName)+t.lastName,30,50):"gray"},onClick:()=>a((e=>!e)),onMouseEnter:()=>a(!0),children:Object(zt.jsxs)(Ve.a,{variant:"h6",children:[t.firstName.substring(0,1),t.lastName.substring(0,1)]})})};const So=Object(s.a)((e=>Object(l.a)({root:{display:"flex",color:"rgba(0, 0, 0, 0.54)",flexDirection:"column",justifyContent:"center",alignItems:"center",height:"100%",cursor:"pointer"},chipBox:{display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"flex-start"},chipContainer:{display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-around"},chip:{width:"fit-content",margin:e.spacing(.5)},logo:{width:"1em !important",height:"1em !important"},userInfoBox:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:e.spacing(2),paddingBottom:e.spacing(2),paddingLeft:e.spacing(.5)},popover:{position:"absolute",width:"300px",padding:"10px 20px",background:e.palette.primary.light,borderTop:"1px solid lightgrey",right:"0",top:"64px",textAlign:"left",boxShadow:"-2px 2px 2px 0px rgb(0 0 0 / 30%)",display:"flex",flexDirection:"column",gap:e.spacing(1)},loggOut:{display:"flex",alignItems:"center",gap:e.spacing(1),cursor:"pointer"},toggle:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer"},prefs:{display:"flex",alignItems:"center",flexDirection:"column"},report:{cursor:"pointer"},gray:{color:e.palette.grey[700]},save:{margin:e.spacing(2)}})));var ko=Object(h.a)((()=>{var e;const t=So(),a=Object(v.f)(),{user:i,setUser:n,changeNavPrefs:c}=Object(x.useContext)(Ct),{setDrawerOpen:s}=Object(x.useContext)(po),{enqueueSnackbar:l}=Object(g.b)(),[r,o]=Object(x.useState)(!1),[d,u]=Object(x.useState)(!1),[j,p]=Object(x.useState)(i.navPref);return Object(zt.jsxs)(Lt.a,{children:[Object(zt.jsx)(Co,{user:i,toggle:o}),r&&Object(zt.jsxs)(Lt.a,{className:t.popover,onMouseLeave:()=>o(!1),children:[Object(zt.jsxs)(Lt.a,{className:t.userInfoBox,children:[Object(zt.jsxs)(Lt.a,{children:[Object(zt.jsxs)(Ve.a,{variant:"h5",children:[i.firstName," ",i.lastName]}),Object(zt.jsx)(Ve.a,{color:"secondary",children:i.email})]}),Object(zt.jsx)(Ya.a,{title:"Bug melden",children:Object(zt.jsx)(pr.a,{className:t.report,color:"disabled",onClick:()=>{window.open("mailto:kundensupport@ki-test.com?subject=".concat("Fehlerhafte Funktion: KI.PORTAL","&body=").concat("Bitte beschreiben Sie das Problem:"))}})})]}),Object(zt.jsxs)(Lt.a,{className:t.chipContainer,children:[Object(zt.jsx)(Lt.a,{className:t.chipBox,children:i.Customers&&i.Customers.map((e=>Object(zt.jsx)(Ba.a,{label:e.shortName,className:t.chip,color:"secondary",size:"small"},e.id)))}),Object(zt.jsx)(Lt.a,{className:t.chipBox,children:null===(e=i.Offices)||void 0===e?void 0:e.map((e=>Object(zt.jsx)(Ba.a,{className:t.chip,label:e.shortName,size:"small",variant:"outlined"},e.id)))})]}),Object(zt.jsxs)(Lt.a,{className:t.loggOut,onClick:()=>{localStorage.removeItem("jwtToken"),delete b.a.defaults.headers.common.Authorization,n({firstName:"",lastName:"",email:"",id:"0",roleId:0,Customers:[],Offices:[],showResults:!1,reports:!1,revaluation:!1,navPref:"flexible"},!1),a.push("/login"),localStorage.clear(),l("Logout Erfolgreich.",Je("success"))},children:[Object(zt.jsx)(Oo.a,{className:t.gray}),Object(zt.jsx)(Ve.a,{children:"Ausloggen"})]}),Object(zt.jsx)(Me.a,{}),Object(zt.jsxs)(Lt.a,{className:t.toggle,onClick:()=>u(!d),children:[Object(zt.jsx)(Ve.a,{children:"Navigationspr\xe4ferenzen"}),d?Object(zt.jsx)(vo.a,{className:t.gray}):Object(zt.jsx)(yo.a,{className:t.gray})]}),d&&Object(zt.jsxs)(Lt.a,{className:t.prefs,children:[Object(zt.jsx)(go.a,{component:"fieldset",children:Object(zt.jsxs)(mo.a,{"aria-label":"navPrefs",name:"navPrefs",onChange:e=>{p(e.target.value)},value:j,children:[Object(zt.jsx)(fo.a,{value:"unfolded",control:Object(zt.jsx)(Ur.a,{}),label:"immer ausgeklappt"}),Object(zt.jsx)(fo.a,{value:"folded",control:Object(zt.jsx)(Ur.a,{}),label:"immer eingeklappt"}),Object(zt.jsx)(fo.a,{value:"flexible",control:Object(zt.jsx)(Ur.a,{}),label:"je nach Bildschirmgr\xf6\xdfe"})]})}),Object(zt.jsx)(_e.a,{color:"secondary",variant:"contained",onClick:()=>{const e=window.innerWidth;c(j),u(!1),o(!1),"folded"===j?s(!1):"unfolded"===j?s(!0):"flexible"===j&&s(e>=1480)},className:t.save,children:"Speichern"})]})]})]})}));const Io=Object(s.a)((e=>Object(l.a)({menuButton:{marginRight:"25px",cursor:"pointer"},appBar:{zIndex:1300,boxShadow:e.shadows[2]},logoWrapper:{display:"flex",alignItems:"center"},logo:{width:"160px",height:"auto"},userInfo:{display:"flex",alignItems:"center",justifyConten:"space-around",gap:e.spacing(5)},toolbar:{display:"flex",justifyContent:"space-between"},leftHeader:{display:"flex",alignItems:"center"}})));var zo=Object(h.a)((()=>{const e=Io(),{setDrawerOpen:t,drawerOpen:a}=Object(x.useContext)(po),{loggedIn:i}=Object(x.useContext)(Ct);return Object(zt.jsx)(io.a,{className:e.appBar,position:"fixed",color:"inherit",children:Object(zt.jsxs)(no.a,{className:e.toolbar,children:[Object(zt.jsxs)("div",{className:e.leftHeader,children:[i&&Object(zt.jsx)(so.a,{className:e.menuButton,onClick:()=>{t(!a)}}),Object(zt.jsx)(Lt.a,{className:e.logoWrapper,children:Object(zt.jsx)(c.b,{to:i?"/participants":"/login","data-cy":"logo",children:Object(zt.jsx)(oo,{className:e.logo})})})]}),i&&Object(zt.jsx)(Lt.a,{className:e.userInfo,children:Object(zt.jsx)(ko,{})})]})})})),Do=a(40),Po=a(107),Ao=a(1026),To=a(1027),Fo=a(1023),Bo=a(1024),Ro=a(1025);const Eo=Object(s.a)((e=>Object(l.a)({link:{color:e.palette.info.main},selected:{color:e.palette.secondary.main,"& svg":{color:e.palette.secondary.main}}})));var Uo=Object(h.a)((e=>{let{icon:t,label:a,to:i}=e;const n=Eo();return Object(zt.jsxs)(lc.a,{component:e=>Object(zt.jsx)(c.c,{to:i,activeClassName:"".concat(n.link," ").concat(n.selected),...e}),children:[Object(zt.jsx)(Ya.a,{title:a,children:Object(zt.jsx)(rc.a,{children:Object(zt.jsx)(t,{})})}),Object(zt.jsx)(oc.a,{primary:a})]})}));var Wo=Object(h.a)((()=>{const{userRole:e}=Object(x.useContext)(Ct);return Object(zt.jsx)(sc.a,{children:e<4?Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)(Uo,{icon:()=>Object(zt.jsx)(Fo.a,{}),label:"Teilnehmer*innen",to:"/participants"}),e<3&&Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)(Uo,{icon:()=>Object(zt.jsx)(Bn.a,{}),label:"Termine",to:"/events"}),Object(zt.jsx)(Uo,{icon:()=>Object(zt.jsx)(Dr.a,{}),label:"TN-Import",to:"/participantImport"}),Object(zt.jsx)(Uo,{icon:()=>Object(zt.jsx)(sn.a,{}),label:"Kunden",to:"/customer"}),Object(zt.jsx)(Uo,{icon:()=>Object(zt.jsx)(Bo.a,{}),label:"Nutzer",to:"/users"}),Object(zt.jsx)(Uo,{icon:()=>Object(zt.jsx)(ar.a,{}),label:"Umfragen",to:"/survey"}),Object(zt.jsx)(Uo,{icon:()=>Object(zt.jsx)(w.a,{}),label:"Kompetenzen",to:"/competency"}),Object(zt.jsx)(Uo,{icon:()=>Object(zt.jsx)(Zi.a,{}),label:"Konverter",to:"/converter"}),Object(zt.jsx)(Uo,{icon:()=>Object(zt.jsx)(ec.a,{}),label:"Aufgabengruppen",to:"/rvtypes"}),Object(zt.jsx)(Uo,{icon:()=>Object(zt.jsx)(Ro.a,{}),label:"Normen",to:"/norm"})]})]}):Object(zt.jsx)(Uo,{icon:()=>Object(zt.jsx)(Bn.a,{}),label:"Termine",to:"/events"})})}));const Lo=Object(s.a)((e=>Object(l.a)({drawer:{width:240,flexShrink:0,whiteSpace:"nowrap"},drawerOpen:{width:240,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen})},drawerClose:{transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:"hidden",width:e.spacing(7),[e.breakpoints.up("sm")]:{width:e.spacing(9)}},toolbar:{display:"flex",alignItems:"center",justifyContent:"flex-end",padding:"7px 0"},"@global":{"@media (min-width: 768px)":{".makeStyles-drawerClose-43":{width:"78px"}},".MuiListItem-gutters":{paddingLeft:"25px"}}})));var Mo=Object(h.a)((()=>{const e=Lo(),t=Object(Do.a)(),a=Object(x.useContext)(po),{drawerOpen:i,setDrawerOpen:n}=a;return Object(zt.jsx)("div",{children:Object(zt.jsxs)(Po.a,{variant:"permanent",className:Object(Br.default)(e.drawer,{[e.drawerOpen]:i,[e.drawerClose]:!i}),classes:{paper:Object(Br.default)({[e.drawerOpen]:i,[e.drawerClose]:!i})},children:[Object(zt.jsx)("div",{className:e.toolbar,children:Object(zt.jsx)(ei.a,{onClick:()=>n(!1),children:"rtl"===t.direction?Object(zt.jsx)(Ao.a,{}):Object(zt.jsx)(To.a,{})})}),Object(zt.jsx)(Me.a,{}),Object(zt.jsx)(Wo,{})]})})}));const Go=()=>{const e=Object(v.f)(),{isAdmin:t}=Object(x.useContext)(Ct),{getAllNorms:a}=D,[i,n]=Object(x.useState)([]);ni(a,(e=>{n(e.data||[])}));const c={pagingFilter:!0,pageSize:5,tableButtons:[{tooltip:"Norm Erstellen",icon:()=>Object(zt.jsx)(ql.a,{}),popup:pc,isFreeAction:!0,disabled:!t}],onRowClick:(t,a)=>{e.push("/norm/".concat(null===a||void 0===a?void 0:a.id))},columns:[{align:"left",title:"Name",type:"string",field:"longName"},{align:"left",title:"Abk\xfcrzung",type:"string",field:"shortName"},{align:"left",title:"Beschreibung",type:"string",field:"description"}],data:i};return Object(zt.jsxs)(Ki,{children:[Object(zt.jsx)(Vi,{heading:"Normen",children:Object(zt.jsx)(Ro.a,{})}),Object(zt.jsx)(Li,{dense:!0,...c})]})};var Vo=a(440),_o=a.n(Vo);const Ko=Object(s.a)((e=>Object(l.a)({formControl:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-start",margin:e.spacing(1),gap:e.spacing(4)},modal:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start",position:"absolute",top:"25%",left:"75%",transform:"translate(-50%, -50%)",width:"fit-content",backgroundColor:"white",padding:e.spacing(2),borderRadius:"5px"},btn:{color:e.palette.primary.light},btnBox:{width:"100%",display:"flex",justifyContent:"space-between"}})));var qo=Object(h.a)((e=>{let{participantId:t,open:a,close:i}=e;const n=Ko(),{user:c}=Object(x.useContext)(Ct),{enqueueSnackbar:s}=Object(g.b)(),[l,r]=Object(x.useState)([]),[o,d]=Object(x.useState)({}),[u,b]=Object(x.useState)(!1);return Object(x.useEffect)((()=>{var e;const t=[];null===c||void 0===c||null===(e=c.Offices)||void 0===e||e.forEach((e=>{var a;return null===e||void 0===e||null===(a=e.Projects)||void 0===a?void 0:a.forEach((e=>{t.map((e=>e.id)).includes(e.id)||t.push(e)}))})),r(t),1===t.length&&d(t[0])}),[c.Offices]),Object(zt.jsx)(Gn.a,{open:a,onClose:i,onBackdropClick:i,children:Object(zt.jsxs)(Lt.a,{className:n.modal,children:[Object(zt.jsx)(Ve.a,{variant:"h6",children:"Bitte W\xe4hlen Sie ein Projekt"}),Object(zt.jsxs)(Bt.a,{className:n.formControl,children:[Object(zt.jsx)(Mt.a,{getOptionLabel:e=>(null===e||void 0===e?void 0:e.longName)||"",id:"project-select",noOptionsText:"Keine Projekte verf\xfcgbar",onChange:(e,t)=>(e=>{e&&d(e)})(t),options:l,value:o,renderOption:e=>Object(zt.jsxs)(Ve.a,{children:[" ",e.longName]}),renderInput:e=>Object(zt.jsx)(Wt.a,{...e,label:"Projekt"})}),u?Object(zt.jsx)(Ft,{}):Object(zt.jsxs)(Lt.a,{className:n.btnBox,children:[Object(zt.jsx)(_e.a,{onClick:i,variant:"contained",color:"secondary",className:n.btn,children:"Abbrechen"}),Object(zt.jsx)(_e.a,{disabled:!o||u,onClick:async()=>{if(b(!0),!o.id)return;const e=await ns.exportParticipants(o.id,t?[t]:null,o.longName);let a="Es sind keine Ergebnisse verf\xfcgbar",i="warning";e&&(4e3===e?a="Keine Bewerbungen zum exportieren vorhanden":(a="Export erfolgreich",i="success")),s(a,Je(i)),b(!1)},variant:"contained",color:"secondary",className:n.btn,children:"Download"})]})]})]})})}));const Ho=Object(s.a)((e=>({errorChip:{backgroundColor:e.palette.error.main,color:"white"},warningChip:{backgroundColor:e.palette.warning.main,color:"white"},whiteChip:{backgroundColor:"white",color:"black"}})));var Zo=Object(h.a)((()=>{const e=Object(x.useContext)(ss),t=Object(v.f)(),a=Ho(),{fetchedParticipants:i,isfetchingData:n,getParticipants:c}=e;Object(x.useEffect)((()=>{c()}),[c]);const s={columnFilter:!0,searchFilter:!0,pagingFilter:!0,tableButtons:[{tooltip:"Teilnehmende exportieren",icon:"save_alt",popup:qo,isFreeAction:!0}],onRowClick:(e,a)=>{t.push("/participant/".concat(a.id))},columns:[{title:"Vorname",field:"firstName",width:"25%"},{title:"Nachname",field:"lastName",width:"25%"},{title:"E-Mail",field:"email",width:"40%",searchable:!0,render:e=>Object(zt.jsx)("span",{children:xl.noBreak(e.email)})},{title:"Geburtstag",field:"birthday",type:"string",customFilterAndSearch:(e,t)=>Qt(t.birthday).includes(e),render:e=>Object(zt.jsx)("span",{children:Qt(e.birthday)}),width:"10%"},{title:"Supportfall",field:"supportStatus",lookup:{minor:"Minor Support",major:"Major Support"},render:e=>e.supportStatus?Object(zt.jsx)(_o.a,{label:e.supportStatus,size:"small",className:"major"===e.supportStatus?a.errorChip:a.warningChip}):Object(zt.jsx)(_o.a,{label:"OK",size:"small",className:a.whiteChip})}],data:JSON.parse(JSON.stringify(i))};return Object(zt.jsxs)(Ki,{children:[Object(zt.jsx)(Vi,{heading:"Teilnehmer*innen",children:Object(zt.jsx)(Fo.a,{})}),n?Object(zt.jsx)(Ft,{}):Object(zt.jsx)(Li,{...s})]})}));const Jo=Object(s.a)((e=>({root:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center"},title:{textAlign:"center",boxSizing:"border-box"},content:{width:"400px",padding:e.spacing(2),display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:e.spacing(2)},button:{marginTop:"15px"}}))),$o=e=>{let{open:t,close:a}=e;const i=Jo(),{createRvType:n}=Hl,{enqueueSnackbar:c}=Object(g.b)(),s=Object(v.f)(),[l,r]=Object(x.useState)(),[o,d]=Object(x.useState)(),[u,b]=Object(x.useState)(),j=()=>(null===l||void 0===l?void 0:l.length)&&(null===o||void 0===o?void 0:o.length)&&(null===u||void 0===u?void 0:u.length);return Object(zt.jsxs)(We.a,{transitionDuration:100,className:i.root,open:t,onClose:()=>{a()},children:[Object(zt.jsx)(Le.a,{className:i.title,children:"Aufgabengruppe Erstellen"}),Object(zt.jsx)(Me.a,{}),Object(zt.jsxs)(Ge.a,{children:[Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,value:l,label:"Name",onChange:e=>{r(e.target.value)}}),Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,value:o,label:"Abk\xfcrzung",onChange:e=>{d(e.target.value)}}),Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,value:u,label:"Beschreibung",onChange:e=>{b(e.target.value)}}),Object(zt.jsx)(_e.a,{className:i.button,fullWidth:!0,size:"small",variant:"contained",color:"secondary",type:"submit",disabled:!j(),onClick:async()=>{var e;if(!j())return;const t=await n(l,o,u);var a;1e3===t.status_code&&null!==(e=t.data)&&void 0!==e&&e.id?(console.log(t),s.push("/rvtype/".concat(null===(a=t.data)||void 0===a?void 0:a.id))):c("Aufgabengruppe konnte nicht gespeichert werden",Je("error"))},children:"Speichern"})]})]})},Yo=()=>{const e=Object(v.f)(),{isAdmin:t}=Object(x.useContext)(Ct),{getAllRvTypes:a}=Hl,[i,n]=Object(x.useState)([]);ni((async()=>{const{data:e}=await a();return e||[]}),n);const c={pagingFilter:!0,searchFilter:!0,onRowClick:(t,a)=>{e.push("/rvtype/".concat(a.id))},tableButtons:[{tooltip:"Aufgabengruppe Erstellen",icon:()=>Object(zt.jsx)(ql.a,{}),popup:$o,isFreeAction:!0,disabled:!t}],columns:[{align:"left",title:"Name",type:"string",field:"longName"},{align:"left",title:"Beschreibung",type:"string",field:"description"}],data:i};return Object(zt.jsxs)(Ki,{children:[Object(zt.jsx)(Vi,{heading:"Aufgabengruppen",children:Object(zt.jsx)(ec.a,{})}),Object(zt.jsx)(Li,{dense:!0,...c})]})};var Xo=a(1028);const Qo=Object(s.a)((e=>({root:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center"},title:{textAlign:"center",boxSizing:"border-box"},content:{width:"400px",padding:e.spacing(2),display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:e.spacing(2)},button:{marginTop:"15px"},select:{width:"100%"},formControl:{width:"50%",minWidth:"200px",userSelect:"none"}}))),ed=e=>{let{open:t,close:a}=e;const i=Qo(),{createSurvey:n}=ha,{enqueueSnackbar:c}=Object(g.b)(),s=Object(v.f)(),[l,r]=Object(x.useState)(),[o,d]=Object(x.useState)(),[u,b]=Object(x.useState)(!1),[j,p]=Object(x.useState)();return Object(zt.jsxs)(We.a,{transitionDuration:100,className:i.root,open:t,onClose:()=>{a()},children:[Object(zt.jsx)(Le.a,{className:i.title,children:"Umfrage Erstellen"}),Object(zt.jsx)(Me.a,{}),Object(zt.jsx)(Ge.a,{children:Object(zt.jsxs)(Bt.a,{className:i.formControl,children:[Object(zt.jsx)(Rt.a,{id:"survey-type-select-label",children:"Typ"}),Object(zt.jsxs)(Et.a,{labelId:"survey-type-select-label",value:j||"",onChange:e=>{p(e.target.value)},className:i.select,children:[Object(zt.jsx)(Ut.a,{value:"OT",children:k.c.OT}),Object(zt.jsx)(Ut.a,{value:"PT",children:k.c.PT})]}),Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,value:o,label:"Beschreibung",onChange:e=>{d(e.target.value)}}),Object(zt.jsx)(Wt.a,{required:!0,fullWidth:!0,value:l,label:"survey-id",onChange:e=>{r(e.target.value)}}),Object(zt.jsx)(_e.a,{className:i.button,fullWidth:!0,size:"small",variant:"contained",color:"secondary",type:"submit",onClick:async()=>{if(!o||!l||!j)return;1e3===(await n(o,l,u,[],j)).status_code?s.go(0):c("Umfrage konnte nicht gespeichert werden",Je("error"))},disabled:!o||!o.length||!l||!rr(l)||!j,children:"Speichern"})]})})]})},td=Object(s.a)((e=>Object(l.a)({form:{width:"100%",maxWidth:"400px",marginTop:e.spacing(3)},submit:{margin:e.spacing(3,0,2)},btnBox:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center"},btn:{margin:"0.5rem"}})));var ad=Object(h.a)((()=>{td();const e=Object(v.f)(),{isAdmin:t}=Object(x.useContext)(Ct),{getAllSurveys:a}=ha,[i,n]=Object(x.useState)([]);ni((async()=>{const{data:e}=await a();return e}),n);const c={pagingFilter:!0,searchFilter:!0,tableButtons:[{tooltip:"Umfrage erstellen",icon:()=>Object(zt.jsx)(Xo.a,{}),isFreeAction:!0,popup:ed,disabled:!t},{tooltip:"Umfrage duplizieren",icon:()=>Object(zt.jsx)(Fe.a,{}),isFreeAction:!0,popup:Oa,data:i||[],disabled:!t}],onRowClick:(t,a)=>{e.push("/survey/".concat(a.id))},columns:[{align:"left",title:"Umfrage\xa0ID",type:"numeric",field:"sid"},{align:"left",field:"description",title:"Umfrage",type:"string"},{field:"type",title:"Umfragentyp",type:"string",render:e=>Object(zt.jsx)(zt.Fragment,{children:k.c[e.type||"OT"]})}],data:i||[]};return Object(zt.jsxs)(Ki,{children:[Object(zt.jsx)(Vi,{heading:"Umfragen",children:Object(zt.jsx)(ar.a,{})}),Object(zt.jsx)(Li,{dense:!0,...c})]})}));const id=Object(s.a)((e=>({addLink:{padding:e.spacing(2)},addCircle:{width:"50px",height:"50px",background:"#fff",cursor:"pointer",borderRadius:"50%"}}))),nd={maxWidth:"".concat(1e3/6,"px"),overflow:"hidden",textOverflow:"ellipsis",whitespace:"nowrap"};var cd=Object(h.a)((()=>{id();const{fetchedUsers:e,isfetchingData:t,getUsers:a}=Object(x.useContext)(Ct),{getCustomers:i,getAllOffices:n}=Object(x.useContext)(Pe),[c,s]=Object(x.useState)(!1),[l,r]=Object(x.useState)({id:"",firstName:"",lastName:"",email:"",roleId:0,userId:"",Customers:[],Offices:[],Role:{},phone:"",reports:!1,showResults:!1,revaluation:!1,navPref:"flexible"});Object(x.useEffect)((()=>{a(),i(),n()}),[a,i,n]);const o={addUserButton:!0,onRowClick:(e,t)=>(r(t),void s(!0)),dense:!0,searchFilter:!0,pagingFilter:!0,columns:[{title:"Vorname",field:"firstName"},{title:"Nachname",field:"lastName"},{title:"E-Mail",field:"email",cellStyle:nd,render:e=>Object(zt.jsx)("span",{children:xl.noBreak(null===e||void 0===e?void 0:e.email)})},{title:"Rolle",render:e=>{var t;return Object(zt.jsx)("span",{children:null===e||void 0===e||null===(t=e.Role)||void 0===t?void 0:t.longName})},customSort:(e,t)=>{var a,i;return rs.alphabetically(null===(a=e.Role)||void 0===a?void 0:a.longName,null===(i=t.Role)||void 0===i?void 0:i.longName)}}],data:JSON.parse(JSON.stringify(e))};return Object(zt.jsxs)(Ki,{children:[Object(zt.jsx)(Vi,{heading:"Nutzer",children:Object(zt.jsx)(Bo.a,{})}),!t&&Object(zt.jsx)(Li,{...o})||Object(zt.jsx)(Ft,{}),c&&Object(zt.jsx)(Ui,{open:c,close:()=>s(!1),user:l})]})})),sd=a(999),ld=a(626),rd=a.n(ld);const od=Object(s.a)((e=>({paper:{marginTop:e.spacing(8),display:"flex",flexDirection:"column",alignItems:"center"},avatar:{margin:e.spacing(1),backgroundColor:e.palette.secondary.main},form:{width:"100%",marginTop:e.spacing(1)},submit:{margin:e.spacing(3,0,2)}})));function dd(){const e=od(),{login:t}=Object(x.useContext)(Ct),{enqueueSnackbar:a}=Object(g.b)(),[i,n]=Object(x.useState)({email:"",password:""});return Object(zt.jsx)(sd.a,{component:"main",maxWidth:"xs",children:Object(zt.jsxs)("div",{className:e.paper,children:[Object(zt.jsx)(Mi.a,{className:e.avatar,children:Object(zt.jsx)(rd.a,{})}),Object(zt.jsx)(Ve.a,{component:"h1",variant:"h5",children:"Login"}),Object(zt.jsxs)("form",{className:e.form,onSubmit:async e=>{e.preventDefault();await t(i)?a("Login Erfolgreich.",Je("success")):a("Login Fehlgeschlagen. Ung\xfcltige Anmeldedaten.",Je("error"))},children:[Object(zt.jsx)(Wt.a,{variant:"outlined",margin:"normal",required:!0,fullWidth:!0,color:"secondary",id:"email",label:"E-Mail-Adresse",name:"email",autoComplete:"email",onChange:e=>{n({...i,email:e.target.value})}}),Object(zt.jsx)(Wt.a,{variant:"outlined",margin:"normal",required:!0,color:"secondary",fullWidth:!0,name:"password",label:"Passwort",type:"password",id:"password",onChange:e=>{n({...i,password:e.target.value})}}),Object(zt.jsx)(_e.a,{type:"submit",fullWidth:!0,variant:"contained",color:"secondary",className:e.submit,children:"Login"})]})]})})}var ud=a(1029);var bd={async getSurvey(e,t){const a=await b.a.request({url:Object(k.j)("/api/router/".concat(e,"/").concat(t),"/api/router/".concat(e,"/").concat(t)),method:"GET"});return await Promise.resolve(a.data)}};function jd(){const{getSurvey:e}=bd,[t,a]=Object(x.useState)(""),[i,n]=Object(x.useState)(""),[c,s]=Object(x.useState)(!1),[l,r]=Object(x.useState)(!1),[o,d]=Object(x.useState)(!1),[u,b]=Object(x.useState)(!1),[j,p]=Object(x.useState)([]),m={office:"Auftraggeber",position:"Zielposition",status:"Bewerbungsstatus",validity:"Teilnahmefrist"};return Object(x.useEffect)((()=>{(()=>{const e=new URLSearchParams(window.location.search),t=e.get("part"),i=e.get("proj");t?(window.sessionStorage.setItem("part",t),a(t)):s(!0),i?(window.sessionStorage.setItem("proj",i),n(i)):s(!0)})()}),[]),Object(x.useEffect)((()=>{t&&i&&!o&&(async()=>{const a=new URLSearchParams(window.location.search),n=await e(t,i),c=null===n||void 0===n?void 0:n.status_code,l=null===n||void 0===n?void 0:n.data;if(1e3===c)switch(null===l||void 0===l?void 0:l.progress){case"done":d(!0),p(null===l||void 0===l?void 0:l.applications);break;case"continue":const e=a.get("dev"),t="".concat(l.link).concat(e?"&dev=".concat(e):"");window.location.href=t;break;case"freeze":r(!0);break;case"abort":b(!0)}else s(!0)})()})),Object(zt.jsx)("div",{style:{width:"100%",height:"60vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",boxSizing:"border-box"},children:c?Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)(ud.a,{style:{fontSize:"6rem",margin:"2rem",color:"lightgrey"}}),Object(zt.jsx)(Ve.a,{children:"Hoppla! Wir konnten die aufgerufene Seite nicht finden."}),Object(zt.jsx)(Ve.a,{style:{textAlign:"center",maxWidth:"600px"},children:"Bitte \xfcberpr\xfcfen Sie den Link und versuchen es noch einmal. Sollten Sie diese Seite weiterhin sehen, kontaktieren Sie bitte unseren Support. Wir k\xfcmmern uns schnellstm\xf6glich um Ihr Anliegen."}),Object(zt.jsx)(_e.a,{style:{margin:"1rem"},variant:"outlined",color:"secondary",href:"https://support.ki-test.com/",children:"Zum Support"}),Object(zt.jsx)(Ve.a,{children:"Sie k\xf6nnen das Browser-Fenster nun schlie\xdfen."})]}):l?Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)(Ve.a,{style:{textAlign:"center",maxWidth:"600px"},children:"Sie haben angegeben ein technisches Problem im Rahmen des Online-Tests gehabt zu haben. Diese Anfrage befindet sich derzeit in Pr\xfcfung. Bitte haben Sie Verst\xe4ndnis, dass Sie den Test bis dahin nicht fortsetzen k\xf6nnen. Bei Fragen wenden Sie sich gerne an unser Support-Team."}),Object(zt.jsx)(_e.a,{style:{margin:"1rem"},variant:"outlined",color:"secondary",href:"https://support.ki-test.com/",children:"Zum Support"})]}):u?Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)(Ve.a,{style:{textAlign:"center",maxWidth:"600px"},children:"Wir haben Ihren Antrag auf Datenl\xf6schung erhalten."}),Object(zt.jsx)(Ve.a,{children:"Bitte beachten Sie, dass Sie f\xfcr einen R\xfcckzug Ihrer Bewerbung zus\xe4tzlich die einstellende Beh\xf6rde/Firma informieren m\xfcssen."}),Object(zt.jsx)(_e.a,{style:{margin:"1rem"},variant:"outlined",color:"secondary",href:"https://support.ki-test.com/",children:"Zum Support"})]}):o?Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)(Ve.a,{style:{textAlign:"center",maxWidth:"600px",margin:"3rem"},children:"Zur Zeit liegen keine weiteren Tests f\xfcr Sie vor. Nachfolgend finden Sie Ihre aktuellen Bewerbungen in der \xdcbersicht:"}),Object(zt.jsx)(Vn.a,{component:Ae.a,style:{maxWidth:"1000px"},children:Object(zt.jsxs)(la.a,{className:"table",children:[Object(zt.jsx)(Xa.a,{children:Object(zt.jsxs)(ra.a,{children:[Object(zt.jsx)(oa.a,{scope:"col",children:m.office}),Object(zt.jsx)(oa.a,{scope:"col",children:m.position}),Object(zt.jsx)(oa.a,{scope:"col",children:m.status}),Object(zt.jsx)(oa.a,{scope:"col",children:m.validity})]})}),Object(zt.jsx)(Qa.a,{children:j.map(((e,t)=>Object(zt.jsxs)("tr",{children:[Object(zt.jsx)(oa.a,{children:e.Office.longName}),Object(zt.jsx)(oa.a,{children:e.Position.longName}),Object(zt.jsx)(oa.a,{children:aa("application",e.status)}),Object(zt.jsx)(oa.a,{children:ea(e.validUntil)})]},t)))})]})})]}):Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)(Ft,{}),Object(zt.jsx)(Ve.a,{style:{textAlign:"center",maxWidth:"600px"},children:"Einen Augenblick bitte"})]})})}const pd=Object(s.a)((e=>Object(l.a)({root:{padding:e.spacing(12),fontFamily:'"Open Sans", "Cambria"'},"@media (max-width: 812px)":{root:{padding:e.spacing(2)}},"@global .App":{display:"flex"}})));var md=Object(h.a)((()=>{const e=Object(r.a)({breakpoints:{values:{xs:0,sm:768,md:800,lg:900,xl:1200}},palette:{type:"light",primary:{light:"#ffffff",main:"#404040",dark:"#000000"},secondary:{light:"#1998d3",main:"#008dcf",dark:"#015f8ad8"},info:{light:"#999999",main:"#666666",dark:"#323232"},warning:{light:"#f1cb80",main:"#e39802",dark:"#b57901"},success:{light:"#59a75c",main:"#309134",dark:"#1c551e"},error:{light:"#c43a49",main:"#b60a1c",dark:"#910816"}},typography:{fontFamily:"Open Sans"}},j.a),t=Object(v.f)(),{setUser:a,loggedIn:i,user:n,getUser:c,isAdminSupport:s,isCustomer:l}=Object(x.useContext)(Ct),u=Object(x.useContext)(po),{setDrawerOpen:p}=u,[h]=Object(x.useState)(["/","/login","/router"]),[f]=Object(x.useState)(localStorage.getItem("path")),[y]=Object(x.useState)(t.location.pathname),[w]=Object(x.useState)(window.innerWidth);Object(x.useEffect)((()=>{if(localStorage.jwtToken){const e=localStorage.jwtToken;e?b.a.defaults.headers.common.Authorization=e:delete b.a.defaults.headers.common.Authorization,c();const a=m()(e),i=Date.now()/1e3;a.exp{"folded"===n.navPref?p(!1):"unfolded"===n.navPref?p(!0):"flexible"===n.navPref&&p(w>=1480)}),[w,p,n.navPref]),Object(x.useEffect)((()=>{b.a.defaults.timeout=12e4}),[]),i&&f&&!h.includes(f)&&t.push(f);const N=pd();return Object(zt.jsx)(o.a,{theme:e,children:Object(zt.jsx)(g.a,{maxSnack:6,children:Object(zt.jsx)(O.ErrorBoundary,{FallbackComponent:mr,children:Object(zt.jsxs)("div",{id:"app",className:"App",children:[Object(zt.jsx)(v.b,{path:"/",render:e=>{let{location:t}=e;return["/router"].includes(t.pathname)?null:Object(zt.jsx)(zo,{})}}),i&&Object(zt.jsx)(zt.Fragment,{children:Object(zt.jsx)(v.b,{path:"/",component:Mo})}),Object(zt.jsxs)(d.a,{container:!0,justify:"center",className:N.root,children:[i&&Object(zt.jsxs)(zt.Fragment,{children:[s&&Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)(v.b,{exact:!0,path:"/participantImport",component:ao}),Object(zt.jsx)(v.b,{exact:!0,path:"/users",component:cd}),Object(zt.jsx)(v.b,{exact:!0,path:"/customer",component:gn}),Object(zt.jsx)(v.b,{exact:!0,path:"/customer/:id",component:Tn}),Object(zt.jsx)(v.b,{exact:!0,path:"/project/:id",component:Kl}),Object(zt.jsx)(v.b,{exact:!0,path:"/office/:id",component:Nc}),Object(zt.jsx)(v.b,{exact:!0,path:"/converter",component:cn}),Object(zt.jsx)(v.b,{exact:!0,path:"/survey",component:ad}),Object(zt.jsx)(v.b,{exact:!0,path:"/survey/:id",component:br}),Object(zt.jsx)(v.b,{exact:!0,path:"/competency",component:qi}),Object(zt.jsx)(v.b,{exact:!0,path:"/rvtypes",component:Yo}),Object(zt.jsx)(v.b,{exact:!0,path:"/rvtype/:id",component:er}),Object(zt.jsx)(v.b,{exact:!0,path:"/norm",component:Go}),Object(zt.jsx)(v.b,{exact:!0,path:"/norm/:id",component:vc})]}),(s||l)&&Object(zt.jsxs)(zt.Fragment,{children:[Object(zt.jsx)(v.b,{exact:!0,path:"/participants",component:Zo}),Object(zt.jsx)(v.b,{exact:!0,path:"/participant/:id",component:Pl}),Object(zt.jsx)(v.a,{exact:!0,from:"/",to:"/participants"})]}),Object(zt.jsx)(v.b,{exact:!0,path:"/events",component:wr}),Object(zt.jsx)(v.b,{exact:!0,path:"/event/:id",component:Qn})]}),Object(zt.jsx)(v.b,{exact:!0,path:"/router",component:jd}),Object(zt.jsx)(v.b,{exact:!0,path:"/login",component:dd})]})]})})})})}));a(954);Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));n.a.render(Object(zt.jsx)(c.a,{children:Object(zt.jsx)(md,{})}),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((e=>{e.unregister()})).catch((e=>{console.error(e.message)}))}},[[955,1,2]]]); //# sourceMappingURL=main.4c14c83d.chunk.js.map