<?xml version='1.0' encoding='UTF-8'?><uidget><metadata><name>Agenda</name><description>Add a calendar to your website</description><help><![CDATA[
			This block displays a nice and dynamic calendar on your website. You can customize its events easily: title, color, dates, description.
			]]></help><api_version>1.0</api_version><size height='500' width='650' /><server>local://CalendarCptServer</server><blog en='662' /></metadata><view><content>&lt;!-- CALENDAR CONTAINER --&gt;
&lt;div class=&quot;uica_calendar&quot;&gt;
	&lt;div class=&quot;uica_calendar_container&quot;&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;!-- Add Event form --&gt;
&lt;div class=&quot;uica_window&quot; style=&quot;display:none;&quot;&gt;
		&lt;div class=&quot;uica_header_window&quot;&gt;
			&lt;input class=&quot;uica_title_event uica_te&quot; type=&quot;text&quot; name=&quot;title_event&quot; placeholder=&quot;Event title&quot;&gt;
			&lt;!--COLOR PICKER --&gt;

			&lt;span class=&quot;fonticon uica_window_close_btn&quot;&gt;✖&lt;/span&gt;
			&lt;button class=&quot;uica_cs_opener&quot; style=&quot;padding: 3px 8px;border-radius: 2px;border: 0px solid;background-color: transparent;margin-left: 10px;float:right&quot;&gt;
				&lt;span class=&quot;fonticon&quot;&gt;&amp;#xe902;&lt;/span&gt;
			&lt;/button&gt;
			&lt;div class=&quot;uica_color_selector&quot;&gt;
				&lt;div class=&quot;uica_cs_square&quot;&gt;&lt;/div&gt;
				&lt;div class=&quot;uica_cs_title&quot;&gt;
					&lt;span&gt;Choose a color&lt;/span&gt;
					&lt;span class=&quot;fonticon uica_cf_close_btn&quot;&gt;✖&lt;/span&gt;
				&lt;/div&gt;
				&lt;div class=&quot;uica_cs_container&quot;&gt;
					&lt;div class=&quot;uica_cs_card_more&quot;&gt;
						&lt;span class=&quot;uica_cs_textcolor&quot;&gt;Or another color&lt;/span&gt;
							&lt;input class=&quot;uica_colorPicker input_colorPicker&quot;&gt;
					&lt;/div&gt;
				&lt;/div&gt;
			&lt;/div&gt;
		&lt;/div&gt;
		&lt;div class=&quot;uica_content&quot;&gt;
			&lt;div class=&quot;uica_event_dates&quot;&gt;

				&lt;!-- Jour entier==&gt; checkbox --&gt;
				&lt;div&gt;
					&lt;label id=&quot;use_hour_text&quot; for=&quot;use_hour&quot;&gt;Specify hours&lt;/label&gt;
					&lt;input class=&quot;uica_input_use_hour&quot; name=&apos;use_hour&apos; type=&apos;checkbox&apos; value=&apos;use_hour&apos;&gt;
				&lt;/div&gt;
				&lt;div&gt;
					&lt;label for=&quot;start_date&quot;&gt;Start Date&lt;/label&gt;
					&lt;div class=&quot;day_container&quot;&gt;
						&lt;select class=&quot;start_day_chooser&quot;&gt;
							&lt;option value=&quot;1&quot;&gt;Monday&lt;/option&gt;
							&lt;option value=&quot;2&quot;&gt;Tuesday&lt;/option&gt;
							&lt;option value=&quot;3&quot;&gt;Wednesday&lt;/option&gt;
							&lt;option value=&quot;4&quot;&gt;Thursday&lt;/option&gt;
							&lt;option value=&quot;5&quot;&gt;Friday&lt;/option&gt;
							&lt;option value=&quot;6&quot;&gt;Saturday&lt;/option&gt;
							&lt;option value=&quot;0&quot;&gt;Sunday&lt;/option&gt;
						&lt;/select&gt;
					&lt;/div&gt;
					&lt;div class=&apos;input-group date uica_startdatepicker&apos;&gt;
              &lt;input type=&apos;text&apos; class=&quot;form-control&quot; style=&quot;height: 29px;border-radius: 2px;padding-left:45px;&quot; required=&quot;required&quot;/&gt;
              &lt;span class=&quot;input-group-addon&quot;&gt;
                  &lt;span class=&quot;fonticon&quot;&gt;⏨&lt;/span&gt;
              &lt;/span&gt;
          &lt;/div&gt;
				&lt;/div&gt;
				&lt;div&gt;
					&lt;label for=&quot;end_date&quot;&gt;End Date&lt;/label&gt;
					&lt;div class=&quot;day_container&quot;&gt;
						&lt;select class=&quot;end_day_chooser&quot;&gt;
							&lt;option value=&quot;1&quot;&gt;Monday&lt;/option&gt;
							&lt;option value=&quot;2&quot;&gt;Tuesday&lt;/option&gt;
							&lt;option value=&quot;3&quot;&gt;Wednesday&lt;/option&gt;
							&lt;option value=&quot;4&quot;&gt;Thursday&lt;/option&gt;
							&lt;option value=&quot;5&quot;&gt;Friday&lt;/option&gt;
							&lt;option value=&quot;6&quot;&gt;Saturday&lt;/option&gt;
							&lt;option value=&quot;0&quot;&gt;Sunday&lt;/option&gt;
						&lt;/select&gt;
					&lt;/div&gt;
          &lt;div class=&apos;input-group date uica_enddatepicker&apos;&gt;
              &lt;input type=&apos;text&apos; class=&quot;form-control&quot; style=&quot;height: 29px;border-radius: 2px;padding-left:45px;&quot; required=&quot;required&quot;/&gt;
              &lt;span class=&quot;input-group-addon&quot;&gt;
                  &lt;span class=&quot;fonticon&quot;&gt;⏨&lt;/span&gt;
              &lt;/span&gt;
          &lt;/div&gt;
				&lt;/div&gt;
			&lt;/div&gt;
			&lt;div class=&quot;uica_elements uica_textcontainer&quot;&gt;
				&lt;label&gt;Description: &lt;/label&gt;
				&lt;div class=&quot;uica_ptxt&quot; uitype=&quot;editor&quot; uinocb=&quot;true&quot;&gt;&lt;/div&gt;
			&lt;/div&gt;
		&lt;/div&gt;
		&lt;div class=&quot;uica_footer&quot;&gt;
				&lt;button class=&quot;uica_delete_btn btn btn-default&quot;&gt;&lt;span class=&quot;fonticon&quot; style=&quot;font-size: 14px;&quot;&gt;&lt;/span&gt; Delete&lt;/button&gt;
				&lt;button class=&quot;uica_submit_btn btn btn-primary&quot;&gt;&lt;/button&gt;
		&lt;/div&gt;
&lt;/div&gt;

&lt;!-- Popup viewer form --&gt;
&lt;div class=&quot;uica_viewer_event_window&quot; style=&quot;display:none;&quot;&gt;
		&lt;div class=&quot;uica_viewer_header_window&quot;&gt;
			&lt;span class=&quot;fonticon uica_viewer_close_btn&quot;&gt;✖&lt;/span&gt;
			&lt;label class=&quot;uica_viewer_title_event uica_te&quot;&gt;&lt;/label&gt;
		&lt;/div&gt;
		&lt;div class=&quot;uica_viewer_content&quot;&gt;
			&lt;div class=&quot;uica_viewer_event_dates&quot;&gt;
				&lt;span class=&quot;uica_viewer_date_event&quot;&gt;&lt;/span&gt;
			&lt;/div&gt;
			&lt;div class=&quot;uica_viewer_uica_elements&quot;&gt;
				&lt;label&gt;Description&lt;/label&gt;
				&lt;div class=&quot;uica_viewer_description_container&quot;&gt;&lt;/div&gt;
			&lt;/div&gt;
		&lt;/div&gt;
	&lt;/form&gt;
