!function(e,t){if("function"==typeof define&&define.amd)define(["exports"],t);else if("undefined"!=typeof exports)t(exports);else{var n={};t(n),e.jsYearCalendar=n}}(this,function(e){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;nnew Date(this.options.startYear-1,11,31)&&n.classList.add("disabled");var a=document.createElement("span");a.innerHTML="‹",n.appendChild(a),t.appendChild(n);var i=document.createElement("th");i.classList.add("year-title"),i.classList.add("year-neighbor2"),i.textContent=(this.options.startYear-2).toString(),null!=this.options.minDate&&this.options.minDate>new Date(this.options.startYear-2,11,31)&&i.classList.add("disabled"),t.appendChild(i);var s=document.createElement("th");s.classList.add("year-title"),s.classList.add("year-neighbor"),s.textContent=(this.options.startYear-1).toString(),null!=this.options.minDate&&this.options.minDate>new Date(this.options.startYear-1,11,31)&&s.classList.add("disabled"),t.appendChild(s);var o=document.createElement("th");o.classList.add("year-title"),o.textContent=this.options.startYear.toString(),t.appendChild(o);var r=document.createElement("th");r.classList.add("year-title"),r.classList.add("year-neighbor"),r.textContent=(this.options.startYear+1).toString(),null!=this.options.maxDate&&this.options.maxDater.options.minDate)&&(null==r.options.maxDate||t<=r.options.maxDate)){for(var o=[],a=0;a=n&&!(r._dataSource[a].endDate=r.options.minDate)&&(null==r.options.maxDate||t<=r.options.maxDate)){for(var i=0;i=t&&a.push(o[i]);0s._rangeStart?s._rangeEnd:s._rangeStart;s._triggerEvent("selectRange",{startDate:t,endDate:n,events:s.getEventsOnRange(t,new Date(n.getFullYear(),n.getMonth(),n.getDate()+1))})}}),this._responsiveInterval&&(clearInterval(this._responsiveInterval),this._responsiveInterval=null),this._responsiveInterval=setInterval(function(){if(null!=s.element.querySelector(".month")){var e=s.element.offsetWidth,t=s.element.querySelector(".month").offsetWidth+10;s._nbCols=null,s._nbCols=6*tthis._rangeStart?this._rangeEnd:this._rangeStart;this.element.querySelectorAll(".month-container").forEach(function(e){var t=parseInt(e.dataset.monthId);a.getMonth()<=t&&i.getMonth()>=t&&e.querySelectorAll("td.day:not(.old):not(.new)").forEach(function(e){var t=n._getDate(e);a<=t&&t<=i&&(e.classList.add("range"),t.getTime()==a.getTime()&&e.classList.add("range-start"),t.getTime()==i.getTime()&&e.classList.add("range-end"))})})}}},{key:"_getElementPosition",value:function(e){for(var t=0,n=0;t+=e.offsetTop||0,n+=e.offsetLeft||0,e=e.offsetParent;);return{top:t,left:n}}},{key:"_openContextMenu",value:function(e){var t=document.querySelector(".calendar-context-menu");if(null!==t)for(t.style.display="none";t.firstChild;)t.removeChild(t.firstChild);else(t=document.createElement("div")).classList.add("calendar-context-menu"),document.body.appendChild(t);for(var n=this._getDate(e),a=this.getEvents(n),i=0;ithis.options.maxDate)return!0;if(0=e&&n.push(this._dataSource[a]);return n}},{key:"isThereFreeSlot",value:function(t){var n=this,e=1t}):!1===e?!a.some(function(e){return!n.options.alwaysHalfDay&&!e.startHalfDay||e.startDate