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