/*
@license
dhtmlxScheduler v.4.4.9 Professional Evaluation

This software is covered by DHTMLX Evaluation License. Contact sales@dhtmlx.com to get Commercial or Enterprise license. Usage without proper license is prohibited.

(c) Dinamenta, UAB.
*/
Scheduler.plugin(function(e){e.config.icons_select=["icon_details","icon_delete"],e.config.details_on_create=!0,e.config.show_quick_info=!0,e.xy.menu_width=0,e.attachEvent("onClick",function(t){return e.showQuickInfo(t),!0}),function(){for(var t=["onEmptyClick","onViewChange","onLightbox","onBeforeEventDelete","onBeforeDrag"],a=function(){return e._hideQuickInfo(),!0},i=0;i<t.length;i++)e.attachEvent(t[i],a)}(),e.templates.quick_info_title=function(e,t,a){return a.text.substr(0,50)},e.templates.quick_info_content=function(e,t,a){
return a.details||a.text},e.templates.quick_info_date=function(t,a,i){return e.isOneDayEvent(i)?e.templates.day_date(t,a,i)+" "+e.templates.event_header(t,a,i):e.templates.week_date(t,a,i)},e.showQuickInfo=function(e){if(e!=this._quick_info_box_id&&this.config.show_quick_info){this.hideQuickInfo(!0);var t=this._get_event_counter_part(e);t&&(this._quick_info_box=this._init_quick_info(t),this._fill_quick_data(e),this._show_quick_info(t),this.callEvent("onQuickInfo",[e]))}},e._hideQuickInfo=function(){
e.hideQuickInfo()},e.hideQuickInfo=function(t){var a=this._quick_info_box,i=this._quick_info_box_id;if(this._quick_info_box_id=0,a&&a.parentNode){var n=a.offsetWidth;if(e.config.quick_info_detached)return this.callEvent("onAfterQuickInfo",[i]),a.parentNode.removeChild(a);"auto"==a.style.right?a.style.left=-n+"px":a.style.right=-n+"px",t&&a.parentNode.removeChild(a),this.callEvent("onAfterQuickInfo",[i])}},dhtmlxEvent(window,"keydown",function(t){27==t.keyCode&&e.hideQuickInfo()}),e._show_quick_info=function(t){
var a=e._quick_info_box;e._obj.appendChild(a);var i=a.offsetWidth,n=a.offsetHeight;e.config.quick_info_detached?(a.style.left=t.left-t.dx*(i-t.width)+"px",a.style.top=t.top-(t.dy?n:-t.height)+"px"):(a.style.top=this.xy.scale_height+this.xy.nav_height+20+"px",1==t.dx?(a.style.right="auto",a.style.left=-i+"px",setTimeout(function(){a.style.left="-10px"},1)):(a.style.left="auto",a.style.right=-i+"px",setTimeout(function(){a.style.right="-10px"},1)),a.className=a.className.replace(" dhx_qi_left","").replace(" dhx_qi_right","")+" dhx_qi_"+(1==t.dx?"left":"right"));
},e.attachEvent("onTemplatesReady",function(){if(e.hideQuickInfo(),this._quick_info_box){var t=this._quick_info_box;t.parentNode&&t.parentNode.removeChild(t),this._quick_info_box=null}}),e._quick_info_onscroll_handler=function(t){e.hideQuickInfo()},e._init_quick_info=function(){if(!this._quick_info_box){var t=e.xy,a=this._quick_info_box=document.createElement("div");this._waiAria.quickInfoAttr(a),a.className="dhx_cal_quick_info",e.$testmode&&(a.className+=" dhx_no_animate");var i=this._waiAria.quickInfoHeaderAttrString(),n='<div class="dhx_cal_qi_title" style="height:'+t.quick_info_title+'px" '+i+'><div class="dhx_cal_qi_tcontent"></div><div  class="dhx_cal_qi_tdate"></div></div><div class="dhx_cal_qi_content"></div>';
n+='<div class="dhx_cal_qi_controls" style="height:'+t.quick_info_buttons+'px">';for(var r=e.config.icons_select,s=0;s<r.length;s++){var i=this._waiAria.quickInfoButtonAttrString(this.locale.labels[r[s]]);n+="<div "+i+' class="dhx_qi_big_icon '+r[s]+'" title="'+e.locale.labels[r[s]]+"\"><div class='dhx_menu_icon "+r[s]+"'></div><div>"+e.locale.labels[r[s]]+"</div></div>"}n+="</div>",a.innerHTML=n,dhtmlxEvent(a,"click",function(t){t=t||event,e._qi_button_click(t.target||t.srcElement)}),e.config.quick_info_detached&&(e._detachDomEvent(e._els.dhx_cal_data[0],"scroll",e._quick_info_onscroll_handler),
dhtmlxEvent(e._els.dhx_cal_data[0],"scroll",e._quick_info_onscroll_handler))}return this._quick_info_box},e._qi_button_click=function(t){var a=e._quick_info_box;if(t&&t!=a){var i=e._getClassName(t);if(-1!=i.indexOf("_icon")){var n=e._quick_info_box_id;e._click.buttons[i.split(" ")[1].replace("icon_","")](n)}else e._qi_button_click(t.parentNode)}},e._get_event_counter_part=function(t){for(var a=e.getRenderedEvent(t),i=0,n=0,r=a;r&&r!=e._obj;)i+=r.offsetLeft,n+=r.offsetTop-r.scrollTop,r=r.offsetParent;
if(r){var s=i+a.offsetWidth/2>e._x/2?1:0,d=n+a.offsetHeight/2>e._y/2?1:0;return{left:i,top:n,dx:s,dy:d,width:a.offsetWidth,height:a.offsetHeight}}return 0},e._fill_quick_data=function(t){var a=e.getEvent(t),i=e._quick_info_box;e._quick_info_box_id=t;var n={content:e.templates.quick_info_title(a.start_date,a.end_date,a),date:e.templates.quick_info_date(a.start_date,a.end_date,a)},r=i.firstChild.firstChild;r.innerHTML=n.content;var s=r.nextSibling;s.innerHTML=n.date,e._waiAria.quickInfoHeader(i,[n.content,n.date].join(" "));
var d=i.firstChild.nextSibling;d.innerHTML=e.templates.quick_info_content(a.start_date,a.end_date,a)}});