import{r as registerInstance,h}from"./index-ecdfb761.js";import{i as injectNotifier}from"./index-1e6a7311.js";import"./apiBase-648a161d.js";import"./data-transfer-field-2f305919.js";import"./filter-cbaa3d7d.js";import{c as createMentornityApiInstance,e as MentornityViewConfigViewName}from"./instance-db63ecb7.js";import{g as getSessionDetails,a as mentornityApiEndpoint}from"./session-a602596d.js";import{a as getFormViewConfig,b as getFormParameters}from"./wrapper-util-9d93716a.js";import"./state-tunnel-04c0b67a.js";import"./BaseField-0b01dc2c.js";import"./FieldModelGenerator-03c7516c.js";import"./reference-field-a5b414d1.js";import"./index-61dcd269.js";import"./FieldGenerator-3ae403b2.js";import"./date-1bc489bd.js";import"./index-4e451db4.js";import"./index-32d8b974.js";import"./index-23baeeef.js";import"./index-09efdc01.js";import"./index-150b6a59.js";import"./membership-24db029a.js";import"./data-model-f7ccf826.js";import"./table-config-3820fb34.js";import"./string-3065a411.js";import"./User-9f1f4513.js";import"./UserSettings-27df01e6.js";import"./cookie-9f22e0fb.js";import"./kimlik-api-66e341bd.js";import"./_commonjsHelpers-27f122dd.js";import"./index-d3bd30bd.js";import"./mentorinty-bridge-api-f70621dd.js";import"./index-5f14b4fc.js";import"./attachment-d13ad547.js";import"./CalendarConfig-f8d4a70d.js";import"./index-3bf9b308.js";import"./i18n-4dcb85fe.js";import"./i18n-73c2e20d.js";import"./calendar-470c802a.js";import"./index-a3ca021c.js";import"./moment-65eca6b3.js";import"./ModifierTrimmer-2f77f917.js";import"./InterceptorHandler-6474bcf4.js";import"./ValidatorLength-f56a7c14.js";import"./form-view-config-db7fef80.js";import"./view-config-2fc2ba10.js";import"./common-wrapper-util-62bbacf2.js";import"./models-f0bc20c6.js";import"./actions-b9a0f808.js";var MentornityMembershipSettingsWrapper=function(){function e(e){registerInstance(this,e);this.isViewConfigWrapperLoaded=false}e.prototype.onInvalidation=function(e){this.notifier.showCustomNotification(e.detail.notification)};e.prototype.componentWillLoad=function(){var e=this;var i=getSessionDetails(),t=i.context,r=t.organisationId,n=t.role,o=t.userId,s=i.headers;var a=createMentornityApiInstance(mentornityApiEndpoint,s);a.getOrganisationConfig(r).then((function(i){e.organisationConfig=i}));var p=n==="mentor"?MentornityViewConfigViewName.MentorInfoForm:MentornityViewConfigViewName.MenteeInfoForm;a.getViewConfig(r,p).then((function(i){e.viewConfigWrapper=i})).finally((function(){return e.isViewConfigWrapperLoaded=true}));a.get("users",o).then((function(i){e.user=i}));a.getMetadataOfUser(r,n==="mentor"?"mentors":"mentees",o).then((function(i){e.userMetadata=i}));if(n==="mentor"){a.getMentorshipOfUser(r,o).then((function(i){e.userMentorship=i}))}};e.prototype.render=function(){var e=this,i=e.isViewConfigWrapperLoaded,t=e.language,r=e.organisationConfig,n=e.user,o=e.userMentorship,s=e.userMetadata,a=e.viewConfigWrapper;var p=getSessionDetails().context;if(!i||!r||!n||!s||p.role==="mentor"&&!o){return h("mentornity-root-wrapper",null,h("div",{class:"d-flex justify-content-center pt-3"},h("dvn-progress",{indefinite:true})))}var m={firstName:true,lastName:true};var f=["bio","skills","title"];var d=!this.organisationConfig.webAppConfiguration.membershipForm;var c=getFormViewConfig(p,t,r,a,n,s,o);if(a){(a.dvnAppViewConfig.table.fields||[]).forEach((function(e){var i=!f.includes(e.id);if(d||i){m[e.id]=true}}));c.ui.fields=c.ui.fields.filter((function(e){return m[e.fieldId]}))}return h("mentornity-root-wrapper",null,h("dvn-card",null,h("dvn-app-view-form-view",{params:getFormParameters(p,r,n,s,o),view:c})))};return e}();injectNotifier(MentornityMembershipSettingsWrapper);export{MentornityMembershipSettingsWrapper as mentornity_membership_settings_wrapper};