import{r as p,h as t}from"./p-9f21f85f.js";import{i as s}from"./p-7b89f99a.js";import"./p-25d382ec.js";import"./p-3968aca6.js";import"./p-d343a062.js";import{g as r,c as o,m as i,h as e}from"./p-c44f96b9.js";import{a as m,b as a}from"./p-d300bfce.js";import"./p-83f217d4.js";import"./p-105f7627.js";import"./p-6a6f355f.js";import"./p-aa5ffe14.js";import"./p-293acc32.js";import"./p-f2965a61.js";import"./p-0563ceba.js";import"./p-1e47e7bd.js";import"./p-31e77e7b.js";import"./p-825ab276.js";import"./p-6c8be41c.js";import"./p-1187cc7c.js";import"./p-881a2bb8.js";import"./p-968ee2ec.js";import"./p-d27cb594.js";import"./p-9c82afa0.js";import"./p-d6c479ab.js";import"./p-10cfccbb.js";import"./p-8d2ddf16.js";import"./p-814af281.js";import"./p-e929429b.js";import"./p-905285ef.js";import"./p-a86d8cf2.js";import"./p-3ccedaa0.js";import"./p-9aa2fafd.js";import"./p-c2c9e896.js";import"./p-cb585cde.js";import"./p-3d141e05.js";import"./p-d59ffc5b.js";import"./p-0988b316.js";import"./p-65eb3f89.js";import"./p-42939000.js";import"./p-0b1ac773.js";import"./p-35c7f358.js";import"./p-ad6da9fe.js";import"./p-8e52c7df.js";import"./p-5d192a8d.js";import"./p-33c4053b.js";import"./p-65434c2b.js";import"./p-6cf8ecf7.js";const c=class{constructor(t){p(this,t),this.isViewConfigWrapperLoaded=!1}onInvalidation(p){this.notifier.showCustomNotification(p.detail.notification)}componentWillLoad(){const{context:{organisationId:p,role:t,userId:s},headers:m}=r(),a=o(i,m);a.getOrganisationConfig(p).then((p=>{this.organisationConfig=p})),a.getViewConfig(p,"mentor"===t?e.MentorInfoForm:e.MenteeInfoForm).then((p=>{this.viewConfigWrapper=p})).finally((()=>this.isViewConfigWrapperLoaded=!0)),a.get("users",s).then((p=>{this.user=p})),a.getMetadataOfUser(p,"mentor"===t?"mentors":"mentees",s).then((p=>{this.userMetadata=p})),"mentor"===t&&a.getMentorshipOfUser(p,s).then((p=>{this.userMentorship=p}))}render(){const{isViewConfigWrapperLoaded:p,language:s,organisationConfig:o,user:i,userMentorship:e,userMetadata:c,viewConfigWrapper:n}=this,{context:j}=r();if(!p||!o||!i||!c||"mentor"===j.role&&!e)return t("mentornity-root-wrapper",null,t("div",{class:"d-flex justify-content-center pt-3"},t("dvn-progress",{indefinite:!0})));const f={firstName:!0,lastName:!0},d=["bio","skills","title"],b=!this.organisationConfig.webAppConfiguration.membershipForm;let l=m(j,s,o,n,i,c,e);return n&&((n.dvnAppViewConfig.table.fields||[]).forEach((p=>{const t=!d.includes(p.id);(b||t)&&(f[p.id]=!0)})),l.ui.fields=l.ui.fields.filter((p=>f[p.fieldId]))),t("mentornity-root-wrapper",null,t("dvn-card",null,t("dvn-app-view-form-view",{params:a(j,o,i,c,e),view:l})))}};s(c);export{c as mentornity_membership_settings_wrapper}