import{r as registerInstance,h}from"./index-102043e0.js";import{i as injectNotifier}from"./index-627a1410.js";import"./kimlikApi-ac700c81.js";import"./data-transfer-field-918730a3.js";import"./filter-cbaa3d7d.js";import{c as createMentornityApiInstance,d as MentornityViewConfigViewName}from"./instance-fe40f49f.js";import{m as mentornityApiEndpoint}from"./env-4ec3c807.js";import{g as getSessionDetails}from"./session-4127c2a1.js";import{a as getFormViewConfig,b as getFormParameters}from"./wrapper-util-1b6dfb05.js";import"./state-tunnel-04c0b67a.js";import"./BaseField-461b6d0c.js";import"./FieldModelGenerator-ee438a53.js";import"./index-ef734a5e.js";import"./index-336ef773.js";import"./date-ce777316.js";import"./index-0e8b9ea2.js";import"./index-c3eacf05.js";import"./membership-821de3c5.js";import"./data-model-f5160369.js";import"./membership-config-68ed7772.js";import"./table-config-720f8ea0.js";import"./string-3065a411.js";import"./User-d2ee8b71.js";import"./UserSettings-7b80b841.js";import"./cookie-647f9dc7.js";import"./_commonjsHelpers-27f122dd.js";import"./index-d3bd30bd.js";import"./form-view-config-fb04db06.js";import"./InterceptorHandler-6474bcf4.js";import"./view-config-efdeed6d.js";import"./ValidatorLength-f56a7c14.js";import"./mentorinty-bridge-api-fc8ad2d8.js";import"./index-a1675f50.js";import"./attachment-32decf79.js";import"./CalendarConfig-cc1e3a80.js";import"./common-wrapper-util-f1abefff.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};