var __awaiter=this&&this.__awaiter||function(e,i,t,n){function a(e){return e instanceof t?e:new t((function(i){i(e)}))}return new(t||(t=Promise))((function(t,r){function o(e){try{c(n.next(e))}catch(e){r(e)}}function s(e){try{c(n["throw"](e))}catch(e){r(e)}}function c(e){e.done?t(e.value):a(e.value).then(o,s)}c((n=n.apply(e,i||[])).next())}))};var __generator=this&&this.__generator||function(e,i){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,a,r,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(i){return c([e,i])}}function c(o){if(n)throw new TypeError("Generator is already executing.");while(t)try{if(n=1,a&&(r=o[0]&2?a["return"]:o[0]?a["throw"]||((r=a["return"])&&r.call(a),0):a.next)&&!(r=r.call(a,o[1])).done)return r;if(a=0,r)o=[o[0]&2,r.value];switch(o[0]){case 0:case 1:r=o;break;case 4:t.label++;return{value:o[1],done:false};case 5:t.label++;a=o[1];o=[0];continue;case 7:o=t.ops.pop();t.trys.pop();continue;default:if(!(r=t.trys,r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){t=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){t.label=o[1];break}if(o[0]===6&&t.label<r[1]){t.label=r[1];r=o;break}if(r&&t.label<r[2]){t.label=r[2];t.ops.push(o);break}if(r[2])t.ops.pop();t.trys.pop();continue}o=i.call(e,t)}catch(e){o=[6,e];a=0}finally{n=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-ecdfb761.js";import{a as generateActionEmitData}from"./action-util-20b0b25d.js";import{I as InvalidationAction,N as NotificationAction}from"./actions-b9a0f808.js";import{t as takvimAvailableTimePickerI18nDefault}from"./i18n-2d5bee10.js";import"./i18n-27a6b633.js";import"./i18n-f1ddd0c3.js";var DvnAppViewTakvimAvailableTimePickerView=function(){function e(e){registerInstance(this,e);this.invalidation=createEvent(this,"invalidation",7);this.notification=createEvent(this,"notification",7);this.action=createEvent(this,"action",7)}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){switch(i.label){case 0:e=this;return[4,this.apiSozluk.getContent(this.view.i18nEntryId,takvimAvailableTimePickerI18nDefault)];case 1:e.strings=i.sent();return[2]}}))}))};e.prototype.render=function(){var e=this;var i=this,t=i.createdMeeting,n=i.membership,a=i.user,r=i.userSettings,o=i.params.viewedUserMembership,s=i.strings,c=i.view;return h(Host,{class:"d-block"},h("takvim-available-time-picker",{apiData:this.apiData,apiTakvim:this.apiTakvim,userId:a._id,membershipConfigId:n.config._id,userSettings:r,guests:[a,o.user],guestMetadata:[{membershipConfigId:n.config._id},{membershipConfigId:o.config._id}],viewedUserId:o.user._id,viewedUserMembershipConfigId:o.config._id,calendarConfigId:c.table._id,onCreateMeeting:function(i){var t,n;if(c.successNavigationAction){e.createdMeeting=i.detail}(n=(t=c.events)===null||t===void 0?void 0:t.success)===null||n===void 0?void 0:n.forEach((function(i){if(i instanceof InvalidationAction){e.invalidation.emit(i)}if(i instanceof NotificationAction){e.notification.emit(i)}}))},strings:s,weekStartDay:r.weekStartDay}),h("dvn-dialog",{title:s.meetingIsScheduled,shown:!!t,onDismiss:function(){return e.createdMeeting=undefined}},h("div",{slot:"actions"},h("dvn-button",{view:"flat",onClick:function(){return e.createdMeeting=undefined}},s.stayOnPage),h("dvn-button",{tint:"primary",view:"flat",onClick:function(){return e.action.emit(generateActionEmitData({},e.createdMeeting,e.view.successNavigationAction))}},s.goToMeetingPage))))};return e}();export{DvnAppViewTakvimAvailableTimePickerView as dvn_app_view_takvim_available_time_picker_view};