/*
@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){!function(){function t(e){return e.replace(k,"\n").replace(w,"")}function a(e,t){e=parseFloat(e),t=parseFloat(t),isNaN(t)||(e-=t);var a=n(e);return e=e-a.width+a.cols*b,isNaN(e)?"auto":100*e/b}function i(e,t,a){e=parseFloat(e),t=parseFloat(t),!isNaN(t)&&a&&(e-=t);var i=n(e);return e=e-i.width+i.cols*b,isNaN(e)?"auto":100*e/(b-(isNaN(t)?0:t))}function n(t){for(var a=0,i=e._els.dhx_cal_header[0].childNodes,n=i[1]?i[1].childNodes:i[0].childNodes,r=0;r<n.length;r++){var s=n[r].style?n[r]:n[r].parentNode,d=parseFloat(s.style.width);
if(!(t>d))break;t-=d+1,a+=d+1}return{width:a,cols:r}}function r(e){return e=parseFloat(e),isNaN(e)?"auto":100*e/x}function s(e,t){return(window.getComputedStyle?window.getComputedStyle(e,null)[t]:e.currentStyle?e.currentStyle[t]:null)||""}function d(t,a){for(var i=parseInt(t.style.left,10),n=0;n<e._cols.length;n++)if(i-=e._cols[n],0>i)return n;return a}function o(t,a){for(var i=parseInt(t.style.top,10),n=0;n<e._colsS.heights.length;n++)if(e._colsS.heights[n]>i)return n;return a}function l(e){return e?"<"+e+">":"";
}function _(e){return e?"</"+e+">":""}function c(e,t,a,i){var n="<"+e+" profile='"+t+"'";return a&&(n+=" header='"+a+"'"),i&&(n+=" footer='"+i+"'"),n+=">"}function h(){var a="",i=e._mode;if(e.matrix&&e.matrix[e._mode]&&(i="cell"==e.matrix[e._mode].render?"matrix":"timeline"),a+="<scale mode='"+i+"' today='"+e._els.dhx_cal_date[0].innerHTML+"'>","week_agenda"==e._mode)for(var n=e._els.dhx_cal_data[0].getElementsByTagName("DIV"),r=0;r<n.length;r++)"dhx_wa_scale_bar"==n[r].className&&(a+="<column>"+t(n[r].innerHTML)+"</column>");else if("agenda"==e._mode||"map"==e._mode){
var n=e._els.dhx_cal_header[0].childNodes[0].childNodes;a+="<column>"+t(n[0].innerHTML)+"</column><column>"+t(n[1].innerHTML)+"</column>"}else if("year"==e._mode)for(var n=e._els.dhx_cal_data[0].childNodes,r=0;r<n.length;r++)a+="<month label='"+t(n[r].childNodes[0].innerHTML)+"'>",a+=f(n[r].childNodes[1].childNodes),a+=u(n[r].childNodes[2]),a+="</month>";else{a+="<x>";var n=e._els.dhx_cal_header[0].childNodes;a+=f(n),a+="</x>";var s=e._els.dhx_cal_data[0];if(e.matrix&&e.matrix[e._mode]){a+="<y>";for(var r=0;r<s.firstChild.rows.length;r++){
var d=s.firstChild.rows[r];a+="<row><![CDATA["+t(d.cells[0].innerHTML)+"]]></row>"}a+="</y>",x=s.firstChild.rows[0].cells[0].offsetHeight}else if("TABLE"==s.firstChild.tagName)a+=u(s);else{for(s=s.childNodes[s.childNodes.length-1];-1==s.className.indexOf("dhx_scale_holder");)s=s.previousSibling;s=s.childNodes,a+="<y>";for(var r=0;r<s.length;r++)a+="\n<row><![CDATA["+t(s[r].innerHTML)+"]]></row>";a+="</y>",x=s[0].offsetHeight}}return a+="</scale>"}function u(e){for(var a="",i=e.firstChild.rows,n=0;n<i.length;n++){
for(var r=[],s=0;s<i[n].cells.length;s++)r.push(i[n].cells[s].firstChild.innerHTML);a+="\n<row height='"+e.firstChild.rows[n].cells[0].offsetHeight+"'><![CDATA["+t(r.join("|"))+"]]></row>",x=e.firstChild.rows[0].cells[0].offsetHeight}return a}function f(a){var i,n="";e.matrix&&e.matrix[e._mode]&&(e.matrix[e._mode].second_scale&&(i=a[1].childNodes),a=a[0].childNodes);for(var r=0;r<a.length;r++)n+="\n<column><![CDATA["+t(a[r].innerHTML)+"]]></column>";if(b=a[0].offsetWidth,i)for(var s=0,d=a[0].offsetWidth,o=1,r=0;r<i.length;r++)n+="\n<column second_scale='"+o+"'><![CDATA["+t(i[r].innerHTML)+"]]></column>",
s+=i[r].offsetWidth,s>=d&&(d+=a[o]?a[o].offsetWidth:0,o++),b=i[0].offsetWidth;return n}function v(n){var l="",_=e._rendered,c=e.matrix&&e.matrix[e._mode];if("agenda"==e._mode||"map"==e._mode)for(var h=0;h<_.length;h++)l+="<event><head><![CDATA["+t(_[h].childNodes[0].innerHTML)+"]]></head><body><![CDATA["+t(_[h].childNodes[2].innerHTML)+"]]></body></event>";else if("week_agenda"==e._mode)for(var h=0;h<_.length;h++)l+="<event day='"+_[h].parentNode.getAttribute("day")+"'><body>"+t(_[h].innerHTML)+"</body></event>";else if("year"==e._mode)for(var _=e.get_visible_events(),h=0;h<_.length;h++){
var u=_[h].start_date;for(u.valueOf()<e._min_date.valueOf()&&(u=e._min_date);u<_[h].end_date;){var f=u.getMonth()+12*(u.getFullYear()-e._min_date.getFullYear())-e.week_starts._month,v=e.week_starts[f]+u.getDate()-1,g=n?s(e._get_year_cell(u),"color"):"",m=n?s(e._get_year_cell(u),"backgroundColor"):"";if(l+="<event day='"+v%7+"' week='"+Math.floor(v/7)+"' month='"+f+"' backgroundColor='"+m+"' color='"+g+"'></event>",u=e.date.add(u,1,"day"),u.valueOf()>=e._max_date.valueOf())break}}else if(c&&"cell"==c.render)for(var _=e._els.dhx_cal_data[0].getElementsByTagName("TD"),h=0;h<_.length;h++){
var g=n?s(_[h],"color"):"",m=n?s(_[h],"backgroundColor"):"";l+="\n<event><body backgroundColor='"+m+"' color='"+g+"'><![CDATA["+t(_[h].innerHTML)+"]]></body></event>"}else for(var h=0;h<_.length;h++){var p,y;if(e.matrix&&e.matrix[e._mode])p=a(_[h].style.left),y=a(_[h].offsetWidth)-1;else{var b=e.config.use_select_menu_space?0:26;p=i(_[h].style.left,b,!0),y=i(_[h].style.width,b)-1}if(!isNaN(1*y)){var w=r(_[h].style.top),k=r(_[h].style.height),E=_[h].className.split(" ")[0].replace("dhx_cal_","");if("dhx_tooltip_line"!==E){
var D=e.getEvent(_[h].getAttribute("event_id"));if(D){var v=D._sday,N=D._sweek,S=D._length||0;if("month"==e._mode)k=parseInt(_[h].offsetHeight,10),w=parseInt(_[h].style.top,10)-e.xy.month_head_height,v=d(_[h],v),N=o(_[h],N);else if(e.matrix&&e.matrix[e._mode]){v=0;var A=_[h].parentNode.parentNode.parentNode;N=A.rowIndex;var C=x;x=_[h].parentNode.offsetHeight,w=r(_[h].style.top),w-=.2*w,x=C}else{if(_[h].parentNode==e._els.dhx_cal_data[0])continue;var M=e._els.dhx_cal_data[0].childNodes[0],O=parseFloat(-1!=M.className.indexOf("dhx_scale_holder")?M.style.left:0);
p+=a(_[h].parentNode.style.left,O)}if(l+="\n<event week='"+N+"' day='"+v+"' type='"+E+"' x='"+p+"' y='"+w+"' width='"+y+"' height='"+k+"' len='"+S+"'>","event"==E){l+="<header><![CDATA["+t(_[h].childNodes[1].innerHTML)+"]]></header>";var g=n?s(_[h].childNodes[2],"color"):"",m=n?s(_[h].childNodes[2],"backgroundColor"):"";l+="<body backgroundColor='"+m+"' color='"+g+"'><![CDATA["+t(_[h].childNodes[2].innerHTML)+"]]></body>"}else{var g=n?s(_[h],"color"):"",m=n?s(_[h],"backgroundColor"):"";l+="<body backgroundColor='"+m+"' color='"+g+"'><![CDATA["+t(_[h].innerHTML)+"]]></body>";
}l+="</event>"}}}}return l}function g(t,a,i,n,r,s){var d=!1;"fullcolor"==n&&(d=!0,n="color"),n=n||"color";var o="";if(t){var u=e._date,f=e._mode;a=e.date[i+"_start"](a),a=e.date["get_"+i+"_end"]?e.date["get_"+i+"_end"](a):e.date.add(a,1,i),o=c("pages",n,r,s);for(var g=new Date(t);+a>+g;g=this.date.add(g,1,i))this.setCurrentView(g,i),o+=l("page")+h().replace("–","-")+v(d)+_("page");o+=_("pages"),this.setCurrentView(u,f)}else o=c("data",n,r,s)+h().replace("–","-")+v(d)+_("data");return o}function m(t,a){
var i=e.uid(),n=document.createElement("div");n.style.display="none",document.body.appendChild(n),n.innerHTML='<form id="'+i+'" method="post" target="_blank" action="'+a+'" accept-charset="utf-8" enctype="application/x-www-form-urlencoded"><input type="hidden" name="mycoolxmlbody"/> </form>',document.getElementById(i).firstChild.value=encodeURIComponent(t),document.getElementById(i).submit(),n.parentNode.removeChild(n)}function p(e,t,a,i,n,r,s){var d="";d="object"==typeof n?y(n):g.apply(this,[e,t,a,n,r,s]),
m(d,i)}function y(e){for(var t="<data>",a=0;a<e.length;a++)t+=e[a].source.getPDFData(e[a].start,e[a].end,e[a].view,e[a].mode,e[a].header,e[a].footer);return t+="</data>"}var b,x,w=new RegExp("<[^>]*>","g"),k=new RegExp("<br[^>]*>","g");e.getPDFData=g,e.toPDF=function(e,t,a,i){return p.apply(this,[null,null,null,e,t,a,i])},e.toPDFRange=function(t,a,i,n,r,s,d){return"string"==typeof t&&(t=e.templates.api_date(t),a=e.templates.api_date(a)),p.apply(this,arguments)}}()});