/* @license Copyright (C) Exontrol. All rights reserved. */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):(t="undefined"!=typeof globalThis?globalThis:t||self,e(t.exontrol||{}))}(this,function(t){"use strict";function e(t,e){return"cc"+(e?"c":"h")+t}function i(t){return t-t%l}function o(t){return i(v(t)?t.getTime():t)}function n(t){return v(t)?t:new Date(t)}function h(t){return null!=t}function r(t){return null==t}function s(t,e,i){return r(t)?~~i:a.s2F(t,e)}var a=a||window.exontrol,l=a.msday,p=a.G,u="N",c="P",y=Math.round,g=a.ToB,f=Math.max,d=Math.min,S=a.N.IsN,D=a.IsO,v=a.IsD,b=a.ToS;a.Shapes.Calendar={today:{normal:{fillColor:"rgba(0,0,0,0.10)",frameColor:"rgba(0,0,0,0.25)",tfi:{bold:!0}}},gray:{normal:{tfi:{fgColor:"gray"}}},lightgray:{normal:{tfi:{fgColor:"lightgray"}}},select:{normal:{fillColor:"dodgerblue",tfi:{fgColor:"white"}},hover:{tfi:{fgColor:"white"}}},frame:{normal:{frameColor:"black"}},hot:{hover:{frameColor:"black"}},weekend:{normal:{pattern:6,patternColor:"rgba(0,0,0,0.20)"}},prev:{normal:{client:"[x-3]",pad:[0,-3],fillColor:"rgb(192,192,192)",frameColor:"rgb(128,128,128)",text:"▴"},click:{fillColor:"rgb(164,164,164)",pad:[0,-3],tfi:{fgColor:"gray"}}},next:{normal:{pad:[0,-3],fillColor:"rgb(192,192,192)",frameColor:"rgb(128,128,128)",text:"▾"},click:{fillColor:"rgb(164,164,164)",pad:[0,-3],tfi:{fgColor:"gray"}}}},a.Mrg(a,function(){function t(t,e){this.oC=e,(t=b(t))&&(~t.toLocaleLowerCase().indexOf("freq")?a.ICalendar&&(this.oEx=a.ICalendar.IRecur.Parse(t),(this.valid=this.oEx.valid())&&(this.eval=function(t){return this.gA(this.oC.date[0],this.oC.date[0]).has(o(t))})):(this.gA=function(){},this.oEx=a.E.Create(t,"value"),(this.valid=this.oEx.IsValid())&&(this.eval=function(t){return t=n(t),this.oEx.Evaluate(function(){return t})})))}function L(t){this.init(t)}function C(t,e){this.oE=t,this.oO={},this.setOpts(e)}function M(t,e){a.host.call(this,arguments)}function w(t,e,i){this.oC=t,this.nLV=i||0,this.date=this.getDateToView(e),this.rgVP=null,this.size={width:0,height:0},this.table={h:0,v:0},this.nDirExt=null,this.prevExtDate=null,this.nextExtDate=null,this.build()}t.prototype.eval=function(t){},t.prototype.gA=function(t,e){var o,n=t.GetYear()-1,h=e.GetYear()+1;return(!this.rgA||nthis.rgA.eY)&&(t=Date.Create(n,1,1),o={count:((e=Date.Create(h,12,31))-t)/l,until:e,filter:i},this.oEx.has("DTSTART")||(o.start=t),this.rgA=this.oEx.all(o),this.rgA.sY=n,this.rgA.eY=h),this.rgA};var O={date:null,selectable:null,key:null,shape:null,cursor:null,repetitive:null,toolTip:null,userData:void 0};L.prototype.init=function(t){this.oC=t,this.rgE=new a.Arr,this.rgE.onRemove=t.onDelEvent.bind(t),this.import()},L.prototype.import=function(){var t=this.oC;["bU","eU"].forEach(function(e){this[e]=t[e].bind(t)},this),["has","len","forEach","forEachU","add","indexOf","getPos","setPos"].forEach(function(t){this[t]=this.rgE[t].bind(this.rgE)},this)},L.prototype.resKE=function(){this.mKE=null},L.prototype.resDE=function(){this.mDE=null},L.prototype.resRE=function(){this.rgRE=null,this.resDE()},L.prototype.gDE=function(){return this.mDE||(this.mDE=function(){var t,e,i=new Map;return this.forEach(function(o){o.isRepetitive()||(t=o.getDate().getTime(),!(e=i.get(t))&&i.set(t,e=[]),e.push(o))}),i}.call(this))},L.prototype.gRE=function(){return this.rgRE||(this.rgRE=function(){var t=new a.Arr;return this.forEach(function(e){e.isRepetitive()&&t.add(e)}),t}.call(this))},L.prototype.gE=function(t,e){var i,n,s;return h(t)&&(n=r(e),s=o(t),(n||1&e)&&(i=this.gDE().get(s))&&(i=i.slice()),(n||2&e)&&this.gRE().forEach(function(e){var o=e.gRx();o&&o.eval(t)&&(i=i||[]).push(e)})),i},L.prototype.isSelectable=function(t){var e,i,o=this,h=o.oC.getSelectable(),r=h&&a.E.Create(h,"value,eventuserdata,isevent");return(e=!r||r.Evaluate(function(e){return-1==e?n(t):function(e){var i,n=o.gE(t);return n&&(i=n.forEachU(function(t){return-3==e?i=t:-2==e&&(i=t.getUserData()),i})),-3==e&&(i=!!i),i}(e)}))&&(i=this.gE(t))&&(e=i.forEachU(function(t){return e=e&&t.isSelectable()})),e},L.prototype.Add=function(t){this.bU(),this.resKE(),this.resDE();var e=this.add(new a.Calendar.Event(this,a.IsO(t)&&!a.IsD(t)?t:{date:t}));return this.oC.onAddEvent(e),this.eU(),e},L.prototype.GetCount=function(){return this.rgE.len()},L.prototype.Item=function(t){var e=null;return~~t===t?e=this.rgE.at(t)||null:t instanceof C?e=this.rgE.has(t)?t:null:r(e=function(t){var e=t.mKE;return r(e)&&(t.mKE=e=new Map,t.forEach(function(t){var i=t.getKey();!e.has(i)&&e.set(i,t)})),e}(this).get(t))&&(e=this.rgE.at(t)||null),e},L.prototype.Remove=function(t){this.RemoveRange(this.Item(t))},L.prototype.toA=function(t){return function(t){var e,i=a.Arr.empty;return h(t)&&(e=t,i=new a.Arr,t instanceof a.Arr?e=t.rgE:t instanceof Array||(e=[t]),e.forEach(function(t){i.ann(this.Item(t))},this)),i}.call(this,t)},L.prototype.RemoveRange=function(t){return this.bU(),this.resKE(),this.resDE(),this.resRE(),this.rgE.removeRange(t=this.toA(t)),this.eU(),t.length},L.prototype.Clear=function(){this.bU(),this.resKE(),this.resDE(),this.resRE(),this.rgE.clear(),this.eU()},C.prototype.getType=function(){return"event"},C.prototype.gC=function(){return this.oE.oC},C.prototype.bU=function(){this.oE.bU()},C.prototype.eU=function(){this.oE.eU()},C.prototype.Remove=function(){return this.oE.Remove(this)},C.prototype.GetOptions=function(){return this.oO},C.prototype.SetOptions=function(t){this.bU(),this.setOpts(t),this.eU()},C.prototype.setOpts=function(t){if(D(t))for(var e in t){var i=this[a.setM(e)];i&&i.call(this,t[e])}},C.prototype.GetIndex=function(){return this.oE.indexOf(this)},C.prototype.GetKey=function(){return this.oO.key},C.prototype.SetKey=function(t){this.bU(),this.oE.resKE(),this.oO.key=t,this.eU()},C.prototype.toString=C.prototype.getKey=function(){var t=this.GetIndex();return b(this.GetKey()||(~(t=this.GetIndex())?t:""))},C.prototype.GetSelectable=function(){return this.oO.selectable},C.prototype.SetSelectable=function(t){this.bU(),this.oO.selectable=t,this.eU()},C.prototype.isSelectable=function(){return r(this.GetSelectable())||this.GetSelectable()},C.prototype.GetShape=function(){return this.oO.shape},C.prototype.SetShape=function(t){this.bU(),this.oO.shape=a.S.A2S(t),this.eU()},C.prototype.getShape=function(){var t=this.GetShape();return t&&t.normal||t},C.prototype.GetCursor=function(){return this.oO.cursor},C.prototype.SetCursor=function(t){this.bU(),this.oO.cursor=t,this.eU()},C.prototype.getCursor=function(){return this.GetCursor()},C.prototype.GetToolTip=function(){return this.oO.toolTip},C.prototype.SetToolTip=function(t){this.bU(),this.oO.toolTip=t,this.oExT=void 0,this.eU()},C.prototype.getToolTip=function(){return b(this.GetToolTip())},C.prototype.GetDate=function(){return this.oO.date},C.prototype.SetDate=function(t){this.bU(),this.oO.date=t,this.oE.resDE(),this.eU()},C.prototype.getDate=function(){var t=Date.Create(this.GetDate());return new Date(i(t.getTime()))},C.prototype.GetRepetitive=function(){return this.oO.repetitive},C.prototype.SetRepetitive=function(t){this.bU(),this.oO.repetitive=t,this.oE.resRE(),this.oRx=void 0,this.eU(!0)},C.prototype.getRepetitive=C.prototype.gRx=function(){return void 0===this.oRx&&((this.oRx=new t(this.GetRepetitive(),this.gC())).valid||(this.oRx=null)),this.oRx},C.prototype.isRepetitive=function(){return!!this.gRx()},C.prototype.getRepetitiveExpression=function(){return b(this.isRepetitive()&&this.GetRepetitive()||"")},C.prototype.GetUserData=function(){return this.oO.userData},C.prototype.SetUserData=function(t){this.bU(),this.oO.userData=t,this.eU()},C.prototype.getUserData=function(){return this.GetUserData()},M.version="5.5",M.type="Calendar",M.smooth="Calendar.smooth",M.AutoSizeEnum={exFontSize:-1,exFixedSize:0,exFitClient:1},M.FlowEnum={exLeftToRight:0,exTopToBottom:1},M.ModeEnum={exVertical:0,exHorizontal:1},M.SingleSelEnum={exDisableSel:0,exEnableSel:1,exSingleSel:2,exToggleSel:4,exDisableCtrlSel:8,exDisableShiftSel:16,exDisableDrag:32},M.CollectEnum={exContinue:0,exMonth:1,exWeek:2,exWeekAll:3,exWeekDay:4},M.Options={tfi:null,locale:null,mode:null,flow:null,date:null,autoSize:null,smoothSel:null,smoothScroll:null,locked:null,readOnly:null,selection:null,singleSel:null,allowSwitchView:null,allowScrollByDrag:null,padCal:null,alignCal:null,wheelChange:null,minMonthX:null,maxMonthX:null,minMonthY:null,maxMonthY:null,pad:null,dayLabel:null,dayAlign:null,dayFixedWidth:null,dayFixedHeight:null,dayWeekHeader:null,dayWeekLabel:null,dayWeekNoHeader:null,dayWeekNoLabel:null,dayMonthHeader:null,dayMonthLabel:null,dayMonthAlign:null,dayNonMonth:null,dayNonMonthLabel:null,dayWeekAllLabel:null,monthLabel:null,monthAlign:null,monthYearAlign:null,yearLabel:null,yearAlign:null,yearRangeAlign:null,shapes:null,hlShapes:null,cursors:null,toolTipDelay:null,toolTipPopDelay:null,toolTipWidth:null,events:null,selectable:void 0},M.Collect=function(t,e,i){t=Date.Date(Date.Create(t));var o=[],n=(e=Date.Create(e||t).copy()).Compare(t),h=a.UnitEnum;if(4==(i=s(i,M.CollectEnum)))if(n)for(var r=!0;r;){var l=t.WeekOff(),p=e.WeekOff();t.GetYear()==e.GetYear()&&t.GetMonth()==e.GetMonth()||(p=n<0?0:a.days-1),t=t.Reset(h.exMonth);for(var u=d(l,p),c=f(l,p),y=t.copy(),g=y.GetMonth();y.GetMonth()==g;)y.WeekOff()>=u&&y.WeekOff()<=c&&o.push(y.copy()),y.NextDay();if(n<0)for(t=t.PrevDay(),r=e.Compare(t)<=0;t.WeekOff()!=a.days-1;)t.PrevDay();else for(t=t.NextMonth(),r=e.Compare(t)>=0;0!=t.WeekOff();)t.NextDay()}else for(var S=t.WeekColDay();S.GetMonth()==t.GetMonth();)o.push(S.copy()),S.NextWeek();else{if(n<0){var D=t;t=e,e=D}switch(i){case 1:for(t.Reset(h.exMonth),e.Reset(h.exMonth),e.NextMonth().PrevDay();t<=e;)o.push(t.copy()),t.NextDay();break;case 2:var v=t.GetMonth();for(t.Reset(h.exWeek);t.GetMonth()!=v;)t.NextDay();var b=e.GetMonth();for(e.Reset(h.exWeek),e.NextWeek().PrevDay();e.GetMonth()!=b;)e.PrevDay();for(;t<=e;)o.push(t.copy()),t.NextDay();break;case 3:for(t.Reset(h.exWeek),e.Reset(h.exWeek),e.NextWeek().PrevDay();t<=e;)o.push(t.copy()),t.NextDay();break;default:for(;t<=e;)o.push(t.copy()),t.NextDay()}n<0&&o.reverse()}return o},M.prototype.init=function(t,e){this.lnt=this.lnt||0,this.lnt++,this.lI=0,this.xL=0,this.yL=0,this.lSel=0,this.nLV=0,this.htToday=w.setObject("D",Date.Today()),this.oE=new L(this),this.iLts(),this.oO=a.Cpy(this.defOpt()),this.SetClientRect(t),this.date={0:Date.Today(),1:Date.Today().Reset(16),2:Date.Today().Reset(0)},this.SetOptions(e||this.defOpt(),!0),a.CC.GetCanvas(t)&&this.SetCanvas(t),a.DPR.Reg(this),--this.lnt},a.SB.addProto(M.prototype),M.prototype.defOpt=function(){return a[this.constructor.type].Options},M.prototype.hideTT=function(){a.TT.Hide()},M.prototype.showTT=function(t,e,i){function o(t,e,i,o){var n;return t&&(h(t.t)?n=e.drawHTMLText(t.t,i,o):t.d&&(n=t.d(e,i,o))),n}if(e){var n=e.call(i||this,t),r=16;n&&a.TT.Show(function(){return{relative:t.target,client:function(){return this.ctxTfi(function(t){var e=a.NRt(n.rtT,this.GetWindowRect())||n.rtT,i=t.fontHeight(),h=[0,0,this.getToolTipWidth(),i],s=o(n,t,h,1024|r),l=s&&s.width||0,p=s&&s.height||0;return l&&p&&[e[0],e[1]+(p>i?0:(e[3]-p)/2),~~(l+1),p]||null})}.call(this),onpaint:function(t,e){this.ctxTfi(function(t){o(n,t,e,r)},this,t)},thisArg:this}},{thisArg:this,ttO:n.o,ttD:this.getToolTipDelay(),ttP:this.getToolTipPopDelay()})}},M.prototype.onAddEvent=function(t){},M.prototype.onDelEvent=function(t){},M.prototype.GetOptions=function(){return this.oO},M.prototype.SetOptions=function(t,e){var i=!1;if(h(t)){var o=[],n=this.GetOptions();if(h(n)){for(var r in n){var s=t[r];void 0!==s&&(o.push(r),n[r]!==s&&(n[r]=a.CpV(s)))}if(e)for(var r in t)r in n||(n[r]=a.CpV(t[r]));(i=0!=o.length)&&(this.bU(),this.nLV=0,o.forEach(function(t){var e=a.setM(t);e in this&&this[e].call(this,n[t])},this),this.eU())}}return i},M.prototype.opt=function(t,e){var i=this.GetOptions()[t];return r(i)&&r(i=this.defOpt()[t])&&(i=e),i},M.prototype.GetCanvas=function(){return this.canvas},M.prototype.SetCanvas=function(t,e){this.bU(),this.udefSts(this.oSts),this.oSts=null,this.resAO(),t=a.CC.GetCanvas(t),!e&&a.CC.SetCanvas(this,t),this.canvas=t,a.CC.GetCanvas(this.canvas)&&this.defSts(this.Shortcuts=this.oSts=new a.Sts),this.eU()},a.ComboBox&&(M.prototype.dCBl=function(t,e,i){var o="";this.getSel().forEach(function(t){o+=(o?",":"")+t.toLocaleDateString()}),i.oO.label=o},M.prototype.cCB=function(t){var e=this.gPtr(t),i=this.getObject(this.p2P(e));return!i.type||"D"==i.type||"DNM"==i.type},M.prototype.sCB=function(t){return t&&this.SetSelection(null),this.getSelCount()},M.prototype.SetCanvas=function(t,e){return a.ComboBox.implExHost(t,"onselchange")}(M.prototype.SetCanvas)),M.prototype.SetClientRect=function(t){var e=a.CC.GetCanvas(t);e&&(t=[0,0,e.width,e.height]),this.client=a.C2R(t),!this.visAO()&&this.resAO(),this.nLV=0,this.onRL()},M.prototype.GetClientRect=function(){return this.client.slice()},M.prototype.GetWindowRect=M.prototype.GetClientRect,M.prototype.GetViewRect=function(){return a.EArtC(this.GetCanvas())},M.prototype.c2V=function(t,e){return a.CW.prototype.c2V.apply(this,arguments)},M.prototype.v2C=function(t,e){return a.CW.prototype.v2C.apply(this,arguments)},M.prototype.c2Vrt=function(t){var e=this.c2V(t);return[e.x,e.y,t[2],t[3]]},M.prototype.v2Crt=function(t){var e=this.v2C(t);return[e.x,e.y,t[2],t[3]]},M.prototype.getObject=function(t){var e,i=this.gLyt();return h(i)&&(i.mHT=i.mHT||new Map,!(e=i.mHT.get(t))&&i.mHT.set(t,e=w.getObject(t))),e},M.prototype.setAO=function(t){if(this.visAO()){var e,i=!0;this.oEF?e=this.oEF.oAO:(e=t.gAO())&&(i=!1,!e.lU&&this.onSetAO(e),e.onDrawAO(this.drawAO,this)),i&&this.drawAO(t,e)}else this.resAO()},M.prototype.getCursor=function(t){var e,i,o;return this.isSelectable()&&(i=this.getCursors(),!a.H.lA&&this.p2A(t)?e=a.GP.Get("anchor",i):(e=function(t){if(t){var e=this.p2E(t);return e&&e.reverse().forEachU(function(t){return t.getCursor()})}}.call(this,t))||(o=this.p2P(t))&&(e=a.GP.Get(this.getObject(o).type.toLowerCase(),i))),e||null},M.prototype.onmousemove=function(t){var e,i=this.gPtr(t),o=this.getCursor(i);return(e=this.GetCanvas())&&(e.style.cursor=o||"auto"),this.allowTT()&&this.showTT(t,function(t){var e=this.p2T(i);return this.hideTT(),e&&{t:e,rtT:[p.X(i),p.Y(i)+18,0,0]}}),o},M.prototype.onwheel=function(t){if(this.isSelectable()){var e=this.gPtr(t);if(h(e)&&a.PInR(e.x,e.y,this.GetClientRect()))return this.dowheel(t)}return!1},M.prototype.dowheel=function(t){var e=a.WhelInc(t);if(e){var i=this.getWheelChange();if(i)return e<0?this.Next(i):this.Prev(i),!0}return!1},M.prototype.ondown=function(t){var e=this.hitTest(this.gPtr(t));return!!h(e)&&(e.callback instanceof Function&&e.callback.call(e.thisArg,t,e),!0)},M.prototype.onkeydown=function(t){this.onkey(t,-1)},M.prototype.onkeyup=function(t){this.onkey(t,0)},M.prototype.onkeypress=function(t){this.onkey(t,1)},M.prototype.onkey=function(t,e){switch(h(this.oSts)&&this.oSts.onkey(t,e),e){case-1:a.IsEsc(t)&&this.onEscapeKey()}},M.prototype.GetLayout=function(t){return a.Lay.Save(this.onlayout,this,t)},M.prototype.SetLayout=function(t,e){a.Lay.Load(t,this.onlayout,this,e)},M.prototype.onlayout=function(t){var e,i=this;t.IsSave()?(t.Add("date",this.GetDate().toFormat()),t.Add("sel",function(){var t="";return i.getSel().forEach(function(e){t+=(t?",":"")+e.toFormat()}),t}())):(i.oLts.lock(),i.bU(),i.nLV=0,(e=t.GetValue("date"))&&this.SetDate(e),function(t){i.SetSelection(t&&t.split(","))}(t.GetValue("sel")||null),i.eU(),i.oLts.unlock())},M.prototype.udefSts=function(t){t&&t.RemoveOf(this)},M.prototype.defSts=function(t){},M.prototype.iLts=function(){this.Listeners=this.oLts=new a.Lts,this.oLts.Add("ondatechange"),this.oLts.Add("onselchanging"),this.oLts.Add("onselchange"),this.oLts.Add("onclick"),this.oLts.Add("onanchorclick")},a.Lts.Onf(M.prototype),M.prototype.hitTest=function(t){var e;if(t&&this.isSelectable()&&(e=this.p2P(t)))return{code:e,callback:function(t,e){this.onHTDown(e.code,t)},thisArg:this}},M.prototype.onHTDown=function(t,i){var o=t,n=this.getObject(o);switch(n.type){case c:case u:a.RUC(i,function(t){this.onClick(n,t)},this,{client:this.p2rt(o),activeObjects:{oAO:this.gAO(),owner:this,unfreezemask:e(o)+" "+e(o,!0)}});break;default:a.A.Cancel(M.smooth);if(h(this.gLyt())){var r=null;if(this.getAllowScrollByDrag()&&(r=this.onscrollbydrag),this.allowSelect()&&this.allowSelectByDrag())if(this.isSingleSel())switch(n.type){case"D":case"DNM":r=this.onselectbydrag}else{h(this.getTypeCollect(n.type))&&(r=this.onselectbydrag)}a.RUR.Do(i,function(t){switch(t.drag.status){case 2:case 7:r&&r.call(this,n,t);break;case 4:case 5:this.onClick(n,t);break;case 3:!this.ondrag&&this.getAllowScrollByDrag()&&(t.drag.setCursor("pointer"),r=this.onscrollbydrag)}},this)}}},M.prototype.onA=function(t,e){t&&(a.H.VisitA(this,t),this.inv(),this.onanchorclick(t))},M.prototype.onClick=function(t,e){var i=M.toClick(e);if(!i.dblClick&&t)switch(t.type){case c:this.Prev();break;case u:this.Next();break;case"DMH":this.getAllowSwitchView()&&this.setLayoutView(1,t.date);break;case"MH":this.setLayoutView(2,t.date);break;case"M":this.setLayoutView(0,t.date);break;case"YH":this.setLayoutView(0);break;case"Y":this.setLayoutView(1,t.date);break;default:if(this.allowSelect())if(this.isSingleSel())switch(t.type){case"D":case"DNM":this.lSel++,this.pushLoc(),this.selectModifierEvent(e),this.select(t.date),this.selectModifierEvent(null),this.popLoc(),this.lSel--,this.onSel()}else{var o=this.getTypeCollect(t.type);h(o)&&(this.lSel++,this.pushLoc(),this.selectModifierEvent(e),this.select(M.Collect(t.date,null,o)),this.selectModifierEvent(),this.popLoc(),this.lSel--,this.onSel())}}i=this.toClick(e,i),this.onA(this.p2A(this.gPtr(e)),i),this.onclick(i)},M.toClick=function(t){return{uiEvent:t,dblClick:t.drag&&(t.drag.long||1!=t.drag.click)||!1,button:a.e2B(t),modifiers:a.ModK(t)}},M.prototype.toClick=function(t,e){var i=this.gPtr(t),o=this.getObject(this.p2P(i));return e.type=o.type,e.date=o.date,e.events=this.p2E(i),e},M.prototype.onclick=function(t){this.oLts.onclick.do(t)},M.prototype.onanchorclick=function(t){this.oLts.onanchorclick.do(t)},M.prototype.onscrollbydrag=function(t,e){switch(e.drag.status){case 2:if(r(this.ondrag))this.ondrag={type:"scroll",oLyt:this.gLyt(),x:this.xL,y:this.yL,date:this.GetDate().copy()},this.lockClientPart(c,u),this.clip=this.GetClipRect();else if("scroll"==this.ondrag.type){var i=this.isFlowL2R(),o=e.drag.offset[i?"dy":"dx"];this.ondrag.oLyt.extendLayout(-o),this[i?"yL":"xL"]=this.ondrag[i?"y":"x"]+o,this.inv()}break;case 7:if(h(this.ondrag)&&"scroll"==this.ondrag.type){this.clip=null;var n=e.drag.cancel?this.ondrag.date:this.ondrag.oLyt.getExtendDate();h(n)?this.SetSmoothDate(n):this.refresh(),this.ondrag=null}}},M.prototype.onselectbydrag=function(t,e){var i=this.gAO();switch(e.drag.status){case 2:if(r(this.ondrag))this.ondrag={type:"select",canScroll:!0,typeCollect:this.getTypeCollect(t.type),firstInvalidate:!1,date:this.GetDate().copy(),selection:this.rgSel},this.lSel++,this.isSingleSel()||this.selectModifierEvent(e),this.resAO();else{var o=e.drag.current,n=this.GetLayoutRect();if(a.PInR(o.x,o.y,n)){this.ondrag.canScroll=!0;var s=this.p2P(o),l=this.getObject(s),p=null,u=this.ondrag.typeCollect;if(h(u)&&function(t,e){var i=t==e;if(!i)switch(t){case"D":case"DNM":case"DWN":case"DWNN":switch(e){case"D":case"DNM":case"DWN":case"DWNN":i=!0}break;case"DW":switch(e){case"D":case"DNM":i=!0}break;case"DWA":i=!0;break;default:switch(i=!0,e){case"DM":i=!1}}return i}(t.type,l.type)){if(this.pushLoc(),p=M.Collect(t.date,l.date,u),!this.isSingleSel()&&0==u)switch(l.type){case"DWN":case"DWNN":var c=M.Collect(l.date,null,this.getWeekCollect());(p=p||c)!=c&&(p.push.apply(p,c),p.sort(function(t,e){return a.Cmp.D(t,e)}))}this.popLoc()}if(!this.isSingleSel()){this.setHighlightPart({type:"D",date:h(p)?p[0]:t.date},"selStart",-1);var y=l;h(p)&&(y={type:"D",date:p[p.length-1]}),this.setHighlightPart(y,"selEnd",h(p)?-1:0)}this.select(p)||this.ondrag.firstInvalidate||(this.ondrag.firstInvalidate=!0,this.postInvalidate())}else if(this.ondrag.canScroll){this.ondrag.canScroll=!1;var g=this.isFlowL2R(),f=o[g?"y":"x"],d=g?a.TOf(n):a.LOf(n),S=g?a.BOf(n):a.ROf(n);fS&&this.Next()}}break;case 7:if(h(this.ondrag)){this.selectModifierEvent(),this.lSel--,this.isSingleSel()||(this.setHighlightPart(t,"selStart",0),this.setHighlightPart(t,"selEnd",0)),i&&i.rur();e.drag.cancel?(this.rgSel=this.ondrag.selection,this.SetSmoothDate(this.ondrag.date)):this.rfhAO(),this.onSel(),this.ondrag=null}}},M.prototype.onSetAO=function(t){var i=this.getVisibleParts();if(i&&!t.hasOf(this)&&this.isSelectable()){var o=this.getSmoothSel();i.forEach(function(i,n){var h=this.getObject(n),r=this.getTypeShape(h.type);r&&(!a.EyO(r.hover)&&t.set({owner:this,id:e(n),htObject:n,inv:this.inv,hitTest:function(t,e,i){return this.ptInPart(t,e,i.htObject)&&this.isAP(t,e)},duration:o}),!a.EyO(r.click)&&t.set({owner:this,id:e(n,!0),htObject:n,inv:this.inv,hitTest:function(t,e,i){return this.ptInPart(t,e,i.htObject)&&this.isAP(t,e)},actOn:4,duration:o}))},this)}},M.prototype.onLD=function(){this.onRL()},M.prototype.onRL=function(t){this.xL=this.yL=0,this.rgLCP=this.sShs=this.sCrs=this.rgL=this.oLyt=this.oDS=this.oYS=this.oHdS=null,(r(t)||t)&&this.resAO()},M.prototype.drawAO=function(t,i){a.H.StoreA(this,function(){i=i||t.gAO();var o=this.getVisibleParts(),n=this.isSelectable();if(o){!n&&a.H.lA++;var h,s=this.GetClientRect(),l=s[0]+this.xL,p=s[1]+this.yL,u=this.clip||s,c=new a.M1;t.selClip(this.clip||s),this.pushLoc(),i&&(h=i.aIDOf(this)),o.forEach(function(o,n){var s=this.getLockClientPart(n);o=s||a.ORt(o.slice(),l,p),(r(this.clip)||a.NRt(o,u))&&(function(t){return h&&(h.has(e(t))||h.has(e(t,!0)))}(n)||this.getHighlightShape(n)||n==this.htToday||s?c.push(n,o):this.drawP(t,n,o,i))},this),c&&c.forEach(function(e,o){this.drawP(t,o,e,i)},this),this.popLoc(),t.resClip(),!n&&--a.H.lA}})},M.prototype.lockClientPart=function(t){var e=arguments.length;if(0==e)this.rgLCP=null;else{this.rgLCP=this.rgLCP||new a.M1;for(var i=0;i1&&(n+=" - ",n+=a.H.DateNoHTML(i,e.copy().NextYear(r-1))),i=n}}return i},M.prototype.getLabelSize=function(t){var e,i,o={width:0,height:0};return t&&(e=this.gCtx())&&(this.pushLoc(),i=a.HF.Date.MeasureLabel(e,t.text,t.align),o.width=i.width,o.height=i.height,this.popLoc(),o=this.padSize(o)),o},M.isDay=function(t){return"D"==t||"DNM"==t},M.getDay=function(t){if(t){var e=w.getObject(t);if(M.isDay(e.type))return e.date}},M.isMonth=function(t){return"M"==t},M.isYear=function(t){return"Y"==t},M.isToday=function(t){return!function(t,e){return Math.trunc(t/a.msday)-Math.trunc(e/a.msday)}(t,Date.now())},M.isCurrentYear=function(t){return t.GetYear()==Date.Today().GetYear()},M.isCurrentMonth=function(t){return M.isCurrentYear(t)&&t.GetMonth()==Date.Today().GetMonth()},M.compareUnit=function(t,e,i){var o=t.Compare(e);return o&&e.GetUnit(i)==t.GetUnit(i)&&(o=0),o},M.bSCTX=function(t,e,i,o){var n;return e&&(t.drawShape(i,e,o),n=a.TFI.bCTX(t,e.tfi),h(e.opacity)&&((n=n||{}).opacity=t.globalAlpha,t.globalAlpha=e.opacity)),n},M.eSCTX=function(t,e){h(e.opacity)&&(t.globalAlpha=e.opacity),e instanceof a.TFI&&a.TFI.eCTX(t,e)},M.sCTX=function(t,e,i,o,n,h){var r=M.bSCTX(t,e,i,o);n&&n.call(h),r&&M.eSCTX(t,r)},M.prototype.isSelected=function(t){if(h(this.rgSel))try{var e=Date.Date(t).getTime();if(h(e)){if(this.rgSel instanceof a.Arr)return this.rgSel.has(e);if(this.rgSel==e)return!0}}catch(t){}return!1},M.prototype.isSelectedM=function(t){if(h(this.rgSel))try{var e=t.GetMonth(),i=t.GetYear();if(this.rgSel instanceof a.Arr){var o=!1;return this.rgSel.forEachU(function(t){var n=new Date(t);if(n.GetYear()==i&&n.GetMonth()==e)return o=!0}),o}var n=new Date(this.rgSel);if(n.GetYear()==i&&n.GetMonth()==e)return!0}catch(t){}return!1},M.prototype.isSelectedY=function(t){if(h(this.rgSel))try{var e=t.GetYear();if(this.rgSel instanceof a.Arr){var i=!1;return this.rgSel.forEachU(function(t){if(new Date(t).GetYear()==e)return i=!0}),i}if(new Date(this.rgSel).GetYear()==e)return!0}catch(t){}return!1},M.prototype.getSelCount=function(){var t=0;if(h(this.rgSel)){if(this.rgSel instanceof a.Arr)return this.rgSel.len();t++}return t},M.prototype.allowSelect=function(){return this.getSingleSel()},M.prototype.isSingleSel=function(){return this.getSingleSel()&M.SingleSelEnum.exSingleSel},M.prototype.isToggleSel=function(){return this.getSingleSel()&M.SingleSelEnum.exToggleSel},M.prototype.isToggleCtrlSel=function(){return 0==(this.getSingleSel()&M.SingleSelEnum.exDisableCtrlSel)},M.prototype.isShiftSel=function(){return 0==(this.getSingleSel()&M.SingleSelEnum.exDisableShiftSel)},M.prototype.allowSelectByDrag=function(){return 0==(this.getSingleSel()&M.SingleSelEnum.exDisableDrag)},M.prototype.allowScrollByDrag=function(){return!1},M.prototype.getWeekCollect=function(){return 2},M.prototype.getTypeCollect=function(t){switch(t){case"D":case"DNM":return 0;case"DWA":return 1;case"DWN":case"DWNN":return this.getWeekCollect();case"DW":return 4}return null},M.prototype.onSel=function(){this[this.lSel?"onselchanging":"onselchange"].call(this,this.GetSelection())},M.prototype.onselchanging=function(t){this.oLts.onselchanging.do(t)},M.prototype.onselchange=function(t){this.oLts.onselchange.do(t)},M.prototype.equalSel=function(t){var e=!1;return r(this.rgSel)?e=r(t):(e=this.rgSel==t,this.rgSel instanceof a.Arr&&(e=this.rgSel.equal(t))),e},M.prototype.selectModifierEvent=function(t){this.oSelEv=t&&{modifier:a.ModK(t),selection:this.rgSel}},M.prototype.select=function(t){function e(t){var e,i=!this.equalSel(t);if(t&&this.oE.len())if(function(t){return v(t)||S(t)}(t))t=this.oE.isSelectable(t)?t:null;else{var o=new a.Arr;t.forEach(function(t){this.oE.isSelectable(t)&&o.push(t)},this),t=o}return e=!this.equalSel(t),this.rgSel=t,e&&this.onSel(),i}function i(t){var e=null;if(h(t))try{var i=null,o=null;t instanceof a.Arr?t.forEach(function(t){i=r(i)?t:d(i,t),o=r(o)?t:f(o,t)}):i=o=t;var n=null;h(i)&&((n=new Date(i)).isValid()||(n=null));var s=null;h(o)&&((s=new Date(o)).isValid()||(s=null)),n&&s&&(e={min:n,max:s})}catch(t){}return e}var o,n=!1,s=!1;if(r(t))s=r(this.ondrag);else if(0==(t=t instanceof Array?t:[t]).length)s=!0;else if(this.isSingleSel()){var l=t[t.length-1];v(l)?((o=l.getTime())&&h(this.oSelEv)&&(this.isToggleSel()||this.isToggleCtrlSel()&&2&this.oSelEv.modifier)&&this.isSelected(l)&&(o=null),n=e.call(this,o)):s=!0}else{if(o=new a.Arr,t.forEach(function(t){v(t)&&o.push(t.getTime())},this),h(this.oSelEv)){if(this.isShiftSel()&&1&this.oSelEv.modifier&&h(this.oSelEv.selection)){var p=i(this.oSelEv.selection),u=i(o);if(p&&u){var c=M.Collect(p.min.Min(u.min),p.max.Max(u.max));c&&c.forEach(function(t){o.push(t.getTime())})}}if(this.isToggleSel()||this.isToggleCtrlSel()&&2&this.oSelEv.modifier){var y=new a.Arr;h(this.oSelEv.selection)&&y.push(this.oSelEv.selection),o=y.toggle(o)}}n=e.call(this,o.len()?o:null)}return s&&(n=e.call(this,null)),n&&this.postInvalidate(),n},M.prototype.postInvalidate=function(){h(this.hInv)&&clearTimeout(this.hInv);var t=this;this.hInv=setTimeout(function(){this.hInv=null,t.inv()},0)},M.prototype.onEscapeKey=function(){switch(this.nLV){case 2:this.setLayoutView(1);break;case 1:this.setLayoutView(0)}},M.prototype.getObjectShapes=function(t){var e=t.type;if(M.isDay(t.type)){i=t.date;M.isToday(i)&&(e+=",DT"),this.isSelected(i)&&(e+=",DS"),i.IsWknd()&&(e+=",DE")}if(M.isMonth(t.type)){i=t.date;M.isCurrentMonth(i)&&(e+=",MT"),this.isSelectedM(i)&&(e+=",MS")}if(M.isYear(t.type)){var i=t.date;M.isCurrentYear(i)&&(e+=",YT"),this.isSelectedY(i)&&(e+=",YS")}return e},M.prototype.drawP=function(t,i,o,n){if(!a.EyR(o)){var r,s,l,p,u=this.getObject(i),c=this.getLabel(u.type)||{};r=Date.SetHObj(u.date),s=this.getObjectShapes(u),h(l=this.getHighlightShape(i))&&(s+=","+l),p=c.text,"YH"==u.type&&(p=this.getYearRangeCaption(c,u.date)),function(h,r,s,l){var p,u=(h=h||{}).normal||h;this.isSelectable()?n&&(a.EyO(h.hover)||(p=n.get(this,e(i)))&&(M.isDay(l.type)&&!this.oE.isSelectable(l.date)||(u=a.R.Shape(p.state,p.range,{from:u,to:h.hover}))),a.EyO(h.click)||(p=n.get(this,e(i,!0)))&&(u=a.R.Shape(p.state,p.range,{from:u,to:h.click}))):a.EyO(h.disabled)||(u=a.Mrg(a.Cpy(u),h.disabled)),this.drawO(t,o,u,{text:r,formatText:s,ht:i},l)}.call(this,this.getTypeShape(s),p,c.align,u),Date.ResHObj(r)}},M.prototype.drawO=function(t,e,i,o,n){var h,r=M.isDay(n.type)&&this.oE.gE(n.date);r&&r.forEach(function(i){var n=M.bSCTX(t,i.getShape(),e,{ht:o.ht});n&&(h=h||[]).push(n)}),t.drawShape(e,i,o),h&&h.reverse().forEach(function(e){M.eSCTX(t,e)})},M.prototype.BeginUpdate=function(){this.lI++},M.prototype.bU=M.prototype.BeginUpdate,M.prototype.EndUpdate=function(){!--this.lI&&this.rfhAO()},M.prototype.eU=M.prototype.EndUpdate,M.prototype.Update=function(t,e){this.bU(),t&&t.call(e||this),this.eU()},M.prototype.draw=function(t,e,i){},M.prototype.Next=function(t){if(t=~~(h(t)?t:1)){var e=this.GetDate().copy(),i=1,o=this.gLyt();switch(h(o)&&(i=f(i,o.table[this.isFlowL2R()?"h":"v"])),this.nLV){case 1:(e=e.Reset(a.UnitEnum.exYear)).NextYear(i*t);break;case 2:e=e.Reset(a.UnitEnum.exYear),h(o)&&(i=f(1,o.table.h*o.table.v)),e.NextYear(i*t);break;default:(e=e.Reset(a.UnitEnum.exMonth)).NextMonth(i*t)}this.SetSmoothDate(e)}},M.prototype.Prev=function(t){this.Next(-~~(h(t)?t:1))},M.prototype.ctxTfi=function(t,e,i){var o,n;return(i=i||this.gCtx())&&(o=a.TFI.bCTX(i,this.getTfi()),n=t.call(e||this,i),a.TFI.eCTX(i,o)),n},M.prototype.gLyt=function(){var t,e=this.oLyt;return!e&&this.ctxTfi(function(){(e=new w(this,this.date[this.nLV],this.nLV)).addNP(),t=this.gLyO(e),this.xL=t.x,this.yL=t.y,this.oLyt=e}),e},M.prototype.gLyO=function(t){var e,i={x:0,y:0};return(t=t||this.gLyt())&&(i=function(t,e,i){var o,n,r=t[0],s=t[1];if(h(e)){if((o=(e.width||0)-t[2])<0){var l=i&a.AlignEnum.exAlignCenter,p=i&a.AlignEnum.exAlignRight;(l||p)&&(r+=-o/(l?2:1))}if((n=(e.height||0)-t[3])<0){var u=i&a.AlignEnum.exAlignVCenter,c=i&a.AlignEnum.exAlignBottom;(u||c)&&(s+=-n/(u?2:1))}}return{x:r,y:s}}(this.GetInsideRect(),t.size,this.getAlignCal()),e=this.GetClientRect(),i.x-=e[0],i.y-=e[1]),i},M.prototype.GetLayoutRect=function(){var t,e=this.GetClientRect(),i=this.gLyt();return i&&(t=this.gLyO(i),a.ORt(e,t.x,t.y),e[2]=i.size.width,e[3]=i.size.height),e},M.prototype.GetClipRect=function(){var t=this.GetLayoutRect(),e=this.GetClientRect();return this.isFlowL2R()?(t[0]=e[0],t[2]=e[2]):(t[1]=e[1],t[3]=e[3]),a.NRt(t,e)},M.prototype.getVisibleParts=function(){var t=this.gLyt();return h(t)?t.rgVP:null},M.prototype.ptInPart=function(t,e,i){var o=i==this.p2P([t,e]);if(!o){var n=this.getVisibleParts();if(h(n)){var r=this.GetClientRect();a.PInR(t,e,r)&&(t-=r[0]+this.xL,e-=r[1]+this.yL,(o=n.pInO(t,e,i))&&(n.pInO(t,e,c)&&(o=i==c),n.pInO(t,e,u)&&(o=i==u)))}}return o},M.prototype.p2P=function(t){var e=null,i=p.X(t),o=p.Y(t);if(h(this.rgLCP)&&(e=this.rgLCP.p2O(i,o)),r(e)){var n=this.getVisibleParts();if(h(n)){var s=this.GetClientRect();i-=s[0]+this.xL,o-=s[1]+this.yL,e=n.p2O(i,o)}}return e},M.prototype.p2A=function(t){return a.H.P2A(this,p.X(t),p.Y(t))},M.prototype.p2rt=function(t){var e=this.getLockClientPart(t);if(r(e)){var i=this.getVisibleParts();if(h(i)&&(e=i.get(t),h(e))){var o=this.GetClientRect(),n=o[0]+this.xL,s=o[1]+this.yL;e=a.ORt(e.slice(),n,s)}}return e},M.prototype.p2D=function(t){if(t)return M.getDay(this.p2P(t))},M.prototype.p2E=function(t){if(t)return this.oE.gE(this.p2D(t))},M.prototype.p2T=function(t){if(t){var e=this.p2E(t);return e&&e.reverse().forEachU(function(t){return t.getToolTip()})}},M.prototype.GetLocale=function(){return this.oO.locale},M.prototype.SetLocale=function(t){this.bU(),this.oO.locale=t||null,this.onLD(),this.eU()},M.prototype.getLocale=function(){return this.GetLocale()},M.prototype.pushLoc=function(){a.Loc.Push(this.getLocale())},M.prototype.popLoc=function(){a.Loc.Pop()},M.prototype.locale=function(t,e){var i;return this.pushLoc(),t&&(i=t.call(e||this)),this.popLoc(),i},M.prototype.GetDate=function(){return Date.Copy(this.date[this.nLV])},M.prototype.SetDate=function(t,e,i){this.bU();var o,n=Date.Create(t,e,i).Reset(a.UnitEnum.exDay),h=this.nLV,r=n.Compare(this.date[h]);return(r||this.refresh==this.smoothRefresh)&&(o=n.Compare(this.date[h]),this.date[h]=n,o&&0==h&&this.ondatechange(n),this.refresh()),this.eU(),r},M.prototype.ondatechange=function(t){this.oLts.ondatechange.do(t)},M.prototype.getLayoutDate=function(){return date},M.prototype.SetSmoothDate=function(t,e,i){var o=this.refresh;this.refresh=this.smoothRefresh,this.SetDate(t,e,i),this.refresh=o},M.prototype.setHighlightPart=function(t,e,i,o){function n(t){h(t.timeoutID)&&(clearTimeout(t.timeoutID),t.timeoutID=null)}if(e=e||"",h(this.rgHP)){h(r=this.rgHP.get(e))&&(n(r),this.rgHP.delete(e),0==this.rgHP.size&&(this.rgHP=null))}if((i=h(i)?i:1e3)&&(o=o||this.getTypeHLShape(t.type))){this.rgHP=this.rgHP||new Map;var r=this.rgHP.get(e);if(h(r)&&n(r),r={type:t.type,date:t.date,key:e,htObject:w.setObject(t.type,t.date),shape:o,timeoutID:null},this.rgHP.set(e,r),i>0){var s=this;r.timeoutID=setTimeout(function(){s.setHighlightPart(r,r.key,0),s.rfhAO()},this.getSmoothSel()+i)}}},M.prototype.getHighlightShape=function(t){if(h(this.rgHP)){var e=[];if(this.rgHP.forEach(function(i){i.htObject==t&&e.push(i.shape)}),e.length)return e.join()}},M.prototype.setLayoutView=function(t,e){switch(this.nLV){case 1:if(h(e))switch(t){case 0:this.setHighlightPart({type:"DM",date:e}),this.nDVP&&e.PrevMonth(this.nDVP);break;case 2:this.setHighlightPart({type:"Y",date:e})}break;case 2:h(e)&&1==t&&(this.setHighlightPart({type:"MH",date:e}),this.nDVP&&e.PrevYear(this.nDVP));break;default:if(this.oDVL=this.oLyt,this.nDVP=null,h(e)){var i=this.getVisibleParts();if(h(i)){var o=0;i.forEachU(function(t,i){var n=this.getObject(i);if("DA"==n.type){if(0==M.compareUnit(n.date,e,a.UnitEnum.exMonth))return this.nDVP=o,!0;o++}},this)}this.setHighlightPart({type:"M",date:e}),this.nDVP&&1==t&&e.PrevYear(this.nDVP)}}this.nLV=t,this.SetSmoothDate(e||this.date[this.nLV])},M.prototype.Refresh=function(){this.bU(),this.onRL(),this.eU()},M.prototype.refresh=M.prototype.Refresh,M.prototype.smoothRefresh=function(){a.A.Cancel(M.smooth);var t,e,i,o,n,r,s,l,p,y,g,f,d,S,D=this.gLyt();D&&(t=this.gLyO(D),i=(e=this.date[this.nLV]).Compare(D.date),this.lockClientPart(c,u),o=D.rgVP,n=new w(this,e,this.nLV),r=n.rgVP,s=o.forEachU(function(t,e){return r.has(e)&&e},this),l=0,p=0,y=o.get(s),g=r.get(s),y&&g?(l=g[0]-y[0],p=g[1]-y[1]):h(f=o.union())&&(this.isFlowL2R()?(l=0,p=-(i<0?a.TOf(f)-n.size.height:a.BOf(f))):(p=0,l=-(i<0?a.LOf(f)-n.size.width:a.ROf(f)))),r.offset(-l,-p),o.add(r),d=this.xL,S=this.yL,p-=S-t.y,(l-=d-t.x)||p?(this.clip=this.GetClipRect(),a.A.Progress(function(t){this.xL=d+t*l,this.yL=S+t*p,1==t&&(this.clip=null,this.lockClientPart(),this.onRL()),this.rfhAO()},{thisArg:this,duration:this.getSmoothScroll(),name:M.smooth,transition:"ease"})):this.rfhAO())},M.prototype.GetAutoSize=function(){return this.oO.autoSize},M.prototype.SetAutoSize=function(t){this.bU(),this.oO.autoSize=t,this.onRL(),this.eU()},M.prototype.getAutoSize=function(){return s(this.opt("autoSize"),a.Calendar.AutoSizeEnum,-1)},M.prototype.GetSmoothSel=function(){return this.oO.smoothSel},M.prototype.SetSmoothSel=function(t){this.bU(),this.oO.smoothSel=t,this.onRL(),this.eU()},M.prototype.getSmoothSel=function(){return f(0,a.ToI(this.opt("smoothSel",125)))},M.prototype.GetSmoothScroll=function(){return this.oO.smoothScroll},M.prototype.SetSmoothScroll=function(t){this.bU(),this.oO.smoothScroll=t,this.onRL(),this.eU()},M.prototype.getSmoothScroll=function(){return f(0,a.ToI(this.opt("smoothScroll",250)))},M.prototype.GetLocked=function(){return this.oO.locked},M.prototype.SetLocked=function(t){this.bU(),this.oO.locked=t,this.onRL(),this.eU()},M.prototype.getLocked=function(){return g(this.opt("locked",!1))},M.prototype.GetReadOnly=function(){return this.oO.readOnly},M.prototype.SetReadOnly=function(t){this.bU(),this.oO.readOnly=t,this.onRL(),this.eU()},M.prototype.isReadOnly=function(){return this.opt("readOnly",!1)},M.prototype.GetMode=function(){return this.oO.mode},M.prototype.SetMode=function(t){this.bU(),this.oO.mode=t,this.onLD(),this.eU()},M.prototype.getMode=function(){return s(this.opt("mode"),a.Calendar.ModeEnum,1)},M.prototype.GetFlow=function(){return this.oO.flow},M.prototype.SetFlow=function(t){this.bU(),this.oO.flow=t||null,this.onLD(),this.eU()},M.prototype.getFlow=function(){return s(this.opt("flow"),a.Calendar.FlowEnum,0)},M.prototype.isFlowL2R=function(){return 0==this.getFlow()},M.prototype.isH=function(){return 1==this.getMode()},M.prototype.isFitClient=function(){return 1==this.getAutoSize()},M.prototype.GetMinMonthX=function(){return this.oO.minMonthX},M.prototype.SetMinMonthX=function(t){this.bU(),this.oO.minMonthX=t||null,this.onRL(),this.eU()},M.prototype.getMinMonthX=function(){return f(1,a.ToI(this.opt("minMonthX",1)))},M.prototype.GetMaxMonthX=function(){return this.oO.maxMonthX},M.prototype.SetMaxMonthX=function(t){this.bU(),this.oO.maxMonthX=t||null,this.onRL(),this.eU()},M.prototype.getMaxMonthX=function(){return f(1,a.ToI(this.opt("maxMonthX",6)))},M.prototype.GetMinMonthY=function(){return this.oO.minMonthY},M.prototype.SetMinMonthY=function(t){this.bU(),this.oO.minMonthY=t||null,this.onRL(),this.eU()},M.prototype.getMinMonthY=function(){return f(1,a.ToI(this.opt("minMonthY",1)))},M.prototype.GetMaxMonthY=function(){return this.oO.maxMonthY},M.prototype.SetMaxMonthY=function(t){this.bU(),this.oO.maxMonthY=t||null,this.onRL(),this.eU()},M.prototype.getMaxMonthY=function(){return f(1,a.ToI(this.opt("maxMonthY",2)))},M.prototype.getMinMonth=function(){return{x:d(this.getMinMonthX(),this.getMaxMonthX()),y:d(this.getMinMonthY(),this.getMaxMonthY())}},M.prototype.getMaxMonth=function(){return{x:f(this.getMinMonthX(),this.getMaxMonthX()),y:f(this.getMinMonthY(),this.getMaxMonthY())}},M.prototype.GetDayFixedWidth=function(){return this.oO.dayFixedWidth},M.prototype.SetDayFixedWidth=function(t){this.bU(),this.oO.dayFixedWidth=t||null,this.onRL(),this.eU()},M.prototype.getDayFixedWidth=function(){return a.ToI(this.opt("dayFixedWidth",24))},M.prototype.GetDayFixedHeight=function(){return this.oO.dayFixedHeight},M.prototype.SetDayFixedHeight=function(t){this.bU(),this.oO.dayFixedHeight=t||null,this.onRL(),this.eU()},M.prototype.getDayFixedHeight=function(){return a.ToI(this.opt("dayFixedHeight",24))},M.prototype.GetDayLabel=function(){return this.oO.dayLabel},M.prototype.SetDayLabel=function(t){this.bU(),this.oO.dayLabel=t,this.onRL(),this.eU()},M.prototype.getDayLabel=function(){return b(this.opt("dayLabel","<%d%>"))},M.prototype.GetDayAlign=function(){return this.oO.dayAlign},M.prototype.SetDayAlign=function(t){this.bU(),this.oO.dayAlign=t,this.onRL(),this.eU()},M.prototype.getDayAlign=function(){return s(this.opt("dayAlign"),a.DrawTextFormatEnum,261)},M.prototype.GetDayWeekHeader=function(){return this.oO.dayWeekHeader},M.prototype.SetDayWeekHeader=function(t){this.bU(),this.oO.dayWeekHeader=t,this.onRL(),this.eU()},M.prototype.getDayWeekHeader=function(){return g(this.opt("dayWeekHeader",!0))},M.prototype.GetDayWeekLabel=function(){return this.oO.dayWeekLabel},M.prototype.SetDayWeekLabel=function(t){this.bU(),this.oO.dayWeekLabel=t,this.onRL(),this.eU()},M.prototype.getDayWeekLabel=function(){return b(this.opt("dayWeekLabel","<%d2%>"))},M.prototype.GetDayWeekNoHeader=function(){return this.oO.dayWeekNoHeader},M.prototype.SetDayWeekNoHeader=function(t){this.bU(),this.oO.dayWeekNoHeader=t,this.onRL(),this.eU()},M.prototype.getDayWeekNoHeader=function(){return g(this.opt("dayWeekNoHeader",!0))},M.prototype.GetDayWeekNoLabel=function(){return this.oO.dayWeekNoLabel},M.prototype.SetDayWeekNoLabel=function(t){this.bU(),this.oO.dayWeekNoLabel=t,this.onRL(),this.eU()},M.prototype.getDayWeekNoLabel=function(){return b(this.opt("dayWeekNoLabel","<%ww%>"))},M.prototype.GetDayMonthHeader=function(){return this.oO.dayMonthHeader},M.prototype.SetDayMonthHeader=function(t){this.bU(),this.oO.dayMonthHeader=t,this.onRL(),this.eU()},M.prototype.getDayMonthHeader=function(){return g(this.opt("dayMonthHeader",!0))},M.prototype.GetDayMonthLabel=function(){return this.oO.dayMonthLabel},M.prototype.SetDayMonthLabel=function(t){this.bU(),this.oO.dayMonthLabel=t,this.onRL(),this.eU()},M.prototype.getDayMonthLabel=function(){return b(this.opt("dayMonthLabel","<%mmmm%> <%yyyy%>"))},M.prototype.GetDayMonthAlign=function(){return this.oO.dayMonthAlign},M.prototype.SetDayMonthAlign=function(t){this.bU(),this.oO.dayMonthAlign=t,this.onRL(),this.eU()},M.prototype.getDayMonthAlign=function(){return s(this.opt("dayMonthAlign"),a.DrawTextFormatEnum,5)},M.prototype.GetDayNonMonth=function(){return this.oO.dayNonMonth},M.prototype.SetDayNonMonth=function(t){this.bU(),this.oO.dayNonMonth=t,this.onRL(),this.eU()},M.prototype.getDayNonMonth=function(){return g(this.opt("dayNonMonth",!0))},M.prototype.GetDayNonMonthLabel=function(){return this.oO.dayNonMonthLabel},M.prototype.SetDayNonMonthLabel=function(t){this.bU(),this.oO.dayNonMonthLabel=t,this.onRL(),this.eU()},M.prototype.getDayNonMonthLabel=function(){return b(this.opt("dayNonMonthLabel","<%d%>"))},M.prototype.GetDayWeekAllLabel=function(){return this.oO.dayWeekAllLabel},M.prototype.SetDayWeekAllLabel=function(t){this.bU(),this.oO.dayWeekAllLabel=t,this.onRL(),this.eU()},M.prototype.getDayWeekAllLabel=function(){return b(this.opt("dayWeekAllLabel"))},M.prototype.GetMonthLabel=function(){return this.oO.monthLabel},M.prototype.SetMonthLabel=function(t){this.bU(),this.oO.monthLabel=t,this.onRL(),this.eU()},M.prototype.getMonthLabel=function(){return b(this.opt("monthLabel","<%mmm%>"))},M.prototype.GetMonthAlign=function(){return this.oO.monthAlign},M.prototype.SetMonthAlign=function(t){this.bU(),this.oO.monthAlign=t,this.onRL(),this.eU()},M.prototype.getMonthAlign=function(){return s(this.opt("monthAlign"),a.DrawTextFormatEnum,262149)},M.prototype.GetMonthYearAlign=function(){return this.oO.monthYearAlign},M.prototype.SetMonthYearAlign=function(t){this.bU(),this.oO.monthYearAlign=t,this.onRL(),this.eU()},M.prototype.getMonthYearAlign=function(){return s(this.opt("monthYearAlign"),a.DrawTextFormatEnum,4)},M.prototype.GetYearLabel=function(){return this.oO.yearLabel},M.prototype.SetYearLabel=function(t){this.bU(),this.oO.yearLabel=t,this.onRL(),this.eU()},M.prototype.getYearLabel=function(){return b(this.opt("yearLabel","<%yyyy%>"))},M.prototype.GetYearAlign=function(){return this.oO.yearAlign},M.prototype.SetYearAlign=function(t){this.bU(),this.oO.yearAlign=t,this.onRL(),this.eU()},M.prototype.getYearAlign=function(){return s(this.opt("yearAlign"),a.DrawTextFormatEnum,5)},M.prototype.GetYearRangeAlign=function(){return this.oO.yearRangeAlign},M.prototype.SetYearRangeAlign=function(t){this.bU(),this.oO.yearRangeAlign=t,this.onRL(),this.eU()},M.prototype.getYearRangeAlign=function(){return s(this.opt("yearRangeAlign"),a.DrawTextFormatEnum,4)},M.prototype.GetPad=function(){return this.oO.pad},M.prototype.SetPad=function(t){this.bU(),this.oO.pad=t,this.onRL(),this.eU()},M.prototype.getPad=function(){return this.opt("pad",[4,2])},M.prototype.GetShapes=function(){return this.oO.shapes},M.prototype.SetShapes=function(t){this.bU(),this.oO.shapes=t,this.onRL(),this.eU()},M.prototype.getShapes=function(){return r(this.sShs)&&(this.sShs=b(this.opt("shapes","hot(d,dnm,m,y),today(dt,mt,yt),gray(dw,dwn,dwnn),lightgray(dnm),select(ds,ms,ys),weekend(de),prev(p),next(n)"))),this.sShs},M.prototype.GetHlShapes=function(){return this.oO.hlShapes},M.prototype.SetHlShapes=function(t){this.bU(),this.sHLShapes=null,this.oO.hlShapes=t,this.onRL(),this.eU()},M.prototype.getHLShapes=function(){return r(this.sHLShapes)&&(this.sHLShapes=b(this.opt("hlShapes","frame(m,dm,y),frame(d,dnm)"))),this.sHLShapes},M.prototype.getTypeHLShape=function(t){return h(t)?a.GP.GetAll(t.toLowerCase(),this.getHLShapes()):null},M.prototype.getTypeShape=function(t){return h(t)?a.S.GetOf(t.toLowerCase(),this.getShapes(),"Calendar"):null},M.prototype.GetCursors=function(){return this.oO.cursors},M.prototype.SetCursors=function(t){this.bU(),this.oO.cursors=t,this.onRL(),this.eU()},M.prototype.getCursors=function(){return r(this.sCrs)&&(this.sCrs=b(this.opt("cursors","pointer(p,n,anchor)"))),this.sCrs},M.prototype.GetSelection=function(){var t=null;return this.rgSel&&(this.rgSel instanceof a.Arr?(t=[],this.rgSel.forEach(function(e){t.push(new Date(e))})):t=new Date(this.rgSel)),t},M.prototype.SetSelection=function(t){this.select(this.toDates(t))},M.prototype.getSel=function(){var t=a.Arr.empty;return this.rgSel&&(t=(this.rgSel instanceof a.Arr?this.rgSel:new a.Arr(this.rgSel)).map(function(t){return new Date(t)})),t},M.prototype.toDates=function(t){var e=null;return h(t)&&(e=[],(a.IsS(t)||!t.forEach?[t]:t).forEach(function(t){(t=Date.Create(t)).isValid()&&e.push(function(t){var e;return(e=t.getTime())%a.msday&&t.setTime(e-e%a.msday),t}(t))})),e},M.prototype.GetSingleSel=function(){return this.oO.singleSel},M.prototype.SetSingleSel=function(t){this.bU(),this.n1S=null,this.oO.singleSel=t,this.onRL(),this.eU()},M.prototype.getSingleSel=function(){return this.isReadOnly()?0:(r(this.n1S)&&(this.n1S=s(this.opt("singleSel"),a.Calendar.SingleSelEnum,1)),this.n1S)},M.prototype.GetAllowSwitchView=function(){return this.oO.allowSwitchView},M.prototype.SetAllowSwitchView=function(t){this.bU(),this.oO.allowSwitchView=t,this.onRL(),this.eU()},M.prototype.getAllowSwitchView=function(){return g(this.opt("allowSwitchView",!0))},M.prototype.GetPadCal=function(){return this.oO.padCal},M.prototype.SetPadCal=function(t){this.bU(),this.oO.padCal=t,this.onRL(),this.eU()},M.prototype.getPadCal=function(){return this.opt("padCal",4)},M.prototype.GetAlignCal=function(){return this.oO.alignCal},M.prototype.SetAlignCal=function(t){this.bU(),this.oO.alignCal=t,this.onRL(),this.eU()},M.prototype.getAlignCal=function(){return a.ToI(this.opt("alignCal",5))},M.prototype.GetTfi=function(){return this.oO.tfi},M.prototype.SetTfi=function(t){this.bU(),this.oO.tfi=t||null,this.onRL(),this.eU()},M.prototype.getTfi=function(){return this.opt("tfi")},M.prototype.GetWheelChange=function(){return this.oO.wheelChange},M.prototype.SetWheelChange=function(t){this.bU(),this.oO.wheelChange=t,this.onRL(),this.eU()},M.prototype.getWheelChange=function(){return a.ToI(this.opt("wheelChange",1))},M.prototype.GetAllowScrollByDrag=function(){return this.oO.allowScrollByDrag},M.prototype.SetAllowScrollByDrag=function(t){this.bU(),this.oO.allowScrollByDrag=t,this.onRL(),this.eU()},M.prototype.getAllowScrollByDrag=function(){return g(this.opt("allowScrollByDrag",!0))},M.prototype.GetInsideRect=function(){return a.PRt(this.GetClientRect(),this.getPadCal(),-1)},M.prototype.getDayFixedSize=function(){return{width:this.getDayFixedWidth(),height:this.getDayFixedHeight()}},M.prototype.gDCSize=function(){return w.gDCSize(this,this.getMode())},M.prototype.getDayAutoSize=function(){this.pushLoc();var t,e=this.gCtx(),i=this.getDayAlign(),o=a.HF.Date.MeasureLabel(e,this.getDayLabel(),i),n={width:o.width,height:o.height};return this.getDayNonMonth()&&(t=a.HF.Date.MeasureLabel(e,this.getDayNonMonthLabel(),i),n.width=f(n.width,t.width),n.height=f(n.height,t.height)),this.popLoc(),n},M.prototype.padSize=function(t){var e=[0,0,t.width,t.height];return a.PRt(e,this.getPad()),t.width=e[2],t.height=e[3],t},M.prototype.getYearSize=function(){var t=this.oYS;return r(t)&&((t=this.getLabelSize(this.getLabel("Y"))).width=y(t.width),t.height=y(t.height),this.oYS=t),t},M.prototype.getDaySize=function(){var t=this.oDS;if(r(t)){switch(this.getAutoSize()){case M.AutoSizeEnum.exFixedSize:t=this.padSize(this.getDayFixedSize());break;case M.AutoSizeEnum.exFitClient:t=this.gDCSize();break;default:t=this.padSize(this.getDayAutoSize())}t.width=y(t.width),t.height=y(t.height),this.oDS=t}return this.oDS},M.prototype.getHeaderSize=function(){var t=this.oHdS;if(r(t)){t={width:0,height:0},this.pushLoc();var e=this.gCtx();if(this.getDayMonthHeader()){i=a.HF.Date.MeasureLabel(e,this.getDayMonthLabel(),0);t.height=f(t.height,i.height)}if(this.getDayWeekHeader()){i=a.HF.Date.MeasureLabel(e,this.getDayWeekLabel(),0);if(t.height=f(t.height,i.height),t.width=f(t.width,i.width),this.getDayWeekNoHeader()&&this.getDayWeekAllLabel()){i=a.HF.Date.MeasureLabel(e,this.getDayWeekAllLabel(),0);t.height=f(t.height,i.height),t.width=f(t.width,i.width)}}if(this.getDayWeekNoHeader()){var i=a.HF.Date.MeasureLabel(e,this.getDayWeekNoLabel(),0);t.width=f(t.width,i.width),t.height=f(t.height,i.height)}this.popLoc(),t.width=y(t.width),t.height=y(t.height),this.oHdS=this.padSize(t)}return this.oHdS},M.prototype.Unshuffle=function(){this.Shuffle(0)},M.prototype.Shuffle=function(t){var e=this.getVisibleParts();if(h(e)){r(e.original)&&(e.original=e.copy());var i=e.original;(t=h(t)?t:.5)&&(i=e.copy().shuffle(t)),e.morph(i,{inv:this.rfhAO,thisArg:this,duration:this.getSmoothScroll(),name:"shuffle",transition:"ease"})}},M.prototype.GetToolTipDelay=function(){return this.oO.toolTipDelay},M.prototype.SetToolTipDelay=function(t){this.oO.toolTipDelay=t},M.prototype.getToolTipDelay=function(){return this.opt("toolTipDelay",500)},M.prototype.GetToolTipPopDelay=function(){return this.oO.toolTipPopDelay},M.prototype.SetToolTipPopDelay=function(t){this.oO.toolTipPopDelay=t},M.prototype.getToolTipPopDelay=function(){return this.opt("toolTipPopDelay",5e3)},M.prototype.GetToolTipWidth=function(){return this.oO.toolTipWidth},M.prototype.SetToolTipWidth=function(t){this.oO.toolTipWidth=t},M.prototype.getToolTipWidth=function(){return this.opt("toolTipWidth",-1)},M.prototype.allowTT=function(){return a.TT&&this.getToolTipWidth()&&this.getToolTipPopDelay()},M.prototype.GetEvents=function(){return this.oE},M.prototype.SetEvents=function(t){if(this.bU(),this.oE.Clear(),h(t))if(a.IsO(t))for(var e in t){var i=t[e],o=this.oE.Add(i);i&&r(i.key)&&o.SetKey(e)}else(t.forEach&&t||[t]).forEach(function(t){this.oE.Add(t)},this);this.eU()},M.prototype.Event=function(t){return this.oE.Item(t)},M.prototype.GetSelectable=function(){return this.oO.selectable},M.prototype.SetSelectable=function(t){this.bU(),this.oO.selectable=t,this.eU()},M.prototype.getSelectable=function(){return b(this.opt("selectable"))};return w.prototype.getDateToView=function(t){return Date.Copy(t).Reset(a.UnitEnum.exMonth)},w.setObject=function(t,e){return e?t+":"+e.getTime():t},w.getObject=function(t){var e=b(t).indexOf(":");return e<0?{type:t}:{type:t.substr(0,e),date:new Date(parseInt(t.substr(e+1)))}},w.prototype.build=function(){switch(this.oC.pushLoc(),this.nLV){case 1:(function(){this.rgVP=new a.M1;var t=this.oC;if(h(t.oDVL)){var e=this.oC.isFlowL2R(),i=t.getHeaderSize(),o=t.oDVL.table.h,n=t.oDVL.table.v,r={width:t.oDVL.size.width/o,height:t.oDVL.size.height/n};if(this.table.h=o,this.table.v=n,!e){var s=n;n=o,o=s}for(var l=this.date.copy().Reset(a.UnitEnum.exYear),p=0,u=0,c=0;cD&&(x=L,L=C,C=x);var M=D/L,O=v/C;if(!e){var x=L;L=C,C=x}for(var m=g[0],E=g[1],A=l.copy(),T=m,k=E,R=0;R0){s=function(t,e){switch(e=e.copy(),t.nLV){case 1:case 2:return e.PrevYear(t.table.h*t.table.v);default:return e.PrevMonth(t.table.h*t.table.v)}}(this,this.prevExtDate||this.date);do{var r=e(this.oC,s,o);r.rgVP.offset(i?0:a.LOf(n)-r.size.width,i?a.TOf(n)-r.size.height:0),this.rgVP.add(r.rgVP),n=this.rgVP.union()}while((i?a.TOf(n):a.LOf(n))-t>0);this.prevExtDate=s}}else if((i?a.BOf(n)-this.size.height:a.ROf(n)-this.size.width)-t<=0){var s=function(t,e){switch(e=e.copy(),t.nLV){case 1:case 2:return e.NextYear(t.table.h*t.table.v);default:return e.NextMonth(t.table.h*t.table.v)}}(this,this.nextExtDate||this.date);do{var l=e(this.oC,s,o);l.rgVP.offset(i?0:a.ROf(n),i?a.BOf(n):0),this.rgVP.add(l.rgVP),n=this.rgVP.union()}while((i?a.BOf(n)-this.size.height:a.ROf(n)-this.size.width)-t<=0);this.nextExtDate=s}}},w.prototype.getExtendDate=function(){var t=this.nDirExt;if(t){var e=this.date.copy(),i=this.oC.isFlowL2R(),o=t<0;t<0&&(t=-t);var n=i?this.size.height:this.size.width;switch(this.nLV){case 1:n/=i?this.table.v:this.table.h;break;case 2:break;default:n/=i?this.table.v:this.table.h}var h=t/n,r=Math.trunc(h);switch(h-r>.15&&r++,this.nLV){case 1:e=(o?e.PrevYear:e.NextYear).call(e,r*(i?this.table.h:this.table.v));break;case 2:e=(o?e.PrevYear:e.NextYear).call(e,r*this.table.h*this.table.v);break;default:e=(o?e.PrevMonth:e.NextMonth).call(e,r*(i?this.table.h:this.table.v))}return e}return null},w.oLay=function(t){var e,i={width:0,height:0};return t&&(e=t.union())&&(i.width=e[2],i.height=e[3],t.offset(-e[0],-e[1])),i},w.gMSize=function(t,e){switch(e){case M.ModeEnum.exVertical:return w.gVMSize(t);default:return w.gHMSize(t)}return{width:0,height:0}},w.gDCSize=function(t,e){switch(e){case M.ModeEnum.exVertical:return w.gVDCSize(t);default:return w.gHDCSize(t)}return{width:0,height:0}},w.gHMSize=function(t){var e={width:0,height:0},i=t.getDaySize(),o=t.getHeaderSize();return t.getDayMonthHeader()&&(e.height+=o.height),t.getDayWeekHeader()&&(e.height+=o.height),t.getDayWeekNoHeader()&&(e.width+=o.width),e.width+=a.days*i.width,e.height+=a.weeks*i.height,e},w.gHDCSize=function(t){function e(t,e,i,o){return(t-e*o)/(e*i)}var i=t.getMaxMonth(),o=t.getHeaderSize(),n=t.GetInsideRect();return{width:e(n[2],i.x,a.days,(t.getDayWeekNoHeader()?1:0)*o.width),height:e(n[3],i.y,a.weeks,((t.getDayMonthHeader()?1:0)+(t.getDayWeekHeader()?1:0))*o.height)}},w.bMZOrder=function(t,e){var i=0;["DA","DMH","DWA","DWH","DWNH","DM"].forEach(function(o){i=e.setZOrd(w.setObject(o,t),i)})},w.prototype.bHM=function(t,e){var i=new a.M1,o=this.oC.getDaySize(),n=this.oC.getHeaderSize(),r=t,s=r.GetMonth(),l=Date.Copy(r).PrevDay(r.WeekOff()),p=Date.Copy(l);i.push(w.setObject("DM",r),[0,0,a.days*o.width,a.weeks*o.height]);for(var u=0,c=0,y=0;y0))),D&&i.push(w.setObject(S?"D":"DNM",l),[u,c,o.width,o.height]),u+=o.width,l.NextDay()}u=0,c+=o.height}if(u=0,c=0,this.oC.getDayWeekHeader()){c-=n.height,l=Date.Copy(p),this.oC.getDayWeekNoHeader()&&(u-=n.width,i.push(w.setObject("DWA",r),[u,c,n.width,n.height]),u+=n.width),i.push(w.setObject("DWH",r),[u,c,a.days*o.width,n.height]);for(var g=0;g0),D&&i.push(w.setObject(S?"DWN":"DWNN",d),[u,c,n.width,o.height]),c+=o.height,l.NextWeek()}}if(this.oC.getDayMonthHeader()){var v=w.oLay(i);i.push(w.setObject("DMH",r),[0,-n.height,v.width,n.height])}var b=w.oLay(i);i.push(w.setObject("DA",r),[0,0,b.width,b.height]),w.bMZOrder(r,i);return{rgVP:i,size:b}},w.gVMSize=function(t){var e={width:0,height:0},i=t.getDaySize(),o=t.getHeaderSize();return t.getDayMonthHeader()&&(e.height+=o.height),t.getDayWeekHeader()&&(e.width+=o.width),t.getDayWeekNoHeader()&&(e.height+=o.height),e.width+=a.weeks*i.width,e.height+=a.days*i.height,e},w.gVDCSize=function(t){function e(t,e,i,o){return(t-e*o)/(e*i)}var i=t.getMaxMonth(),o=t.getHeaderSize(),n=t.GetInsideRect();return{width:e(n[2],i.x,a.weeks,(t.getDayWeekHeader()?1:0)*o.width),height:e(n[3],i.y,a.days,((t.getDayMonthHeader()?1:0)+(t.getDayWeekNoHeader()?1:0))*o.height)}},w.prototype.bVM=function(t,e){var i=new a.M1,o=this.oC.getDaySize(),n=this.oC.getHeaderSize(),r=t,s=r.GetMonth(),l=Date.Copy(r).PrevDay(r.WeekOff()),p=Date.Copy(l);i.push(w.setObject("DM",r),[0,0,a.weeks*o.width,a.days*o.height]);for(var u=0,c=0,y=0;y0))),D&&i.push(w.setObject(S?"D":"DNM",l),[u,c,o.width,o.height]),c+=o.height,l.NextDay()}c=0,u+=o.width}if(u=0,c=0,this.oC.getDayWeekHeader()){u-=n.width,l=Date.Copy(p),this.oC.getDayWeekNoHeader()&&(c-=n.height,i.push(w.setObject("DWA",r),[u,c,n.width,n.height]),c+=n.height),i.push(w.setObject("DWH",r),[u,c,n.width,a.days*o.height]);for(var g=0;g0),D&&i.push(w.setObject(S?"DWN":"DWNN",d),[u,c,o.width,n.height]),u+=o.width,l.NextWeek()}}if(this.oC.getDayMonthHeader()){var v=w.oLay(i);i.push(w.setObject("DMH",r),[0,-n.height,v.width,n.height])}var b=w.oLay(i);return i.push(w.setObject("DA",r),[0,0,b.width,b.height]),w.bMZOrder(r,i),{rgVP:i,size:b}},w.prototype.addNP=function(){var t=this.oC,e=t.getDaySize(),i=t.getHeaderSize(),o=n?4+n.fontHeight():0,n=t.gCtx(),h={width:f(o,e.width),height:f(o,i.height)},r=[this.size.width-h.width,0,h.width,h.height];t.getTypeShape(u)&&(this.rgVP.push(w.setObject(u),r),r=a.ORt(r.slice(),-h.width,0)),t.getTypeShape(c)&&this.rgVP.push(w.setObject(c),r)},a.expO({Count:null},L.prototype),a.expO(a.Mrg({Options:null,Index:null},O),C.prototype),a.expO(a.Mrg({Canvas:null,Layout:null,Options:null},M.Options),M.prototype),M.parts=function(){function t(e,i,o){return o=o||new Map,a.B.split(e).forEach(function(e){o.set(e.caption,i),t(e.subText,e.caption,o)}),o}return t("DA(DMH(DWA,DWH(DW)),DWNH(DWN,DWNN),DM(D,DNM)),MA(MH,MM(M)),YA(YH,YY(Y)),N,P")}(),M.decode=w.getObject,M.encode=w.setObject,M.EventOptions=O,M.Events=L,M.Event=C,M.Layout=w,{Calendar:M}}()),t.Calendar=a.Calendar});