var __extends=this&&this.__extends||function(){var e=function(i,t){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var t in i)if(Object.prototype.hasOwnProperty.call(i,t))e[t]=i[t]};return e(i,t)};return function(i,t){if(typeof t!=="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(i,t);function n(){this.constructor=i}i.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();import{r as registerInstance,h,H as Host}from"./index-ecdfb761.js";import{T as TakvimAvailableTimePickerViewConfig}from"./takvim-available-time-picker-view-config-816c103b.js";import{T as TableConfig}from"./table-config-d73a72ab.js";import{D as DvnAppViewConfig}from"./view-config-1ed8c59f.js";import{g as generateCalendarConfig}from"./mentorinty-bridge-api-5ca2d652.js";import{b as generateMentornitySessionContext,d as generateMembershipForRole}from"./session-2a491341.js";import"./FieldModelGenerator-378c8613.js";import"./reference-field-a5b414d1.js";import"./BaseField-0b01dc2c.js";import"./index-61dcd269.js";import"./FieldGenerator-3ae403b2.js";import"./date-1bc489bd.js";import"./index-4e451db4.js";import"./index-23baeeef.js";import"./index-09efdc01.js";import"./index-150b6a59.js";import"./data-model-88af49fc.js";import"./apiBase-6015f41f.js";import"./data-transfer-field-2f305919.js";import"./filter-cbaa3d7d.js";import"./index-e66e8eca.js";import"./attachment-961dd228.js";import"./membership-b6639471.js";import"./string-3065a411.js";import"./User-72c4643a.js";import"./CalendarConfig-412d1b0f.js";import"./UserSettings-7e4170a7.js";import"./cookie-5d9f5819.js";import"./kimlik-api-fddeac81.js";import"./_commonjsHelpers-27f122dd.js";import"./index-d3bd30bd.js";import"./index-3bf9b308.js";import"./sozluk-entries-1e8f5234.js";import"./i18n-09a07b97.js";import"./i18n-0e757ca5.js";import"./calendar-470c802a.js";import"./index-a3ca021c.js";import"./moment-65eca6b3.js";var TakvimDailyCalendarViewConfig=function(e){__extends(i,e);function i(){return e!==null&&e.apply(this,arguments)||this}i.decode=function(e){var t=Object.assign(Object.create(i.prototype),e);t.table=TableConfig.decode(t.table);return t};return i}(DvnAppViewConfig);var MentornityHomeMessageWrapper=function(){function e(e){registerInstance(this,e)}e.prototype.componentWillLoad=function(){var e=this;generateMentornitySessionContext(this.contextParams,{fetchConfig:true}).then((function(i){e.mentornitySessionContext=i;e.view=generateView(i);e.membership=generateMembershipForRole("admin")})).catch((function(i){return e.error=i}))};e.prototype.onViewMeeting=function(e){window.dispatchEvent(new CustomEvent("dvn.mentornity-admin-calendar-view.open-meeting-page",{detail:{meetingId:e.detail._id}}))};e.prototype.onAction=function(e){var i=e.detail;switch(i.name){case"open-meeting-detail-after-creation":window.dispatchEvent(new CustomEvent("dvn.mentornity-admin-calendar-view.open-meeting-page",{detail:{meetingId:i.params.meetingId}}));break}};e.prototype.render=function(){var e=this,i=e.error,t=e.mentornitySessionContext,n=e.view;if(!!i){return h("dvn-card",{leanedSides:true,tint:"danger"},"Failed to get data.")}if(!t){return h("div",{class:"d-flex justify-content-center pt-3"},h("dvn-progress",{indefinite:true}))}return h(Host,{class:"d-flex flex-grow-1",style:{overflow:"hidden",background:"var(--color-background-primary)"}},h("mentornity-root-wrapper",null,h("dvn-app-view-takvim-daily-calendar-view",{apiData:this.mentornitySessionContext.mentornityBridgeApi,apiSozluk:this.mentornitySessionContext.apiSozluk,apiTakvim:this.mentornitySessionContext.mentornityBridgeApi,user:this.mentornitySessionContext.user,userSettings:this.mentornitySessionContext.userSettings,membership:this.membership,view:n})))};return e}();function generateView(e){var i="mentors";var t="mentees";if(e.organisationConfig.menteeType==="group"){t="groups"}return TakvimDailyCalendarViewConfig.decode({i18nEntryId:"dailyCalendarView",table:generateCalendarConfig(e.organisationConfig),membershipConfigIdToGroupMeetings:i,membershipConfigIdToViewOnMeetings:t,availableTimePickerConfig:TakvimAvailableTimePickerViewConfig.decode({_id:"admin-calendar-page-available-time-picker-view-wrapper",i18nEntryId:"user-card-list-page-available-time-picker-view",table:generateCalendarConfig(e.organisationConfig),successNavigationAction:{type:"navigation",direction:"forward",name:"open-meeting-detail-after-creation",params:{conversionConfig:{"item._id":"meetingId"}}}})})}export{MentornityHomeMessageWrapper as mentornity_admin_calendar_view};