&lt;/div&gt;

&lt;!-- Windows selection mode --&gt;

&lt;div class=&quot;uica_mode_selection_window editor_interface&quot;&gt;
	&lt;div class=&quot;uica_mode_selection_header&quot;&gt;
		&lt;h3&gt;Choose your display mode&lt;/h3&gt;
	&lt;/div&gt;
	&lt;div class=&quot;uica_mode_selection_first_choice_container&quot; data-mode=&quot;calendar&quot;&gt;
	  &lt;div class=&quot;uica_mode_selection_choice_header&quot;&gt;
	  	&lt;h3&gt;Calendar&lt;/h3&gt;
		&lt;/div&gt;
	  &lt;div class=&quot;uica_mode_selection_content&quot;&gt;
			&lt;img class=&quot;uica_mode_selection_illustration&quot; src=&quot;/components/UI_Calendar/agenda.svg&quot; alt=&quot;&quot;&gt;
			&lt;p&gt;Display a calendar on your website - easily add and edit events for specific dates.&lt;/p&gt;
		&lt;/div&gt;
	  &lt;div class=&quot;uica_mode_selection_footer&quot;&gt;
			&lt;button type=&quot;button&quot; class=&quot;uica_mode_selection_calendar_choice btn btn-primary&quot; value=&quot;calendar&quot;&gt;Calendar mode&lt;/button&gt;
		&lt;/div&gt;
	&lt;/div&gt;
	&lt;div class=&quot;uica_mode_selection_second_choice_container&quot; data-mode=&quot;agenda&quot;&gt;
		&lt;div class=&quot;uica_mode_selection_choice_header&quot;&gt;
			&lt;h3&gt;Timetable&lt;/h3&gt;
		&lt;/div&gt;
		&lt;div class=&quot;uica_mode_selection_content&quot;&gt;
			&lt;img class=&quot;uica_mode_selection_illustration&quot; src=&quot;/components/UI_Calendar/emploie_du_temps.svg&quot; alt=&quot;&quot;&gt;
			&lt;p&gt;Do you have an activity with recurring schedules? Use the Timetable mode.&lt;/p&gt;
		&lt;/div&gt;
		&lt;div class=&quot;uica_mode_selection_footer&quot;&gt;
			&lt;button type=&quot;button&quot; class=&quot;uica_mode_selection_agenda_choice btn btn-primary&quot; value=&quot;agenda&quot;&gt;Timetable mode&lt;/button&gt;
		&lt;/div&gt;
	&lt;/div&gt;
&lt;/div&gt;
</content><properties><radio class='default_mode_radio' default='&apos;not_set&apos;' display='Timetable mode|Calendar mode' help='The Agenda block can display two types of content:&lt;br/&gt;
				- a Calendar: with events at specific dates (ideal to show reservations for example).&lt;br/&gt;
				- a Timetable: only showing specific days of a week (ideal to show your regular opening hours for example).' name='default_mode' title='Display mode' values='agenda|calendar' /><label class='calendar_mode_option' text='Available views' title='Available views' /><checkbox class='calendar_mode_option' default='true' help='If checked, a button will be displayed at the top to select the &apos;month&apos; view' name='month' value='Month' /><checkbox class='calendar_mode_option' default='true' help='If checked, a button will be displayed at the top to select the &apos;week&apos; view' name='agendaWeek' value='Week' /><checkbox class='calendar_mode_option' default='true' help='If checked, a button will be displayed at the top to select the &apos;list&apos; view' name='listMonth' value='List' /><checkbox class='calendar_mode_option' default='false' help='If checked, a button will be displayed at the top to select the &apos;year list&apos; view' name='listYear' value='Year list' /><checkbox class='calendar_mode_option' default='true' help='If checked, a button will be displayed at the top to select the &apos;day&apos; view' name='agendaDay' value='Day' /><checkbox class='calendar_mode_option' default='false' help='If checked, the visitors will not be able to display past events in the calendar.' name='blockPast' title='Other options' value='Now and future only' /><radio class='calendar_mode_option defaultDayRadio' default='&apos;now&apos;' display='The current period|The last displayed period' help='Choose on which day the calendar is opened&lt;br&gt;The period containing the day the user open your website&lt;br&gt;The period of your choice: the calendar will always open on the same period, the one displayed when you last saved your website.' name='default_date' title='Period displayed' values='now|current_day' /><calendar_selector default='[]' help='Display events of personal or public Google calendars' icon='calendar' name='calendarsFile' /><label class='agenda_mode_option' text='Agenda options' title='Agenda options' /><select class='agenda_mode_option' default='&apos;0&apos;' display='Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday' help='Set the first day of your week' name='agenda_start_date' title='First day' values='0|1|2|3|4|5|6' /><slider class='uim_prop_custom agenda_mode_option calendar_mode_option agenda_mode_option_start_hour' default='8' help='Set the first hour of each day.' maximum='23' minimum='0' name='start_hour' title='Start hour' /><slider class='uim_prop_custom agenda_mode_option calendar_mode_option agenda_mode_option_day_duration' default='12' help='Set how many hours is displayed in each day.' maximum='24' minimum='1' name='day_duration' title='Day duration (in hours)' /><radio class='agenda_mode_option defaultDayRadio' default='30' display='5min|10 min|15 min|30 min|60 min' name='event_duration' title='Period displayed' values='5|10|15|30|60' /><slider class='uim_prop_custom uim_prop_font_size agenda_mode_option' default='5' help='Set how many days are displayed.' maximum='7' minimum='1' name='week_day_number' title='Number of days' /></properties><design_properties /></view><script>UI_Calendar={scriptLoaded:false,getLang:false};
