PageSourceSearch

https://ds.datascientia.eu/community/7475.40377fc181a0981a.js

js datascientia.eu collected 2026-10-01 15:11:28 UTC 112,498 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunklorax=self.webpackChunklorax||[]).push([[7475],{41:(M,q,l)=>{l.d(q,{q:()=>p});var u=l(7206),I=l(4650);let p=(()=>{class f{constructor(){this.secretKey="F)J@NcRfUjXn2r5u8x/A?D*G-KaPdSgV",this.iv="o0RvXK25VgZzljPP"}encryptString(t){const h=u.AES.encrypt(t,this.secretKey,{iv:u.enc.Utf8.parse(this.iv)});return encodeURIComponent(h.toString())}decryptString(t){return u.AES.decrypt(decodeURIComponent(t),this.secretKey,{iv:u.enc.Utf8.parse(this.iv)}).toString(u.enc.Utf8)}}return f.\u0275fac=function(t){return new(t||f)},f.\u0275prov=I.Yz7({token:f,factory:f.\u0275fac,providedIn:"root"}),f})()},7475:(M,q,l)=>{l.r(q),l.d(q,{StudyModule:()=>qi});var u=l(6895),g=l(9132),I=l(5226),p=l.n(I),f=l(6170),A=l.n(f),t=l(4650),h=l(5680),y=l(600),V=l(41),m=l(9549),b=l(4144),w=l(7392),T=l(4859),U=l(3848),x=l(1299),k=l(9188),_=l(7331),C=l(3162);const R=["coordinator_feedback"];function Y(o,n){if(1&o&&(t.TgZ(0,"div",27),t._UZ(1,"app-breadcrumb",28),t.qZA()),2&o){const e=n.$implicit;t.xp6(1),t.Q6J("title",e.title)("items",e.items)("active_item",e.active)}}function O(o,n){1&o&&t._UZ(0,"mat-progress-bar",29)}function G(o,n){1&o&&(t.TgZ(0,"mat-icon",30),t._uU(1,"assignment"),t.qZA(),t._uU(2," Project Details "))}function K(o,n){if(1&o&&(t.TgZ(0,"div"),t._UZ(1,"img",31),t.qZA()),2&o){const e=t.oxw();
1t.xp6(1),t.Q6J("src","data:image/jpeg;base64,"+e.imageData,t.LSH)}}function H(o,n){if(1&o&&t._UZ(0,"img",31),2&o){const e=t.oxw(2);t.s9C("src",e.projectImage,t.LSH)}}function B(o,n){if(1&o&&(t.TgZ(0,"div",32),t.YNc(1,H,1,1,"img",33),t.TgZ(2,"div",34)(3,"h5",35)(4,"strong"),t._uU(5),t.qZA()()()()),2&o){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",!e.imageData),t.xp6(4),t.Oqu(e.studyTitle)}}function z(o,n){if(1&o&&t._UZ(0,"ckeditor",36),2&o){const e=t.oxw();t.Q6J("editor",e.Editor)("data",e.emptyValueFilter(e.studyPurpose))("disabled",!0)("config",e.configReadOnly)}}function $(o,n){if(1&o&&t._UZ(0,"ckeditor",36),2&o){const e=t.oxw();t.Q6J("editor",e.Editor)("data",e.emptyValueFilter(e.studyTasks))("disabled",!0)("config",e.configReadOnly)}}function W(o,n){if(1&o&&t._UZ(0,"ckeditor",36),2&o){const e=t.oxw();t.Q6J("editor",e.Editor)("data",e.emptyValueFilter(e.studyDescription))("disabled",!0)("config",e.configReadOnly)}}function X(o,n){if(1&o&&t._UZ(0,"ckeditor",36),2&o){const e=t.oxw();t.Q6J("editor",e.Editor)("data",e.emptyValueFilter(e.studyEligibility))("disabled",!0)("config",e.configReadOnly)}}function tt(o,n){if(1&o&&t._UZ(0,"ckeditor",36),2&o){const e=t.oxw();t.Q6J("editor",e.Editor)("data",e.emptyValueFilter(e.participationFrequency))("disabled",!0)("config",e.configReadOnly)}}function et(o,n){if(1&o&&t._UZ(0,"ckeditor",36),2&o){const e=t.oxw();t.Q6J("editor",e.Editor)("data",e.emptyValueFilter(e.participationGuidelines))("disabled",!0)("config",e.configReadOnly)}}function it(o,n){if(1&o&&(t.TgZ(0,"div"),t._UZ(1,"br"),t.TgZ(2,"h4"),t._uU(3,"Experiment Configuration Files"),t.qZA(),t.TgZ(4,"a",37),t._UZ(5,"i",38),t._uU(6," Download Config File here "),t.qZA()()),2&o){const e=t.oxw();
1t.xp6(4),t.Q6J("href",e.getDownloadUrl(),t.LSH)}}function ot(o,n){if(1&o&&(t.TgZ(0,"div",39)(1,"div",40),t._UZ(2,"i"),t.qZA(),t.TgZ(3,"div",41)(4,"a",42),t._uU(5),t.qZA()()()),2&o){const e=n.$implicit;t.xp6(2),t.Tol(e.iconClass),t.xp6(2),t.s9C("href",e.url,t.LSH),t.xp6(1),t.hij(" ",e.url,"")}}function at(o,n){if(1&o&&(t.TgZ(0,"mat-chip"),t._uU(1),t.qZA()),2&o){const e=n.$implicit;t.xp6(1),t.hij(" ",e," ")}}function rt(o,n){if(1&o&&(t.TgZ(0,"div",22)(1,"strong"),t._uU(2,"Selected Participants"),t.qZA(),t._UZ(3,"br"),t.TgZ(4,"mat-chip-list"),t.YNc(5,at,2,1,"mat-chip",43),t.qZA()()),2&o){const e=t.oxw();t.xp6(5),t.Q6J("ngForOf",e.studyParticipantsArray)}}function nt(o,n){if(1&o&&(t.TgZ(0,"div",44),t._UZ(1,"hr"),t.TgZ(2,"div",45)(3,"h4")(4,"strong"),t._uU(5,"Coordinator's Feedback:"),t.qZA()()(),t.TgZ(6,"div",46),t._uU(7),t.qZA()()),2&o){const e=t.oxw();t.xp6(7),t.hij(" ",e.studyCoordinatorFeedback," ")}}function st(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"div",47),t._UZ(1,"hr"),t.TgZ(2,"button",48),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.editStudy())}),t._uU(3," Edit Project "),t.qZA()()}}function dt(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"div",47),t._UZ(1,"br")(2,"hr"),t.TgZ(3,"div",49)(4,"h3")(5,"strong"),t._uU(6,"Review the Project"),t.qZA()()(),t.TgZ(7,"div",50)(8,"div",51)(9,"mat-form-field",52)(10,"mat-label"),t._uU(11,"add any additional comments if study does not meet approval criteria"),t.qZA(),t._UZ(12,"textarea",53,54),t.qZA()()(),t.TgZ(14,"button",48),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.approveRejectStudy("approved"))}),t._uU(15," Approve"),t.qZA(),t.TgZ(16,"button",55),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.approveRejectStudy("rejected"))}),t._uU(17," Reject"),t.qZA()()}}function lt(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"div",47)(1,"button",48),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.acceptRejectStudyInvite("accepted"))}),t._uU(2," Accept"),t.qZA(),t.TgZ(3,"button",55),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.acceptRejectStudyInvite("rejected"))}),t._uU(4," Reject"),t.qZA()()}}function ct(o,n){1&o&&(t.TgZ(0,"mat-icon",30),t._uU(1,"group"),t.qZA(),t._uU(2," Participants "))}function pt(o,n){1&o&&t._UZ(0,"col",66)}function ut(o,n){1&o&&t._UZ(0,"col",67)}function mt(o,n){1&o&&(t.TgZ(0,"th"),t._uU(1,"Name"),t.qZA())}function gt(o,n){1&o&&(t.TgZ(0,"th"),t._uU(1,"Email"),t.qZA())}function ht(o,n){if(1&o&&(t.TgZ(0,"td"),t._uU(1),t.qZA()),2&o){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",e.member_name,"")}}function _t(o,n){if(1&o&&(t.TgZ(0,"td"),t._uU(1),t.qZA()),2&o){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",e.member_email,"")}}function ft(o,n){if(1&o&&(t.TgZ(0,"tr")(1,"td",68),t._uU(2),t.qZA(),t.YNc(3,ht,2,1,"td",12),t.YNc(4,_t,2,1,"td",12),t.TgZ(5,"td"),t._uU(6),t.qZA()()),2&o){const e=n.$implicit,i=t.oxw(2);t.xp6(2),t.hij(" ",e.member_ds_id," "),t.xp6(1),t.Q6J("ngIf","study_coordinator"==i.userRole),t.xp6(1),t.Q6J("ngIf","study_coordinator"==i.userRole),t.xp6(2),t.Oqu(e.invitation_status)}}function yt(o,n){1&o&&(t.TgZ(0,"div",56)(1,"p"),t._uU(2,"No data available."),t.qZA()())}function vt(o,n){if(1&o&&(t.TgZ(0,"div"),t.YNc(1,yt,3,0,"div",69),t.qZA()),2&o){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",e.studyParticipantsDetails.length<=0)}}function Zt(o,n){if(1&o&&(t.TgZ(0,"mat-tab"),t.YNc(1,ct,3,0,"ng-template",8),t.TgZ(2,"div",5)(3,"div",6)(4,"div",16)(5,"div",10)(6,"div",5)(7,"p",56)(8,"Strong"),t._uU(9,"- ( Project Participant Requirements ) - "),t.qZA()()(),t.TgZ(10,"div",57),t._uU(11," Required Sample Size "),t.qZA(),t.TgZ(12,"div",58),t._uU(13),t.qZA(),t.TgZ(14,"div",57),t._uU(15," Gender(s) "),t.qZA(),t.TgZ(16,"div",58),t._uU(17),t.qZA(),t.TgZ(18,"div",57),t._uU(19," Nationality "),t.qZA(),t.TgZ(20,"div",58),t._uU(21),t.qZA(),t.TgZ(22,"div",57),t._uU(23," Institution / University "),t.qZA(),t.TgZ(24,"div",58),t._uU(25),t.qZA(),t.TgZ(26,"div",57),t._uU(27," Department / Faculty "),t.qZA(),t.TgZ(28,"div",58),t._uU(29),t.qZA()(),t._UZ(30,"br"),t.TgZ(31,"p",59),t._uU(32,"*list of all participants invited to join the project. Invitations are sent to participants once project is approved by study coordinator."),t.qZA()(),t.TgZ(33,"div",60)(34,"div",61)(35,"table",62)(36,"colgroup"),t._UZ(37,"col",63),t.YNc(38,pt,1,0,"col",64),t.YNc(39,ut,1,0,"col",65),t._UZ(40,"col",66)(41,"col",66),t.qZA(),t.TgZ(42,"thead")(43,"tr")(44,"th"),t._uU(45,"Participant ID"),t.qZA(),t.YNc(46,mt,2,0,"th",12),t.YNc(47,gt,2,0,"th",12),t.TgZ(48,"th"),t._uU(49,"Invitation Status"),t.qZA()()(),t.TgZ(50,"tbody"),t.YNc(51,ft,7,4,"tr",43),t.qZA()(),t.YNc(52,vt,2,1,"div",12),t.qZA()()()()()),2&o){const e=t.oxw();
1t.xp6(13),t.hij(" ",e.sampleSize," "),t.xp6(4),t.hij(" ",e.genders," "),t.xp6(4),t.hij(" ",e.nationalities," "),t.xp6(4),t.hij(" ",e.institutions," "),t.xp6(4),t.hij(" ",e.faculties," "),t.xp6(9),t.Q6J("ngIf","study_coordinator"==e.userRole),t.xp6(1),t.Q6J("ngIf","study_coordinator"==e.userRole),t.xp6(7),t.Q6J("ngIf","study_coordinator"==e.userRole),t.xp6(1),t.Q6J("ngIf","study_coordinator"==e.userRole),t.xp6(4),t.Q6J("ngForOf",e.studyParticipantsDetails),t.xp6(1),t.Q6J("ngIf",e.studyParticipantsDetails)}}const bt=function(o,n){return{"custom-green-badge":o,"custom-blue-badge":n}},Tt=function(o,n){return{"custom-green-badge":o,"custom-red-badge":n}};let Ct=(()=>{class o{constructor(e,i,a,r,s,c){this.route=e,this.localService=i,this.backendService=a,this.router=r,this.encryptDecrypt=s,this.document=c,this.Editor=A(),this.configReadOnly={readOnly:!0,toolbar:[]},this.breadscrums=[{title:"Details",items:["Project"],active:"Details"}],this.projectImage="assets/images/project-logo-default.png",this.detailsProgressbar=!1,this.allInstitutions=[],this.allFaculties=[],this.userRole="",this.showActionButtonsStudyCoordinator=!1,this.showStudyParticipantDetails=!1,this.member_ds_id="",this.studyInvitationAcceptStatus="",this.study_participents_id=-1,this.showActionButtonsParticipant=!1,this.studyTitle="",this.studyCoordinatorName="",this.studyCoordinatorId=-1,this.researcherName="",this.researcherDsId="",this.studyStatus="",this.incentive="",this.studyDescription="",this.studyCoordinatorFeedback="",this.studyPurpose="",this.studyTasks="",this.studyEligibility="",this.studyPrivacyLinks="",this.studyParticipants="",this.configFileExists=0,this.notInvitedFlag=!1,this.sampleSize="0",this.nationalities="",this.genders="",this.institutions="",this.faculties="",this.ProjectCategoriesList=[],this.route.params.subscribe(N=>this.studyDsId=N.id),this.userRole=this.localService.getUserRole()}getBaseUrl(){return this.document.location.origin}ngOnInit(){this.userRole==this.backendService.member||this.userRole==this.backendService.participant?this.get
1SingleStudyDetails().then(e=>this.getParticipationInvitationStatus().then(i=>{this.setActionButtonViewPermissions(),this.loadAllProjectCategories()})):(this.getSingleStudyDetails().then(e=>{this.setActionButtonViewPermissions(),this.loadAllProjectCategories()}),this.getProjectParticipantRequirements()),(this.userRole==this.backendService.researcher||this.userRole==this.backendService.scoordinator||this.userRole==this.backendService.fadmin||this.userRole==this.backendService.smanager)&&this.getStudyParticipantsDetails()}openInNewTab(e,i){let a=e.createUrlTree([i]),r=window.location.href.replace(e.url,"");window.open(r+a,"_blank")}loadInstitutions(){return new Promise((e,i)=>{this.backendService.getInstitutionsList().subscribe(a=>{this.allInstitutions=a.institutions,e()},a=>{console.log(a),e()})})}getInstitutionNamesByIds(e){return new Promise((i,a)=>{this.loadInstitutions().then(()=>{const r=e.split(",").map(c=>c.trim()),s=this.allInstitutions.filter(c=>r.includes(c.id.toString())).map(c=>c.name);i(s.length>0?s.join(", "):"")}).catch(r=>{console.log("Error loading institutions:",r),a(r)})})}loadFaculties(){var e={institution_ids:""};return new Promise((i,a)=>{this.backendService.getFaculties(e).subscribe(r=>{this.allFaculties=r.data,i()},r=>{this.allFaculties=[],i()})})}getFacultyNamesByIds(e){return new Promise((i,a)=>{this.loadFaculties().then(()=>{const r=e.split(",").map(c=>c.trim()),s=this.allFaculties.filter(c=>r.includes(c.faculty_id.toString())).map(c=>`${c.faculty_name} (${c.institution_name})`);i(s.length>0?s.join(", "):"not specified")}).catch(r=>{console.log("Error loading faculties:",r),a(r)})})}loadMemberPublicProfile(e,i){i.preventDefault();var a=this.encryptDecrypt.encryptString(e);this.openInNewTab(this.router,"public/profile/"+a)}setActionButtonViewPermissions(){this.userRole===this.backendService.scoordinator&&(this.showStudyParticipantDetails=!0),this.userRole===this.backendService.scoordinator&&"pending"===this.studyStatus&&(this.showActionButtonsStudyCoordinator=!0),this.userRole===this.backendService.participant&&"pending"==this.studyInvitationAcceptStatus&&(this.showActionButtonsParticipant=!0)}getParticipationInvitationStatus(){this.member_ds_id=this.localService.getJsonValue("member_ds_id");let e={member_ds_id:this.member_ds_id,study_ds_id:this.studyDsId};return new Promise((i,a)=>{this.backendService.getParticipantInvitationStatus(e).subscribe(r=>{if(r.found>0){let s=r.data;this.studyInvitationAcceptStatus=s[0].invitation_status,this.study_participents_id=s[0].study_participents_id,i()}else this.notInvitedFlag=!0,i(),this.router.navigate(["/authentication/page401"])},r=>{i(),console.log(r)})})}getProjectParticipantRequirements(){this.backendService.getProjectParticipantRequirements(this.studyDsId).subscribe(e=>{if(e.found>0){let r=e.data;this.genders=this.backendService.getGenderNames(r.genders_selected),this.sampleSize=r.sample_size,this.nationalities=this.backendService.getCountryNamesFromCodes(r.nationalities_selected),this.getInstitutionNamesByIds(r.universities_selected).then(s=>{this.institutions=s}),this.getFacultyNamesByIds(r.faculties_selected).then(s=>{this.faculties=s})}else this.sampleSize="not Specified"},e=>{this.sampleSize="not Specified"})}editStudy(){this.router.navigateByUrl("study/edit/"+this.studyDsId)}onNavigate(e){window.open(e,"_blank")}acceptRejectStudyInvite(e){this.backendService.acceptRejectStudyInvite({study_ds_id:this.studyDsId,member_ds_id:this.member_ds_id,invitation_status:e,study_participents_id:this.study_participents_id}).subscribe(a=>{p().fire({icon:"success",title:"Success!",text:"Request completed successfully."}),this.router.navigateByUrl("study-invites")},a=>{p().fire({icon:"error",title:"Sorry!",text:"Request could not be completed."})})}approveRejectStudy(e){var i;const a=this.coordinatorFeedbackTextarea.nativeElement.value;""!=a&&null!=a||"approved"==e?(i={study_id:this.studyId,study_title:this.studyTitle,study_url:this.getBaseUrl()+"/community/study/view/"+this.studyId,contacts:this.studyParticipants,researcher_ds_id:this.researcherDsId,study_status:e,coordinator_feedback:a},this.backendService.approveRejectStudy(i).subscribe(r=>{"approved"==e?this.backendService.sendParticipationInvitations({study_ds_id:this.studyDsId,member_emails:this.studyParticipants}).subscribe(c=>{p().fire({icon:"success",title:"Success!",text:"Request completed successfully."}),this.router.navigateByUrl("all-studies")},c=>{p().fire({icon:"error",title:"Sorry!",text:"Request could not be completed."})}):(p().fire({icon:"success",title:"Success!",text:"Request completed successfully."}),this.router.navigateByUrl("all-studies"))},r=>{})):p().fire({icon:"error",title:"Attention!",text:"Please provide reason(s) for rejection in the comment section. This would help our researchers understand why their project cannot be approved"})}getSingleStudyDetails(){return this.detailsProgressbar=!0,new Promise((e,i)=>{this.backendService.getSingleStudyDetails(this.studyDsId).subscribe(a=>{if(a.found>0){let r=a.data;this.studyTitle=r.title,this.studyId=r.study_id,this.studyCoordinatorName=r.study_coordinator_name,this.studyCoordinatorId=r.study_coordinator_id,this.researcherName=r.researcher_name,this.researcherDsId=r.researcher_id,this.studyStatus=r.study_status,this.incentive=r.studyIncentive,this.studyParticipantEnrollment=r.participant_enrollment,this.studyStartDate=new Date(r.start_date).toDateString(),this.studyEndDate=new Date(r.end_date).toDateString(),this.studyDescription=r.description,this.studyCoordinatorFeedback=r.coordinator_feedback,this.studyPurpose=r.purpose,this.studyTasks=r.tasks,this.studyEligibility=r.eligibility_criteria,this.studyPrivacyLinks=r.privacy_links,this.privacyLinksArray=null!=this.studyPrivacyLinks&&""!=this.studyPrivacyLinks?this.studyPrivacyLinks.split(","):[],""!=this.studyPrivacyLinks&&null!=this.studyPrivacyLinks&&(this.processedLinksArray=this.backendService.getIconAndLinks(this.privacyLinksArray)),this.categoryId=r.category,null!=r.keywords&&""!=r.keywords&&(this.keywords=r.keywords.replace(/,/g,", ")),this.studyDifficulty=this.backendService.getDifficultyLevelName(r.project_difficulty),this.studyNature=this.backendService.getProjectNatureName(r.project_nature),this.participationFrequency=r.participation_frequency,this.participationGuidelines=r.participation_guidelines,this.projectParticipantDemographics=r.participant_demographics.flatMap(s=>s.map(c=>" "+c.name)),this.studyParticipants=r.contacts,this.studyParticipantsArray=this.studyParticipants.split(","),this.formattedUpdateDate=new Date(r.updated_at).toDateString(),this.imageData=r.image,this.configFileExists=r.config_file_exists}this.detailsProgressbar=!1,e()},a=>{this.detailsProgressbar=!1,e(),console.log(a)})})}getStudyParticipantsDetails(){return new Promise((e,i)=>{this.backendService.getSingleStudyParticipants(this.studyDsId).subscribe(a=>
1{this.studyParticipantsDetails=a.data,e()},a=>{e(),console.log(a)})})}getDownloadUrl(){return this.backendService.api_link+`media/projects/configs/${this.studyDsId}_config.zip`}emptyValueFilter(e){return null==e||""==e||null==e?"not specified":e}loadAllProjectCategories(){return new Promise((e,i)=>{this.backendService.getProjectCategoriesList().subscribe(a=>{this.ProjectCategoriesList=a.projectCategories;let r=this.ProjectCategoriesList.find(s=>s.id===this.categoryId);this.studyCategory=r.name,e()},a=>{console.log(a),e()})})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(g.gz),t.Y36(h.C),t.Y36(y.v),t.Y36(g.F0),t.Y36(V.q),t.Y36(u.K0))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-view"]],viewQuery:function(e,i){if(1&e&&t.Gf(R,5),2&e){let a;t.iGM(a=t.CRH())&&(i.coordinatorFeedbackTextarea=a.first)}},decls:117,vars:40,consts:[[1,"content"],[1,"container-fluid"],["class","block-header",4,"ngFor","ngForOf"],["mode","indeterminate",4,"ngIf"],[1,"row","clearfix"],[1,"col-xs-12","col-sm-12","col-md-12","col-lg-12"],[1,"card"],[1,"body"],["mat-tab-label",""],["id","studyViewSection",1,"project-container"],[1,"row"],[1,"col-lg-4","col-md-12","col-sm-12","col-xs-12",2,"padding","30px","text-align","center"],[4,"ngIf"],["style","position: relative; display: inline-block;",4,"ngIf"],[1,"col-lg-8","col-md-12","col-sm-12","col-xs-12",2,"padding","30px"],[1,"project_widget"],[1,"header"],[1,"col-lg-4","col-md-4","col-sm-4","col-xs-12","proj-headings-bold"],[1,"col-lg-8","col-md-8","col-sm-8","col-xs-12"],[3,"ngClass"],[3,"editor","data","disabled","config",4,"ngIf"],[1,"col-md-12","col-12","b-r","proj-headings-bold"],[1,"col-md-12","col-12","b-r"],["class","font-icon","style","margin-bottom: 0px;",4,"ngFor","ngForOf"],["class","col-md-12 col-12 b-r",4,"ngIf"],["class","col-md-12 example-button-row",4,"ngIf"],["class","col-md-12 example-button-row align-right",4,"ngIf"],[1,"block-header"],[3,"title","items","active_item"],["mode","indeterminate"],[1,"example-tab-icon","msr-2"],["alt","Project Image",1,"img-fluid",2,"max-width","80%",3,"src"],[2,"position","relative","display","inline-block"],["style","max-width:80%","alt","Project Image","class","img-fluid",3,"src",4,"ngIf"],[2,"position","absolute","top","65%","left","50%","transform","translate(-50%, -50%)","max-width","85%","width","max-content"],[2,"background-color","white","color","#52b5ee","padding","10px"],[3,"editor","data","disabled","config"],["target","_blank","download","",3,"href"],["aria-hidden","true",1,"fas","fa-download"],[1,"font-icon",2,"margin-bottom","0px"],[1,"icon-preview"],[1,"icon-class","custom-wrapt"],["target","_blank",3,"href"],[4,"ngFor","ngForOf"],[1,"col-md-12","example-button-row"],[1,"col-md-12","col-12",2,"color","darkred"],["role","alert",1,"col-md-12","col-12","alert","alert-warning"],[1,"col-md-12","example-button-row","align-right"],["mat-stroked-button","","color","primary",3,"click"],[1,"header",2,"float","left"],[1,"col-lg-12","col-md-12","col-sm-12"],[1,"form-group"],["appearance","outline",1,"example-full-width"],["matInput",""],["coordinator_feedback",""],["mat-stroked-button","","color","warn",3,"click"],[2,"text-align","center"],[1,"col-xs-6","col-sm-2","col-md-2","col-lg-2","proj-headings-bold"],[1,"col-xs-6","col-sm-4","col-md-4","col-lg-4"],[2,"color","goldenrod"],[1,"tableBody"],[1,"table-responsive"],[1,"table","table-hover","dashboard-task-infos",2,"width","100%"],["span","1",2,"width","20%"],["span","1","style","width: 10%;",4,"ngIf"],["span","1","style","width: 15%;",4,"ngIf"],["span","1",2,"width","10%"],["span","1",2,"width","15%"],[2,"text-align","left"],["style","text-align: center;",4,"ngIf"]],template:function(e,i){1&e&&(t.TgZ(0,"section",0)(1,"div",1),t.YNc(2,Y,2,3,"div",2),t.YNc(3,O,1,0,"mat-progress-bar",3),t.TgZ(4,"div",4)(5,"div",5)(6,"div",6)(7,"div",7)(8,"mat-tab-group")(9,"mat-tab"),t.YNc(10,G,3,0,"ng-template",8),t.TgZ(11,"div",9)(12,"div",10)(13,"div",11),t.YNc(14,K,2,1,"div",12),t.YNc(15,B,6,2,"div",13),t._UZ(16,"br")(17,"br"),t.qZA(),t.TgZ(18,"div",14)(19,"div",15)(20,"div",16)(21,"h1")(22,"strong"),t._uU(23),t.qZA()()(),t.TgZ(24,"div",7)(25,"div",10)(26,"div",17),t._uU(27," Status "),t.qZA(),t.TgZ(28,"div",18)(29,"span",19),t._uU(30),t.qZA()(),t.TgZ(31,"div",17),t._uU(32," Participant Enrollment "),t.qZA(),t.TgZ(33,"div",18)(34,"span",19),t._uU(35),t.qZA()(),t.TgZ(36,"div",17),t._uU(37," Start date "),t.qZA(),t.TgZ(38,"div",18),t._uU(39),t.qZA(),t.TgZ(40,"div",17),t._uU(41," End date "),t.qZA(),t.TgZ(42,"div",18),t._uU(43),t.qZA(),t.TgZ(44,"div",17),t._uU(45," Incentive "),t.qZA(),t.TgZ(46,"div",18),t._uU(47),t.qZA(),t.TgZ(48,"div",17),t._uU(49," Goal "),t.qZA(),t.TgZ(50,"div",18),t.YNc(51,z,1,4,"ckeditor",20),t.qZA(),t.TgZ(52,"div",17),t._uU(53," Tasks "),t.qZA(),t.TgZ(54,"div",18),t.YNc(55,$,1,4,"ckeditor",20),t.qZA(),t.TgZ(56,"div",17),t._uU(57," Description "),t.qZA(),t.TgZ(58,"div",18),t.YNc(59,W,1,4,"ckeditor",20),t.qZA(),t.TgZ(60,"div",17),t._uU(61," Project category "),t.qZA(),t.TgZ(62,"div",18),t._uU(63),t.qZA(),t.TgZ(64,"div",17),t._uU(65," Activity nature "),t.qZA(),t.TgZ(66,"div",18),t._uU(67),t.qZA(),t.TgZ(68,"div",17),t._uU(69," Difficulty level "),t.qZA(),t.TgZ(70,"div",18),t._uU(71),t.qZA(),t.TgZ(72,"div",17),t._uU(73," Eligibility criteria "),t.qZA(),t.TgZ(74,"div",18),t.YNc(75,X,1,4,"ckeditor",20),t.qZA(),t.TgZ(76,"div",17),t._uU(77," Ideal participant groups "),t.qZA(),t.TgZ(78,"div",18),t._uU(79),t.qZA(),t.TgZ(80,"div",17),t._uU(81," Tags / keywords "),t.qZA(),t.TgZ(82,"div",18),t._uU(83),t.qZA(),t.TgZ(84,"div",17),t._uU(85," Frequency of participation "),t.qZA(),t.TgZ(86,"div",18),t.YNc(87,tt,1,4,"ckeditor",20),t.qZA(),t.TgZ(88,"div",17),t._uU(89," How to get started "),t.qZA(),t.TgZ(90,"div",18),t.YNc(91,et,1,4,"ckeditor",20),t.YNc(92,it,7,1,"div",12),t.qZA(),t.TgZ(93,"div",21),t._uU(94," Related links "),t.qZA(),t.TgZ(95,"div",22),t.YNc(96,ot,6,5,"div",23),t.qZA(),t._UZ(97,"hr"),t.TgZ(98,"div",17),t._uU(99," Study coordinator "),t.qZA(),t.TgZ(100,"div",18),t._uU(101),t.qZA(),t.TgZ(102,"div",17),t._uU(103," Researcher "),t.qZA(),t.TgZ(104,"div",18),t._uU(105),t.qZA(),t._UZ(106,"hr"),t.TgZ(107,"div",17),t._uU(108," Last updated "),t.qZA(),t.TgZ(109,"div",18),t._uU(110),t.qZA(),t.YNc(111,rt,6,1,"div",24),t.qZA()(),t.YNc(112,nt,8,1,"div",25),t.YNc(113,st,4,0,"div",26),t.YNc(114,dt,18,0,"div",26),t.YNc(115,lt,5,0,"div",26),t.qZA()()()()(),t.YNc(116,Zt,53,11,"mat-tab",12),t.qZA()()()()()()()),2&e&&(t.xp6(2),t.Q6J("ngForOf",i.breadscrums),t.xp6(1),t.Q6J("ngIf",i.detailsProgressbar),t.xp6(11),t.Q6J("ngIf",i.imageData),t.xp6(1),t.Q6J("ngIf",!i.imageData),t.xp6(8),t.Oqu(i.studyTitle),t.xp6(6),t.Q6J("ngClass",t.WLB(34,bt,"completed"===i.studyStatus,"inprogress"===i.studyStatus)),t.xp6(1),t.hij(" ",i.studyStatus,""),t.xp6(4),t.Q6J("ngClass",t.WLB(37,Tt,!0===i.studyParticipantEnrollment,!1===i.studyParticipantEnrollment)),t.xp6(1),t.hij(" ",i.studyParticipantEnrollment?" Open":" Closed",""),t.xp6(4),t.hij(" ",i.studyStartDate," "),t.xp6(4),t.hij(" ",i.studyEndDate," "),t.xp6(4),t.hij(" ",i.incentive," "),t.xp6(4),t.Q6J("ngIf",i.studyPurpose),t.xp6(4),t.Q6J("ngIf",i.studyTasks),t.xp6(4),t.Q6J("ngIf",i.studyDescription),t.xp6(4),t.hij(" ",i.studyCategory," "),t.xp6(4),t.hij(" ",i.emptyValueFilter(i.studyNature)," "),t.xp6(4),t.hij(" ",i.emptyValueFilter(i.studyDifficulty)," "),t.xp6(4),t.Q6J("ngIf",i.studyEligibility),t.xp6(4),t.hij(" ",i.emptyValueFilter(i.projectParticipantDemographics)," "),t.xp6(4),t.hij(" ",i.emptyValueFilter(i.keywords)," "),t.xp6(4),t.Q6J("ngIf",i.participationFrequency),t.xp6(4),t.Q6J("ngIf",i.participationGuidelines),t.xp6(1),t.Q6J("ngIf",i.configFileExists>0&&0==i.showActionButtonsParticipant&&0==i.notInvitedFlag),t.xp6(4),t.Q6J("ngForOf",i.processedLinksArray),t.xp6(5),t.hij(" ",i.studyCoordinatorName," "),t.xp6(4),t.hij(" ",i.researcherName," "),t.xp6(5),t.hij(" ",i.formattedUpdateDate," "),t.xp6(1),t.Q6J("ngIf",1==i.showStudyParticipantDetails),t.xp6(1),t.Q6J("ngIf","researcher"==i.userRole&&"rejected"==i.studyStatus),t.xp6(1),t.Q6J("ngIf","researcher"==i.userRole),t.xp6(1),t.Q6J("ngIf",1==i.showActionButtonsStudyCoordinator),t.xp6(1),t.Q6J("ngIf",1==i.showActionButtonsParticipant),t.xp6(1),t.Q6J("ngIf","researcher"==i.userRole||"study_coordinator"==i.userRole))},dependencies:[u.mk,u.sg,u.O5,m.KE,m.hX,b.Nt,w.Hw,T.lW,U.SP,U.uD,U.uX,x.L,k.u,_.qn,_.HS,C.pW],styles:[".proj-headings[_ngcontent-%COMP%]{color:#528980}.custom-wrapt[_ngcontent-%COMP%]{word-wrap:break-word;word-break:break-word;max-width:100%}","#studyViewSection .ck-rounded-corners{\n            border: none !important;\n        }\n\n      #studyViewSection .ck-reset_all{\n        display: none !important;\n    }\n\n      #studyViewSection .ck-editor__editable {\n        padding: 0px !important;\n    }\n\n      #studyViewSection .ck-editor__editable> p {\n        margin: 0px !important;\n    }"]}),o})();var D=l(5861),d=l(4006),J=l(4314),S=l(3238),v=l(9602),Z=l(4385),F=l(455),P=l(266),E=l(1208);const St=["fileInput"],At=["configFileInput"];function wt(o,n){if(1&o&&(t.TgZ(0,"div",87),t._UZ(1,"app-breadcrumb",88),t.qZA()),2&o){const e=n.$implicit;t.xp6(1),t.Q6J("title",e.title)("items",e.items)("active_item",e.active)}}function qt(o,n){1&o&&t._UZ(0,"mat-progress-bar",89)}function Ut(o,n){if(1&o&&(t.TgZ(0,"div",90),t._UZ(1,"img",91),t.qZA()),2&o){const e=t.oxw();
1t.xp6(1),t.Q6J("src","data:image/jpeg;base64,"+e.imageData,t.LSH)}}function xt(o,n){if(1&o&&(t.TgZ(0,"div",90),t._UZ(1,"img",91),t.qZA()),2&o){const e=t.oxw();t.xp6(1),t.s9C("src",e.projectImage,t.LSH)}}function kt(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"div",92)(1,"image-cropper",93),t.NdJ("imageCropped",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.onImageCropped(a))})("imageLoaded",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.onImageLoaded(a))})("cropperReady",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.onCropperReady())})("loadImageFailed",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.onLoadImageFailed())}),t.qZA()()}if(2&o){const e=t.oxw();t.xp6(1),t.Q6J("imageChangedEvent",e.imageChangedEvent)("maintainAspectRatio",!0)("aspectRatio",1)}}function It(o,n){1&o&&(t.TgZ(0,"mat-error"),t._uU(1," Project title is required "),t.qZA())}function Ft(o,n){1&o&&(t.TgZ(0,"mat-error"),t._uU(1," This field is required "),t.qZA())}function Pt(o,n){1&o&&(t.TgZ(0,"mat-error"),t._uU(1," This field is required "),t.qZA())}function Et(o,n){1&o&&(t.TgZ(0,"mat-error"),t._uU(1," This field is required "),t.qZA())}function Nt(o,n){1&o&&(t.TgZ(0,"mat-error"),t._uU(1," This field is required "),t.qZA())}function Dt(o,n){if(1&o&&(t.TgZ(0,"mat-option",94),t._uU(1),t.qZA()),2&o){const e=n.$implicit;t.Q6J("disabled",1!=e.is_active)("value",e.study_coordinator_ds_id),t.xp6(1),t.hij(" ",e.first_name+" "+e.last_name," ")}}function Jt(o,n){1&o&&(t.TgZ(0,"mat-error"),t._uU(1," This field is required "),t.qZA())}function jt(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"div",95)(1,"h4",96),t._uU(2,"Participants"),t.qZA(),t.TgZ(3,"button",97),t.NdJ("click",function(){const r=t.CHM(e).$implicit;return t.KtG(r.dismiss("Cross click"))}),t.TgZ(4,"span",98)(5,"i",99),t._uU(6,"close"),t.qZA()()()(),t.TgZ(7,"div",100),t._UZ(8,"div",24),t.qZA(),t.TgZ(9,"div",101)(10,"button",102),t.NdJ("click",function(){const r=t.CHM(e).$implicit;return t.KtG(r.close())}),t._uU(11,"Close"),t.qZA()()}}function Qt(o,n){1&o&&(t.TgZ(0,"div",103)(1,"span",49)(2,"i"),t._uU(3,"This field is required."),t.qZA()()())}function Lt(o,n){1&o&&(t.TgZ(0,"div",103)(1,"span",49)(2,"i"),t._uU(3,"This field is required."),t.qZA()()())}function Mt(o,n){1&o&&(t.TgZ(0,"div",103)(1,"span",49)(2,"i"),t._uU(3,"This field is required."),t.qZA()()())}function Vt(o,n){if(1&o&&(t.TgZ(0,"mat-option",104),t._uU(1),t.qZA()),2&o){const e=n.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij("",e.name," ")}}function Rt(o,n){if(1&o&&(t.TgZ(0,"mat-option",104),t._uU(1),t.qZA()),2&o){const e=n.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij("",e.name," ")}}function Yt(o,n){if(1&o&&(t.TgZ(0,"mat-option",104),t._uU(1),t.qZA()),2&o){const e=n.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij("",e.name," ")}}function Ot(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"mat-chip",105),t.NdJ("removed",function(){const r=t.CHM(e).$implicit,s=t.oxw();return t.KtG(s.removeKeyword(r))}),t._uU(1),t.TgZ(2,"mat-icon",106),t._uU(3,"cancel"),t.qZA()()}if(2&o){const e=n.$implicit;t.Q6J("removable",!0),t.xp6(1),t.hij(" ",e," ")}}function Gt(o,n){1&o&&(t.TgZ(0,"div",103)(1,"span",49)(2,"i"),t._uU(3,"This field is required."),t.qZA()()())}function Kt(o,n){1&o&&(t.TgZ(0,"div",103)(1,"span",49)(2,"i"),t._uU(3,"This field is required."),t.qZA()()())}function Ht(o,n){1&o&&(t.TgZ(0,"div",103)(1,"span",49)(2,"i"),t._uU(3,"This field is required."),t.qZA()()())}function Bt(o,n){if(1&o&&(t.TgZ(0,"mat-option",104),t._uU(1),t.qZA()),2&o){const e=n.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij("",e.name," ")}}function zt(o,n){1&o&&(t.TgZ(0,"mat-error"),t._uU(1," Invalid url pattren, correct example: "),t.TgZ(2,"i"),t._uU(3,"https://www.google.com"),t.qZA()())}function $t(o,n){1&o&&(t.TgZ(0,"mat-icon",106),t._uU(1,"cancel"),t.qZA())}function Wt(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"mat-chip",107),t.NdJ("removed",function(){const r=t.CHM(e).index,s=t.oxw();return t.KtG(s.removeLink(r))}),t._uU(1),t.YNc(2,$t,2,0,"mat-icon",108),t.qZA()}if(2&o){const e=n.$implicit,i=t.oxw();t.Q6J("selectable",!0)("removable",!0),t.xp6(1),t.hij(" ",e," "),t.xp6(1),t.Q6J("ngIf",!i.editStudyForm.get("multipleLinks").disabled)}}function Xt(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"button",109),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.clearFile())}),t._UZ(1,"i",110),t._uU(2," remove file "),t.qZA()}}function te(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"button",109),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.deleteConfigFile())}),t._UZ(1,"i",110),t._uU(2," delete file "),t.qZA()}}function ee(o,n){if(1&o&&(t.TgZ(0,"div",11),t._UZ(1,"br"),t.TgZ(2,"h4"),t._uU(3,"Experiment Configuration Files"),t.qZA(),t.TgZ(4,"a",111),t._UZ(5,"i",112),t._uU(6," Download Config File here "),t.qZA(),t.YNc(7,te,3,0,"button",82),t.qZA()),2&o){const e=t.oxw();t.Q6J("hidden",e.systemManagerView),t.xp6(4),t.Q6J("href",e.getDownloadUrl(
1),t.LSH),t.xp6(3),t.Q6J("ngIf",e.configFileExists>0)}}function ie(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"div",113)(1,"button",114),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.assignStudyCoordinator())}),t._uU(2,"Assign"),t.qZA()()}}let oe=(()=>{class o{constructor(e,i,a,r,s,c,N){this.route=e,this.fb=i,this.router=a,this.modalService=r,this.localService=s,this.backendService=c,this.renderer=N,this.breadscrums=[{title:"Edit",items:["Project"],active:"Edit"}],this.imageData="",this.configFileExists=0,this.Editor=A(),this.configReadOnly={readOnly:!0,toolbar:[]},this.config={toolbar:{items:["heading","|","bold","italic","link","bulletedList","numberedList","|","outdent","indent","|","blockQuote","insertTable","|","undo","redo"],shouldNotGroupWhenFull:!0},image:{toolbar:["imageTextAlternative"]},readOnly:!1,minHeight:"300"},this.editProgressbar=!1,this.hide=!0,this.systemManagerView=!1,this.study_coordinators_data=[],this.userRole="",this.researcherDsId="",this.participantGenderList=this.backendService.genderList,this.projectNature=this.backendService.projectNature,this.difficultyLevels=this.backendService.difficultyLevels,this.studyId=-1,this.studyTitle="",this.studyCoordinatorName="Coordinator 1",this.studyCoordinatorDsId="",this.researcherName="",this.incentive="",this.studyEcts="",this.studyStatus="",this.studyParticipantEnrollment=!0,this.studyStartDate=new d.p4(new Date),this.studyEndDate=new d.p4(new Date),this.studyDescription="",this.studyPurpose="",this.studyTasks="",this.studyEligibility="",this.studyCategory="",this.studyDifficulty="",this.studyNature="",this.studyKeywords="",this.participationFrequency="",this.participationGuidelines="",this.projectParticipantDemographics=[],this.multipleLinks=[],this.studyPrivacyLinks="",this.privacyLinksArray=this.studyPrivacyLinks.split(","),this.studyParticipants="",this.studyParticipantsArray=this.studyParticipants.split(","),this.disableEditStudyCoordinator=!0,this.disableEditStudyDetails=!1,this.projectImage="assets/images/project-logo-default.png",this.ProjectCategoriesList=[],this.ParticipantDemographicsList=[],this.keywords=[],this.imageChangedEvent="",this.croppedImage="",this.validImageUploaded=!1,this.route.params.subscribe(Ui=>this.studyDsId=Ui.id)}ngOnInit(){this.loadAllProjectCategories(),this.loadAllParticipantDemographics(),this.initForm(),this.userRole=this.localService.getUserRole(),this.setFormEditPermissions(),this.get
1SingleStudyDetails().then(e=>this.getStudyCoordinatorsList().then(i=>this.initForm())),this.userRole==this.backendService.researcher&&(this.researcherDsId=this.localService.getJsonValue("researcher_ds_id"))}getDownloadUrl(){return this.backendService.api_link+`media/projects/configs/${this.studyDsId}_config.zip`}onNavigate(e){window.open(e,"_blank")}initForm(){this.editStudyForm=this.fb.group({studyTitle:[{value:this.studyTitle,disabled:this.disableEditStudyDetails},[d.kI.required]],studyStatus:[this.studyStatus,[]],studyStartDate:[{value:this.studyStartDate,disabled:!1},[d.kI.required]],studyEndDate:[{value:this.studyEndDate,disabled:!1},[d.kI.required]],incentive:[{value:this.incentive,disabled:this.disableEditStudyDetails},[d.kI.required]],studyEcts:[{value:this.studyEcts,disabled:this.disableEditStudyDetails},[d.kI.required]],studyCoordinatorDsId:[{value:this.studyCoordinatorDsId,disabled:this.disableEditStudyCoordinator},[d.kI.required]],studyDescription:[{value:this.studyDescription,disabled:!1},[d.kI.required]],studyPurpose:[{value:this.studyPurpose,disabled:!1},[d.kI.required]],studyTasks:[{value:this.studyTasks,disabled:!1},[d.kI.required]],studyEligibility:[{value:this.studyEligibility,disabled:!1},[d.kI.required]],studyPrivacyLinks:[{value:this.studyPrivacyLinks,disabled:this.disableEditStudyDetails},[]],studyCategory:[{value:this.studyCategory,disabled:this.disableEditStudyDetails},[]],studyNature:[{value:this.studyNature,disabled:this.disableEditStudyDetails},[]],studyDifficulty:[{value:this.studyDifficulty,disabled:this.disableEditStudyDetails},[]],participationFrequency:[{value:this.participationFrequency,disabled:!1},[d.kI.required]],participationGuidelines:[{value:this.participationGuidelines,disabled:!1},[d.kI.required]],projectParticipantDemographics:[{value:this.projectParticipantDemographics,disabled:this.disableEditStudyDetails},[]],multipleLinks:this.fb.array(this.multipleLinks),newLink:["",[d.kI.pattern(/^(http|https):\/\/[^ "]+$/)]],participantEnrollment:[this.studyParticipantEnrollment,[d.kI.required]]})}updateValidation(e){const i=this.editStudyForm.get(e);i&&(i.markAsTouched(),i.updateValueAndValidity())}onSubmitEditStudyForm(){if(this.updateValidation("studyDescription"),this.updateValidation("studyTasks"),this.updateValidation("studyPurpose"),this.updateValidation("studyEligibility"),this.updateValidation("participationFrequency"),this.updateValidation("participationGuidelines"),""!=this.imageData||this.validImageUploaded){if(!this.validImageUploaded&&""!=this.imageData){const i=this.backendService.base64toBlob(this.imageData,"image/jpeg");this.croppedImage=this.backendService.blobToFile(i,"cropped_image.jpeg")}if(this.editStudyForm.valid&&null!=this.editStudyForm.value.studyStartDate.value&&null!=this.editStudyForm.value.studyEndDate.value){let i=this.editStudyForm.value;const a=new FormData;if(0==this.disableEditStudyDetails)a.append("study_id",this.studyId.toString()),a.append("study_ds_id",this.studyDsId.toString()),a.append("title",i.studyTitle),a.append("description",i.studyDescription),a.append("start_date",new Date(i.studyStartDate.value).toLocaleDateString("fr-CA")),a.append("end_date",new Date(i.studyEndDate.value).toLocaleDateString("fr-CA")),a.append("funds",i.incentive.toString()),a.append("contacts",this.studyParticipants),a.append("eligibility_criteria",i.studyEligibility),a.append("participation_frequency",i.participationFrequency),a.append("participation_guidelines",i.participationGuidelines),a.append("category",i.studyCategory),a.append("project_difficulty",i.studyDifficulty),a.append("project_nature",i.studyNature),a.append("keywords",this.keywords.toString()),a.append("participant_demographics",i.projectParticipantDemographics),a.append("purpose",i.studyPurpose),a.append("tasks",i.studyTasks),a.append("privacy_links",this.editStudyForm.get("multipleLinks").value.join(",")),a.append("credits",i.studyEcts),a.append("study_status",i.studyStatus),a.append("participant_enrollment",i.participantEnrollment),a.append("config_file",this.selectedConfigFile);else{a.append("study_id",this.studyId.toString()),a.append("study_ds_id",this.studyDsId.toString()),a.append("title",this.studyTitle.toString()),a.append("description",i.studyDescription),a.append("start_date",new Date(i.studyStartDate.value).toLocaleDateString("fr-CA")),a.append("end_date",new Date(i.studyEndDate.value).toLocaleDateString("fr-CA")),a.append("funds",this.incentive.toString()),a.append("contacts",this.studyParticipants),a.append("eligibility_criteria",i.studyEligibility),a.append("participation_frequency",i.participationFrequency),a.append("participation_guidelines",i.participationGuidelines),a.append("category",this.studyCategory),a.append("project_difficulty",this.studyDifficulty),a.append("project_nature",this.studyNature),a.append("keywords",this.keywords.toString()),a.append("participant_demographics",this.projectParticipantDemographics.toString()),a.append("purpose",i.studyPurpose),a.append("tasks",i.studyTasks);const r=this.editStudyForm.get("multipleLinks").value.join(",");a.append("privacy_links",""!=r&&null!=r?r:this.studyPrivacyLinks),a.append("credits",this.studyEcts),a.append("participant_enrollment",i.participantEnrollment),a.append("study_status",i.studyStatus)}a.append("image",this.croppedImage),this.backendService.updateStudy(a).subscribe(r=>{p().fire({icon:"success",title:"Success!",text:"Details updated successfully."})},r=>{})}else p().fire({icon:"error",title:"Attention",text:"Please fill all required fields."})}else p().fire({icon:"error",title:"Attention",text:"Please upload project image (jpg, jpeg), with size upto 512KB ."})}assignStudyCoordinator(){this.editProgressbar=!0,""!=this.editStudyForm.value.studyCoordinatorDsId?this.backendService.assignStudyCoordinator({study_id:this.studyId,study_coordinator_ds_id:this.editStudyForm.value.studyCoordinatorDsId}).subscribe(a=>{p().fire({icon:"success",title:"Success!",text:"Coordinator Assigned to the Project."}),this.editProgressbar=!1},a=>{this.editProgressbar=!1}):(p().fire({icon:"error",title:"Attention",text:"Please fill all fields."}),this.editProgressbar=!1)}openVerticallyCentered(e){this.modalService.open(e,{centered:!0})}getSingleStudyDetails(){return this.editProgressbar=!0,new Promise((e,i)=>{this.backendService.getSingleStudyDetails(this.studyDsId).subscribe(a=>{if(a.found>0){let r=a.data;this.studyTitle=r.title,this.studyId=r.study_id,this.studyCoordinatorName=r.study_coordinator_name,this.studyCoordinatorDsId=r.study_coordinator_ds_id,this.researcherName=r.researcher_name,this.researcherDsId=r.researcher_ds_id,this.studyStatus=r.study_status,this.studyParticipantEnrollment=r.participant_enrollment,("approved"==r.study_status||"completed"==r.study_status||"inprogress"==r.study_status)&&(this.disableEditStudyDetails=!0),this.incentive=r.funds,this.studyStartDate=new d.p4(new Date(r.start_date)),this.studyEndDate=new d.p4(new Date(r.end_date)),this.studyDescription=r.description,this.studyPurpose=r.purpose,this.studyTasks=r.tasks,this.studyEcts=r.credits,this.studyEligibility=r.eligibility_criteria,this.studyPrivacyLinks=r.privacy_links,this.privacyLinksArray=null!=this.studyPrivacyLinks&&""!=this.studyPrivacyLinks?this.studyPrivacyLinks.split(","):[],this.multipleLinks=this.privacyLinksArray,this.studyCategory=r.category,this.studyDifficulty=r.project_difficulty,this.studyNature=r.project_nature,this.participationFrequency=r.participation_frequency,this.participationGuidelines=r.participation_guidelines,this.projectParticipantDemographics=r.participant_demographics.flatMap(s=>s.map(c=>c.id)),this.studyKeywords=r.keywords,null!=r.keywords&&this.addKeywordsFromString(this.studyKeywords.toString()),this.studyParticipants=r.contacts,this.studyParticipantsArray=this.studyParticipants.split(","),this.imageData=r.image,this.configFileExists=r.config_file_exists,this.editProgressbar=!1,e()}this.editProgressbar=!1,e()},a=>{this.editProgressbar=!1,console.log(a),e()})})}setFormEditPermissions(){"system_manager"===this.userRole&&(this.disableEditStudyCoordinator=!1,this.systemManagerView=!0)}getStudyCoordinatorsList(){return this.editProgressbar=!0,new Promise((e,i)=>{this.backendService.getStudyCoordinatorsList().subscribe(a=>{a.found>0?(this.study_coordinators_data=a.data,this.editProgressbar=!1,e()):this.study_coordinators_data=[],this.editProgressbar=!1,e()},a=>{console.log(a),this.editProgressbar=!1,e()})})}loadAllProjectCategories(){return new Promise((e,i)=>{this.backendService.getProjectCategoriesList().subscribe(a=>{this.ProjectCategoriesList=a.projectCategories,e()},a=>{console.log(a),e()})})}loadAllParticipantDemographics(){return new Promise((e,i)=>{this.backendService.getParticipantDemographicsList().subscribe(a=>{this.ParticipantDemographicsList=a.ParticipantDemographics,e()},a=>{console.log(a),e()})})}addKeyword(e){const i=e.target,a=i.value.trim();("Enter"===e.key||","===e.key)&&a&&(a.split(",").map(s=>
1s.trim()).forEach(s=>{s&&!this.keywords.includes(s)&&this.keywords.push(s)}),i.value="")}handlePaste(e){var i=this;return(0,D.Z)(function*(){if(!e.clipboardData&&!window.clipboardData)return;const r=yield navigator.clipboard.readText();r&&(i.addKeywordsFromString(r),e.target.value="")})()}addKeywordsFromString(e){e.split(",").map(a=>a.trim()).forEach(a=>{a&&!this.keywords.includes(a)&&this.keywords.push(a)})}removeKeyword(e){const i=this.keywords.indexOf(e);-1!==i&&this.keywords.splice(i,1)}addLink(){event.preventDefault();const e=this.editStudyForm.get("newLink"),i=this.editStudyForm.get("multipleLinks");""!==e.value.trim()&&e.valid&&(i.push(this.fb.control(e.value,d.kI.pattern(/^(http|https):\/\/[^ "]+$/))),e.setValue(""))}removeLink(e){this.editStudyForm.get("multipleLinks").removeAt(e)}onFileSelected(e){this.selectedFile=e.target.files[0],this.imageChangedEvent=e}clearFile(){this.selectedConfigFile=null,this.configFileInput.nativeElement.value=""}onConfigFileSelected(e){const i=e.target.files[0],a=["zip"],r=i.name.split(".").pop()?.toLowerCase();if(r&&a.includes(r)&&i.size<=5242880)this.selectedConfigFile=i;else{let s;s=a.includes(r)?"File exceeds 5MB size limit.":"Invalid file extension. Please select a ZIP file.",p().fire({icon:"error",title:"Error",text:s}),e.target.value=""}}deleteConfigFile(){this.backendService.deleteConfigFile(this.studyDsId).subscribe(e=>{p().fire({icon:"success",title:"Success",text:"Config file deleted successfully."}),this.configFileExists=0},e=>{console.log(e)})}onImageCropped(e){this.croppedImage=this.validImageUploaded?this.base64ToFile(e.base64):""}base64ToFile(e){const i=atob(e.split(",")[1]),a=new ArrayBuffer(i.length),r=new 
1Uint8Array(a);for(let s=0;s<i.length;s++)r[s]=i.charCodeAt(s);return new File([a],"cropped_image.jpg",{type:"image/jpeg"})}onImageLoaded(e){var i="";if(this.selectedFile){const a=this.selectedFile.name.split(".").pop().toLowerCase();if("jpg"!==a&&"jpeg"!==a)return i="Invalid file extension. Please select a JPG or JPEG image.",p().fire({icon:"error",title:"Error",text:i}),void(this.validImageUploaded=!1);if(this.selectedFile.size>524288)return i="File size exceeds the limit of 512KB.",p().fire({icon:"error",title:"Error",text:i}),void(this.validImageUploaded=!1);this.validImageUploaded=!0}}onCropperReady(){}onLoadImageFailed(){p().fire({icon:"error",title:"Error",text:"Invalid file extension. Please select a JPG or JPEG image."}),this.validImageUploaded=!1}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(g.gz),t.Y36(d.QS),t.Y36(g.F0),t.Y36(J.FF),t.Y36(h.C),t.Y36(y.v),t.Y36(t.Qsj))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-edit"]],viewQuery:function(e,i){if(1&e&&(t.Gf(St,5),t.Gf(At,5)),2&e){let a;t.iGM(a=t.CRH())&&(i.fileInput=a.first),t.iGM(a=t.CRH())&&(i.configFileInput=a.first)}},decls:273,vars:91,consts:[[1,"content"],[1,"container-fluid"],["class","block-header",4,"ngFor","ngForOf"],["mode","indeterminate",4,"ngIf"],[1,"row","clearfix"],[1,"col-lg-12","col-md-12"],[1,"card"],[1,"header"],[1,"body"],[1,"register-form","m-4",3,"formGroup","ngSubmit"],[3,"hidden"],[1,"col-lg-6","col-md-6","col-sm-12",3,"hidden"],[1,"col-lg-6","col-md-6","col-sm-12","col-xs-12",3,"hidden"],["style","float:right;",4,"ngIf"],[1,"header",3,"hidden"],[1,"row","clearfix",2,"margin","1.5rem !important",3,"hidden"],[1,"col-lg-2","col-md-2","col-sm-12","col-xs-12",2,"overflow","hidden"],["type","file",3,"change"],["fileInput",""],[1,"col-lg-6","col-md-6","col-sm-12","col-xs-12",2,"overflow","hidden"],["class","cropper-container",4,"ngIf"],[1,"header","section-heading"],[1,"col-lg-6","col-md-6","col-sm-12"],[1,"col-lg-10","col-md-10","col-sm-12"],[1,"form-group"],["appearance","outline",1,"example-full-width"],["matInput","","formControlName","studyTitle","required",""],[4,"ngIf"],[1,"col-lg-10","col-md-10","col-sm-12",3,"hidden"],[1,"example-full-width"],["matInput","","required","",3,"matDatepicker","formControl"],["matSuffix","",3,"for"],["required",""],["startDatePicker",""],["matInput","","type","number","min","0","formControlName","incentive","required",""],["matSuffix",""],["formControlName","studyStatus"],["value","pending",3,"disabled"],["value","approved",3,"disabled"],["value","inprogress",3,"disabled"],["value","rejected",3,"disabled"],["value","completed",3,"disabled"],["endDatePicker",""],["matInput","","type","number","min","0","formControlName","studyEcts","required",""],[1,"header","section-heading",3,"hidden"],["formControlName","studyCoordinatorDsId","required",""],[3,"disabled","value",4,"ngFor","ngForOf"],["participantsListModel",""],[1,"col-lg-12","col-md-12","col-sm-12",3,"hidden"],[2,"color","red"],["formControlName","studyDescription",3,"editor","config"],["class","error",4,"ngIf"],["formControlName","studyPurpose",3,"editor","config"],["formControlName","studyTasks",3,"editor","config"],[1,"col-lg-4","col-md-4","col-sm-12",3,"hidden"],["formControlName","studyCategory"],[3,"value",4,"ngFor","ngForOf"],["formControlName","studyDifficulty"],["formControlName","studyNature"],[1,"col-lg-8","col-md-8","col-sm-12",3,"hidden"],[1,"form-group",2,"padding","10px 20px 10px 20px","border","1px solid lightgray","border-radius","5px"],["appearance","none",1,"example-full-width"],["matInput","","placeholder","Type keywords and press Enter",3,"paste","keyup"],["keywordsInput",""],["aria-label","Keywords"],["chipList",""],[3,"removable","removed",4,"ngFor","ngForOf"],["formControlName","studyEligibility",3,"editor","config"],["formControlName","participationFrequency",3,"editor","config"],["formControlName","participationGuidelines",3,"editor","config"],["formControlName","projectParticipantDemographics","multiple",""],["formControlName","participantEnrollment"],[1,"row","col-lg-6","col-md-6","col-sm-12",3,"hidden"],[1,"col-lg-8","col-md-8","col-sm-12"],["matInput","","formControlName","newLink"],[1,"col-lg-2","col-md-2","col-sm-12"],["mat-stroked-button","","color","primary",2,"margin-top","8px",3,"click"],["formArrayName","multipleLinks"],["class","chip-wrap","style","color: blue; background-color: white;",3,"selectable","removable","removed",4,"ngFor","ngForOf"],[1,"text-muted"],["matTooltip","Please note these configurations will be only visible to the participants who agree to join\n                                        the project. For files bigger than specified size limit, you can include external link(s) to your \n                                        project configuration(s) in the links repository above.","aria-hidden","true",1,"fas","fa-info-circle","fa-lg","text-muted"],["configFileInput",""],["mat-button","","color","warn","type","button",3,"click",4,"ngIf"],["class","col-lg-6 col-md-6 col-sm-12",3,"hidden",4,"ngIf"],[1,"col-md-12",3,"hidden"],["mat-raised-button","","color","primary"],["class","col-md-12",4,"ngIf"],[1,"block-header"],[3,"title","items","active_item"],["mode","indeterminate"],[2,"float","right"],["alt","Project Image",1,"img-fluid",2,"max-width","120px",3,"src"],[1,"cropper-container"],["format","jpeg",3,"imageChangedEvent","maintainAspectRatio","aspectRatio","imageCropped","imageLoaded","cropperReady","loadImageFailed"],[3,"disabled","value"],[1,"modal-header"],["id","modal-basic-title",1,"modal-title"],["type","button","aria-label","Close",1,"close",3,"click"],["aria-hidden","true"],[1,"material-icons"],[1,"modal-body"],[1,"modal-footer"],["mat-button","","type","button",3,"click"],[1,"error"],[3,"value"],[3,"removable","removed"],["matChipRemove",""],[1,"chip-wrap",2,"color","blue","background-color","white",3,"selectable","removable","removed"],["matChipRemove","",4,"ngIf"],["mat-button","","color","warn","type","button",3,"click"],["aria-hidden","true",1,"fas","fa-times"],["target","_blank","download","",3,"href"],["aria-hidden","true",1,"fas","fa-download"],[1,"col-md-12"],["mat-raised-button","","type","button","color","primary",3,"click"]],template:function(e,i){if(1&e&&(t.TgZ(0,"section",0)(1,"div",1),t.YNc(2,wt,2,3,"div",2),t.YNc(3,qt,1,0,"mat-progress-bar",3),t.TgZ(4,"div",4)(5,"div",5)(6,"div",6)(7,"div",7)(8,"h2"),t._uU(9),t.qZA(),t._UZ(10,"hr"),t.qZA(),t.TgZ(11,"div",8)(12,"form",9),t.NdJ("ngSubmit",function(){return i.onSubmitEditStudyForm()}),t.TgZ(13,"div",4)(14,"h3",10),t._uU(15,"Assign project"),t.qZA(),t.TgZ(16,"div",11)(17,"h3"),t._uU(18,"Update project"),t.qZA(),t.TgZ(19,"p"),t._uU(20," If this project was previously rejected by our study coordinators, it will once again go under review as soon as you submit updated details. "),t.qZA(),t.TgZ(21,"i"),t._uU(22,"An asterisk signifies mandatory fields that must be completed."),t.qZA(),t._UZ(23,"br"),t.qZA(),t.TgZ(24,"div",12),t.YNc(25,Ut,2,1,"div",13),t.YNc(26,xt,2,1,"div",13),t.qZA(),t.TgZ(27,"div",14)(28,"h2")(29,"strong"),t._uU(30,"Project Picture"),t.qZA()()(),t.TgZ(31,"div",15)(32,"div",16)(33,"input",17,18),t.NdJ("change",function(r){return i.onFileSelected(r)}),t.qZA()(),t.TgZ(35,"div",19),t.YNc(36,kt,2,3,"div",20),t.qZA(),t._UZ(37,"hr"),t.qZA(),t.TgZ(38,"div",21)(39,"span"),t._uU(40,"Project details"),t.qZA()(),t.TgZ(41,"div",22)(42,"div",23)(43,"div",24)(44,"mat-form-field",25)(45,"mat-label"),t._uU(46,"Project Title"),t.qZA(),t._UZ(47,"input",26),t.YNc(48,It,2,0,"mat-error",27),t.qZA()()(),t.TgZ(49,"div",28)(50,"div",24)(51,"mat-form-field",29)(52,"mat-label"),t._uU(53,"Start Date"),t.qZA(),t._UZ(54,"input",30)(55,"mat-datepicker-toggle",31)(56,"mat-datepicker",32,33),t.YNc(58,Ft,2,0,"mat-error",27),t.qZA()()(),t.TgZ(59,"div",28)(60,"div",24)(61,"mat-form-field",25)(62,"mat-label"),t._uU(63,"Incentive"),t.qZA(),t._UZ(64,"input",34),t.TgZ(65,"mat-icon",35),t._uU(66,"euro_symbol"),t.qZA(),t.YNc(67,Pt,2,0,"mat-error",27),t.qZA()()()(),t.TgZ(68,"div",11)(69,"div",23)(70,"div",24)(71,"mat-form-field",25)(72,"mat-label"),t._uU(73,"Status"),t.qZA(),t.TgZ(74,"mat-select",36)(75,"mat-option",37),t._uU(76,"Pending"),t.qZA(),t.TgZ(77,"mat-option",38),t._uU(78,"Approved"),t.qZA(),t.TgZ(79,"mat-option",39),t._uU(80,"In progress"),t.qZA(),t.TgZ(81,"mat-option",40),t._uU(82,"Rejected"),t.qZA(),t.TgZ(83,"mat-option",41),t._uU(84,"Completed"),t.qZA()()()()(),t.TgZ(85,"div",28)(86,"div",24)(87,"mat-form-field",29)(88,"mat-label"),t._uU(89,"End Date"),t.qZA(),t._UZ(90,"input",30)(91,"mat-datepicker-toggle",31)(92,"mat-datepicker",32,42),t.YNc(94,Et,2,0,"mat-error",27),t.qZA()()(),t.TgZ(95,"div",28)(96,"div",24)(97,"mat-form-field",25)(98,"mat-label"),t._uU(99,"ECTS"),t.qZA(),t._UZ(100,"input",43),t.TgZ(101,"mat-icon",35),t._uU(102,"school"),t.qZA(),t.YNc(103,Nt,2,0,"mat-error",27),t.qZA()()()(),t.TgZ(104,"div",44)(105,"span"),t._uU(106,"Community reach"),t.qZA()(),t.TgZ(107,"div",22)(108,"div",23)(109,"div",24)(110,"mat-form-field",25)(111,"mat-label"),t._uU(112,"Study Coordinator"),t.qZA(),t.TgZ(113,"mat-select",45),t.YNc(114,Dt,2,3,"mat-option",46),t.qZA(),t.TgZ(115,"mat-icon",35),t._uU(116,"face"),t.qZA(),t.YNc(117,Jt,2,0,"mat-error",27),t.qZA()()()(),t.YNc(118,jt,12,0,"ng-template",null,47,t.W1O),t.TgZ(120,"div",11)(121,"div",23)(122,"mat-label")(123,"strong"),t._uU(124,"Selected Participants"),t.qZA()(),t.TgZ(125,"div",24)(126,"p"),t._uU(127),t.qZA()()()(),t.TgZ(128,"div",44)(129,"span"),t._uU(130,"Let people know what it's about..."),t.qZA()(),t.TgZ(131,"div",48)(132,"div",24)(133,"mat-label")(134,"span",49),t._uU(135,"*"),t.qZA(),t._uU(136," description of your project goes here"),t.qZA(),t._UZ(137,"ckeditor",50),t.YNc(138,Qt,4,0,"div",51),t.qZA()(),t.TgZ(139,"div",48)(140,"div",24)(141,"mat-label")(142,"span",49),t._uU(143,"*"),t.qZA(),t._uU(144," purpose of the project"),t.qZA(),t._UZ(145,"ckeditor",52),t.YNc(146,Lt,4,0,"div",51),t.qZA()(),t.TgZ(147,"div",48)(148,"div",24)(149,"mat-label")(150,"span",49),t._uU(151,"*"),t.qZA(),t._uU(152," tasks to be completed by the participant"),t.qZA(),t._UZ(153,"ckeditor",53),t.YNc(154,Mt,4,0,"div",51),t.qZA()(),t.TgZ(155,"div",44)(156,"span"),t._uU(157,"Project categorization"),t.qZA()(),t.TgZ(158,"div",54)(159,"div",24)(160,"mat-form-field",25)(161,"mat-label"),t._uU(162,"Project Category"),t.qZA(),t.TgZ(163,"mat-select",55),t.YNc(164,Vt,2,2,"mat-option",56),t.qZA()()()(),t.TgZ(165,"div",54)(166,"div",24)(167,"mat-form-field",25)(168,"mat-label"),t._uU(169,"Difficulty level"),t.qZA(),t.TgZ(170,"mat-select",57),t.YNc(171,Rt,2,2,"mat-option",56),t.qZA()()()(),t.TgZ(172,"div",54)(173,"div",24)(174,"mat-form-field",25)(175,"mat-label"),t._uU(176,"Where it takes place?"),t.qZA(),t.TgZ(177,"mat-select",58),t.YNc(178,Yt,2,2,"mat-option",56),t.qZA()()()(),t.TgZ(179,"div",59)(180,"div",60)(181,"mat-form-field",61)(182,"mat-label"),t._uU(183,"Keywords / tags"),t.qZA(),t.TgZ(184,"input",62,63),t.NdJ("paste",function(r){return i.handlePaste(r)})("keyup",function(r){return i.addKeyword(r)}),t.qZA()(),t.TgZ(186,"mat-chip-list",64,65),t.YNc(188,Ot,4,2,"mat-chip",66),t.qZA()()(),t.TgZ(189,"div",44)(190,"span"),t._uU(191,"Joining the project"),t.qZA()(),t.TgZ(192,"div",48)(193,"div",24)(194,"mat-label")(195,"span",49),t._uU(196,"*"),t.qZA(),t._uU(197," provide details about eligibility criteria for the project"),t.qZA(),t._UZ(198,"ckeditor",67),t.YNc(199,Gt,4,0,"div",51),t.qZA()(),t.TgZ(200,"div",48)(201,"div",24)(202,"mat-label")(203,"span",49),t._uU(204,"*"),t.qZA(),t._uU(205," Ideal Participation Frequency; how often a participant's effort will be required"),t.qZA(),t._UZ(206,"ckeditor",68),t.YNc(207,Kt,4,0,"div",51),t.qZA()(),t.TgZ(208,"div",48)(209,"div",24)(210,"mat-label")(211,"span",49),t._uU(212,"*"),t.qZA(),t._uU(213," Getting Started: Provide clear and practical guidelines for participants. "),t.qZA(),t._UZ(214,"ckeditor",69),t.YNc(215,Ht,4,0,"div",51),t.qZA()(),t.TgZ(216,"div",11)(217,"div",24)(218,"mat-form-field",29)(219,"mat-label"),t._uU(220,"Who can join?"),t.qZA(),t.TgZ(221,"mat-select",70),t.YNc(222,Bt,2,2,"mat-option",56),t.qZA()()()(),t.TgZ(223,"div",11)(224,"div",24)(225,"h6"),t._uU(226,"Participant Enrollment"),t.qZA(),t.TgZ(227,"mat-slide-toggle",71),t._uU(228),t.qZA()()(),t.TgZ(229,"div",44)(230,"span"),t._uU(231,"Project on the Web"),t.qZA()(),t.TgZ(232,"i",10),t._uU(233,"* Project's Link Repository: You can add project external page URLs, app URLs, link to privacy statements, and more."),t.qZA(),t._UZ(234,"br",10)(235,"br",10),t.TgZ(236,"div",72)(237,"div",73)(238,"div",24)(239,"mat-form-field",25)(240,"mat-label"),t._uU(241,"Enter link here"),t.qZA(),t._UZ(242,"input",74),t.qZA(),t.YNc(243,zt,4,0,"mat-error",27),t.qZA()(),t.TgZ(244,"div",75)(245,"button",76),t.NdJ("click",function(){return i.addLink()}),t._uU(246,"Add link"),t.qZA()()(),t.TgZ(247,"div",11)(248,"div",24)(249,"mat-chip-list",77),t.YNc(250,Wt,3,4,"mat-chip",78),t.qZA()()(),t.TgZ(251,"div",44)(252,"span"),t._uU(253,"Upload Section "),t.qZA()(),t.TgZ(254,"div",11)(255,"p")(256,"strong",79),t._uU(257,"Experiment Configuration "),t.qZA(),t._UZ(258,"i",80),t.qZA(),t.TgZ(259,"div",24)(260,"mat-label"),t._uU(261,"Upload File "),t.TgZ(262,"small"),t._uU(263,"[ allowed formats: .zip .rar under 5MB ]"),t.qZA()(),t._UZ(264,"br"),t.TgZ(265,"input",17,81),t.NdJ("change",function(r){return i.onConfigFileSelected(r)}),t.qZA(),t.YNc(267,Xt,3,0,"button",82),t.qZA()(),t.YNc(268,ee,8,3,"div",83),t.TgZ(269,"div",84)(270,"button",85),t._uU(271,"Save Changes"),t.qZA()(),t.YNc(272,ie,3,0,"div",86),t.qZA()()()()()()()()),2&e){const a=t.MAs(57),r
1=t.MAs(93);t.xp6(2),t.Q6J("ngForOf",i.breadscrums),t.xp6(1),t.Q6J("ngIf",i.editProgressbar),t.xp6(6),t.Oqu(i.studyTitle),t.xp6(3),t.Q6J("formGroup",i.editStudyForm),t.xp6(2),t.Q6J("hidden",!i.systemManagerView),t.xp6(2),t.Q6J("hidden",i.systemManagerView),t.xp6(8),t.Q6J("hidden",i.systemManagerView),t.xp6(1),t.Q6J("ngIf",i.imageData),t.xp6(1),t.Q6J("ngIf",!i.imageData),t.xp6(1),t.Q6J("hidden",i.systemManagerView),t.xp6(4),t.Q6J("hidden",i.systemManagerView),t.xp6(5),t.Q6J("ngIf",i.selectedFile),t.xp6(12),t.Q6J("ngIf",i.editStudyForm.get("studyTitle").hasError("required")),t.xp6(1),t.Q6J("hidden",i.systemManagerView),t.xp6(5),t.Q6J("matDatepicker",a)("formControl",i.studyStartDate),t.xp6(1),t.Q6J("for",a),t.xp6(3),t.Q6J("ngIf",i.editStudyForm.get("studyStartDate").hasError("required")),t.xp6(1),t.Q6J("hidden",i.systemManagerView),t.xp6(8),t.Q6J("ngIf",i.editStudyForm.get("incentive").hasError("required")),t.xp6(1),t.Q6J("hidden",i.systemManagerView),t.xp6(7),t.Q6J("disabled","approved"==i.studyStatus||"completed"==i.studyStatus||"inprogress"==i.studyStatus),t.xp6(2),t.Q6J("disabled","researcher"==i.userRole),t.xp6(2),t.Q6J("disabled","researcher"==i.userRole&&"rejected"==i.studyStatus),t.xp6(2),t.Q6J("disabled","researcher"==i.userRole),t.xp6(2),t.Q6J("disabled","researcher"==i.userRole&&"rejected"==i.studyStatus),t.xp6(2),t.Q6J("hidden",i.systemManagerView),t.xp6(5),t.Q6J("matDatepicker",r)("formControl",i.studyEndDate),t.xp6(1),t.Q6J("for",r),t.xp6(3),t.Q6J("ngIf",i.editStudyForm.get("studyEndDate").hasError("required")),t.xp6(1),t.Q6J("hidden",i.systemManagerView),t.xp6(8),t.Q6J("ngIf",i.editStudyForm.get("studyEcts").hasError("required")),t.xp6(1),t.Q6J("hidden",i.systemManagerView),t.xp6(10),t.Q6J("ngForOf",i.study_coordinators_data),t.xp6(3),t.Q6J("ngIf",i.editStudyForm.get("studyCoordinatorDsId").hasError("required")),t.xp6(3),t.Q6J("hidden",i.systemManagerView),t.xp6(7),t.hij(" ",i.studyParticipantsArray.length," participants assigned to project "),t.xp6(1),t.Q6J("hidden",i.systemManagerView),t.xp6(3),t.Q6J("hidden",i.systemManagerView),t.xp6(6),t.Q6J("editor",i.Editor)("config",i.config),t.xp6(1),t.Q6J("ngIf",i.editStudyForm.controls.studyDescription.invalid&&i.editStudyForm.controls.studyDescription.touched),t.xp6(1),t.Q6J("hidden",i.systemManagerView),t.xp6(6),t.Q6J("editor",i.Editor)("config",i.config),t.xp6(1),t.Q6J("ngIf",i.editStudyForm.controls.studyPurpose.invalid&&i.editStudyForm.controls.studyPurpose.touched),t.xp6(1),t.Q6J("hidden",i.systemManagerView),t.xp6(6),t.Q6J("editor",i.Editor)("config",i.config),t.xp6(1),t.Q6J("ngIf",i.editStudyForm.controls.studyTasks.invalid&&i.editStudyForm.controls.studyTasks.touched),t.xp6(1),t.Q6J("hidden",i.systemManagerView),t.xp6(3),t.Q6J("hidden",i.systemManagerView),t.xp6(6),t.Q6J("ngForOf",i.ProjectCategoriesList),t.xp6(1),t.Q6J("hidden",i.systemManagerView),t.xp6(6),t.Q6J("ngForOf",i.difficultyLevels),t.xp6(1),t.Q6J("hidden",i.systemManagerView),t.xp6(6),t.Q6J("ngForOf",i.projectNature),t.xp6(1),t.Q6J("hidden",i.systemManagerView),t.xp6(9),t.Q6J("ngForOf",i.keywords),t.xp6(1),t.Q6J("hidden",i.systemManagerView),t.xp6(3),t.Q6J("hidden",i.systemManagerView),t.xp6(6),t.Q6J("editor",i.Editor)("config",i.config),t.xp6(1),t.Q6J("ngIf",i.editStudyForm.controls.studyEligibility.invalid&&i.editStudyForm.controls.studyEligibility.touched),t.xp6(1),t.Q6J("hidden",i.systemManagerView),t.xp6(6),t.Q6J("editor",i.Editor)("config",i.config),t.xp6(1),t.Q6J("ngIf",i.editStudyForm.controls.participationFrequency.invalid&&i.editStudyForm.controls.participationFrequency.touched),t.xp6(1),t.Q6J("hidden",i.systemManagerView),t.xp6(6),t.Q6J("editor",i.Editor)("config",i.config),t.xp6(1),t.Q6J("ngIf",i.editStudyForm.controls.participationGuidelines.invalid&&i.editStudyForm.controls.participationGuidelines.touched),t.xp6(1),t.Q6J("hidden",i.systemManagerView),t.xp6(6),t.Q6J("ngForOf",i.ParticipantDemographicsList),t.xp6(1),t.Q6J("hidden",i.systemManagerView),t.xp6(5),t.hij(" ",i.editStudyForm.controls.participantEnrollment.value?" Open":" Closed"," "),t.xp6(1),t.Q6J("hidden",i.systemManagerView),t.xp6(3),t.Q6J("hidden",i.systemManagerView),t.xp6(2),t.Q6J("hidden",i.systemManagerView),t.xp6(1),t.Q6J("hidden",i.systemManagerView),t.xp6(1),t.Q6J("hidden",i.systemManagerView),t.xp6(7),t.Q6J("ngIf",i.editStudyForm.get("newLink").hasError("pattern")),t.xp6(4),t.Q6J("hidden",i.systemManagerView),t.xp6(3),t.Q6J("ngForOf",i.editStudyForm.get("multipleLinks").value),t.xp6(1),t.Q6J("hidden",i.systemManagerView),t.xp6(3),t.Q6J("hidden",i.systemManagerView),t.xp6(13),t.Q6J("ngIf",null!=i.selectedConfigFile),t.xp6(1),t.Q6J("ngIf",i.configFileExists>0),t.xp6(1),t.Q6J("hidden",i.systemManagerView),t.xp6(3),t.Q6J("ngIf",i.systemManagerView)}},dependencies:[u.sg,u.O5,d._Y,d.Fj,d.wV,d.JJ,d.JL,d.Q7,d.qQ,d.oH,d.sg,d.u,d.CE,m.TO,m.KE,m.hX,m.R9,b.Nt,w.Hw,T.lW,x.L,k.u,S.ey,v.Mq,v.hl,v.nW,Z.gD,F.Rr,P.gM,_.qn,_.HS,_.qH,C.pW,E.ap],styles:[".section-heading[_ngcontent-%COMP%]{background-color:#4fafa6;border-radius:0;margin:10px 10px 20px;color:#fff}.cropper-container[_ngcontent-%COMP%]{height:300px;display:flex;justify-content:center;align-items:center}image-cropper[_ngcontent-%COMP%]{width:100%;height:100%}.chip-wrap[_ngcontent-%COMP%]{color:#00f;background-color:#fff;word-wrap:break-word;word-break:break-word;max-width:100%;margin:5px;
1display:block;line-height:1.5;padding:8px;border-radius:16px;box-sizing:border-box}.chip-wrap[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{vertical-align:middle;margin-left:8px}",".ck-editor__editable {\n            min-height: 100px !important;\n        }"]}),o})();var ae=l(4362);function re(o,n){if(1&o&&(t.TgZ(0,"mat-option",10),t._uU(1),t.qZA()),2&o){const e=n.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij("",e.name," ")}}function ne(o,n){1&o&&t._UZ(0,"mat-progress-bar",11)}function se(o,n){if(1&o&&(t.TgZ(0,"mat-option",12),t._uU(1),t.qZA()),2&o){const e=n.$implicit;t.Q6J("value",e.faculty_id)("matTooltip",e.name),t.xp6(1),t.hij(" ",e.faculty_name," ")}}let j=(()=>{class o{constructor(e){this.backendService=e,this.facultiesProgressbar=!1,this.allInstitutions=[],this.institutionsSelected="",this.facultiesList=[],this.facultiesSelected=""}ngOnInit(){this.loadInstitutions()}loadInstitutions(){return new Promise((e,i)=>{this.backendService.getInstitutionsList().subscribe(a=>{this.allInstitutions=a.institutions,e()},a=>{console.log(a),e()})})}universityUpdate(e){this.facultiesProgressbar=!0,this.institutionsSelected=e.value.toString(),this.backendService.getFaculties({institution_ids:this.institutionsSelected}).subscribe(r=>{this.facultiesList=r.data,this.facultiesProgressbar=!1},r=>{this.facultiesList=[],this.facultiesProgressbar=!1})}facultyUpdate(e){this.facultiesSelected=e.value.toString()}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(y.v))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-institution-faculty-dropdown"]],decls:18,vars:3,consts:[[1,"row"],[1,"col-lg-6","col-md-6","col-sm-12"],[1,"form-group"],[1,"example-full-width"],["multiple","",3,"selectionChange"],["universitySelect",""],[3,"value",4,"ngFor","ngForOf"],["mode","indeterminate",4,"ngIf"],["facultySelect",""],[3,"value","matTooltip",4,"ngFor","ngForOf"],[3,"value"],["mode","indeterminate"],[3,"value","matTooltip"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"mat-form-field",3)(4,"mat-label"),t._uU(5,"University"),t.qZA(),t.TgZ(6,"mat-select",4,5),t.NdJ("selectionChange",function(r){return i.universityUpdate(r)}),t.YNc(8,re,2,2,"mat-option",6),t.qZA()()()(),t.TgZ(9,"div",1),t.YNc(10,ne,1,0,"mat-progress-bar",7),t.TgZ(11,"div",2)(12,"mat-form-field",3)(13,"mat-label"),t._uU(14,"Department"),t.qZA(),t.TgZ(15,"mat-select",4,8),t.NdJ("selectionChange",function(r){return i.facultyUpdate(r)}),t.YNc(17,se,2,3,"mat-option",9),t.qZA()()()()()),2&e&&(t.xp6(8),t.Q6J("ngForOf",i.allInstitutions),t.xp6(2),t.Q6J("ngIf",i.facultiesProgressbar),t.xp6(7),t.Q6J("ngForOf",i.facultiesList))},dependencies:[u.sg,u.O5,m.KE,m.hX,Z.gD,S.ey,C.pW]}),o})();const de=["fileInput"],le=["configFileInput"];function ce(o,n){if(1&o&&(t.TgZ(0,"div",84),t._UZ(1,"app-breadcrumb",85),t.qZA()),2&o){const e=n.$implicit;t.xp6(1),t.Q6J("title",e.title)("items",e.items)("active_item",e.active)}}function pe(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"div",86)(1,"image-cropper",87),t.NdJ("imageCropped",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.onImageCropped(a))})("imageLoaded",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.onImageLoaded(a))})("cropperReady",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.onCropperReady())})("loadImageFailed",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.onLoadImageFailed())}),t.qZA()()}if(2&o){const e=t.oxw();
1t.xp6(1),t.Q6J("imageChangedEvent",e.imageChangedEvent)("maintainAspectRatio",!0)("aspectRatio",1)}}function ue(o,n){1&o&&(t.TgZ(0,"mat-error"),t._uU(1," Project title is required "),t.qZA())}function me(o,n){1&o&&(t.TgZ(0,"mat-error"),t._uU(1," This field is required "),t.qZA())}function ge(o,n){1&o&&(t.TgZ(0,"mat-error"),t._uU(1," This field is required "),t.qZA())}function he(o,n){1&o&&(t.TgZ(0,"mat-error"),t._uU(1," This field is required "),t.qZA())}function _e(o,n){1&o&&(t.TgZ(0,"div",88)(1,"span",36)(2,"i"),t._uU(3,"This field is required."),t.qZA()()())}function fe(o,n){1&o&&(t.TgZ(0,"div",88)(1,"span",36)(2,"i"),t._uU(3,"This field is required."),t.qZA()()())}function ye(o,n){1&o&&(t.TgZ(0,"div",88)(1,"span",36)(2,"i"),t._uU(3,"This field is required."),t.qZA()()())}function ve(o,n){if(1&o&&(t.TgZ(0,"mat-option",61),t._uU(1),t.qZA()),2&o){const e=n.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij("",e.name," ")}}function Ze(o,n){if(1&o&&(t.TgZ(0,"mat-option",61),t._uU(1),t.qZA()),2&o){const e=n.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij("",e.name," ")}}function be(o,n){if(1&o&&(t.TgZ(0,"mat-option",61),t._uU(1),t.qZA()),2&o){const e=n.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij("",e.name," ")}}function Te(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"mat-chip",89),t.NdJ("removed",function(){const r=t.CHM(e).$implicit,s=t.oxw();return t.KtG(s.removeKeyword(r))}),t._uU(1),t.TgZ(2,"mat-icon",90),t._uU(3,"cancel"),t.qZA()()}if(2&o){const e=n.$implicit;t.Q6J("removable",!0),t.xp6(1),t.hij(" ",e," ")}}function Ce(o,n){1&o&&(t.TgZ(0,"div",88)(1,"span",36)(2,"i"),t._uU(3,"This field is required."),t.qZA()()())}function Se(o,n){1&o&&(t.TgZ(0,"div",88)(1,"span",36)(2,"i"),t._uU(3,"This field is required."),t.qZA()()())}function Ae(o,n){1&o&&(t.TgZ(0,"div",88)(1,"span",36)(2,"i"),t._uU(3,"This field is required."),t.qZA()()())}function we(o,n){if(1&o&&(t.TgZ(0,"mat-option",61),t._uU(1),t.qZA()),2&o){const e=n.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij("",e.name," ")}}function qe(o,n){1&o&&(t.TgZ(0,"mat-error"),t._uU(1," This field is required "),t.qZA())}
1function Ue(o,n){1&o&&t._UZ(0,"mat-progress-bar",91)}function xe(o,n){if(1&o&&(t.TgZ(0,"mat-option",92),t._uU(1),t.qZA()),2&o){const e=n.$implicit;t.oxw();const i=t.MAs(218);t.Q6J("disabled",i.selected)("value",e.email),t.xp6(1),t.hij(" ",e.member_ds_id," ")}}function ke(o,n){if(1&o&&(t.TgZ(0,"mat-option",61),t._uU(1),t.qZA()),2&o){const e=n.$implicit;t.Q6J("value",e.code),t.xp6(1),t.hij("",e.name," ")}}function Ie(o,n){if(1&o&&(t.TgZ(0,"mat-option",61),t._uU(1),t.qZA()),2&o){const e=n.$implicit;t.Q6J("value",e.value),t.xp6(1),t.hij("",e.name," ")}}function Fe(o,n){1&o&&(t.TgZ(0,"mat-error"),t._uU(1," Invalid url pattren, correct example: "),t.TgZ(2,"i"),t._uU(3,"https://www.google.com"),t.qZA()())}function Pe(o,n){1&o&&(t.TgZ(0,"mat-icon",90),t._uU(1,"cancel"),t.qZA())}function Ee(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"mat-chip",93),t.NdJ("removed",function(){const r=t.CHM(e).index,s=t.oxw();return t.KtG(s.removeLink(r))}),t._uU(1),t.YNc(2,Pe,2,0,"mat-icon",94),t.qZA()}if(2&o){const e=n.$implicit,i=t.oxw();t.Q6J("selectable",!0)("removable",!0),t.xp6(1),t.hij(" ",e," "),t.xp6(1),t.Q6J("ngIf",!i.createStudyForm.get("multipleLinks").disabled)}}function Ne(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"button",95),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.clearFile())}),t._UZ(1,"i",96),t._uU(2," remove file "),t.qZA()}}let De=(()=>{class o{constructor(e,i,a,r,s){this.fb=e,this.modalService=i,this.localService=a,this.backendService=r,this.router=s,this.Editor=A(),this.configReadOnly={readOnly:!0,toolbar:[]},this.config={toolbar:{items:["heading","|","bold","italic","link","bulletedList","numberedList","|","outdent","indent","|","blockQuote","insertTable","|","undo","redo"],shouldNotGroupWhenFull:!0},image:{toolbar:["imageTextAlternative"]},readOnly:!1,minHeight:"300"},this.breadscrums=[{title:"New Project",items:["Project"],active:"New"}],this.participantsProgressbar=!1,this.participantsNationalities=new d.p4,this.countriesList=ae.h,this.participants=new d.p4,this.participantsList=[],this.participantGender=new d.p4,this.participantGenderList=this.backendService.genderList,this.projectNature=this.backendService.projectNature,this.difficultyLevels=this.backendService.difficultyLevels,this.filteredParticipants=0,this.totalParticipants=0,this.participantPercentage=100,this.multipleLinks=[],this.hide=!0,this.userRole="",this.studyId=-1,this.studyTitle="",this.researcherName="",this.researcherDsId="",this.incentive="0",this.sampleSize="0",this.studyEcts="0",this.studyStatus="pending",this.studyStartDate=new d.p4(new Date),this.studyEndDate=new d.p4(new Date),this.disableEditStudyCoordinator=!0,this.ParticipantDemographicsList=[],this.ProjectCategoriesList=[],this.keywords=[],this.imageChangedEvent="",this.croppedImage="",this.validImageUploaded=!1}ngOnInit(){this.userRole=this.localService.getUserRole(),this.setFormEditPermissions(),this.initForm(),this.researcherDsId=this.localService.getJsonValue("researcher_ds_id"),this.loadAllParticipantDemographics(),this.loadAllProjectCategories()}ngAfterViewInit(){this.getAllParticipants()}updateValidation(e){const i=this.createStudyForm.get(e);i&&(i.markAsTouched(),i.updateValueAndValidity())}filtersUpdate(){var e=this.createStudyForm.value,i=e.genders.toString(),a=e.nationalities.toString();this.getAllParticipants(i,a,this.childComponent.institutionsSelected,this.childComponent.facultiesSelected)}getAllParticipants(e="",i="",a="",r=""){this.participantsProgressbar=!0,this.backendService.getAllActiveParticipants({gender:e,nationalities:i,universities:a,faculties:r}).subscribe(c=>{this.participantsList=c.data,this.participantsProgressbar=!1,this.totalParticipants=c.total_participants,this.filteredParticipants=c.filtered_participants,this.participantPercentage=100*Math.round(this.filteredParticipants/this.totalParticipants)},c=>{this.participantsList=[],this.totalParticipants=0,this.filteredParticipants=0,this.participantsProgressbar=!1})}onNavigate(e){window.open(e,"_blank")}initForm(){this.createStudyForm=this.fb.group({studyTitle:["",[d.kI.required]],studyStatus:[{value:this.studyStatus,disabled:!0},[]],studyStartDate:[this.studyStartDate,[d.kI.required]],studyEndDate:[this.studyEndDate,[d.kI.required]],incentive:["",[d.kI.required]],sampleSize:["",[d.kI.required]],studyEcts:["",[d.kI.required]],studyParticipants:["",[d.kI.required]],genders:["",[]],nationalities:["",[]],participationFrequency:["",[d.kI.required]],participationGuidelines:["",[d.kI.required]],projectDifficulty:["",[]],projectNature:["",[]],projectParticipantDemographics:["",[d.kI.required]],projectCaterory:["",[]],studyDescription:["",[d.kI.required]],studyPurpose:["",[d.kI.required]],studyTasks:["",[d.kI.required]],studyEligibility:["",[d.kI.required]],multipleLinks:this.fb.array([]),newLink:["",[d.kI.pattern(/^(http|https):\/\/[^ "]+$/)]],participantEnrollment:[!0,[d.kI.required]]})}loadAllParticipantDemographics(){return new Promise((e,i)=>{this.backendService.getParticipantDemographicsList().subscribe(a=>{this.ParticipantDemographicsList=a.ParticipantDemographics,e()},a=>{console.log(a),e()})})}loadAllProjectCategories(){return new Promise((e,i)=>{this.backendService.getProjectCategoriesList().subscribe(a=>{this.ProjectCategoriesList=a.projectCategories,e()},a=>{console.log(a),e()})})}addLink(){event.preventDefault();const e=this.createStudyForm.get("newLink"),i=this.createStudyForm.get("multipleLinks");""!==e.value.trim()&&e.valid&&(i.push(this.fb.control(e.value,d.kI.pattern(/^(http|https):\/\/[^ "]+$/))),e.setValue(""))}removeLink(e){this.createStudyForm.get("multipleLinks").removeAt(e)}openSelectParticipantModal(e){this.modalService.open(e,{centered:!0})}
1onSubmitEditStudyForm(){if(this.updateValidation("studyDescription"),this.updateValidation("studyTasks"),this.updateValidation("studyPurpose"),this.updateValidation("studyEligibility"),this.updateValidation("participationFrequency"),this.updateValidation("participationGuidelines"),this.validImageUploaded)if(this.createStudyForm.valid&&null!=this.createStudyForm.value.studyStartDate.value&&null!=this.createStudyForm.value.studyEndDate.value){let a=this.createStudyForm.value,r="";if("-1"==this.createStudyForm.value.studyParticipants){let c=[];for(var i of this.participantsList)c.push(i.email);r=c.toString()}else r=a.studyParticipants.toString();const s=new FormData;s.append("title",a.studyTitle),s.append("description",a.studyDescription),s.append("start_date",new Date(a.studyStartDate.value).toLocaleDateString("fr-CA")),s.append("end_date",new Date(a.studyEndDate.value).toLocaleDateString("fr-CA")),s.append("funds",a.incentive.toString()),s.append("contacts",r),s.append("eligibility_criteria",a.studyEligibility),s.append("participation_frequency",a.participationFrequency),s.append("participation_guidelines",a.participationGuidelines),s.append("category",a.projectCaterory),s.append("project_difficulty",a.projectDifficulty),s.append("project_nature",a.projectNature),s.append("keywords",this.keywords.toString()),s.append("participant_demographics",a.projectParticipantDemographics),s.append("purpose",a.studyPurpose),s.append("tasks",a.studyTasks),s.append("privacy_links",this.createStudyForm.get("multipleLinks").value.join(",")),s.append("credits",a.studyEcts),s.append("participant_enrollment",a.participantEnrollment),s.append("researcher_ds_id",this.researcherDsId.toString()),s.append("image",this.croppedImage),s.append("config_file",this.selectedConfigFile),s.append("sample_size",a.sampleSize.toString()),s.append("gendersSelected",a.genders.toString()),s.append("nationalitiesSelected",a.nationalities.toString()),s.append("universitiesSelected",this.childComponent.institutionsSelected),s.append("facultiesSelected",this.childComponent.facultiesSelected),this.backendService.createNewStudy(s).subscribe(c=>{p().fire({icon:"success",title:"Success!",text:"New study created."}),this.router.navigateByUrl("all-studies")},c=>{})}else p().fire({icon:"error",title:"Attention",text:"Please fill all required fields."});else p().fire({icon:"error",title:"Attention",text:"Please upload project image (jpg, jpeg), with size upto 512KB ."})}setFormEditPermissions(){"system manager"===this.userRole&&(this.disableEditStudyCoordinator=!1)}addKeyword(e){e.preventDefault();const i=e.target,a=i.value.trim();("Enter"===e.key||","===e.key)&&a&&(a.split(",").map(s=>s.trim()).forEach(s=>{s&&!this.keywords.includes(s)&&this.keywords.push(s)}),i.value="")}handlePaste(e){var i=this;return(0,D.Z)(function*(){if(!e.clipboardData&&!window.clipboardData)return;const r=yield navigator.clipboard.readText();r&&(i.addKeywordsFromString(r),e.target.value="")})()}addKeywordsFromString(e){e.split(",").map(a=>a.trim()).forEach(a=>{a&&!this.keywords.includes(a)&&this.keywords.push(a)})}removeKeyword(e){const i=this.keywords.indexOf(e);-1!==i&&this.keywords.splice(i,1)}onFileSelected(e){this.selectedFile=e.target.files[0],this.imageChangedEvent=e}clearFile(){this.selectedConfigFile=null,this.configFileInput.nativeElement.value=""}onConfigFileSelected(e){const i=e.target.files[0],a=["zip"],r=i.name.split(".").pop()?.toLowerCase();if(r&&a.includes(r)&&i.size<=5242880)this.selectedConfigFile=i;else{let s;s=a.includes(r)?"File exceeds 5MB size limit.":"Invalid file extension. Please select a ZIP file.",p().fire({icon:"error",title:"Error",text:s}),e.target.value=""}}onImageCropped(e){this.croppedImage=this.validImageUploaded?this.base64ToFile(e.base64):""}base64ToFile(e){const i=atob(e.split(",")[1]),a=new ArrayBuffer(i.length),r=new 
1Uint8Array(a);for(let s=0;s<i.length;s++)r[s]=i.charCodeAt(s);return new File([a],"cropped_image.jpg",{type:"image/jpeg"})}onImageLoaded(e){var i="";if(this.selectedFile){const a=this.selectedFile.name.split(".").pop().toLowerCase();if("jpg"!==a&&"jpeg"!==a)return i="Invalid file extension. Please select a JPG or JPEG image.",p().fire({icon:"error",title:"Error",text:i}),void(this.validImageUploaded=!1);if(this.selectedFile.size>524288)return i="File size exceeds the limit of 512KB.",p().fire({icon:"error",title:"Error",text:i}),void(this.validImageUploaded=!1);this.validImageUploaded=!0}}onCropperReady(){}onLoadImageFailed(){p().fire({icon:"error",title:"Error",text:"Invalid file extension. Please select a JPG or JPEG image."}),this.validImageUploaded=!1}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(d.QS),t.Y36(J.FF),t.Y36(h.C),t.Y36(y.v),t.Y36(g.F0))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-new"]],viewQuery:function(e,i){if(1&e&&(t.Gf(j,5),t.Gf(de,5),t.Gf(le,5)),2&e){let a;t.iGM(a=t.CRH())&&(i.childComponent=a.first),t.iGM(a=t.CRH())&&(i.fileInput=a.first),t.iGM(a=t.CRH())&&(i.configFileInput=a.first)}},decls:295,vars:52,consts:[[1,"content"],[1,"container-fluid"],["class","block-header",4,"ngFor","ngForOf"],[1,"row","clearfix"],[1,"col-lg-12","col-md-12"],[1,"card"],[1,"body"],[1,"register-form","m-4",3,"formGroup","ngSubmit"],[1,"col-lg-8","col-md-8","col-sm-12"],["href","public/project-guidelines","target","_blank"],[1,"header"],[1,"row","clearfix",2,"margin","1.5rem !important"],[1,"col-lg-6","col-md-12",2,"overflow","hidden"],["type","file",3,"change"],["fileInput",""],["class","cropper-container",4,"ngIf"],[1,"header","section-heading"],[1,"col-lg-6","col-md-6","col-sm-12"],[1,"col-lg-10","col-md-10","col-sm-12"],[1,"form-group"],["appearance","outline",1,"example-full-width"],["matInput","","formControlName","studyTitle","required",""],[4,"ngIf"],[1,"example-full-width"],["matInput","","required","",3,"matDatepicker","formControl"],["matSuffix","",3,"for"],["required",""],["startDatePicker",""],["matInput","","type","number","min","0","formControlName","incentive","required",""],["matSuffix",""],["formControlName","studyStatus"],["value","pending"],["endDatePicker",""],["matInput","","type","number","min","0","formControlName","studyEcts","required",""],["href","https://education.ec.europa.eu/education-levels/higher-education/inclusive-and-connected-higher-education/european-credit-transfer-and-accumulation-system","target","_blank"],[1,"col-lg-12","col-md-12","col-sm-12"],[2,"color","red"],["formControlName","studyDescription",3,"editor","config"],["class","error",4,"ngIf"],["formControlName","studyPurpose",3,"editor","config"],["formControlName","studyTasks",3,"editor","config"],[1,"col-lg-4","col-md-4","col-sm-12"],["formControlName","projectCaterory"],[3,"value",4,"ngFor","ngForOf"],["formControlName","projectDifficulty"],["formControlName","projectNature"],[1,"form-group",2,"padding","10px 20px 10px 20px","border","1px solid lightgray","border-radius","5px"],["appearance","none",1,"example-full-width"],["matInput","","placeholder","Type keywords and press Enter",3,"paste","keyup"],["keywordsInput",""],["aria-label","Keywords"],["chipList",""],[3,"removable","removed",4,"ngFor","ngForOf"],["formControlName","studyEligibility",3,"editor","config"],["formControlName","participationFrequency",3,"editor","config"],["formControlName","participationGuidelines",3,"editor","config"],["formControlName","projectParticipantDemographics","multiple","","required",""],["matInput","","type","number","min","0","formControlName","sampleSize","required",""],["formControlName","participantEnrollment"],["mode","indeterminate",4,"ngIf"],["formControlName","studyParticipants","multiple",""],[3,"value"],["allS",""],[3,"disabled","value",4,"ngFor","ngForOf"],[1,"text-muted"],["matTooltip","The percentage represents the proportion of users \n                                            chosen from the total pool of participants, \n                                            determined by the filters you apply.","aria-hidden","true",1,"fas","fa-info-circle","fa-lg","text-muted"],[1,"progress"],["role","progressbar","aria-valuemin","0","aria-valuemax","100"],[1,"col-lg-6","col-md-6","col-sm-12","row"],["formControlName","nationalities","multiple",""],["formControlName","genders","multiple",""],[1,"col-lg-2","col-md-2","col-sm-4","col-xs-6"],["mat-stroked-button","","color","primary","type","button",3,"click"],[1,"row","col-lg-6","col-md-6","col-sm-12"],["matInput","","formControlName","newLink"],[1,"col-lg-2","col-md-2","col-sm-12"],["mat-stroked-button","","color","primary",2,"margin-top","8px",3,"click"],["formArrayName","multipleLinks"],["style","color: blue; background-color: white;",3,"selectable","removable","removed",4,"ngFor","ngForOf"],["matTooltip","Please note these configurations will be only visible to the participants who agree to join\n                                        the project. For files bigger than specified size limit, you can include external link(s) to your \n                                        project configuration(s) in the links repository above.","aria-hidden","true",1,"fas","fa-info-circle","fa-lg","text-muted"],["configFileInput",""],["mat-button","","color","warn","type","button",3,"click",4,"ngIf"],[1,"col-md-12"],["mat-raised-button","","type","submit","color","primary"],[1,"block-header"],[3,"title","items","active_item"],[1,"cropper-container"],["format","jpeg",3,"imageChangedEvent","maintainAspectRatio","aspectRatio","imageCropped","imageLoaded","cropperReady","loadImageFailed"],[1,"error"],[3,"removable","removed"],["matChipRemove",""],["mode","indeterminate"],[3,"disabled","value"],[2,"color","blue","background-color","white",3,"selectable","removable","removed"],["matChipRemove","",4,"ngIf"],["mat-button","","color","warn","type","button",3,"click"],["aria-hidden","true",1,"fas","fa-times"]],template:function(e,i){if(1&e&&(t.TgZ(0,"section",0)(1,"div",1),t.YNc(2,ce,2,3,"div",2),t.TgZ(3,"div",3)(4,"div",4)(5,"div",5)(6,"div",6)(7,"form",7),t.NdJ("ngSubmit",function(){return i.onSubmitEditStudyForm()}),t.TgZ(8,"div",3)(9,"div",8)(10,"h3"),t._uU(11,"Add a project"),t.qZA(),t.TgZ(12,"p"),t._uU(13," You can move from section to section to complete the fields, and save your project. Once you submit it, our coordinators will review it and let you know if they have questions or if it's been approved. You can publish an approved project to let outer world know about your project. This will increase the chances of your project getting more visibility and attention of people with interest in the same domain. "),t.TgZ(14,"i"),t._uU(15,"See our "),t.TgZ(16,"a",9),t._uU(17,"project guidelines here"),t.qZA(),t._uU(18,"."),t.qZA()(),t.TgZ(19,"i"),t._uU(20,"*An asterisk signifies mandatory fields that must be completed."),t.qZA(),t._UZ(21,"br"),t.qZA(),t.TgZ(22,"div",10)(23,"h2")(24,"strong"),t._uU(25,"Project Picture"),t.qZA()()(),t.TgZ(26,"div",11)(27,"div",12)(28,"input",13,14),t.NdJ("change",function(r){return i.onFileSelected(r)}),t.qZA()(),t._UZ(30,"hr"),t.qZA(),t.YNc(31,pe,2,3,"div",15),t.TgZ(32,"div",16)(33,"span"),t._uU(34,"Project details"),t.qZA()(),t.TgZ(35,"div",17)(36,"div",18)(37,"div",19)(38,"mat-form-field",20)(39,"mat-label"),t._uU(40,"Project title e.g. a study about bird species"),t.qZA(),t._UZ(41,"input",21),t.YNc(42,ue,2,0,"mat-error",22),t.qZA()()(),t.TgZ(43,"div",18)(44,"div",19)(45,"mat-form-field",23)(46,"mat-label"),t._uU(47,"Start Date"),t.qZA(),t._UZ(48,"input",24)(49,"mat-datepicker-toggle",25)(50,"mat-datepicker",26,27),t.YNc(52,me,2,0,"mat-error",22),t.qZA()()(),t.TgZ(53,"div",18)(54,"div",19)(55,"mat-form-field",20)(56,"mat-label"),t._uU(57,"Incentive per participant"),t.qZA(),t._UZ(58,"input",28),t.TgZ(59,"mat-icon",29),t._uU(60,"euro_symbol"),t.qZA(),t.YNc(61,ge,2,0,"mat-error",22),t.qZA()()()(),t.TgZ(62,"div",17)(63,"div",18)(64,"div",19)(65,"mat-form-field",20)(66,"mat-label"),t._uU(67,"Status"),t.qZA(),t.TgZ(68,"mat-select",30)(69,"mat-option",31),t._uU(70,"Pending"),t.qZA()()()()(),t.TgZ(71,"div",18)(72,"div",19)(73,"mat-form-field",23)(74,"mat-label"),t._uU(75,"End Date"),t.qZA(),t._UZ(76,"input",24)(77,"mat-datepicker-toggle",25)(78,"mat-datepicker",26,32),t.qZA()()(),t.TgZ(80,"div",18)(81,"div",19)(82,"mat-form-field",20)(83,"mat-label"),t._uU(84,"ECTS credits for student participant"),t.qZA(),t._UZ(85,"input",33),t.TgZ(86,"mat-icon",29),t._uU(87,"school"),t.qZA(),t.YNc(88,he,2,0,"mat-error",22),t.qZA(),t.TgZ(89,"span"),t._uU(90,"What is ECTS? "),t.TgZ(91,"a",34),t._uU(92,"Inquire more here"),t.qZA()()()()(),t.TgZ(93,"div",16)(94,"span"),t._uU(95,"Let people know what it's about..."),t.qZA()(),t.TgZ(96,"div",35)(97,"div",19)(98,"mat-label")(99,"span",36),t._uU(100,"*"),t.qZA(),t._uU(101," description of your project goes here"),t.qZA(),t._UZ(102,"ckeditor",37),t.YNc(103,_e,4,0,"div",38),t.qZA()(),t.TgZ(104,"div",35)(105,"div",19)(106,"mat-label")(107,"span",36),t._uU(108,"*"),t.qZA(),t._uU(109," purpose of the project"),t.qZA(),t._UZ(110,"ckeditor",39),t.YNc(111,fe,4,0,"div",38),t.qZA()(),t.TgZ(112,"div",35)(113,"div",19)(114,"mat-label")(115,"span",36),t._uU(116,"*"),t.qZA(),t._uU(117," tasks to be completed by the participant"),t.qZA(),t._UZ(118,"ckeditor",40),t.YNc(119,ye,4,0,"div",38),t.qZA()(),t.TgZ(120,"div",16)(121,"span"),t._uU(122,"Project categorization"),t.qZA()(),t.TgZ(123,"div",41)(124,"div",19)(125,"mat-form-field",20)(126,"mat-label"),t._uU(127,"Project Category"),t.qZA(),t.TgZ(128,"mat-select",42),t.YNc(129,ve,2,2,"mat-option",43),t.qZA()()()(),t.TgZ(130,"div",41)(131,"div",19)(132,"mat-form-field",20)(133,"mat-label"),t._uU(134,"Difficulty level"),t.qZA(),t.TgZ(135,"mat-select",44),t.YNc(136,Ze,2,2,"mat-option",43),t.qZA()()()(),t.TgZ(137,"div",41)(138,"div",19)(139,"mat-form-field",20)(140,"mat-label"),t._uU(141,"Where it takes place?"),t.qZA(),t.TgZ(142,"mat-select",45),t.YNc(143,be,2,2,"mat-option",43),t.qZA()()()(),t.TgZ(144,"div",8)(145,"div",46)(146,"mat-form-field",47)(147,"mat-label"),t._uU(148,"Keywords / tags"),t.qZA(),t.TgZ(149,"input",48,49),t.NdJ("paste",function(r){return i.handlePaste(r)})("keyup",function(r){return i.addKeyword(r)}),t.qZA()(),t.TgZ(151,"mat-chip-list",50,51),t.YNc(153,Te,4,2,"mat-chip",52),t.qZA()()(),t.TgZ(154,"div",16)(155,"span"),t._uU(156,"Joining the project"),t.qZA()(),t.TgZ(157,"div",35)(158,"div",19)(159,"mat-label")(160,"span",36),t._uU(161,"*"),t.qZA(),t._uU(162," provide details about eligibility criteria for the project"),t.qZA(),t._UZ(163,"ckeditor",53),t.YNc(164,Ce,4,0,"div",38),t.qZA()(),t.TgZ(165,"div",35)(166,"div",19)(167,"mat-label")(168,"span",36),t._uU(169,"*"),t.qZA(),t._uU(170," Ideal Participation Frequency; how often a participant's effort will be required"),t.qZA(),t._UZ(171,"ckeditor",54),t.YNc(172,Se,4,0,"div",38),t.qZA()(),t.TgZ(173,"div",35)(174,"div",19)(175,"mat-label")(176,"span",36),t._uU(177,"*"),t.qZA(),t._uU(178," Getting Started: Provide clear and practical guidelines for participants. "),t.qZA(),t._UZ(179,"ckeditor",55),t.YNc(180,Ae,4,0,"div",38),t.qZA()(),t.TgZ(181,"div",17)(182,"div",19)(183,"mat-form-field",23)(184,"mat-label"),t._uU(185,"Who can join?"),t.qZA(),t.TgZ(186,"mat-select",56),t.YNc(187,we,2,2,"mat-option",43),t.qZA()()()(),t.TgZ(188,"div",16)(189,"span"),t._uU(190,"Community reach"),t.qZA()(),t.TgZ(191,"div",17)(192,"div",18)(193,"div",19)(194,"mat-form-field",20)(195,"mat-label"),t._uU(196,"Number of Participants Required"),t.qZA(),t._UZ(197,"input",57),t.TgZ(198,"mat-icon",29),t._uU(199,"euro_symbol"),t.qZA(),t.YNc(200,qe,2,0,"mat-error",22),t.qZA()()()(),t.TgZ(201,"div",17)(202,"div",19)(203,"h6"),t._uU(204,"Participant Enrollment"),t.qZA(),t.TgZ(205,"mat-slide-toggle",58),t._uU(206),t.qZA()()(),t.TgZ(207,"div",17),t.YNc(208,Ue,1,0,"mat-progress-bar",59),t.TgZ(209,"div",18)(210,"div",19)(211,"h6"),t._uU(212,"Select Participants"),t.qZA(),t.TgZ(213,"mat-form-field",23)(214,"mat-label"),t._uU(215,"Participants"),t.qZA(),t.TgZ(216,"mat-select",60)(217,"mat-option",61,62),t._uU(219,"All"),t.qZA(),t.YNc(220,xe,2,3,"mat-option",63),t.qZA()()()(),t.TgZ(221,"div",18)(222,"p")(223,"strong",64),t._uU(224,"Targeted User Reach Percentage "),t.qZA(),t._UZ(225,"i",65)(226,"br"),t.TgZ(227,"small"),t._uU(228),t.qZA()(),t.TgZ(229,"div",66)(230,"div",67),t._uU(231),t.qZA()()()(),t.TgZ(232,"div",68)(233,"mat-label"),t._uU(234,"Filter Participants"),t.qZA(),t.TgZ(235,"div",17)(236,"div",19)(237,"mat-form-field",23)(238,"mat-label"),t._uU(239,"Nationality"),t.qZA(),t.TgZ(240,"mat-select",69),t.YNc(241,ke,2,2,"mat-option",43),t.qZA()()()(),t.TgZ(242,"div",17)(243,"div",19)(244,"mat-form-field",23)(245,"mat-label"),t._uU(246,"Gender"),t.qZA(),t.TgZ(247,"mat-select",70),t.YNc(248,Ie,2,2,"mat-option",43),t.qZA()()()(),t._UZ(249,"app-institution-faculty-dropdown"),t.TgZ(250,"div",71)(251,"button",72),t.NdJ("click",function(){return i.filtersUpdate()}),t._uU(252,"Apply Filters"),t.qZA()()(),t.TgZ(253,"div",16)(254,"span"),t._uU(255,"Project on the Web"),t.qZA()(),t.TgZ(256,"i"),t._uU(257,"* Project's Link Repository: You can add project external page URLs, app URLs, link to privacy statements, and more."),t.qZA(),t._UZ(258,"br")(259,"br"),t.TgZ(260,"div",73)(261,"div",8)(262,"div",19)(263,"mat-form-field",20)(264,"mat-label"),t._uU(265,"Enter link here"),t.qZA(),t._UZ(266,"input",74),t.qZA(),t.YNc(267,Fe,4,0,"mat-error",22),t.qZA()(),t.TgZ(268,"div",75)(269,"button",76),t.NdJ("click",function(){return i.addLink()}),t._uU(270,"Add link"),t.qZA()()(),t.TgZ(271,"div",17)(272,"div",19)(273,"mat-chip-list",77),t.YNc(274,Ee,3,4,"mat-chip",78),t.qZA()()(),t.TgZ(275,"div",16)(276,"span"),t._uU(277,"Upload Section "),t.qZA()(),t.TgZ(278,"div",17)(279,"p")(280,"strong",64),t._uU(281,"Project Configuration "),t.qZA(),t._UZ(282,"i",79),t.qZA(),t.TgZ(283,"div",19)(284,"mat-label"),t._uU(285,"Upload File "),t.TgZ(286,"small"),t._uU(287,"[ allowed formats: .zip .rar under 5MB ]"),t.qZA()(),t._UZ(288,"br"),t.TgZ(289,"input",13,80),t.NdJ("change",function(r){return i.onConfigFileSelected(r)}),t.qZA(),t.YNc(291,Ne,3,0,"button",81),t.qZA()(),t.TgZ(292,"div",82)(293,"button",83),t._uU(294,"Save Changes"),t.qZA()()()()()()()()()()),2&e){const a=t.MAs(51),r=t.MAs(79);t.xp6(2),t.Q6J("ngForOf",i.breadscrums),t.xp6(5),t.Q6J("formGroup",i.createStudyForm),t.xp6(24),t.Q6J("ngIf",i.selectedFile),t.xp6(11),t.Q6J("ngIf",i.createStudyForm.get("studyTitle").hasError("required")),t.xp6(6),t.Q6J("matDatepicker",a)("formControl",i.studyStartDate),t.xp6(1),t.Q6J("for",a),t.xp6(3),t.Q6J("ngIf",i.createStudyForm.get("studyStartDate").hasError("required")),t.xp6(9),t.Q6J("ngIf",i.createStudyForm.get("incentive").hasError("required")),t.xp6(15),t.Q6J("matDatepicker",r)("formControl",i.studyEndDate),t.xp6(1),t.Q6J("for",r),t.xp6(11),t.Q6J("ngIf",i.createStudyForm.get("studyEcts").hasError("required")),t.xp6(14),t.Q6J("editor",i.Editor)("config",i.config),t.xp6(1),t.Q6J("ngIf",i.createStudyForm.controls.studyDescription.invalid&&i.createStudyForm.controls.studyDescription.touched),t.xp6(7),t.Q6J("editor",i.Editor)("config",i.config),t.xp6(1),t.Q6J("ngIf",i.createStudyForm.controls.studyPurpose.invalid&&i.createStudyForm.controls.studyPurpose.touched),t.xp6(7),t.Q6J("editor",i.Editor)("config",i.config),t.xp6(1),t.Q6J("ngIf",i.createStudyForm.controls.studyTasks.invalid&&i.createStudyForm.controls.studyTasks.touched),t.xp6(10),t.Q6J("ngForOf",i.ProjectCategoriesList),t.xp6(7),t.Q6J("ngForOf",i.difficultyLevels),t.xp6(7),t.Q6J("ngForOf",i.projectNature),t.xp6(10),t.Q6J("ngForOf",i.keywords),t.xp6(10),t.Q6J("editor",i.Editor)("config",i.config),t.xp6(1),t.Q6J("ngIf",i.createStudyForm.controls.studyEligibility.invalid&&i.createStudyForm.controls.studyEligibility.touched),t.xp6(7),t.Q6J("editor",i.Editor)("config",i.config),t.xp6(1),t.Q6J("ngIf",i.createStudyForm.controls.participationFrequency.invalid&&i.createStudyForm.controls.participationFrequency.touched),t.xp6(7),t.Q6J("editor",i.Editor)("config",i.config),t.xp6(1),t.Q6J("ngIf",i.createStudyForm.controls.participationGuidelines.invalid&&i.createStudyForm.controls.participationGuidelines.touched),t.xp6(7),t.Q6J("ngForOf",i.ParticipantDemographicsList),t.xp6(13),t.Q6J("ngIf",i.createStudyForm.get("sampleSize").hasError("required")),t.xp6(6),t.hij(" ",i.createStudyForm.controls.participantEnrollment.value?" Open
1":" Closed"," "),t.xp6(2),t.Q6J("ngIf",i.participantsProgressbar),t.xp6(9),t.Q6J("value",-1),t.xp6(3),t.Q6J("ngForOf",i.participantsList),t.xp6(8),t.hij("Number of users fitered: ",i.filteredParticipants,""),t.xp6(2),t.Gre("progress-bar width-per-",i.participantPercentage,""),t.uIk("aria-valuenow",i.participantPercentage),t.xp6(1),t.hij(" ",i.participantPercentage,"% "),t.xp6(10),t.Q6J("ngForOf",i.countriesList),t.xp6(7),t.Q6J("ngForOf",i.participantGenderList),t.xp6(19),t.Q6J("ngIf",i.createStudyForm.get("newLink").hasError("pattern")),t.xp6(7),t.Q6J("ngForOf",i.createStudyForm.get("multipleLinks").value),t.xp6(17),t.Q6J("ngIf",null!=i.selectedConfigFile)}},dependencies:[u.sg,u.O5,d._Y,d.Fj,d.wV,d.JJ,d.JL,d.Q7,d.qQ,d.oH,d.sg,d.u,d.CE,m.TO,m.KE,m.hX,m.R9,b.Nt,w.Hw,T.lW,x.L,k.u,S.ey,v.Mq,v.hl,v.nW,Z.gD,F.Rr,P.gM,_.qn,_.HS,_.qH,C.pW,E.ap,j],styles:[".section-heading[_ngcontent-%COMP%]{background-color:#4fafa6;border-radius:0;margin:10px 10px 20px;color:#fff}.cropper-container[_ngcontent-%COMP%]{height:300px;display:flex;justify-content:center;align-items:center}image-cropper[_ngcontent-%COMP%]{width:100%;height:100%}",".ck-editor__editable {\n            min-height: 100px !important;\n        }"]}),o})();var Je=l(2574);let je=(()=>{class o{constructor(e,i,a){this.router=e,this.localService=i,this.backendService=a}canActivate(e,i){let a=this.localService.getUserRole();return a==this.backendService.researcher||a==this.backendService.smanager||(this.router.navigate(["/authentication/page401"]),!1)}}return o.\u0275fac=function(e){return new(e||o)(t.LFG(g.F0),t.LFG(h.C),t.LFG(y.v))}
1,o.\u0275prov=t.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();var Qe=l(8675),Le=l(4004);const Me=["search"];function Ve(o,n){if(1&o&&(t.TgZ(0,"span",10),t._uU(1),t.qZA()),2&o){const e=t.oxw();t.xp6(1),t.AsE(" (+",e.selectFormControl.value.length-1," ",2===(null==e.selectFormControl.value?null:e.selectFormControl.value.length)?"other":"others",") ")}}function Re(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"button",11),t.NdJ("click",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.clearSearch(a))}),t.TgZ(1,"mat-icon"),t._uU(2,"close"),t.qZA()()}2&o&&t.Q6J("disableRipple",!0)}function Ye(o,n){1&o&&(t.TgZ(0,"mat-optgroup")(1,"div"),t._uU(2,"No results found!"),t.qZA()())}function Oe(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"mat-option",12),t.NdJ("onSelectionChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.selectionChange(a))}),t._uU(1),t.qZA()}if(2&o){const e=n.$implicit;t.Q6J("value",e),t.xp6(1),t.hij(" ",e.name," ")}}let Ge=(()=>{class o{constructor(e){this.cdr=e,this.data=[],this.label="Select Item",this.selectedValues=[],this.selectionChangeEvent=ne
1w t.vpe,this.selectFormControl=new d.NI,this.searchTextboxControl=new d.NI}ngOnInit(){this.data=this.data||[],this.selectedValues=this.selectedValues||[],this.filteredOptions=this.searchTextboxControl.valueChanges.pipe((0,Qe.O)(""),(0,Le.U)(e=>this._filter(e))),this.selectFormControl.valueChanges.subscribe(e=>{this.selectionChangeEvent.emit(e?e.map(i=>i.id):[])})}ngOnChanges(e){(e.data||e.selectedValues)&&this.updateSelectedValues()}ngAfterViewInit(){this.updateSelectedValues()}updateSelectedValues(){(!this.data||!this.selectedValues)&&(this.data=this.data||[],this.selectedValues=this.selectedValues||[]);const e=new Set(this.selectedValues.map(a=>a.id)),i=this.data.filter(a=>e.has(a.id));this.selectFormControl.setValue(i),this.cdr.detectChanges()}_filter(e){if(!e||!this.data)return this.data||[];const i=e.toLowerCase();return this.data.filter(a=>a.name.toLowerCase().includes(i))}selectionChange(e){if(e.isUserInput&&!e.source.selected){const i=this.selectedValues.findIndex(a=>a.id===e.source.value.id);i>=0&&this.selectedValues.splice(i,1)}}openedChange(e){this.searchTextboxControl.patchValue(""),e&&this.searchTextBox?.nativeElement.focus()}clearSearch(e){e.stopPropagation(),this.searchTextboxControl.patchValue("")}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(t.sBO))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-multiselect-with-search"]],viewQuery:function(e,i){if(1&e&&t.Gf(Me,5),2&e){let a;t.iGM(a=t.CRH())&&(i.searchTextBox=a.first)}},inputs:{data:"data",label:"label",selectedValues:"selectedValues"},outputs:{selectionChangeEvent:"selectionChangeEvent"},features:[t.TTD],decls:17,vars:12,consts:[["appearance","outline",1,"example-full-width"],["multiple","",3,"formControl","openedChange"],["class","additional-selection",4,"ngIf"],[1,"select-container"],[2,"width","100%"],["autocomplete","off","placeholder","Search items","aria-label","Search","matInput","",3,"formControl"],["search",""],["matSuffix","","mat-icon-button","","aria-label","Clear",3,"disableRipple","click",4,"ngIf"],[4,"ngIf"],[3,"value","onSelectionChange",4,"ngFor","ngForOf"],[1,"additional-selection"],["matSuffix","","mat-icon-button","","aria-label","Clear",3,"disableRipple","click"],[3,"value","onSelectionChange"]],template:function(e,i){if(1&e&&(t.TgZ(0,"mat-form-field",0)(1,"mat-label"),t._uU(2),t.qZA(),t.TgZ(3,"mat-select",1),t.NdJ("openedChange",function(r){return i.openedChange(r)}),t.TgZ(4,"mat-select-trigger"),t._uU(5),t.YNc(6,Ve,2,2,"span",2),t.qZA(),t.TgZ(7,"div",3)(8,"mat-optgroup")(9,"mat-form-field",4),t._UZ(10,"input",5,6),t.YNc(12,Re,3,1,"button",7),t.qZA()(),t.YNc(13,Ye,3,0,"mat-optgroup",8),t.ALo(14,"async"),t.YNc(15,Oe,2,2,"mat-option",9),t.ALo(16,"async"),t.qZA()()()),2&e){const a=t.MAs(11);let r;t.xp6(2),t.Oqu(i.label),t.xp6(1),t.Q6J("formControl",i.selectFormControl),t.xp6(2),t.hij(" ",i.selectFormControl.value?null==i.selectFormControl.value[0]?null:i.selectFormControl.value[0].name:""," "),t.xp6(1),t.Q6J("ngIf",(null==i.selectFormControl.value?null:i.selectFormControl.value.length)>1),t.xp6(4),t.Q6J("formControl",i.searchTextboxControl),t.xp6(2),t.Q6J("ngIf",a.value),t.xp6(1),t.Q6J("ngIf",0===(null==(r=t.lcZ(14,8,i.filteredOptions))?null:r.length)),t.xp6(2),t.Q6J("ngForOf",t.lcZ(16,10,i.filteredOptions))}},dependencies:[u.sg,u.O5,d.Fj,d.JJ,d.oH,m.KE,m.hX,m.R9,b.Nt,w.Hw,T.lW,Z.gD,Z.$L,S.ey,S.Nv,u.Ov]}),o})();const Ke=["search"];function He(o,n){if(1&o&&(t.TgZ(0,"div",28),t._UZ(1,"app-breadcrumb",29),t.qZA()),2&o){const e=n.$implicit;t.xp6(1),t.Q6J("title",e.title)("items",e.items)("active_item",e.active)}}function Be(o,n){1&o&&t._UZ(0,"mat-progress-bar",30)}function ze(o,n){if(1&o&&(t.TgZ(0,"div",31),t._UZ(1,"img",32),t.qZA()),2&o){const e=t.oxw();
1t.xp6(1),t.Q6J("src","data:image/jpeg;base64,"+e.imageData,t.LSH)}}function $e(o,n){if(1&o&&(t.TgZ(0,"div",31),t._UZ(1,"img",32),t.qZA()),2&o){const e=t.oxw();t.xp6(1),t.s9C("src",e.projectImage,t.LSH)}}function We(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"app-multiselect-with-search",33),t.NdJ("selectionChangeEvent",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.handleSelectionChangeLeader(a))}),t.qZA()}if(2&o){const e=t.oxw();t.Q6J("label","Project Leader/Owner")("data",e.membersList)("selectedValues",e.preSelectedLeaders)}}function Xe(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"app-multiselect-with-search",33),t.NdJ("selectionChangeEvent",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.handleSelectionChangeCollaborators(a))}),t.qZA()}if(2&o){const e=t.oxw();t.Q6J("label","Collaborators")("data",e.membersList)("selectedValues",e.preSelectedCollaborators)}}function ti(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"app-multiselect-with-search",33),t.NdJ("selectionChangeEvent",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.handleSelectionChangeParticipants(a))}),t.qZA()}if(2&o){const e=t.oxw();t.Q6J("label","Participants")("data",e.membersList)("selectedValues",e.preSelectedParticipants)}}function ei(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"app-multiselect-with-search",33),t.NdJ("selectionChangeEvent",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.handleSelectionChangeManagement(a))}),t.qZA()}if(2&o){const e=t.oxw();t.Q6J("label","Management Support")("data",e.membersList)("selectedValues",e.preSelectedManagement)}}function ii(o,n){if(1&o){const e=t.EpF();t.TgZ(0,"app-multiselect-with-search",33),t.NdJ("selectionChangeEvent",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.handleSelectionChangeTechSupport(a))}),t.qZA()}if(2&o){const e=t.oxw();t.Q6J("label","Technical Support")("data",e.membersList)("selectedValues",e.preSelectedTechSupport)}}let Q=(()=>{class o{constructor(e,i,a,r){this.route=e,this.fb=i,this.localService=a,this.backendService=r,this.breadscrums=[{title:"Manage Contributors",items:["Project"],active:"Manage Contributors"}],this.imageData="",this.configFileExists=0,this.editProgressbar=!1,this.study_coordinators_data=[],this.userRole="",this.membersList=[],this.LeaderRoleId=1,this.selectedLeaders=[],this.preSelectedLeaders=[],this.CollaboratorRoleId=2,this.selectedCollaborators=[],this.preSelectedCollaborators=[],this.ParticipantRoleId=3,this.selectedParticipants=[],this.preSelectedParticipants=[],this.ManagementRoleId=4,this.selectedManagement=[],this.preSelectedManagement=[],this.TechSupportRoleId=5,this.selectedTechSupport=[],this.preSelectedTechSupport=[],this.studyId=-1,this.studyTitle="",this.studyStatus="",this.projectImage="assets/images/project-logo-default.png",this.projectContributors=[],this.roleAssignment=[],this.route.params.subscribe(s=>this.studyDsId=s.id)}ngOnInit(){this.initForm(),this.getProjectContributorsDetails().then(e=>this.getSingleStudyDetails().then(i=>{this.getActiveMembersList().then(a=>this.initForm())})),this.userRole=this.localService.getUserRole()}handleSelectionChangeLeader(e){this.selectedLeaders=e}handleSelectionChangeCollaborators(e){this.selectedCollaborators=e}handleSelectionChangeParticipants(e){this.selectedParticipants=e}handleSelectionChangeManagement(e){this.selectedManagement=e}handleSelectionChangeTechSupport(e){this.selectedTechSupport=e}transformMembers(e){if(null!=e)return e.map(i=>({id:i.ds_id,name:`${i.first_name} ${i.last_name}`}))}initForm(){this.editStudyForm=this.fb.group({studyTitle:[{value:this.studyTitle,disabled:!0},[]],studyStatus:[{value:this.studyStatus,disabled:!0},[]]})}onSubmitEditStudyForm(){let e={};e.study_ds_id=this.studyDsId,e.contributors=this.fetchSelectedRoles(),this.backendService.updateProjectContributors(e).subscribe(i=>{p().fire({icon:"success",title:"Success!",text:"Details updated successfully."})},i=>{p().fire({icon:"error",title:"Error!",text:"Request could not be completed successfully."})})}getSingleStudyDetails(){return this.editProgressbar=!0,new Promise((e,i)=>{this.backendService.getSingleStudyDetails(this.studyDsId).subscribe(a=>{if(a.found>0){let r=a.data;this.studyTitle=r.title,this.studyId=r.study_id,this.studyStatus=r.study_status,this.imageData=r.image,this.editProgressbar=!1,e()}this.editProgressbar=!1,e()},a=>{this.editProgressbar=!1,console.log(a),e()})})}getProjectContributorsDetails(){return this.editProgressbar=!0,new Promise((e,i)=>{this.backendService.getProjectContributorsDetails(this.studyDsId).subscribe(a=>{if(a.found>0){let r=a.data;this.projectContributors=r.contributors,this.roleAssignment=r.role_assignments,this.preSelectedLeaders=this.transformMembers(this.roleAssignment[1]),this.preSelectedCollaborators=this.transformMembers(this.roleAssignment[2]),this.preSelectedParticipants=this.transformMembers(this.roleAssignment[3]),this.preSelectedManagement=this.transformMembers(this.roleAssignment[4]),this.preSelectedTechSupport=this.transformMembers(this.roleAssignment[5]),this.editProgressbar=!1,e()}this.editProgressbar=!1,e()},a=>{this.editProgressbar=!1,console.log(a),e()})})}fetchSelectedRoles(){let e=[];
1return this.selectedLeaders.forEach(i=>{e.push({member:i,study:this.studyDsId,role:this.LeaderRoleId})}),this.selectedCollaborators.forEach(i=>{e.push({member:i,study:this.studyDsId,role:this.CollaboratorRoleId})}),this.selectedParticipants.forEach(i=>{e.push({member:i,study:this.studyDsId,role:this.ParticipantRoleId})}),this.selectedManagement.forEach(i=>{e.push({member:i,study:this.studyDsId,role:this.ManagementRoleId})}),this.selectedTechSupport.forEach(i=>{e.push({member:i,study:this.studyDsId,role:this.TechSupportRoleId})}),e}getActiveMembersList(){return this.editProgressbar=!0,new Promise((e,i)=>{this.backendService.getActiveMembersMinDetails().subscribe(a=>{this.membersList=this.transformMembers(a.members),this.editProgressbar=!1,e()},a=>{console.log(a),this.editProgressbar=!1,e()})})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(g.gz),t.Y36(d.QS),t.Y36(h.C),t.Y36(y.v))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-manage-contributors"]],viewQuery:function(e,i){if(1&e&&t.Gf(Ke,5),2&e){let a;t.iGM(a=t.CRH())&&(i.searchTextBox=a.first)}},decls:70,vars:16,consts:[[1,"content"],[1,"container-fluid"],["class","block-header",4,"ngFor","ngForOf"],["mode","indeterminate",4,"ngIf"],[1,"row","clearfix"],[1,"col-lg-12","col-md-12"],[1,"card"],[1,"header"],[1,"body"],[1,"register-form","m-4",3,"formGroup","ngSubmit"],[1,"col-lg-6","col-md-6","col-sm-12"],[1,"col-lg-6","col-md-6","col-sm-12","col-xs-12"],["style","float:right;",4,"ngIf"],[1,"header","section-heading"],[1,"col-lg-10","col-md-10","col-sm-12"],[1,"form-group"],["appearance","outline",1,"example-full-width"],["matInput","","formControlName","studyTitle"],["formControlName","studyStatus"],["value","pending",3,"disabled"],["value","approved",3,"disabled"],["value","inprogress",3,"disabled"],["value","rejected",3,"disabled"],["value","completed",3,"disabled"],[1,"col-lg-6","col-md-6","col-sm-6","col-xs-12"],[3,"label","data","selectedValues","selectionChangeEvent",4,"ngIf"],[1,"col-md-12"],["mat-raised-button","","type","button","color","primary",3,"click"],[1,"block-header"],[3,"title","items","active_item"],["mode","indeterminate"],[2,"float","right"],["alt","Project Image",1,"img-fluid",2,"max-width","120px",3,"src"],[3,"label","data","selectedValues","selectionChangeEvent"]],template:function(e,i){1&e&&(t.TgZ(0,"section",0)(1,"div",1),t.YNc(2,He,2,3,"div",2),t.YNc(3,Be,1,0,"mat-progress-bar",3),t.TgZ(4,"div",4)(5,"div",5)(6,"div",6)(7,"div",7)(8,"h2"),t._uU(9),t.qZA(),t._UZ(10,"hr"),t.qZA(),t.TgZ(11,"div",8)(12,"form",9),t.NdJ("ngSubmit",function(){return i.onSubmitEditStudyForm()}),t.TgZ(13,"div",4)(14,"div",10)(15,"h3"),t._uU(16,"Project Contributors"),t.qZA(),t.TgZ(17,"p"),t._uU(18,"Link all personnel involved in a project under predefined roles. Linked profiles will be featured on the project's public page along with a specified role. "),t.qZA(),t.TgZ(19,"i"),t._uU(20,"You can choose multiple people under some roles."),t.qZA(),t._UZ(21,"br"),t.qZA(),t.TgZ(22,"div",11),t.YNc(23,ze,2,1,"div",12),t.YNc(24,$e,2,1,"div",12),t.qZA(),t.TgZ(25,"div",13)(26,"span"),t._uU(27,"Project details"),t.qZA()(),t.TgZ(28,"div",10)(29,"div",14)(30,"div",15)(31,"mat-form-field",16)(32,"mat-label"),t._uU(33,"Project Title"),t.qZA(),t._UZ(34,"input",17),t.qZA()()()(),t.TgZ(35,"div",10)(36,"div",14)(37,"div",15)(38,"mat-form-field",16)(39,"mat-label"),t._uU(40,"Status"),t.qZA(),t.TgZ(41,"mat-select",18)(42,"mat-option",19),t._uU(43,"Pending"),t.qZA(),t.TgZ(44,"mat-option",20),t._uU(45,"Approved"),t.qZA(),t.TgZ(46,"mat-option",21),t._uU(47,"In progress"),t.qZA(),t.TgZ(48,"mat-option",22),t._uU(49,"Rejected"),t.qZA(),t.TgZ(50,"mat-option",23),t._uU(51,"Completed"),t.qZA()()()()()(),t.TgZ(52,"div",24)(53,"div",14),t.YNc(54,We,1,3,"app-multiselect-with-search",25),t.qZA()(),t.TgZ(55,"div",24)(56,"div",14),t.YNc(57,Xe,1,3,"app-multiselect-with-search",25),t.qZA()(),t.TgZ(58,"div",24)(59,"div",14),t.YNc(60,ti,1,3,"app-multiselect-with-search",25),t.qZA()(),t.TgZ(61,"div",24)(62,"div",14),t.YNc(63,ei,1,3,"app-multiselect-with-search",25),t.qZA()(),t.TgZ(64,"div",24)(65,"div",14),t.YNc(66,ii,1,3,"app-multiselect-with-search",25),t.qZA()(),t.TgZ(67,"div",26)(68,"button",27),t.NdJ("click",function(){return i.onSubmitEditStudyForm()}),t._uU(69,"Save Changes"),t.qZA()()()()()()()()()()),2&e&&(t.xp6(2),t.Q6J("ngForOf",i.breadscrums),t.xp6(1),t.Q6J("ngIf",i.editProgressbar),t.xp6(6),t.Oqu(i.studyTitle),t.xp6(3),t.Q6J("formGroup",i.editStudyForm),t.xp6(11),t.Q6J("ngIf",i.imageData),t.xp6(1),t.Q6J("ngIf",!i.imageData),t.xp6(18),t.Q6J("disabled","approved"==i.studyStatus||"completed"==i.studyStatus||"inprogress"==i.studyStatus),t.xp6(2),t.Q6J("disabled","researcher"==i.userRole),t.xp6(2),t.Q6J("disabled","researcher"==i.userRole&&"rejected"==i.studyStatus),t.xp6(2),t.Q6J("disabled","researcher"==i.userRole),t.xp6(2),t.Q6J("disabled","researcher"==i.userRole&&"rejected"==i.studyStatus),t.xp6(4),t.Q6J("ngIf",i.membersList&&i.membersList.length>0),t.xp6(3),t.Q6J("ngIf",i.membersList&&i.membersList.length>0),t.xp6(3),t.Q6J("ngIf",i.membersList&&i.membersList.length>0),t.xp6(3),t.Q6J("ngIf",i.membersList&&i.membersList.length>0),t.xp6(3),t.Q6J("ngIf",i.membersList&&i.membersList.length>0))},dependencies:[u.sg,u.O5,d._Y,d.Fj,d.JJ,d.JL,d.sg,d.u,m.KE,m.hX,b.Nt,T.lW,x.L,S.ey,Z.gD,C.pW,Ge]}),o})();const ai=[{path:"edit/:id",canActivate:[je],component:oe},{path:"view/:id",component:Ct},{path:"new",canActivate:[Je.m],component:De},{path:"manage-contributors/:id",canActivate:[(()=>{class o{constructor(e,i,a){this.router=e,this.localService=i,this.backendService=a}canActivate(e,i){return this.localService.getUserRole()==this.backendService.scoordinator||(this.router.navigate(["/authentication/page401"]),!1)}}return o.\u0275fac=function(e){return new(e||o)(t.LFG(g.F0),t.LFG(h.C),t.LFG(y.v))}
1,o.\u0275prov=t.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})()],component:Q}];let ri=(()=>{class o{}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[g.Bz.forChild(ai),g.Bz]}),o})();var ni=l(7084),si=l(6709),di=l(4180),li=l(7957),ci=l(811),pi=l(3546),ui=l(5938),mi=l(782),gi=l(6338),hi=l(8255),_i=l(1948),fi=l(3267),yi=l(7314),vi=l(6308),Zi=l(6257),bi=l(3683),Ti=l(1094),Ci=l(2851),L=l(1282),Si=l(5626),Ai=l(6482),wi=l(357);let qi=(()=>{class o{}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.oAB({type:o,bootstrap:[Q]}),o.\u0275inj=t.cJS({imports:[u.ez,ri,d.u5,d.UX,ni.To,m.lN,b.c,w.Ps,T.ot,si.p9,U.Nh,Si.K,di.O,k.d,li.Bb,ci.vV,pi.QW,v.FA,ui.Is,m.lN,mi.N6,gi.ie,hi.Tx,_i.Fk,Z.LD,fi.SJ,F.rP,yi.KP,vi.JX,Zi.T5,bi.g0,P.AV,L.Ll,L.x,Ti.yI,Ci.e4,_.Hi,C.Cv,Ai.u,E.QG,wi.d]}),o})()}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.