import{r as p,h as t}from"./p-9f21f85f.js";import{i as s}from"./p-7b89f99a.js";import"./p-e78d5616.js";import"./p-3968aca6.js";import"./p-d343a062.js";import{c as r,e as o}from"./p-a3d5ad34.js";import{g as i,a as e}from"./p-f88474bf.js";import{a as m,b as a}from"./p-5c061feb.js";import"./p-83f217d4.js";import"./p-105f7627.js";import"./p-62d6b6a7.js";import"./p-0563ceba.js";import"./p-1e47e7bd.js";import"./p-31e77e7b.js";import"./p-825ab276.js";import"./p-6c8be41c.js";import"./p-9f31253b.js";import"./p-1187cc7c.js";import"./p-881a2bb8.js";import"./p-968ee2ec.js";import"./p-3c7a3a90.js";import"./p-7737f905.js";import"./p-0ff0ee91.js";import"./p-d27cb594.js";import"./p-902ec37a.js";import"./p-74e6e642.js";import"./p-84876749.js";import"./p-03b520ca.js";import"./p-814af281.js";import"./p-e929429b.js";import"./p-2c9430cc.js";import"./p-5209de98.js";import"./p-19efc983.js";import"./p-e7d62c6a.js";import"./p-c2c9e896.js";import"./p-67d3bdb0.js";import"./p-1ba76ce7.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-38a21ba5.js";import"./p-6af4d5e0.js";import"./p-26046226.js";import"./p-65434c2b.js";import"./p-6cf8ecf7.js";const j=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}=i(),a=r(e,m);a.getOrganisationConfig(p).then((p=>{this.organisationConfig=p})),a.getViewConfig(p,"mentor"===t?o.MentorInfoForm:o.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:r,user:o,userMentorship:e,userMetadata:j,viewConfigWrapper:n}=this,{context:c}=i();if(!p||!r||!o||!j||"mentor"===c.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(c,s,r,n,o,j,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(c,r,o,j,e),view:l})))}};s(j);export{j as mentornity_membership_settings_wrapper}