import{r as registerInstance,h}from"./index-b7735e0d.js";import{i as injectNotifier}from"./index-94b34cb1.js";import"./apiBase-d573f009.js";import"./data-transfer-field-918730a3.js";import"./filter-cbaa3d7d.js";import{c as createMentornityApiInstance,d as MentornityViewConfigViewName}from"./instance-7b02ef1d.js";import{m as mentornityApiEndpoint}from"./env-4ec3c807.js";import{g as getSessionDetails}from"./session-b16a440c.js";import{a as getFormViewConfig,b as getFormParameters}from"./wrapper-util-3ed8d7e2.js";import"./state-tunnel-04c0b67a.js";import"./BaseField-461b6d0c.js";import"./FieldModelGenerator-020f4a04.js";import"./reference-field-0e7cd534.js";import"./index-7b119e61.js";import"./index-403101cb.js";import"./date-ce777316.js";import"./index-1d3efe49.js";import"./index-eb14fd2d.js";import"./index-80ec23ef.js";import"./index-4c39b6a6.js";import"./membership-e92743d1.js";import"./data-model-f7ccf826.js";import"./table-config-0c06fb1f.js";import"./string-3065a411.js";import"./User-1ef5a482.js";import"./UserSettings-27df01e6.js";import"./cookie-1686830b.js";import"./kimlikApi-0d7e6ce7.js";import"./_commonjsHelpers-27f122dd.js";import"./index-d3bd30bd.js";import"./ModifierTrimmer-2f77f917.js";import"./InterceptorHandler-6474bcf4.js";import"./ValidatorLength-f56a7c14.js";import"./form-view-config-16052dc8.js";import"./view-config-dfb61752.js";import"./mentorinty-bridge-api-78ab1153.js";import"./index-774783ee.js";import"./attachment-32decf79.js";import"./CalendarConfig-88c2213e.js";import"./common-wrapper-util-289d199c.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 t=getSessionDetails(),i=t.context,r=i.organisationId,n=i.role,o=i.userId,s=t.headers;var a=createMentornityApiInstance(mentornityApiEndpoint,s);a.getOrganisationConfig(r).then((function(t){e.organisationConfig=t}));var p=n==="mentor"?MentornityViewConfigViewName.MentorInfoForm:MentornityViewConfigViewName.MenteeInfoForm;a.getViewConfig(r,p).then((function(t){e.viewConfigWrapper=t})).finally((function(){return e.isViewConfigWrapperLoaded=true}));a.get("users",o).then((function(t){e.user=t}));a.getMetadataOfUser(r,n==="mentor"?"mentors":"mentees",o).then((function(t){e.userMetadata=t}));if(n==="mentor"){a.getMentorshipOfUser(r,o).then((function(t){e.userMentorship=t}))}};e.prototype.render=function(){var e=this,t=e.isViewConfigWrapperLoaded,i=e.language,r=e.organisationConfig,n=e.user,o=e.userMentorship,s=e.userMetadata,a=e.viewConfigWrapper;var p=getSessionDetails().context;if(!t||!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=getFormViewConfig(p,i,r,a,n,s,o);return h("mentornity-root-wrapper",null,h("dvn-card",null,h("dvn-app-view-form-view",{params:getFormParameters(p,r,n,s,o),view:m})))};return e}();injectNotifier(MentornityMembershipSettingsWrapper);export{MentornityMembershipSettingsWrapper as mentornity_membership_settings_wrapper};