UI_List.UI_Calendar={initialize:function(a){this.cpt=a;
a.setOptions([&quot;locked&quot;,&quot;footer&quot;]);
this.importCSS(&quot;//cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.4.0/fullcalendar.min.css&quot;,&quot;uica_css1&quot;)
},onDisplay:function(b){var a=this;
if(!this.cpt.data.default_mode){this.cpt.data.default_mode=&quot;calendar&quot;;
this.cpt.data.week_day_number=5;
this.cpt.data.agenda_start_date=0;
this.cpt.data.start_hour=8;
this.cpt.data.day_duration=12;
this.cpt.data.event_duration=30
}this.locale=&quot;en&quot;;
this.defaultDay=moment();
this.currentView=&quot;month&quot;;
this.button_header=(this.cpt.data.header_btn!=null)?this.cpt.data.header_btn:{month:true,agendaWeek:true,listMonth:true,agendaDay:true};
this.calendarNode=$(&quot;.uica_calendar&quot;,this.cpt.node);
this.calendar=$(&quot;.uica_calendar_container&quot;,this.cpt.node);
b.find(&quot;.uica_mode_selection_window&quot;).hide();
if(v.mode==&quot;editor&quot;){if(this.cpt.data.default_mode!=&quot;not_set&quot;){this.onDisplayCorrectMode(b);
this.displayCalendar()
}else{this.askChoice(b)
}this.calendarNode.on(&quot;click&quot;,function(c){var d=$(c.target);
if(!(d.hasClass(&quot;fc-day&quot;)||d.hasClass(&quot;fc-day-top&quot;)||d.closest(&quot;.fc-event-container&quot;).length)){a.cleanAndHidePopup()
}})
}else{this.instantiateViewerModePopup(b);
this.displayCalendar()
}},askChoice:function(c){var b=this;
this.choice_window={window_container:c.find(&quot;.uica_mode_selection_window&quot;),first_choice_container:c.find(&quot;.uica_mode_selection_first_choice_container&quot;),second_choice_container:c.find(&quot;.uica_mode_selection_second_choice_container&quot;)};
this.choice_window.window_container.show();
var a=function(d){var f=$(this).data(&quot;mode&quot;);
b.onDisplayCorrectMode(c);
b.cpt.setData(&quot;default_mode&quot;,f);
b.cpt.propertyNode.find(&quot;.default_mode_radio input[value=&quot;+f+&quot;]&quot;).click()
};
this.choice_window.first_choice_container.click(a);
this.choice_window.second_choice_container.click(a)
},displayCalendar:function(){if(this.cpt.data.default_mode==&quot;not_set&quot;){return
}var a=this;
if(!this.calendar.fullCalendar){if(!UI_Calendar.scriptLoaded){UI_Calendar.scriptLoaded=$.getScript(&quot;//cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.4.0/fullcalendar.min.js&quot;)
}UI_Calendar.scriptLoaded.done(function(c,d){if(!UI_Calendar.getLang){UI_Calendar.getLang=$.getScript(&quot;//cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.4.0/locale-all.js&quot;)
}UI_Calendar.getLang.done(function(e,f){if(!UI_Calendar.getGcal){UI_Calendar.getGcal=$.getScript(&quot;//cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.4.0/gcal.min.js&quot;)
}UI_Calendar.getGcal.done(function(g,h){a.displayCalendar()
}).fail(function(i,h,g){dbg.error(&quot;fullCalendar gcal.min.js can not be loaded&quot;)
})
}).fail(function(g,f,e){dbg.error(&quot;fullCalendar locale-all.js can not be loaded&quot;)
})
}).fail(function(e,d,c){dbg.error(&quot;fullCalendar.min.js can not be loaded&quot;)
});
return
}a.header_btn=&quot;&quot;;
$.each(this.button_header,function(c,d){if(d){a.header_btn+=(a.header_btn==&quot;&quot;)?c:&quot;,&quot;+c
}});
if(this.cpt.data.default_mode==&quot;calendar&quot;||this.cpt.data.default_mode==undefined){a.calendarHash={header:{left:&quot;prev,next today&quot;,center:&quot;title&quot;,right:a.header_btn},firstDay:1,timeFormat:&quot;hh:mm P&quot;,defaultDate:a.cpt.data.default_date==&quot;now&quot;?moment().format():this.cpt.data.saved_initial_date,defaultView:this.cpt.data.saved_view,locale:this.locale,weekNumbers:this.button_header.agendaWeek,height:deviceController.device==&quot;mobile_tree&quot;?&quot;auto&quot;:&quot;parent&quot;,navLinks:true,eventLimit:false,timezone:&quot;local&quot;,nowIndicator:true,eventTextColor:&quot;#ffffff&quot;,views:{agendaWeek:{minTime:moment.duration({hours:a.cpt.data.start_hour}),maxTime:moment.duration({hours:(a.cpt.data.start_hour+a.cpt.data.day_duration)})},listYear:{type:&quot;list&quot;,buttonText:&quot;My schedule&quot;,duration:{years:1}}}};
if(this.cpt.data.externalCalendar&amp;&amp;this.cpt.data.externalCalendar.length&gt;0){a.calendarHash.googleCalendarApiKey=&quot;AIzaSyCWforQeNUlsCkrtK_BcmLtfifWJ0Ic0d0&quot;;
a.calendarHash.eventSources=this.cpt.data.externalCalendar
}}else{a.calendarHash={header:false,defaultView:&quot;agendaPeriodWeek&quot;,height:deviceController.device==&quot;mobile_tree&quot;?&quot;auto&quot;:&quot;parent&quot;,timeFormat:&quot;hh:mm P&quot;,locale:this.locale,timezone:&quot;local&quot;,firstDay:(a.cpt.data.week_day_number==7)?(parseInt(this.cpt.data.agenda_start_date)+1):this.cpt.data.agenda_start_date,views:{agendaPeriodWeek:{type:&quot;agenda&quot;,minTime:moment.duration({hours:a.cpt.data.start_hour}),maxTime:moment.duration({hours:(a.cpt.data.start_hour+a.cpt.data.day_duration)}),slotDuration:moment.duration({minutes:a.cpt.data.event_duration}),columnFormat:&quot;dddd&quot;,allDayText:&quot;All day event&quot;,duration:{days:a.cpt.data.week_day_number}}}}
}if(v.mode==&quot;editor&quot;){a.specificHash={selectable:true,selectHelper:true,editable:true,select:function(f,e,d){var c=function(){a.defaultDay=f;
a.cleanPopup();
a.showNewEventPopup(f,e,d,a.cpt.data.default_mode);
a.calendar.fullCalendar(&quot;renderEvent&quot;,{id:&quot;selected_zone&quot;,title:&quot;&quot;,start:f,end:e,rendering:&quot;background&quot;})
};
if(a.cpt.idserver){c()
}else{if(confirm(sprintf(&quot;Do you want to save this page (as a draft) to start the block configuration?&quot;))){a.cpt.page.saveAndCleanHistory();
c()
}}},viewRender:function(c,d){a.calendar.find(&quot;.fc-view&quot;).off(&quot;mousedown.uica_&quot;+a.cpt.id).on(&quot;mousedown.uica_&quot;+a.cpt.id,function(){blockSelector.node.draggable(&quot;disable&quot;);
$(window).off(&quot;mouseup.uica_&quot;+a.cpt.id).one(&quot;mouseup.uica_&quot;+a.cpt.id,function(){blockSelector.node.draggable(&quot;enable&quot;)
})
});
if(a.cpt.data.default_date!=&quot;now&quot;){a.cpt.setData(&quot;saved_initial_date&quot;,a.calendar.fullCalendar(&quot;getDate&quot;))
}if(c.name!=&quot;agendaPeriodWeek&quot;){a.cpt.setData(&quot;saved_view&quot;,c.name)
}},unselect:function(e,d,c){editorController.deselect()
},addEvent:function(c){},eventRender:function(d,c){if(a.cpt.data.blockPast&amp;&amp;d.rendering==&quot;background&quot;){c.attr(&quot;title&quot;,&quot;Events here will be hidden on your website&quot;)
}},eventClick:function(e,d,c){if(e.url){d.currentTarget.href=&quot;#&quot;;
a.showModifyPopup(e,d,$(this),a.cpt.data.default_mode);
return false
}a.showModifyPopup(e,d,$(this),a.cpt.data.default_mode)
},eventDrop:function(d,e,c){a.addOrModifyEvent(d,&quot;dropped&quot;)
},eventResize:function(c){a.addOrModifyEvent(c,&quot;resized&quot;)
},events:function(f,c,d,e){a.cpt.ask({request:(a.cpt.data.default_mode==&quot;agenda&quot;)?&quot;get_agenda_events&quot;:&quot;get_all_events&quot;,data:{start:f,end:c}},function(g){e(g.events);
a.color_past()
})
}}
}else{a.specificHash={selectable:false,selectHelper:false,editable:false,eventRender:function(d,c){if(d.rendering!=&quot;background&quot;){c.on(&quot;mousemove&quot;,function(e){if(!a.viewer.popup_locked){clearTimeout(a.viewer.popviewer_event_window_to);
a.viewer.popviewer_event_window_to=setTimeout(function(){a.showPopupViewer(d,e,$(this))
},500)
}}).on(&quot;mouseleave&quot;,function(e){var f=$(e.relatedTarget);
clearTimeout(a.viewer.popviewer_event_window_to);
if(!(f.closest(&quot;.uica_viewer_event_window&quot;).length)&amp;&amp;(!a.viewer.popup_locked)){a.cleanViewerPopup()
}})
}},eventClick:function(e,d,c){if(e.url){d.currentTarget.href=&quot;#&quot;;
a.showPopupViewer(e,d,$(this));
a.viewer.popup_locked=true;
return false
}a.showPopupViewer(e,d,$(this));
a.viewer.popup_locked=true
},viewRender:function(c,d){var e=moment();
if(a.cpt.data.blockPast){if(e&gt;=c.start){$(&quot;.fc-prev-button&quot;,a.cpt.node).prop(&quot;disabled&quot;,true).addClass(&quot;fc-state-disabled&quot;);
if(e&gt;=c.end){a.calendar.fullCalendar(&quot;gotoDate&quot;,e)
}}else{$(&quot;.fc-prev-button&quot;,a.cpt.node).removeClass(&quot;fc-state-disabled&quot;).prop(&quot;disabled&quot;,false)
}}a.cleanViewerPopup()
},events:function(f,c,d,e){a.cpt.ask({request:(a.cpt.data.default_mode==&quot;agenda&quot;)?&quot;get_agenda_events&quot;:&quot;get_all_events&quot;,data:{start:f,end:c}},function(g){e(g.events);
a.color_past()
})
}}
}this.calendar.fullCalendar(&quot;destroy&quot;);
this.calendar.fullCalendar(Object.extend(this.calendarHash,this.specificHash));
if(this.cpt.data.default_mode==&quot;agenda&quot;){this.date_week_start=moment(&quot;1980-01-01&quot;).add(this.cpt.data.agenda_start_date-1,&quot;days&quot;);
this.calendar.fullCalendar(&quot;gotoDate&quot;,this.date_week_start)
}else{if(!this.cpt.data.default_mode){var b=this.cpt.propertyNode;
if(v.mode==&quot;editor&quot;){this.cpt.setData(&quot;default_mode&quot;,&quot;calendar&quot;)
}}}this.calendar.find(&quot;button.fc-button&quot;).addClass(&quot;site_button&quot;);
this.getWeekHeightRatio()
},onDisplayCorrectMode:function(a){if(v.mode==&quot;editor&quot;){this.instantiateEditorModePopup(a)
}else{this.instantiateViewerModePopup(a)
}},color_past:function(){if(this.cpt.data.default_mode!=&quot;agenda&quot;&amp;&amp;this.cpt.data.blockPast){this.calendar.fullCalendar(&quot;renderEvent&quot;,{allDay:true,editable:false,color:&quot;#AAA&quot;,rendering:&quot;background&quot;,start:moment().subtract(10,&quot;years&quot;),end:moment().startOf(&quot;day&quot;)})
}},create_color_selector:function(){var a=this;
this.colors=[&quot;#F44336&quot;,&quot;#E91E63&quot;,&quot;#9C27B0&quot;,&quot;#673AB7&quot;,&quot;#3F51B5&quot;,&quot;#2196F3&quot;,&quot;#03A9F4&quot;,&quot;#00BCD4&quot;,&quot;#009688&quot;,&quot;#4CAF50&quot;,&quot;#8BC34A&quot;,&quot;#CDDC39&quot;,&quot;#FFEB3B&quot;,&quot;#FFC107&quot;,&quot;#FF9800&quot;,&quot;#FF5722&quot;,&quot;#795548&quot;,&quot;#9E9E9E&quot;,&quot;#607D8B&quot;];
this.colors_alt=[&quot;#F4511E&quot;,&quot;#F6BF26&quot;,&quot;#0B8043&quot;,&quot;#33B679&quot;,&quot;#039BE5&quot;,&quot;#3F51B5&quot;,&quot;#7986CB&quot;,&quot;#8E24AA&quot;,&quot;#E67C73&quot;,&quot;#616161&quot;,&quot;#C0CA33&quot;,&quot;#F44336&quot;,&quot;#E91E63&quot;,&quot;#9C27B0&quot;,&quot;#FF5722&quot;,&quot;#795548&quot;,&quot;#9E9E9E&quot;,&quot;#607D8B&quot;];
this.n.cs.color_selector_close_btn.on(&quot;click&quot;,function(){a.n.cs.color_selector_main.toggle()
});
$.each(a.colors_alt,function(b,e){var c=$(&quot;&lt;div class=&apos;uica_cs_one_color_card&apos;&gt;&quot;,a.cpt.node);
var d=$(&quot;&lt;div class=&apos;uica_cs_color_container&apos;&gt;&quot;,a.cpt.node);
c.on(&quot;click&quot;,function(){a.n.color_picker.chromoselector(&quot;setColor&quot;,e).trigger(&quot;blur&quot;);
a.setColorPopup(a.n.color_picker.chromoselector(&quot;getColor&quot;).getRgbString())
}).on(&quot;blur&quot;,function(){a.n.cs.color_selector_main.toggle()
});
c.css(&quot;background-color&quot;,e);
d.appendTo(c);
c.prependTo(a.n.cs.color_selector_container)
})
},setColorPopup:function(c){var b=this;
var d=c.replace(/[^\d,]/g,&quot;&quot;).split(&quot;,&quot;);
var a=(((d[0]*299+d[1]*587+d[2]*114)/1000)&gt;125)?&quot;rgb(0,0,0)&quot;:&quot;rgb(255,255,255)&quot;;
b.n.header_windows.css(&quot;background-color&quot;,c);
b.n.windowAE.css(&quot;border-color&quot;,c);
b.n.header_windows.find(&quot;.uica_te&quot;).css(&quot;border-color&quot;,a);
b.n.header_windows.add(b.n.header_windows.find(&quot;.uica_te&quot;)).css(&quot;color&quot;,a)
},setDefaultDate:function(){var a=this;
if(a.cpt.data.default_date==&quot;now&quot;){a.calendar.fullCalendar(&quot;gotoDate&quot;,moment().format());
a.cpt.setData(&quot;saved_initial_date&quot;,moment().format())
}else{a.calendar.fullCalendar(&quot;gotoDate&quot;,a.cpt.data.saved_initial_date)
}},importCSS:function(b,a){if(!$(&quot;#&quot;+a).length){var c=document.getElementsByTagName(&quot;head&quot;)[0];
var d=document.createElement(&quot;link&quot;);
d.rel=&quot;stylesheet&quot;;
d.type=&quot;text/css&quot;;
d.href=b;
d.media=&quot;all&quot;;
d.id=a;
c.appendChild(d)
}},instantiateEditorModePopup:function(b){var a=this;
var b=this.cpt.node;
this.n={windowAE:b.find(&quot;.uica_window&quot;),header_windows:b.find(&quot;.uica_header_window&quot;),close_button:b.find(&quot;.uica_window_close_btn&quot;),input_start_datepicker:b.find(&quot;.uica_startdatepicker&quot;),input_end_datepicker:b.find(&quot;.uica_enddatepicker&quot;),title_event:b.find(&quot;.uica_title_event&quot;),description_event:b.find(&quot;.uica_ptxt&quot;),submit_btn:b.find(&quot;.uica_submit_btn&quot;),checkbox_hour:b.find(&quot;.uica_input_use_hour&quot;),color_picker:b.find(&quot;.uica_colorPicker&quot;),button_cs:b.find(&quot;.uica_cs_opener&quot;),delete_button:b.find(&quot;.uica_delete_btn&quot;),start_day_chooser:b.find(&quot;.start_day_chooser&quot;).hide(),end_day_chooser:b.find(&quot;.end_day_chooser&quot;).hide()};
this.n.cs={color_selector_main:b.find(&quot;.uica_color_selector&quot;),color_selector_container:b.find(&quot;.uica_cs_container&quot;),color_selector_one_color_card:b.find(&quot;.uica_cs_one_color_card&quot;),color_selector_color_container:b.find(&quot;.uica_cs_color_container&quot;),color_selector_card_more:b.find(&quot;.uica_cs_card_more&quot;),color_selector_card_more_icon:b.find(&quot;.uica_cs_card_more_icon&quot;),color_selector_close_btn:b.find(&quot;.uica_cf_close_btn&quot;),color_selector_card_more_text:b.find(&quot;.uica_cs_card_more_text&quot;)};
a.n.delete_button.find(&quot;.fonticon&quot;).html($.fn.fonticon(&quot;delete&quot;));
a.n.cs.color_selector_main.hide();
a.create_color_selector();
a.n.windowAE.hide().appendTo(&quot;#site&quot;).click(function(){editorController.deselect()
});
a.n.delete_button.hide();
a.to_delete=[];
a.delete_to=null;
a.n.button_cs.off(&quot;click&quot;).on(&quot;click&quot;,function(){a.n.cs.color_selector_main.toggle()
});
a.n.close_button.off(&quot;click&quot;).on(&quot;click&quot;,function(){a.cleanAndHidePopup()
});
a.n.color_picker.chromoselector({speed:0,color2str:function(c){return c.getRgbString()
},update:function(){var c=$(this).chromoselector(&quot;getColor&quot;).getRgbString();
a.setColorPopup(c)
},save:function(){$(this).css(&quot;border-color&quot;,$(this).chromoselector(&quot;getColor&quot;).getRgbString()).val($(this).chromoselector(&quot;getColor&quot;).getRgbString())
}}).on(&quot;focus&quot;,function(){a.n.color_picker.css({&quot;background-color&quot;:&quot;#fff&quot;,&quot;border-color&quot;:a.n.color_picker.chromoselector(&quot;getColor&quot;).getRgbString(),color:&quot;#333&quot;,cursor:&quot;text&quot;,&quot;background-image&quot;:&quot;&quot;})
}).on(&quot;blur&quot;,function(){$(this).css({&quot;background-color&quot;:$(this).chromoselector(&quot;getColor&quot;).getRgbString(),&quot;border-color&quot;:&quot;#fff&quot;,color:&quot;transparent&quot;,cursor:&quot;pointer&quot;})
}).css(&quot;background-color&quot;,$(&quot;#u2_foreground&quot;).css(&quot;background-color&quot;)).val($(&quot;#u2_foreground&quot;).css(&quot;background-color&quot;)).css(&quot;color&quot;,&quot;transparent&quot;);
a.n.color_picker.chromoselector(&quot;setColor&quot;,&quot;#F4511E&quot;).trigger(&quot;blur&quot;)
},instantiateViewerModePopup:function(b){var a=this;
color_selector_main=b.find(&quot;.uica_color_selector&quot;).hide();
a.viewer={popviewer_event_window:b.find(&quot;.uica_viewer_event_window&quot;),popviewer_header_window:b.find(&quot;.uica_viewer_header_window&quot;),popviewer_uica_title_event:b.find(&quot;.uica_viewer_title_event&quot;),popviewer_content:b.find(&quot;.uica_viewer_content&quot;),popviewer_event_dates:b.find(&quot;.uica_viewer_event_dates&quot;),popviewer_date_event:b.find(&quot;.uica_viewer_date_event&quot;),popviewer_uica_elements:b.find(&quot;.uica_viewer_uica_elements&quot;),popviewer_description_container:b.find(&quot;.uica_viewer_description_container&quot;),popviewer_close_btn:b.find(&quot;.uica_viewer_close_btn&quot;)};
a.viewer.popviewer_close_btn.off(&quot;click&quot;).on(&quot;click&quot;,function(){a.cleanViewerPopup()
});
a.popup_position={x:0,y:0};
a.viewer.hovered_event=false;
a.viewer.popup_locked=false;
a.viewer.popviewer_event_window.hide()
},showPopupViewer:function(f,b,e){var c=this;
var a=$(&quot;#body&quot;);
if(this.current_popup_event==f&amp;&amp;c.viewer.popviewer_event_window.is(&quot;:visible&quot;)){return
}this.current_popup_event=f;
c.viewer.hovered_event=true;
c.viewer.popviewer_uica_title_event.html(f.title+&quot;&amp;nbsp&quot;);
if(c.cpt.data.default_mode==&quot;agenda&quot;){c.viewer.popviewer_date_event.html(sprintf(&quot;From %1$s to %2$s&quot;,&quot;&lt;span&gt;&quot;+f.start.locale(this.locale).format(&quot;hh:mm P&quot;)+&quot;&lt;/span&gt;&quot;,&quot;&lt;span&gt;&quot;+f.end.locale(this.locale).format(&quot;hh:mm P&quot;)+&quot;&lt;/span&gt;&quot;))
}else{var g=moment.duration(f.end.diff(f.start));
var d=g.days()==1;
if(!d&amp;&amp;f.allDay){f.end=f.end.startOf(&quot;day&quot;).subtract(1,&quot;day&quot;)
}c.viewer.popviewer_date_event.html((f.allDay&amp;&amp;d)?sprintf(&quot;On %1$s&quot;,&quot;&lt;span&gt;&quot;+f.start.locale(this.locale).format(&quot;LL&quot;)+&quot;&lt;/span&gt;&quot;):sprintf(&quot;From %1$s to %2$s&quot;,&quot;&lt;span&gt;&quot;+f.start.locale(this.locale).format(f.allDay?&quot;LL&quot;:&quot;LLLL&quot;)+&quot;&lt;/span&gt;&quot;,&quot;&lt;span&gt;&quot;+f.end.locale(this.locale).format(f.allDay?&quot;LL&quot;:&quot;LLLL&quot;)+&quot;&lt;/span&gt;&quot;))
}if(f.description){c.viewer.popviewer_uica_elements.show();
c.viewer.popviewer_description_container.html(f.description).css(&quot;max-height&quot;,($(window).height()/2)+&quot;px&quot;)
}else{c.viewer.popviewer_uica_elements.hide()
}if(typeof f.url!=&quot;undefined&quot;){}else{c.setColorPopupViewer(f.color)
}c.viewer.popviewer_event_window.appendTo($(&quot;#body&quot;)).css({left:Math.min(b.pageX,a.offset().left+a.width()-c.viewer.popviewer_event_window.width())-a.offset().left,top:Math.min(b.pageY-50,a.offset().top+a.height()-c.viewer.popviewer_event_window.height()-50)-a.offset().top,&quot;z-index&quot;:90000}).show()
},setColorPopupViewer:function(c){var b=this;
var d=c.replace(/[^\d,]/g,&quot;&quot;).split(&quot;,&quot;);
var a=(((d[0]*299+d[1]*587+d[2]*114)/1000)&gt;125)?&quot;rgb(0,0,0)&quot;:&quot;rgb(255,255,255)&quot;;
b.viewer.popviewer_header_window.css(&quot;background-color&quot;,c);
b.viewer.popviewer_header_window.css(&quot;color&quot;,a);
b.viewer.popviewer_event_window.css(&quot;border-color&quot;,c)
},cleanViewerPopup:function(){var a=this;
a.viewer.popviewer_event_window.hide();
a.viewer.popup_locked=false;
a.current_popup_event=null;
a.viewer.popviewer_uica_title_event.html(&quot;&quot;);
a.viewer.popviewer_date_event.html(&quot;&quot;);
a.viewer.popviewer_description_container.empty()
},instantiateDatePicker:function(c,a){var b=this;
if(!b.n.data_dp_start){this.n.input_start_datepicker.datetimepicker({collapse:false,locale:this.locale});
this.n.input_end_datepicker.datetimepicker({collapse:false,locale:this.locale});
this.n.data_dp_start=this.n.input_start_datepicker.data(&quot;DateTimePicker&quot;);
this.n.data_dp_end=this.n.input_end_datepicker.data(&quot;DateTimePicker&quot;);
b.n.input_start_datepicker.on(&quot;dp.change&quot;,function(f,g){if(b.setting_popup){return
}var d=b.n.data_dp_end;
var h=d.viewDate();
b.onDpChange(f.date,h,d,f)
});
b.n.input_end_datepicker.on(&quot;dp.change&quot;,function(g,h){if(b.setting_popup){return
}var f=b.n.data_dp_start;
var d=f.viewDate();
b.onDpChange(d,g.date,f,g)
});
b.n.start_day_chooser.add(b.n.end_day_chooser).on(&quot;change&quot;,function(){var d=b.getAgendaPopupDates();
if(b.current_action==&quot;add&quot;){b.update_selected_zone(d[0],d[1])
}});
if(this.current_action==&quot;add&quot;){b.update_selected_zone(c,a)
}}if(this.cpt.data.default_mode==&quot;agenda&quot;){b.setFormat(&quot;agenda&quot;)
}else{if(b.n.checkbox_hour.is(&quot;:checked&quot;)){b.setFormat(&quot;hour&quot;)
}else{b.setFormat(&quot;day&quot;)
}}},setFormat:function(e){var d=this;
var c=this.n.data_dp_start,b=this.n.data_dp_end;
var f=c.viewDate();
var a=b.viewDate();
if(e==&quot;hour&quot;){c.format(&quot;MM/DD/YYYY hh:mm P&quot;);
b.format(&quot;MM/DD/YYYY hh:mm P&quot;)
}else{if(e==&quot;agenda&quot;){c.format(&quot;hh:mm P&quot;);
b.format(&quot;hh:mm P&quot;)
}else{c.format(&quot;MM/DD/YYYY&quot;);
b.format(&quot;MM/DD/YYYY&quot;)
}}c.date(f.local());
b.date(a.local())
},onDpChange:function(h,a,g,f){var b=this;
var c=g.viewDate();
if(this.cpt.data.default_mode==&quot;calendar&quot;){if(h&gt;a){g.date(c.subtract(f.oldDate.diff(f.date)))
}}else{var d=this.getAgendaPopupDates();
h=d[0];
a=d[1]
}if(this.current_action==&quot;add&quot;){this.update_selected_zone(h,a)
}},getAgendaPopupDates:function(){var c=this.calendar.fullCalendar(&quot;getView&quot;);
var b=c.start;
var g=moment().locale(this.locale).startOf(&quot;week&quot;).isoWeekday()%7;
var e=this.n.data_dp_start.viewDate();
var d=this.n.data_dp_end.viewDate();
var a=moment().locale(this.locale).hour(e.hour()).minute(e.minute()).year(b.year()).month(b.month()).date(b.date()).weekday((this.n.start_day_chooser.val()-g+7)%7);
var f=moment().locale(this.locale).hour(d.hour()).minute(d.minute()).year(b.year()).month(b.month()).date(b.date()).weekday((this.n.end_day_chooser.val()-g+7)%7);
if(a&gt;=f){f.add(7,&quot;days&quot;)
}return[a,f]
},update_selected_zone:function(a,c){var b=this.calendar.fullCalendar(&quot;getView&quot;);
this.selected_zone=this.calendar.fullCalendar(&quot;clientEvents&quot;,&quot;selected_zone&quot;);
if(this.selected_zone[0]){this.selected_zone[0].start=a;
this.selected_zone[0].end=c;
this.calendar.fullCalendar(&quot;updateEvent&quot;,this.selected_zone[0])
}else{this.calendar.fullCalendar(&quot;renderEvent&quot;,{id:&quot;selected_zone&quot;,title:&quot;&quot;,start:a,end:c,rendering:&quot;background&quot;})
}},showPopup:function(f,c,b,e){var d=this;
var a={x:$(&quot;#advised_width_center&quot;),y:$(&quot;#body&quot;)};
d.instantiateDatePicker(f,c);
setTimeout(function(){d.n.windowAE.appendTo(&quot;#site_tools&quot;).show().css({top:Math.min(b.pageY-100,a.y.offset().top+a.y.height()-d.n.windowAE.height()-50)-$(&quot;#site_tools&quot;).offset().top,left:Math.min(b.pageX,a.x.offset().left+a.x.width()-d.n.windowAE.width())-$(&quot;#site_tools&quot;).offset().left,&quot;z-index&quot;:90000})
},100);
if(e==&quot;agenda&quot;){d.n.start_day_chooser.show().val(f.format(&quot;d&quot;));
d.n.end_day_chooser.show().val(c.format(&quot;d&quot;));
d.n.checkbox_hour.hide()
}else{d.n.start_day_chooser.hide();
d.n.end_day_chooser.hide();
d.n.checkbox_hour.show()
}d.n.checkbox_hour.prop(&quot;checked&quot;,!(f.minutes()==0&amp;&amp;f.hours()==0&amp;&amp;c.minutes()==0&amp;&amp;c.hours()==0)).trigger(&quot;change&quot;);
d.n.delete_button.hide();
d.n.checkbox_hour.change(function(){d.instantiateDatePicker(d.n.data_dp_start.viewDate(),d.n.data_dp_end.viewDate())
});
shortcut.remove(&quot;enter&quot;);
shortcut.add(&quot;enter&quot;,function(){d.n.submit_btn.trigger(&quot;click&quot;)
})
},showModifyPopup:function(d,a,c,e){var b=this;
this.setting_popup=true;
if(typeof d.url!=&quot;undefined&quot;){b.showPopup(d.start,d.end,a,e);
b.n.checkbox_hour.hide();
b.n.title_event.val(d.title);
b.n.description_event.html(d.description);
b.n.data_dp_start.date(d.start);
b.n.data_dp_end.date(d.end);
b.n.button_cs.hide();
b.n.submit_btn.hide();
$(&quot;#use_hour_text&quot;).hide()
}else{this.current_action=&quot;modify&quot;;
b.showPopup(d.start,d.end,a,e);
b.n.title_event.val(d.title);
b.n.button_cs.show();
b.n.description_event.html(d.description);
b.n.checkbox_hour.prop(&quot;checked&quot;,!d.allDay).trigger(&quot;change&quot;);
b.n.data_dp_start.date(d.start);
b.n.data_dp_end.date(d.end);
b.setColorPopup(d.color);
b.n.submit_btn.html(&quot;Modify Event&quot;);
b.n.color_picker.chromoselector(&quot;setColor&quot;,d.color).trigger(&quot;blur&quot;);
b.n.submit_btn.off(&quot;click&quot;).on(&quot;click&quot;,function(){b.addOrModifyEvent(d)
});
b.n.delete_button.show().off(&quot;click&quot;).on(&quot;click&quot;,function(){b.calendar.fullCalendar(&quot;removeEvents&quot;,d.id);
b.removeEvent(d,c);
b.cleanAndHidePopup()
});
shortcut.remove(&quot;delete&quot;);
shortcut.add(&quot;delete&quot;,function(){b.n.delete_button.trigger(&quot;click&quot;)
});
$(&quot;#use_hour_text&quot;).show()
}this.setting_popup=false
},showNewEventPopup:function(e,b,a,d){var c=this;
this.setting_popup=true;
this.current_action=&quot;add&quot;;
c.showPopup(e,b,a,d);
c.n.data_dp_start.date(e.local());
c.n.data_dp_end.date(b.local());
c.n.submit_btn.html(&quot;Add Event&quot;);
c.n.submit_btn.off(&quot;click&quot;).on(&quot;click&quot;,function(){c.addOrModifyEvent()
});
$(&quot;#use_hour_text&quot;).show();
c.n.checkbox_hour.show();
c.n.submit_btn.show();
c.n.button_cs.show();
this.setting_popup=false
},cleanPopup:function(){var a=this;
editorController.deselect();
if(this.cpt.data.default_mode!=&quot;not_set&quot;){a.n.title_event.val(&quot;&quot;);
a.n.description_event.html(&quot;&quot;);
shortcut.remove(&quot;delete&quot;);
shortcut.add(&quot;delete&quot;,delete_block,{type:&quot;keydown&quot;,disable_in_input:true});
shortcut.remove(&quot;enter&quot;);
shortcut.add(&quot;enter&quot;,function(){find_active_buttons(&quot;btn-enter&quot;).filter(&quot;:first&quot;).click()
},{type:&quot;keydown&quot;,disable_in_textarea:true});
if(a.calendar.fullCalendar){a.calendar.fullCalendar(&quot;unselect&quot;);
a.calendar.fullCalendar(&quot;removeEvents&quot;,&quot;selected_zone&quot;)
}}},cleanAndHidePopup:function(){if(this.n){if(this.cpt.data.default_mode==&quot;not_set&quot;){return
}this.cleanPopup();
this.n.cs.color_selector_main.hide();
this.n.windowAE.hide()
}},getEvent:function(b){var a=this;
editorController.pause();
if(!b){b={title:a.n.title_event.val(),start:a.n.data_dp_start.viewDate(),end:a.n.data_dp_end.viewDate(),description:a.n.description_event.html(),color:a.n.color_picker.chromoselector(&quot;getColor&quot;).getRgbString(),all_day:!a.n.checkbox_hour.is(&quot;:checked&quot;)}
}else{b.title=a.n.title_event.val();
b.start=a.n.data_dp_start.viewDate();
b.end=a.n.data_dp_end.viewDate();
b.description=a.n.description_event.html();
b.color=a.n.color_picker.chromoselector(&quot;getColor&quot;).getRgbString();
b.all_day=!a.n.checkbox_hour.is(&quot;:checked&quot;)
}return b
},addOrModifyEvent:function(c,d){var b=this;
var a;
if(d){a=c
}else{a=b.getEvent(c)
}if(b.cpt.data.default_mode==&quot;agenda&quot;&amp;&amp;!d){var e=b.getAgendaPopupDates();
a.start=e[0];
a.end=e[1]
}b.cpt.ask({request:&quot;add_or_update_event&quot;,event:a},function(f){if(f.success){b.calendar.fullCalendar(&quot;refetchEvents&quot;);
b.cleanAndHidePopup()
}else{statusController.message(f.message,&quot;warning&quot;)
}},function(){dbg.error(&quot;Event modification error&quot;)
})
},removeEvent:function(c,b){var a=this;
a.to_delete.push(c);
if(a.delete_to){clearTimeout(a.delete_to)
}a.cleanAndHidePopup();
a.delete_to=setTimeout(function(){$.each(a.to_delete,function(e,d){a.confirmRemoveEvent(d.id)
});
a.cleanAndHidePopup();
a.to_delete=[];
statusController.hide()
},5000);
statusController.message(&quot;&lt;b&gt;This event is about to be deleted.&lt;/b&gt;&lt;br&gt;&lt;a href=&apos;#&apos; id=&apos;cancel_deletion_btn&apos;&gt;Cancel&lt;/a&gt;&quot;,&quot;success&quot;);
$(&quot;#cancel_deletion_btn&quot;,a.cpt.node).on(&quot;click&quot;,function(){a.to_delete=[];
clearTimeout(a.delete_to);
a.calendar.fullCalendar(&quot;refetchEvents&quot;);
statusController.hide()
})
},confirmRemoveEvent:function(b){var a=this;
a.cpt.ask({request:&quot;remove_event&quot;,id:b},function(c){a.calendar.fullCalendar(&quot;refetchEvents&quot;)
},function(){dbg.error(&quot;Event deletion error&quot;)
})
},onPropertyChanged:function(a){if(a.include(&quot;external_window&quot;)){this.displayCalendar()
}else{if(a.include(&quot;default_mode&quot;)){if(this.choice_window){this.choice_window.window_container.remove()
}this.displayOptions(this.cpt.data.default_mode);
this.displayCalendar();
this.cleanAndHidePopup()
}if(this.cpt.data.default_mode==&quot;calendar&quot;){if(a.include(&quot;agendaDay&quot;)||a.include(&quot;listMonth&quot;)||a.include(&quot;agendaWeek&quot;)||a.include(&quot;listYear&quot;)||a.include(&quot;month&quot;)){this.button_header[a[0]]=this.cpt.data[a[0]];
this.cleanAndHidePopup();
this.calendar.fullCalendar(&quot;destroy&quot;);
this.displayCalendar();
this.calendar.fullCalendar(&quot;changeView&quot;,this.header_btn.split(&quot;,&quot;)[0]);
this.cpt.setData(&quot;header_btn&quot;,this.button_header)
}if(a.include(&quot;default_date&quot;)){this.setDefaultDate()
}if(a.include(&quot;blockPast&quot;)){this.calendar.fullCalendar(&quot;destroy&quot;);
this.displayCalendar()
}}else{if(a.include(&quot;start_hour&quot;)){var b=this.cpt.data.start_hour+this.cpt.data.day_duration;
if(b&gt;24){this.cpt.setData(&quot;day_duration&quot;,this.cpt.data.day_duration-(b-24))
}}}if(a.include(&quot;start_hour&quot;)||a.include(&quot;day_duration&quot;)||a.include(&quot;event_duration&quot;)||a.include(&quot;agenda_start_date&quot;)||a.include(&quot;week_day_number&quot;)){this.displayCalendar()
}}},onSelect:function(){this.displayOptions(this.cpt.data.default_mode);
if(blockSelector.selected_cpts.length==1){this.cpt.init_sliders()
}},onResize:function(){this.cleanAndHidePopup()
},onResizeStop:function(){this.cleanAndHidePopup();
this.displayCalendar()
},onMoveStop:function(){this.cleanAndHidePopup()
},onDeselect:function(){this.cleanAndHidePopup()
},displayOptions:function(b){var a=$(this.cpt.propertyNode).add(this.cpt.propertyDesignNode);
if(b==&quot;agenda&quot;){$(&quot;.calendar_mode_option&quot;,a).hide();
$(&quot;span.agenda_mode_option, li.agenda_mode_option&quot;,a).show();
$(&quot;.default_mode_radio&quot;,a).show()
}else{if(b==&quot;calendar&quot;){$(&quot;span.agenda_mode_option, li.agenda_mode_option&quot;,a).hide();
$(&quot;.calendar_mode_option&quot;,a).show();
$(&quot;.default_mode_radio&quot;,a).show()
}else{if(b==&quot;not_set&quot;){$(&quot;.calendar_mode_option&quot;,a).hide();
$(&quot;.default_mode_radio&quot;,a).hide();
$(&quot;span.agenda_mode_option, li.agenda_mode_option&quot;,a).hide()
}}}if(!filesSelector.apis.calendar){$(&quot;.property_calendar_selector&quot;,a).hide()
}},getWeekHeightRatio:function(){var e=20;
var c=$(&quot;.fc-time-grid .fc-slats td&quot;,this.cpt.node).height(e+&quot;px&quot;);
var f=$(&quot;.fc-time-grid-container&quot;,this.cpt.node).height();
var b=$(&quot;.fc-slats tr&quot;,this.cpt.node).length;
var a=$($(&quot;.fc-slats tr&quot;,this.cpt.node).get(1)).height()-e;
var d=f/b-a;
if(d&gt;e){c.height(d.toFixed(1)+&quot;px&quot;);
this.calendar.fullCalendar(&quot;option&quot;,&quot;height&quot;,&quot;parent&quot;)
}else{c.css(&quot;height&quot;,&quot;&quot;)
}},onDeviceChanged:function(){var a=this;
setTimeout(function(){a.displayCalendar()
},150)
}};</script><style>.uica_calendar{height:100%}
.fc-view-container{background-color:#fff}
.uica_window,.uica_viewer_event_window,.uica_mode_selection_window{box-shadow:0 2px 2px rgba(0,0,0,.3);transition:.2s;border-radius:2px;position:absolute;pointer-events:auto;background-color:#fff;max-width:440px;min-width:300px;width:300px;border:1px solid}
.uica_window .uica_viewer_description_container,.uica_viewer_event_window .uica_viewer_description_container,.uica_mode_selection_window .uica_viewer_description_container{overflow:auto}
.uica_mode_selection_window{top:0;left:0;width:100%;border:1px solid;height:100%;background:#fff;z-index:11;max-width:none;text-align:center;border:none}
.uica_header_window,.uica_viewer_header_window,.uica_mode_selection_header{display:block;transition:.3s all;box-shadow:0 1px 2px rgba(0,0,0,.6);color:#fff;padding:10px;border-radius:2px 2px 0 0;background-color:#43a6dd}
.uica_window_close_btn,.uica_viewer_close_btn{float:right;font-size:16px;cursor:pointer;margin-left:7px;margin-top:5px}
.editor_interface .uica_window input.uica_title_event{background-color:rgba(255,255,255,.16);color:#fff;padding:3px;border:1px solid rgba(237,237,237,.69);font-size:13px;transition:background-color .25s ease-out,border-color .25s ease-out;width:calc(100% - 70px)}
.editor_interface .uica_window input.uica_title_event:focus{border-color:#fff;background-color:rgba(255,255,255,.3)}
.input_date{font-size:25px;transition:.3s;border-style:none;border-bottom:1px solid #000}
.input_date:focus{border-style:none;border-bottom:1px solid #43a6dd}
.uica_elements,.uica_viewer_uica_elements{margin-top:10px}
.uica_content,.uica_viewer_content{padding:10px}
.uica_event_dates{display:block}
.uica_ptxt,.body.uica_ptxt{background-color:transparent;color:#333;font-size:14px}
.uica_window .uica_ptxt,.body .uica_ptxt{border:2px solid #ccc;height:100px;overflow:auto}
.uica_footer{text-align:center;padding-bottom:10px}
.uica_submit_btn.btn.btn-default,.uica_delete_btn.btn.btn-danger{margin:5px;border-radius:2px}
.form-control{display:block;width:100%;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc}
.uica_colorPicker{border:1px solid;border-radius:4px;float:right;width:100px;padding:2px 10px}
.uica_cs_container{text-align:center}
.uica_cs_one_color_card{height:30px;display:inline-block;width:30px;margin:4px;padding:5px;border-radius:50%;cursor:pointer;vertical-align:top;transition:.2s all}
.uica_cs_one_color_card:hover{box-shadow:0 2px 3px 0 #696969}
.uica_cs_title{background-color:#6db21e;box-shadow:0 1px 4px rgba(0,0,0,.6);padding:11px 10px;margin:-9px;margin-bottom:10px;border-radius:2px 2px 0 0}
.uica_color_selector{display:block;position:absolute;top:52px;left:10px;z-index:1;background-color:#fff;box-shadow:0 .5px 0 0 #fff inset,0 1px 2px 0 #696969;border-radius:6px;padding:9px;right:10px}
.uica_cf_close_btn{float:right;font-size:16px;cursor:pointer}
.fc-event{text-align:center;transition:.2s all}
.fc-event:hover{transition:.3s all;box-shadow:0 1px 2px rgba(0,0,0,.19),1px 2px 7px rgba(0,0,0,.23)}
.uica_cs_card_more{border-top:1px solid gray;padding-top:7px}
.uica_cs_textcolor{color:grey;cursor:default;display:inline-block;position:relative;top:3px}
.uica_cs_square{height:20px;position:absolute;background-color:#6db21e;width:20px;left:78%;transform:rotate(45deg);top:-8px;border-radius:3px}
.uica_viewer_date_event span{font-weight:700;white-space:nowrap}
.uica_cs_opener .fonticon{font-size:18px;cursor:pointer}
.UI_Calendar .fc-state-default{text-shadow:none;background-image:none;box-shadow:none}
.start_day_chooser,.end_day_chooser{padding:4px;width:100%;border:1px solid #999}
.uica_mode_selection_first_choice_container,.uica_mode_selection_second_choice_container{cursor:pointer;text-align:center;width:40%;margin:10px 5%;border-radius:2px;bottom:0;top:0;min-height:80%;float:left}
.uica_mode_selection_first_choice_container .uica_mode_selection_choice_header,.uica_mode_selection_second_choice_container .uica_mode_selection_choice_header{line-height:4}
.uica_mode_selection_first_choice_container .uica_mode_selection_footer,.uica_mode_selection_second_choice_container .uica_mode_selection_footer{border-top:1px solid lightgrey;padding:10px}
.uica_mode_selection_first_choice_container .uica_mode_selection_content,.uica_mode_selection_second_choice_container .uica_mode_selection_content{margin:10px;text-align:left}
.uica_mode_selection_first_choice_container .uica_mode_selection_illustration,.uica_mode_selection_second_choice_container .uica_mode_selection_illustration{width:100%}</style></uidget>