UNPKG

ngx-bootstrap

Version:
15 lines (13 loc) 96.4 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs/operators"),require("ngx-bootstrap/chronos"),require("rxjs"),require("ngx-bootstrap/mini-ngrx"),require("ngx-bootstrap/positioning"),require("@angular/animations"),require("ngx-bootstrap/component-loader"),require("@angular/forms"),require("@angular/common"),require("ngx-bootstrap/utils")):"function"==typeof define&&define.amd?define("ngx-bootstrap/datepicker",["exports","@angular/core","rxjs/operators","ngx-bootstrap/chronos","rxjs","ngx-bootstrap/mini-ngrx","ngx-bootstrap/positioning","@angular/animations","ngx-bootstrap/component-loader","@angular/forms","@angular/common","ngx-bootstrap/utils"],t):t(((e=e||self)["ngx-bootstrap"]=e["ngx-bootstrap"]||{},e["ngx-bootstrap"].datepicker={}),e.ng.core,e.rxjs.operators,e.chronos,e.rxjs,e.miniNgrx,e.positioning,e.ng.animations,e.componentLoader,e.ng.forms,e.ng.common,e.utils)}(this,(function(e,t,n,a,i,s,r,o,c,d,l,h){"use strict"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */var u=function(e,t){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function p(e,t){function n(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function f(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function y(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var a,i,s=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(a=s.next()).done;)r.push(a.value)}catch(e){i={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return r}function b(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(y(arguments[t]));return e}var m=function(){function e(){this.adaptivePosition=!1,this.useUtc=!1,this.isAnimated=!1,this.returnFocusToInput=!1,this.containerClass="theme-green",this.displayMonths=1,this.showWeekNumbers=!0,this.dateInputFormat="L",this.rangeSeparator=" - ",this.rangeInputFormat="L",this.monthTitle="MMMM",this.yearTitle="YYYY",this.dayLabel="D",this.monthLabel="MMMM",this.yearLabel="YYYY",this.weekNumbers="w"}return e.decorators=[{type:t.Injectable}],e}();var g=function(){function e(){this.customRanges=[]}return Object.defineProperty(e.prototype,"minDate",{set:function(e){this._effects.setMinDate(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxDate",{set:function(e){this._effects.setMaxDate(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"daysDisabled",{set:function(e){this._effects.setDaysDisabled(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"datesDisabled",{set:function(e){this._effects.setDatesDisabled(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"datesEnabled",{set:function(e){this._effects.setDatesEnabled(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabled",{set:function(e){this._effects.setDisabled(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dateCustomClasses",{set:function(e){this._effects.setDateCustomClasses(e)},enumerable:!0,configurable:!0}),e.prototype.setViewMode=function(e){},e.prototype.navigateTo=function(e){},e.prototype.dayHoverHandler=function(e){},e.prototype.weekHoverHandler=function(e){},e.prototype.monthHoverHandler=function(e){},e.prototype.yearHoverHandler=function(e){},e.prototype.daySelectHandler=function(e){},e.prototype.monthSelectHandler=function(e){},e.prototype.yearSelectHandler=function(e){},e.prototype._stopPropagation=function(e){e.stopPropagation()},e}();var v=function(){function e(){}return e.prototype.calculate=function(){return{type:e.CALCULATE}},e.prototype.format=function(){return{type:e.FORMAT}},e.prototype.flag=function(){return{type:e.FLAG}},e.prototype.select=function(t){return{type:e.SELECT,payload:t}},e.prototype.changeViewMode=function(t){return{type:e.CHANGE_VIEWMODE,payload:t}},e.prototype.navigateTo=function(t){return{type:e.NAVIGATE_TO,payload:t}},e.prototype.navigateStep=function(t){return{type:e.NAVIGATE_OFFSET,payload:t}},e.prototype.setOptions=function(t){return{type:e.SET_OPTIONS,payload:t}},e.prototype.selectRange=function(t){return{type:e.SELECT_RANGE,payload:t}},e.prototype.hoverDay=function(t){return{type:e.HOVER,payload:t.isHovered?t.cell.date:null}},e.prototype.minDate=function(t){return{type:e.SET_MIN_DATE,payload:t}},e.prototype.maxDate=function(t){return{type:e.SET_MAX_DATE,payload:t}},e.prototype.daysDisabled=function(t){return{type:e.SET_DAYSDISABLED,payload:t}},e.prototype.datesDisabled=function(t){return{type:e.SET_DATESDISABLED,payload:t}},e.prototype.datesEnabled=function(t){return{type:e.SET_DATESENABLED,payload:t}},e.prototype.isDisabled=function(t){return{type:e.SET_IS_DISABLED,payload:t}},e.prototype.setDateCustomClasses=function(t){return{type:e.SET_DATE_CUSTOM_CLASSES,payload:t}},e.prototype.setLocale=function(t){return{type:e.SET_LOCALE,payload:t}},e.CALCULATE="[datepicker] calculate dates matrix",e.FORMAT="[datepicker] format datepicker values",e.FLAG="[datepicker] set flags",e.SELECT="[datepicker] select date",e.NAVIGATE_OFFSET="[datepicker] shift view date",e.NAVIGATE_TO="[datepicker] change view date",e.SET_OPTIONS="[datepicker] update render options",e.HOVER="[datepicker] hover date",e.CHANGE_VIEWMODE="[datepicker] switch view mode",e.SET_MIN_DATE="[datepicker] set min date",e.SET_MAX_DATE="[datepicker] set max date",e.SET_DAYSDISABLED="[datepicker] set days disabled",e.SET_DATESDISABLED="[datepicker] set dates disabled",e.SET_DATESENABLED="[datepicker] set dates enabled",e.SET_IS_DISABLED="[datepicker] set is disabled",e.SET_DATE_CUSTOM_CLASSES="[datepicker] set date custom classes",e.SET_LOCALE="[datepicker] set datepicker locale",e.SELECT_RANGE="[daterangepicker] select dates range",e.decorators=[{type:t.Injectable}],e}();var D=function(){function e(){this._defaultLocale="en",this._locale=new i.BehaviorSubject(this._defaultLocale),this._localeChange=this._locale.asObservable()}return Object.defineProperty(e.prototype,"locale",{get:function(){return this._locale},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localeChange",{get:function(){return this._localeChange},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentLocale",{get:function(){return this._locale.getValue()},enumerable:!0,configurable:!0}),e.prototype.use=function(e){e!==this.currentLocale&&this._locale.next(e)},e.decorators=[{type:t.Injectable}],e}();var _=function(){function e(e,t){this._actions=e,this._localeService=t,this._subs=[]}return e.prototype.init=function(e){return this._store=e,this},e.prototype.setValue=function(e){this._store.dispatch(this._actions.select(e))},e.prototype.setRangeValue=function(e){this._store.dispatch(this._actions.selectRange(e))},e.prototype.setMinDate=function(e){return this._store.dispatch(this._actions.minDate(e)),this},e.prototype.setMaxDate=function(e){return this._store.dispatch(this._actions.maxDate(e)),this},e.prototype.setDaysDisabled=function(e){return this._store.dispatch(this._actions.daysDisabled(e)),this},e.prototype.setDatesDisabled=function(e){return this._store.dispatch(this._actions.datesDisabled(e)),this},e.prototype.setDatesEnabled=function(e){return this._store.dispatch(this._actions.datesEnabled(e)),this},e.prototype.setDisabled=function(e){return this._store.dispatch(this._actions.isDisabled(e)),this},e.prototype.setDateCustomClasses=function(e){return this._store.dispatch(this._actions.setDateCustomClasses(e)),this},e.prototype.setOptions=function(e){var t=Object.assign({locale:this._localeService.currentLocale},e);return this._store.dispatch(this._actions.setOptions(t)),this},e.prototype.setBindings=function(e){return e.daysCalendar=this._store.select((function(e){return e.flaggedMonths})).pipe(n.filter((function(e){return!!e}))),e.monthsCalendar=this._store.select((function(e){return e.flaggedMonthsCalendar})).pipe(n.filter((function(e){return!!e}))),e.yearsCalendar=this._store.select((function(e){return e.yearsCalendarFlagged})).pipe(n.filter((function(e){return!!e}))),e.viewMode=this._store.select((function(e){return e.view.mode})),e.options=this._store.select((function(e){return e.showWeekNumbers})).pipe(n.map((function(e){return{showWeekNumbers:e}}))),this},e.prototype.setEventHandlers=function(e){var t=this;return e.setViewMode=function(e){t._store.dispatch(t._actions.changeViewMode(e))},e.navigateTo=function(e){t._store.dispatch(t._actions.navigateStep(e.step))},e.dayHoverHandler=function(e){var n=e.cell;n.isOtherMonth||n.isDisabled||(t._store.dispatch(t._actions.hoverDay(e)),n.isHovered=e.isHovered)},e.monthHoverHandler=function(e){e.cell.isHovered=e.isHovered},e.yearHoverHandler=function(e){e.cell.isHovered=e.isHovered},e.monthSelectHandler=function(e){e.isDisabled||t._store.dispatch(t._actions.navigateTo({unit:{month:a.getMonth(e.date),year:a.getFullYear(e.date)},viewMode:"day"}))},e.yearSelectHandler=function(e){e.isDisabled||t._store.dispatch(t._actions.navigateTo({unit:{year:a.getFullYear(e.date)},viewMode:"month"}))},this},e.prototype.registerDatepickerSideEffects=function(){var e=this;return this._subs.push(this._store.select((function(e){return e.view})).subscribe((function(t){e._store.dispatch(e._actions.calculate())}))),this._subs.push(this._store.select((function(e){return e.monthsModel})).pipe(n.filter((function(e){return!!e}))).subscribe((function(t){return e._store.dispatch(e._actions.format())}))),this._subs.push(this._store.select((function(e){return e.formattedMonths})).pipe(n.filter((function(e){return!!e}))).subscribe((function(t){return e._store.dispatch(e._actions.flag())}))),this._subs.push(this._store.select((function(e){return e.selectedDate})).pipe(n.filter((function(e){return!!e}))).subscribe((function(t){return e._store.dispatch(e._actions.flag())}))),this._subs.push(this._store.select((function(e){return e.selectedRange})).pipe(n.filter((function(e){return!!e}))).subscribe((function(t){return e._store.dispatch(e._actions.flag())}))),this._subs.push(this._store.select((function(e){return e.monthsCalendar})).subscribe((function(){return e._store.dispatch(e._actions.flag())}))),this._subs.push(this._store.select((function(e){return e.yearsCalendarModel})).pipe(n.filter((function(e){return!!e}))).subscribe((function(){return e._store.dispatch(e._actions.flag())}))),this._subs.push(this._store.select((function(e){return e.hoveredDate})).pipe(n.filter((function(e){return!!e}))).subscribe((function(t){return e._store.dispatch(e._actions.flag())}))),this._subs.push(this._store.select((function(e){return e.dateCustomClasses})).pipe(n.filter((function(e){return!!e}))).subscribe((function(t){return e._store.dispatch(e._actions.flag())}))),this._subs.push(this._localeService.localeChange.subscribe((function(t){return e._store.dispatch(e._actions.setLocale(t))}))),this},e.prototype.destroy=function(){var e,t;try{for(var n=f(this._subs),a=n.next();!a.done;a=n.next()){a.value.unsubscribe()}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:v},{type:D}]},e}();var k={date:new Date,mode:"day"},w=Object.assign(new m,{locale:"en",view:k,selectedRange:[],monthViewOptions:{width:7,height:6}});function C(e,t,n){var i=t&&a.isBefore(a.endOf(e,"month"),t,"day"),s=n&&a.isAfter(a.startOf(e,"month"),n,"day");return i||s}function M(e,t,n){var i=t&&a.isBefore(a.endOf(e,"year"),t,"day"),s=n&&a.isAfter(a.startOf(e,"year"),n,"day");return i||s}function S(e,t){void 0===t&&(t=0);var n=e&&e.yearsCalendarModel&&e.yearsCalendarModel[t];return n&&n.years&&n.years[0]&&n.years[0][0]&&n.years[0][0].date}function E(e,t){for(var n=e.initialDate,i=new Array(e.height),s=0;s<e.height;s++){i[s]=new Array(e.width);for(var r=0;r<e.width;r++)i[s][r]=t(n),n=a.shiftDate(n,e.shift)}return i}function x(e,t){var n=a.getFirstDayOfMonth(e),i=function(e,t){if(a.isFirstDayOfWeek(e,t.firstDayOfWeek))return e;var n=function(e,t){if(0===t)return e;var n=e-t%7;return n<0?n+7:n}(a.getDay(e),t.firstDayOfWeek);return a.shiftDate(e,{day:-n})}(n,t);return{daysMatrix:E({width:t.width,height:t.height,initialDate:i,shift:{day:1}},(function(e){return e})),month:n}}function O(e){var t=a.getLocale(e),n=t.weekdaysShort(),i=t.firstDayOfWeek();return b(n.slice(i),n.slice(0,i))}function I(e,t){return e.weeks.forEach((function(n){n.days.forEach((function(i,s){var r,o,c=!a.isSameMonth(i.date,e.month),d=!c&&a.isSameDay(i.date,t.hoveredDate),l=!c&&t.selectedRange&&a.isSameDay(i.date,t.selectedRange[0]),h=!c&&t.selectedRange&&a.isSameDay(i.date,t.selectedRange[1]),u=!c&&a.isSameDay(i.date,t.selectedDate)||l||h,p=!c&&t.selectedRange&&function(e,t,n){if(!e||!t[0])return!1;if(t[1])return e>t[0]&&e<=t[1];if(n)return e>t[0]&&e<=n;return!1}(i.date,t.selectedRange,t.hoveredDate),f=t.isDisabled||a.isBefore(i.date,t.minDate,"day")||a.isAfter(i.date,t.maxDate,"day")||a.isDisabledDay(i.date,t.daysDisabled)||(r=i.date,!!((o=t.datesDisabled)&&a.isArray(o)&&o.length)&&o.some((function(e){return a.isSame(r,e,"date")})))||function(e,t){return!!(t&&a.isArray(t)&&t.length)&&!t.some((function(t){return a.isSame(e,t,"date")}))}(i.date,t.datesEnabled),y=new Date,b=!c&&a.isSameDay(i.date,y),m=t.dateCustomClasses&&t.dateCustomClasses.map((function(e){return a.isSameDay(i.date,e.date)?e.classes:[]})).reduce((function(e,t){return e.concat(t)}),[]).join(" ")||"",g=Object.assign({},i,{isOtherMonth:c,isHovered:d,isSelected:u,isSelectionStart:l,isSelectionEnd:h,isInRange:p,isDisabled:f,isToday:b,customClasses:m});i.isOtherMonth===g.isOtherMonth&&i.isHovered===g.isHovered&&i.isSelected===g.isSelected&&i.isSelectionStart===g.isSelectionStart&&i.isSelectionEnd===g.isSelectionEnd&&i.isDisabled===g.isDisabled&&i.isInRange===g.isInRange&&i.customClasses===g.customClasses||(n.days[s]=g)}))})),e.hideLeftArrow=t.isDisabled||t.monthIndex>0&&t.monthIndex!==t.displayMonths,e.hideRightArrow=t.isDisabled||t.monthIndex<t.displayMonths&&t.monthIndex+1!==t.displayMonths,e.disableLeftArrow=C(a.shiftDate(e.month,{month:-1}),t.minDate,t.maxDate),e.disableRightArrow=C(a.shiftDate(e.month,{month:1}),t.minDate,t.maxDate),e}function R(e,t){return!t||e>=t}var A={month:1};function H(e,t){return{months:E({width:3,height:4,initialDate:a.startOf(e,"year"),shift:A},(function(e){return{date:e,label:a.formatDate(e,t.monthLabel,t.locale)}})),monthTitle:"",yearTitle:a.formatDate(e,t.yearTitle,t.locale)}}var V=-1*(Math.floor(8)-1),T={year:1};function P(e,t,n){var i=E({width:4,height:4,initialDate:function(e,t){if(t&&e.getFullYear()>=t.getFullYear()&&e.getFullYear()<t.getFullYear()+16)return t;return a.shiftDate(e,{year:V})}(e,n),shift:T},(function(e){return{date:e,label:a.formatDate(e,t.yearLabel,t.locale)}}));return{years:i,monthTitle:"",yearTitle:function(e,t){var n=a.formatDate(e[0][0].date,t.yearTitle,t.locale),i=a.formatDate(e[3][3].date,t.yearTitle,t.locale);return n+" - "+i}(i,t)}}function F(e,t){switch(void 0===e&&(e=w),t.type){case v.CALCULATE:return function(e){var t=e.displayOneMonthRange&&N(e.view.date,e.minDate,e.maxDate)?1:e.displayMonths,n=e.view.date;if("day"===e.view.mode){e.showPreviousMonth&&0===e.selectedRange.length&&(n=a.shiftDate(n,{month:-1})),e.monthViewOptions.firstDayOfWeek=a.getLocale(e.locale).firstDayOfWeek();for(var i=new Array(t),s=0;s<t;s++)i[s]=x(n,e.monthViewOptions),n=a.shiftDate(n,{month:1});return Object.assign({},e,{monthsModel:i})}if("month"===e.view.mode){for(var r=new Array(t),o=0;o<t;o++)r[o]=H(n,j(e)),n=a.shiftDate(n,{year:1});return Object.assign({},e,{monthsCalendar:r})}if("year"===e.view.mode){var c=new Array(t);for(o=0;o<t;o++)c[o]=P(n,j(e),"year"===e.minMode?S(e,o):void 0),n=a.shiftDate(n,{year:16});return Object.assign({},e,{yearsCalendarModel:c})}return e}(e);case v.FORMAT:return function(e,t){if("day"===e.view.mode){var n=e.monthsModel.map((function(t,n){return function(e,t,n){return{month:e.month,monthTitle:a.formatDate(e.month,t.monthTitle,t.locale),yearTitle:a.formatDate(e.month,t.yearTitle,t.locale),weekNumbers:(i=e.daysMatrix,s=t.weekNumbers,r=t.locale,i.map((function(e){return e[0]?a.formatDate(e[0],s,r):""}))),weekdays:O(t.locale),weeks:e.daysMatrix.map((function(e,i){return{days:e.map((function(e,s){return{date:e,label:a.formatDate(e,t.dayLabel,t.locale),monthIndex:n,weekIndex:i,dayIndex:s}}))}}))};var i,s,r}(t,j(e),n)}));return Object.assign({},e,{formattedMonths:n})}var i=e.displayMonths,s=e.view.date;if("month"===e.view.mode){for(var r=new Array(i),o=0;o<i;o++)r[o]=H(s,j(e)),s=a.shiftDate(s,{year:1});return Object.assign({},e,{monthsCalendar:r})}if("year"===e.view.mode){var c=new Array(i);for(o=0;o<i;o++)c[o]=P(s,j(e)),s=a.shiftDate(s,{year:16});return Object.assign({},e,{yearsCalendarModel:c})}return e}(e);case v.FLAG:return function(e,t){var n=N(e.view.date,e.minDate,e.maxDate)?1:e.displayMonths;if("day"===e.view.mode){var i=e.formattedMonths.map((function(t,a){return I(t,{isDisabled:e.isDisabled,minDate:e.minDate,maxDate:e.maxDate,daysDisabled:e.daysDisabled,datesDisabled:e.datesDisabled,datesEnabled:e.datesEnabled,hoveredDate:e.hoveredDate,selectedDate:e.selectedDate,selectedRange:e.selectedRange,displayMonths:n,dateCustomClasses:e.dateCustomClasses,monthIndex:a})}));return Object.assign({},e,{flaggedMonths:i})}if("month"===e.view.mode){var s=e.monthsCalendar.map((function(t,i){return s=t,r={isDisabled:e.isDisabled,minDate:e.minDate,maxDate:e.maxDate,hoveredMonth:e.hoveredMonth,selectedDate:e.selectedDate,displayMonths:n,monthIndex:i},s.months.forEach((function(e,t){e.forEach((function(e,n){var i=a.isSameMonth(e.date,r.hoveredMonth),o=r.isDisabled||C(e.date,r.minDate,r.maxDate),c=a.isSameMonth(e.date,r.selectedDate),d=Object.assign(e,{isHovered:i,isDisabled:o,isSelected:c});e.isHovered===d.isHovered&&e.isDisabled===d.isDisabled&&e.isSelected===d.isSelected||(s.months[t][n]=d)}))})),s.hideLeftArrow=r.monthIndex>0&&r.monthIndex!==r.displayMonths,s.hideRightArrow=r.monthIndex<r.displayMonths&&r.monthIndex+1!==r.displayMonths,s.disableLeftArrow=M(a.shiftDate(s.months[0][0].date,{year:-1}),r.minDate,r.maxDate),s.disableRightArrow=M(a.shiftDate(s.months[0][0].date,{year:1}),r.minDate,r.maxDate),s;var s,r}));return Object.assign({},e,{flaggedMonthsCalendar:s})}if("year"===e.view.mode){var r=e.yearsCalendarModel.map((function(t,i){return function(e,t){e.years.forEach((function(n,i){n.forEach((function(n,s){var r=a.isSameYear(n.date,t.hoveredYear),o=t.isDisabled||M(n.date,t.minDate,t.maxDate),c=a.isSameYear(n.date,t.selectedDate),d=Object.assign(n,{isHovered:r,isDisabled:o,isSelected:c});n.isHovered===d.isHovered&&n.isDisabled===d.isDisabled&&n.isSelected===d.isSelected||(e.years[i][s]=d)}))})),e.hideLeftArrow=t.yearIndex>0&&t.yearIndex!==t.displayMonths,e.hideRightArrow=t.yearIndex<t.displayMonths&&t.yearIndex+1!==t.displayMonths,e.disableLeftArrow=M(a.shiftDate(e.years[0][0].date,{year:-1}),t.minDate,t.maxDate);var n=e.years.length-1,i=e.years[n].length-1;return e.disableRightArrow=M(a.shiftDate(e.years[n][i].date,{year:1}),t.minDate,t.maxDate),e}(t,{isDisabled:e.isDisabled,minDate:e.minDate,maxDate:e.maxDate,hoveredYear:e.hoveredYear,selectedDate:e.selectedDate,displayMonths:n,yearIndex:i})}));return Object.assign({},e,{yearsCalendarFlagged:r})}return e}(e);case v.NAVIGATE_OFFSET:return function(e,t){var n={view:{mode:e.view.mode,date:L(e,t)}};return Object.assign({},e,n)}(e,t);case v.NAVIGATE_TO:var n=t.payload,i=a.setFullDate(e.view.date,n.unit),s=void 0,r=void 0;return s=R(n.viewMode,e.minMode)?{view:{date:i,mode:r=n.viewMode}}:{selectedDate:i,view:{date:i,mode:r=e.view.mode}},Object.assign({},e,s);case v.CHANGE_VIEWMODE:if(!R(t.payload,e.minMode))return e;s={view:{date:i=e.view.date,mode:r=t.payload}};return Object.assign({},e,s);case v.HOVER:return Object.assign({},e,{hoveredDate:t.payload});case v.SELECT:s={selectedDate:t.payload,view:e.view},r=e.view.mode,i=$(t.payload||e.view.date,e.minDate,e.maxDate);return s.view={mode:r,date:i},Object.assign({},e,s);case v.SET_OPTIONS:r=(s=t.payload).minMode?s.minMode:e.view.mode,i=$(a.isDateValid(s.value)&&s.value||a.isArray(s.value)&&a.isDateValid(s.value[0])&&s.value[0]||e.view.date,s.minDate,s.maxDate);return s.view={mode:r,date:i},s.value&&(a.isArray(s.value)&&(s.selectedRange=s.value),s.value instanceof Date&&(s.selectedDate=s.value)),Object.assign({},e,s);case v.SELECT_RANGE:s={selectedRange:t.payload,view:e.view},r=e.view.mode,i=$(t.payload&&t.payload[0]||e.view.date,e.minDate,e.maxDate);return s.view={mode:r,date:i},Object.assign({},e,s);case v.SET_MIN_DATE:return Object.assign({},e,{minDate:t.payload});case v.SET_MAX_DATE:return Object.assign({},e,{maxDate:t.payload});case v.SET_IS_DISABLED:return Object.assign({},e,{isDisabled:t.payload});case v.SET_DATE_CUSTOM_CLASSES:return Object.assign({},e,{dateCustomClasses:t.payload});default:return e}}function L(e,t){if("year"===e.view.mode&&"year"===e.minMode){var n=S(e,0),i=a.shiftDate(n,{year:-V});return a.shiftDate(i,t.payload)}return a.shiftDate(a.startOf(e.view.date,"month"),t.payload)}function j(e){return{locale:e.locale,monthTitle:e.monthTitle,yearTitle:e.yearTitle,dayLabel:e.dayLabel,monthLabel:e.monthLabel,yearLabel:e.yearLabel,weekNumbers:e.weekNumbers}}function $(e,t,n){var i=Array.isArray(e)?e[0]:e;return t&&a.isAfter(t,i,"day")?t:n&&a.isBefore(n,i,"day")?n:i}function N(e,t,n){return!(!n||!a.isSame(n,e,"day"))||!(!t||!n||t.getMonth()!==n.getMonth())}var Y=function(e){function n(){var t=new i.BehaviorSubject({type:"[datepicker] dispatcher init"}),n=new s.MiniState(w,t,F);return e.call(this,t,F,n)||this}return p(n,e),n.decorators=[{type:t.Injectable}],n.ctorParameters=function(){return[]},n}(s.MiniStore),B=o.trigger("datepickerAnimation",[o.state("animated-down",o.style({height:"*",overflow:"hidden"})),o.transition("* => animated-down",[o.style({height:0,overflow:"hidden"}),o.animate("220ms cubic-bezier(0, 0, 0.2, 1)")]),o.state("animated-up",o.style({height:"*",overflow:"hidden"})),o.transition("* => animated-up",[o.style({height:"*",overflow:"hidden"}),o.animate("220ms cubic-bezier(0, 0, 0.2, 1)")]),o.transition("* => unanimated",o.animate("0s"))]),z=function(e){function a(n,a,i,s,r,o,c){var d=e.call(this)||this;return d._config=a,d._store=i,d._element=s,d._actions=r,d._positionService=c,d.valueChange=new t.EventEmitter,d.animationState="void",d._subs=[],d._effects=o,n.setStyle(s.nativeElement,"display","block"),n.setStyle(s.nativeElement,"position","absolute"),d}return p(a,e),Object.defineProperty(a.prototype,"value",{set:function(e){this._effects.setValue(e)},enumerable:!0,configurable:!0}),a.prototype.ngOnInit=function(){var e=this;this._positionService.setOptions({modifiers:{flip:{enabled:this._config.adaptivePosition}},allowedPositions:["top","bottom"]}),this._positionService.event$.pipe(n.take(1)).subscribe((function(){e._positionService.disable(),e._config.isAnimated?e.animationState=e.isTopPosition?"animated-up":"animated-down":e.animationState="unanimated"})),this.isOtherMonthsActive=this._config.selectFromOtherMonth,this.containerClass=this._config.containerClass,this._effects.init(this._store).setOptions(this._config).setBindings(this).setEventHandlers(this).registerDatepickerSideEffects(),this._subs.push(this._store.select((function(e){return e.selectedDate})).subscribe((function(t){return e.valueChange.emit(t)})))},Object.defineProperty(a.prototype,"isTopPosition",{get:function(){return this._element.nativeElement.classList.contains("top")},enumerable:!0,configurable:!0}),a.prototype.positionServiceEnable=function(){this._positionService.enable()},a.prototype.daySelectHandler=function(e){e&&((this.isOtherMonthsActive?e.isDisabled:e.isOtherMonth||e.isDisabled)||this._store.dispatch(this._actions.select(e.date)))},a.prototype.ngOnDestroy=function(){var e,t;try{for(var n=f(this._subs),a=n.next();!a.done;a=n.next()){a.value.unsubscribe()}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this._effects.destroy()},a.decorators=[{type:t.Component,args:[{selector:"bs-datepicker-container",providers:[Y,_],template:'\x3c!-- days calendar view mode --\x3e\n<div class="bs-datepicker" [ngClass]="containerClass" *ngIf="viewMode | async">\n <div class="bs-datepicker-container"\n [@datepickerAnimation]="animationState"\n (@datepickerAnimation.done)="positionServiceEnable()">\n \x3c!--calendars--\x3e\n <div class="bs-calendar-container" [ngSwitch]="viewMode | async" role="application">\n \x3c!--days calendar--\x3e\n <div *ngSwitchCase="\'day\'" class="bs-media-container">\n <bs-days-calendar-view\n *ngFor="let calendar of daysCalendar | async"\n [class.bs-datepicker-multiple]="(daysCalendar | async)?.length > 1"\n [calendar]="calendar"\n [options]="options | async"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="dayHoverHandler($event)"\n (onHoverWeek)="weekHoverHandler($event)"\n (onSelect)="daySelectHandler($event)">\n </bs-days-calendar-view>\n </div>\n\n \x3c!--months calendar--\x3e\n <div *ngSwitchCase="\'month\'" class="bs-media-container">\n <bs-month-calendar-view\n *ngFor="let calendar of monthsCalendar | async"\n [class.bs-datepicker-multiple]="(daysCalendar | async)?.length > 1"\n [calendar]="calendar"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="monthHoverHandler($event)"\n (onSelect)="monthSelectHandler($event)">\n </bs-month-calendar-view>\n </div>\n\n \x3c!--years calendar--\x3e\n <div *ngSwitchCase="\'year\'" class="bs-media-container">\n <bs-years-calendar-view\n *ngFor="let calendar of yearsCalendar | async"\n [class.bs-datepicker-multiple]="(daysCalendar | async)?.length > 1"\n [calendar]="calendar"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="yearHoverHandler($event)"\n (onSelect)="yearSelectHandler($event)">\n </bs-years-calendar-view>\n </div>\n </div>\n\n \x3c!--applycancel buttons--\x3e\n <div class="bs-datepicker-buttons" *ngIf="false">\n <button class="btn btn-success" type="button">Apply</button>\n <button class="btn btn-default" type="button">Cancel</button>\n </div>\n </div>\n\n \x3c!--custom dates or date ranges picker--\x3e\n <div class="bs-datepicker-custom-range" *ngIf="customRanges?.length > 0">\n <bs-custom-date-view \n [selectedRange]="chosenRange" \n [ranges]="customRanges"\n (onSelect)="setRangeOnCalendar($event)">\n </bs-custom-date-view>\n </div>\n</div>\n',host:{class:"bottom","(click)":"_stopPropagation($event)",role:"dialog","aria-label":"calendar"},animations:[B]}]}],a.ctorParameters=function(){return[{type:t.Renderer2},{type:m},{type:Y},{type:t.ElementRef},{type:v},{type:_},{type:r.PositioningService}]},a}(g);var W=function(){function e(e,n,a,s,r){this._config=e,this._elementRef=n,this._renderer=a,this.placement="bottom",this.triggers="click",this.outsideClick=!0,this.container="body",this.outsideEsc=!0,this.bsValueChange=new t.EventEmitter,this._subs=[],Object.assign(this,this._config),this._datepicker=r.createLoader(n,s,a),this.onShown=this._datepicker.onShown,this.onHidden=this._datepicker.onHidden,this.isOpen$=new i.BehaviorSubject(this.isOpen)}return Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._datepicker.isShown},set:function(e){this.isOpen$.next(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bsValue",{set:function(e){this._bsValue&&e&&this._bsValue.getTime()===e.getTime()||(this._bsValue=e,this.bsValueChange.emit(e))},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.isDestroy$=new i.Subject,this._datepicker.listen({outsideClick:this.outsideClick,outsideEsc:this.outsideEsc,triggers:this.triggers,show:function(){return e.show()}}),this.setConfig()},e.prototype.ngOnChanges=function(e){this._datepickerRef&&this._datepickerRef.instance&&(e.minDate&&(this._datepickerRef.instance.minDate=this.minDate),e.maxDate&&(this._datepickerRef.instance.maxDate=this.maxDate),e.daysDisabled&&(this._datepickerRef.instance.daysDisabled=this.daysDisabled),e.datesDisabled&&(this._datepickerRef.instance.datesDisabled=this.datesDisabled),e.datesEnabled&&(this._datepickerRef.instance.datesEnabled=this.datesEnabled),e.isDisabled&&(this._datepickerRef.instance.isDisabled=this.isDisabled),e.dateCustomClasses&&(this._datepickerRef.instance.dateCustomClasses=this.dateCustomClasses))},e.prototype.ngAfterViewInit=function(){var e=this;this.isOpen$.pipe(n.filter((function(t){return t!==e.isOpen})),n.takeUntil(this.isDestroy$)).subscribe((function(){return e.toggle()}))},e.prototype.show=function(){var e=this;this._datepicker.isShown||(this.setConfig(),this._datepickerRef=this._datepicker.provide({provide:m,useValue:this._config}).attach(z).to(this.container).position({attachment:this.placement}).show({placement:this.placement}),this._subs.push(this.bsValueChange.subscribe((function(t){e._datepickerRef.instance.value=t}))),this._subs.push(this._datepickerRef.instance.valueChange.subscribe((function(t){e.bsValue=t,e.hide()}))))},e.prototype.hide=function(){var e,t;this.isOpen&&this._datepicker.hide();try{for(var n=f(this._subs),a=n.next();!a.done;a=n.next()){a.value.unsubscribe()}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this._config.returnFocusToInput&&this._renderer.selectRootElement(this._elementRef.nativeElement).focus()},e.prototype.toggle=function(){if(this.isOpen)return this.hide();this.show()},e.prototype.setConfig=function(){this._config=Object.assign({},this._config,this.bsConfig,{value:this._bsValue,isDisabled:this.isDisabled,minDate:this.minDate||this.bsConfig&&this.bsConfig.minDate,maxDate:this.maxDate||this.bsConfig&&this.bsConfig.maxDate,daysDisabled:this.daysDisabled||this.bsConfig&&this.bsConfig.daysDisabled,dateCustomClasses:this.dateCustomClasses||this.bsConfig&&this.bsConfig.dateCustomClasses,datesDisabled:this.datesDisabled||this.bsConfig&&this.bsConfig.datesDisabled,datesEnabled:this.datesEnabled||this.bsConfig&&this.bsConfig.datesEnabled,minMode:this.minMode||this.bsConfig&&this.bsConfig.minMode})},e.prototype.ngOnDestroy=function(){this._datepicker.dispose(),this.isOpen$.next(!1),this.isDestroy$&&(this.isDestroy$.next(),this.isDestroy$.complete())},e.decorators=[{type:t.Directive,args:[{selector:"[bsDatepicker]",exportAs:"bsDatepicker"}]}],e.ctorParameters=function(){return[{type:m},{type:t.ElementRef},{type:t.Renderer2},{type:t.ViewContainerRef},{type:c.ComponentLoaderFactory}]},e.propDecorators={placement:[{type:t.Input}],triggers:[{type:t.Input}],outsideClick:[{type:t.Input}],container:[{type:t.Input}],outsideEsc:[{type:t.Input}],isOpen:[{type:t.Input}],onShown:[{type:t.Output}],onHidden:[{type:t.Output}],bsValue:[{type:t.Input}],bsConfig:[{type:t.Input}],isDisabled:[{type:t.Input}],minDate:[{type:t.Input}],maxDate:[{type:t.Input}],minMode:[{type:t.Input}],daysDisabled:[{type:t.Input}],datesDisabled:[{type:t.Input}],datesEnabled:[{type:t.Input}],dateCustomClasses:[{type:t.Input}],bsValueChange:[{type:t.Output}]},e}();var G=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return p(n,e),n.decorators=[{type:t.Injectable}],n}(m),U=function(e){function n(t,n,a,i,s,r,o){var c=e.call(this,t,n,a,i,s,r,o)||this;return t.setStyle(i.nativeElement,"display","inline-block"),t.setStyle(i.nativeElement,"position","static"),c}return p(n,e),n.decorators=[{type:t.Component,args:[{selector:"bs-datepicker-inline-container",providers:[Y,_],template:'\x3c!-- days calendar view mode --\x3e\n<div class="bs-datepicker" [ngClass]="containerClass" *ngIf="viewMode | async">\n <div class="bs-datepicker-container"\n [@datepickerAnimation]="animationState"\n (@datepickerAnimation.done)="positionServiceEnable()">\n \x3c!--calendars--\x3e\n <div class="bs-calendar-container" [ngSwitch]="viewMode | async" role="application">\n \x3c!--days calendar--\x3e\n <div *ngSwitchCase="\'day\'" class="bs-media-container">\n <bs-days-calendar-view\n *ngFor="let calendar of daysCalendar | async"\n [class.bs-datepicker-multiple]="(daysCalendar | async)?.length > 1"\n [calendar]="calendar"\n [options]="options | async"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="dayHoverHandler($event)"\n (onHoverWeek)="weekHoverHandler($event)"\n (onSelect)="daySelectHandler($event)">\n </bs-days-calendar-view>\n </div>\n\n \x3c!--months calendar--\x3e\n <div *ngSwitchCase="\'month\'" class="bs-media-container">\n <bs-month-calendar-view\n *ngFor="let calendar of monthsCalendar | async"\n [class.bs-datepicker-multiple]="(daysCalendar | async)?.length > 1"\n [calendar]="calendar"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="monthHoverHandler($event)"\n (onSelect)="monthSelectHandler($event)">\n </bs-month-calendar-view>\n </div>\n\n \x3c!--years calendar--\x3e\n <div *ngSwitchCase="\'year\'" class="bs-media-container">\n <bs-years-calendar-view\n *ngFor="let calendar of yearsCalendar | async"\n [class.bs-datepicker-multiple]="(daysCalendar | async)?.length > 1"\n [calendar]="calendar"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="yearHoverHandler($event)"\n (onSelect)="yearSelectHandler($event)">\n </bs-years-calendar-view>\n </div>\n </div>\n\n \x3c!--applycancel buttons--\x3e\n <div class="bs-datepicker-buttons" *ngIf="false">\n <button class="btn btn-success" type="button">Apply</button>\n <button class="btn btn-default" type="button">Cancel</button>\n </div>\n </div>\n\n \x3c!--custom dates or date ranges picker--\x3e\n <div class="bs-datepicker-custom-range" *ngIf="customRanges?.length > 0">\n <bs-custom-date-view \n [selectedRange]="chosenRange" \n [ranges]="customRanges"\n (onSelect)="setRangeOnCalendar($event)">\n </bs-custom-date-view>\n </div>\n</div>\n',host:{"(click)":"_stopPropagation($event)"},animations:[B]}]}],n.ctorParameters=function(){return[{type:t.Renderer2},{type:m},{type:Y},{type:t.ElementRef},{type:v},{type:_},{type:r.PositioningService}]},n}(z),q=function(){function e(e,n,a,i,s){this._config=e,this._elementRef=n,this.bsValueChange=new t.EventEmitter,this._subs=[],Object.assign(this,this._config),this._datepicker=s.createLoader(n,i,a)}return Object.defineProperty(e.prototype,"bsValue",{set:function(e){this._bsValue!==e&&(this._bsValue=e,this.bsValueChange.emit(e))},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.setConfig(),this._subs.push(this.bsValueChange.subscribe((function(t){e._datepickerRef.instance.value=t}))),this._subs.push(this._datepickerRef.instance.valueChange.subscribe((function(t){e.bsValue=t})))},e.prototype.ngOnChanges=function(e){this._datepickerRef&&this._datepickerRef.instance&&(e.minDate&&(this._datepickerRef.instance.minDate=this.minDate,this.setConfig()),e.maxDate&&(this._datepickerRef.instance.maxDate=this.maxDate,this.setConfig()),e.datesDisabled&&(this._datepickerRef.instance.datesDisabled=this.datesDisabled,this.setConfig()),e.datesEnabled&&(this._datepickerRef.instance.datesEnabled=this.datesEnabled,this._datepickerRef.instance.value=this._bsValue),e.isDisabled&&(this._datepickerRef.instance.isDisabled=this.isDisabled,this.setConfig()),e.dateCustomClasses&&(this._datepickerRef.instance.dateCustomClasses=this.dateCustomClasses,this.setConfig()))},e.prototype.setConfig=function(){this._datepicker&&this._datepicker.hide(),this._config=Object.assign({},this._config,this.bsConfig,{value:this._bsValue,isDisabled:this.isDisabled,minDate:this.minDate||this.bsConfig&&this.bsConfig.minDate,maxDate:this.maxDate||this.bsConfig&&this.bsConfig.maxDate,dateCustomClasses:this.dateCustomClasses||this.bsConfig&&this.bsConfig.dateCustomClasses,datesDisabled:this.datesDisabled||this.bsConfig&&this.bsConfig.datesDisabled,datesEnabled:this.datesEnabled||this.bsConfig&&this.bsConfig.datesEnabled}),this._datepickerRef=this._datepicker.provide({provide:m,useValue:this._config}).attach(U).to(this._elementRef).show()},e.prototype.ngOnDestroy=function(){this._datepicker.dispose()},e.decorators=[{type:t.Directive,args:[{selector:"bs-datepicker-inline",exportAs:"bsDatepickerInline"}]}],e.ctorParameters=function(){return[{type:G},{type:t.ElementRef},{type:t.Renderer2},{type:t.ViewContainerRef},{type:c.ComponentLoaderFactory}]},e.propDecorators={bsValue:[{type:t.Input}],bsConfig:[{type:t.Input}],isDisabled:[{type:t.Input}],minDate:[{type:t.Input}],maxDate:[{type:t.Input}],dateCustomClasses:[{type:t.Input}],datesEnabled:[{type:t.Input}],datesDisabled:[{type:t.Input}],bsValueChange:[{type:t.Output}]},e}();var Z=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.displayMonths=2,t.isAnimated=!1,t}return p(n,e),n.decorators=[{type:t.Injectable}],n}(m);var K=function(e){function a(n,a,i,s,r,o,c){var d=e.call(this)||this;return d._config=a,d._store=i,d._element=s,d._actions=r,d._positionService=c,d.valueChange=new t.EventEmitter,d.animationState="void",d._rangeStack=[],d.chosenRange=[],d._subs=[],d._effects=o,d.customRanges=d._config.ranges,n.setStyle(s.nativeElement,"display","block"),n.setStyle(s.nativeElement,"position","absolute"),d}return p(a,e),Object.defineProperty(a.prototype,"value",{set:function(e){this._effects.setRangeValue(e)},enumerable:!0,configurable:!0}),a.prototype.ngOnInit=function(){var e=this;this._positionService.setOptions({modifiers:{flip:{enabled:this._config.adaptivePosition}},allowedPositions:["top","bottom"]}),this._positionService.event$.pipe(n.take(1)).subscribe((function(){e._positionService.disable(),e._config.isAnimated?e.animationState=e.isTopPosition?"animated-up":"animated-down":e.animationState="unanimated"})),this.containerClass=this._config.containerClass,this.isOtherMonthsActive=this._config.selectFromOtherMonth,this._effects.init(this._store).setOptions(this._config).setBindings(this).setEventHandlers(this).registerDatepickerSideEffects(),this._subs.push(this._store.select((function(e){return e.selectedRange})).subscribe((function(t){e.valueChange.emit(t),e.chosenRange=t})))},Object.defineProperty(a.prototype,"isTopPosition",{get:function(){return this._element.nativeElement.classList.contains("top")},enumerable:!0,configurable:!0}),a.prototype.positionServiceEnable=function(){this._positionService.enable()},a.prototype.daySelectHandler=function(e){e&&((this.isOtherMonthsActive?e.isDisabled:e.isOtherMonth||e.isDisabled)||(1===this._rangeStack.length&&(this._rangeStack=e.date>=this._rangeStack[0]?[this._rangeStack[0],e.date]:[e.date]),0===this._rangeStack.length&&(this._rangeStack=[e.date]),this._store.dispatch(this._actions.selectRange(this._rangeStack)),2===this._rangeStack.length&&(this._rangeStack=[])))},a.prototype.ngOnDestroy=function(){var e,t;try{for(var n=f(this._subs),a=n.next();!a.done;a=n.next()){a.value.unsubscribe()}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this._effects.destroy()},a.prototype.setRangeOnCalendar=function(e){this._rangeStack=null===e?[]:e.value instanceof Date?[e.value]:e.value,this._store.dispatch(this._actions.selectRange(this._rangeStack))},a.decorators=[{type:t.Component,args:[{selector:"bs-daterangepicker-container",providers:[Y,_],template:'\x3c!-- days calendar view mode --\x3e\n<div class="bs-datepicker" [ngClass]="containerClass" *ngIf="viewMode | async">\n <div class="bs-datepicker-container"\n [@datepickerAnimation]="animationState"\n (@datepickerAnimation.done)="positionServiceEnable()">\n \x3c!--calendars--\x3e\n <div class="bs-calendar-container" [ngSwitch]="viewMode | async" role="application">\n \x3c!--days calendar--\x3e\n <div *ngSwitchCase="\'day\'" class="bs-media-container">\n <bs-days-calendar-view\n *ngFor="let calendar of daysCalendar | async"\n [class.bs-datepicker-multiple]="(daysCalendar | async)?.length > 1"\n [calendar]="calendar"\n [options]="options | async"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="dayHoverHandler($event)"\n (onHoverWeek)="weekHoverHandler($event)"\n (onSelect)="daySelectHandler($event)">\n </bs-days-calendar-view>\n </div>\n\n \x3c!--months calendar--\x3e\n <div *ngSwitchCase="\'month\'" class="bs-media-container">\n <bs-month-calendar-view\n *ngFor="let calendar of monthsCalendar | async"\n [class.bs-datepicker-multiple]="(daysCalendar | async)?.length > 1"\n [calendar]="calendar"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="monthHoverHandler($event)"\n (onSelect)="monthSelectHandler($event)">\n </bs-month-calendar-view>\n </div>\n\n \x3c!--years calendar--\x3e\n <div *ngSwitchCase="\'year\'" class="bs-media-container">\n <bs-years-calendar-view\n *ngFor="let calendar of yearsCalendar | async"\n [class.bs-datepicker-multiple]="(daysCalendar | async)?.length > 1"\n [calendar]="calendar"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="yearHoverHandler($event)"\n (onSelect)="yearSelectHandler($event)">\n </bs-years-calendar-view>\n </div>\n </div>\n\n \x3c!--applycancel buttons--\x3e\n <div class="bs-datepicker-buttons" *ngIf="false">\n <button class="btn btn-success" type="button">Apply</button>\n <button class="btn btn-default" type="button">Cancel</button>\n </div>\n </div>\n\n \x3c!--custom dates or date ranges picker--\x3e\n <div class="bs-datepicker-custom-range" *ngIf="customRanges?.length > 0">\n <bs-custom-date-view \n [selectedRange]="chosenRange" \n [ranges]="customRanges"\n (onSelect)="setRangeOnCalendar($event)">\n </bs-custom-date-view>\n </div>\n</div>\n',host:{class:"bottom","(click)":"_stopPropagation($event)",role:"dialog","aria-label":"calendar"},animations:[B]}]}],a.ctorParameters=function(){return[{type:t.Renderer2},{type:m},{type:Y},{type:t.ElementRef},{type:v},{type:_},{type:r.PositioningService}]},a}(g);var Q=function(e){function n(t,n,a,i,s,r,o){var c=e.call(this,t,n,a,i,s,r,o)||this;return t.setStyle(i.nativeElement,"display","inline-block"),t.setStyle(i.nativeElement,"position","static"),c}return p(n,e),n.decorators=[{type:t.Component,args:[{selector:"bs-daterangepicker-inline-container",providers:[Y,_],template:'\x3c!-- days calendar view mode --\x3e\n<div class="bs-datepicker" [ngClass]="containerClass" *ngIf="viewMode | async">\n <div class="bs-datepicker-container"\n [@datepickerAnimation]="animationState"\n (@datepickerAnimation.done)="positionServiceEnable()">\n \x3c!--calendars--\x3e\n <div class="bs-calendar-container" [ngSwitch]="viewMode | async" role="application">\n \x3c!--days calendar--\x3e\n <div *ngSwitchCase="\'day\'" class="bs-media-container">\n <bs-days-calendar-view\n *ngFor="let calendar of daysCalendar | async"\n [class.bs-datepicker-multiple]="(daysCalendar | async)?.length > 1"\n [calendar]="calendar"\n [options]="options | async"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="dayHoverHandler($event)"\n (onHoverWeek)="weekHoverHandler($event)"\n (onSelect)="daySelectHandler($event)">\n </bs-days-calendar-view>\n </div>\n\n \x3c!--months calendar--\x3e\n <div *ngSwitchCase="\'month\'" class="bs-media-container">\n <bs-month-calendar-view\n *ngFor="let calendar of monthsCalendar | async"\n [class.bs-datepicker-multiple]="(daysCalendar | async)?.length > 1"\n [calendar]="calendar"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="monthHoverHandler($event)"\n (onSelect)="monthSelectHandler($event)">\n </bs-month-calendar-view>\n </div>\n\n \x3c!--years calendar--\x3e\n <div *ngSwitchCase="\'year\'" class="bs-media-container">\n <bs-years-calendar-view\n *ngFor="let calendar of yearsCalendar | async"\n [class.bs-datepicker-multiple]="(daysCalendar | async)?.length > 1"\n [calendar]="calendar"\n (onNavigate)="navigateTo($event)"\n (onViewMode)="setViewMode($event)"\n (onHover)="yearHoverHandler($event)"\n (onSelect)="yearSelectHandler($event)">\n </bs-years-calendar-view>\n </div>\n </div>\n\n \x3c!--applycancel buttons--\x3e\n <div class="bs-datepicker-buttons" *ngIf="false">\n <button class="btn btn-success" type="button">Apply</button>\n <button class="btn btn-default" type="button">Cancel</button>\n </div>\n </div>\n\n \x3c!--custom dates or date ranges picker--\x3e\n <div class="bs-datepicker-custom-range" *ngIf="customRanges?.length > 0">\n <bs-custom-date-view \n [selectedRange]="chosenRange" \n [ranges]="customRanges"\n (onSelect)="setRangeOnCalendar($event)">\n </bs-custom-date-view>\n </div>\n</div>\n',host:{"(click)":"_stopPropagation($event)"},animations:[B]}]}],n.ctorParameters=function(){return[{type:t.Renderer2},{type:m},{type:Y},{type:t.ElementRef},{type:v},{type:_},{type:r.PositioningService}]},n}(K),X=function(){function e(e,n,a,i,s){this._config=e,this._elementRef=n,this.bsValueChange=new t.EventEmitter,this._subs=[],Object.assign(this,this._config),this._datepicker=s.createLoader(n,i,a)}return Object.defineProperty(e.prototype,"bsValue",{set:function(e){this._bsValue!==e&&(this._bsValue=e,this.bsValueChange.emit(e))},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.setConfig(),this._subs.push(this.bsValueChange.subscribe((function(t){e._datepickerRef.instance.value=t}))),this._subs.push(this._datepickerRef.instance.valueChange.pipe(n.filter((function(e){return e&&e[0]&&!!e[1]}))).subscribe((function(t){e.bsValue=t})))},e.prototype.ngOnChanges=function(e){this._datepickerRef&&this._datepickerRef.instance&&(e.minDate&&(this._datepickerRef.instance.minDate=this.minDate,this.setConfig()),e.maxDate&&(this._datepickerRef.instance.maxDate=this.maxDate,this.setConfig()),e.datesEnabled&&(this._datepickerRef.instance.datesEnabled=this.datesEnabled),e.datesDisabled&&(this._datepickerRef.instance.datesDisabled=this.datesDisabled,this.setConfig()),e.daysDisabled&&(this._datepickerRef.instance.daysDisabled=this.daysDisabled,this.setConfig()),e.isDisabled&&(this._datepickerRef.instance.isDisabled=this.isDisabled,this.setConfig()),e.dateCustomClasses&&(this._datepickerRef.instance.dateCustomClasses=this.dateCustomClasses,this.setConfig()))},e.prototype.setConfig=function(){this._datepicker&&this._datepicker.hide(),this._config=Object.assign({},this._config,this.bsConfig,{value:this._bsValue,isDisabled:this.isDisabled,minDate:this.minDate||this.bsConfig&&this.bsConfig.minDate,maxDate:this.maxDate||this.bsConfig&&this.bsConfig.maxDate,daysDisabled:this.daysDisabled||this.bsConfig&&this.bsConfig.daysDisabled,dateCustomClasses:this.dateCustomClasses||this.bsConfig&&this.bsConfig.dateCustomClasses,datesDisabled:this.datesDisabled||this.bsConfig&&this.bsConfig.datesDisabled,datesEnabled:this.datesEnabled||this.bsConfig&&this.bsConfig.datesEnabled,ranges:this.bsConfig&&this.bsConfig.ranges}),this._datepickerRef=this._datepicker.provide({provide:m,useValue:this._config}).attach(Q).to(this._elementRef).show()},e.prototype.ngOnDestroy=function(){this._datepicker.dispose()},e.decorators=[{type:t.Directive,args:[{selector:"bs-daterangepicker-inline",exportAs:"bsDaterangepickerInline"}]}],e.ctorParameters=function(){return[{type:Z},{type:t.ElementRef},{type:t.Renderer2},{type:t.ViewContainerRef},{type:c.ComponentLoaderFactory}]},e.propDecorators={bsValue:[{type:t.Input}],bsConfig:[{type:t.Input}],isDisabled:[{type:t.Input}],minDate:[{type:t.Input}],maxDate:[{type:t.Input}],dateCustomClasses:[{type:t.Input}],daysDisabled:[{type:t.Input}],datesDisabled:[{type:t.Input}],datesEnabled:[{type:t.Input}],bsValueChange:[{type:t.Output}]},e}();var J={provide:d.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return te})),multi:!0},ee={provide:d.NG_VALIDATORS,useExisting:t.forwardRef((function(){return