\";\n document.body.appendChild(div);\n var initial = div.scrollLeft;\n div.scrollLeft = -1;\n cachedRtlScrollLeft = div.scrollLeft < 0 ? div.scrollLeft : initial;\n document.body.removeChild(div);\n }\n return cachedRtlScrollLeft;\n}\n/**\n * @hidden\n * move to kendo-common\n */\nvar BrowserSupportService = /** @class */ (function () {\n function BrowserSupportService(zone, changeDetector) {\n var _this = this;\n this.zone = zone;\n this.changeDetector = changeDetector;\n this.changes = new EventEmitter();\n if (typeof window !== 'undefined') {\n this.zone.runOutsideAngular(function () {\n fromEvent(window, 'resize').pipe(auditTime(100)).subscribe(function () {\n if (cachedPixelRatio !== window.devicePixelRatio) {\n zone.run(function () {\n cachedScrollbarWidth = null;\n _this.changes.emit();\n _this.changeDetector.markForCheck();\n });\n }\n });\n });\n }\n }\n Object.defineProperty(BrowserSupportService.prototype, \"scrollbarWidth\", {\n get: function () {\n return scrollbarWidth();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BrowserSupportService.prototype, \"rtlScrollLeft\", {\n get: function () {\n return rtlScrollLeft();\n },\n enumerable: true,\n configurable: true\n });\n BrowserSupportService.decorators = [\n { type: Injectable },\n ];\n /** @nocollapse */\n BrowserSupportService.ctorParameters = function () { return [\n { type: NgZone },\n { type: ChangeDetectorRef }\n ]; };\n return BrowserSupportService;\n}());\n\n/* tslint:disable:use-life-cycle-interface */\nvar isGroupItem = function (source) {\n return source.items !== undefined &&\n source.field !== undefined;\n};\nvar isVirtualGroupItem = function (source) {\n return source.offset !== undefined &&\n source.skipHeader !== undefined;\n};\nvar flattenGroups = function (groups) { return (groups.reduce(function (acc, curr) {\n if (isGroupItem(curr)) {\n return acc.concat(flattenGroups(curr.items));\n }\n return acc.concat([curr]);\n}, []) // tslint:disable-line:align\n); };\n/**\n * @hidden\n */\nvar itemAt = function (data, index) {\n var first = data[0];\n if (isPresent(first) && isGroupItem(first)) {\n return flattenGroups(data)[index];\n }\n return data[index];\n};\n/**\n * @hidden\n */\nvar getIterator$1 = function (data, _a) {\n var footers = _a.footers, level = _a.level, dataIndex = _a.dataIndex, parentGroupIndex = _a.parentGroupIndex, groupIndex = _a.groupIndex;\n var first = data[0];\n if (isPresent(first) && isGroupItem(first)) {\n if (isVirtualGroupItem(first)) {\n groupIndex = isPresent(first.offset) ? first.offset : groupIndex;\n }\n //tslint:disable-next-line:no-use-before-declare\n return new GroupIterator(data, footers, level, dataIndex, parentGroupIndex, groupIndex);\n }\n //tslint:disable-next-line:no-use-before-declare\n return new ItemIterator(data, dataIndex, parentGroupIndex);\n};\nvar ArrayIterator = /** @class */ (function () {\n function ArrayIterator(arr, idx) {\n if (idx === void 0) { idx = 0; }\n this.arr = arr;\n this.idx = idx;\n this.arr = arr || [];\n }\n ArrayIterator.prototype[iterator] = function () {\n return this;\n };\n ArrayIterator.prototype.next = function () {\n return this.idx < this.arr.length ? {\n done: false,\n value: this.arr[this.idx++]\n } : { done: true, value: undefined };\n };\n return ArrayIterator;\n}());\n/**\n * @hidden\n */\nvar Iterator = /** @class */ (function () {\n function Iterator(arr, dataIndex, resultMap) {\n if (dataIndex === void 0) { dataIndex = 0; }\n if (resultMap === void 0) { resultMap = function (x) { return x; }; }\n this.dataIndex = dataIndex;\n this.resultMap = resultMap;\n var iter = arr[iterator];\n this._innerIterator = iter ? arr[iterator]() : new ArrayIterator(arr);\n }\n Iterator.prototype[iterator] = function () {\n return this;\n };\n Iterator.prototype.next = function () {\n return this.resultMap(this._innerIterator.next(), this.dataIndex++);\n };\n return Iterator;\n}());\n/**\n * @hidden\n */\nvar ItemIterator = /** @class */ (function (_super) {\n __extends(ItemIterator, _super);\n function ItemIterator(arr, dataIndex, groupIndex) {\n return _super.call(this, arr, dataIndex, function (x, idx) { return ({\n done: x.done,\n value: {\n data: x.value,\n groupIndex: groupIndex,\n index: idx,\n type: 'data'\n }\n }); }) || this;\n }\n Object.defineProperty(ItemIterator.prototype, \"index\", {\n /**\n * The index of the next record.\n * @readonly\n * @type {number}\n */\n get: function () {\n return this.dataIndex;\n },\n enumerable: true,\n configurable: true\n });\n return ItemIterator;\n}(Iterator));\nvar prefix = function (s, n) {\n var p = s ? s + \"_\" : s;\n return \"\" + p + n;\n};\n/**\n * @hidden\n */\nvar GroupIterator = /** @class */ (function () {\n function GroupIterator(arr, outputFooters, level, dataIndex, parentIndex, groupIndex) {\n if (outputFooters === void 0) { outputFooters = false; }\n if (level === void 0) { level = 0; }\n if (dataIndex === void 0) { dataIndex = 0; }\n if (parentIndex === void 0) { parentIndex = \"\"; }\n if (groupIndex === void 0) { groupIndex = 0; }\n this.arr = arr;\n this.outputFooters = outputFooters;\n this.level = level;\n this.dataIndex = dataIndex;\n this.parentIndex = parentIndex;\n this.groupIndex = groupIndex;\n this.currentGroupIndex = \"\";\n this.arr = arr || [];\n this._iterator = new Iterator(this.arr, this.dataIndex);\n }\n GroupIterator.prototype[iterator] = function () {\n return this;\n };\n GroupIterator.prototype.nextGroupItem = function () {\n this.current = this._iterator.next().value;\n this._innerIterator = null;\n if (this.current) {\n this.currentGroupIndex = prefix(this.parentIndex, this.groupIndex++);\n return {\n done: false,\n value: {\n data: this.current,\n index: this.currentGroupIndex,\n level: this.level,\n type: 'group'\n }\n };\n }\n else {\n this.current = null;\n return { done: true, value: undefined };\n }\n };\n GroupIterator.prototype.footerItem = function () {\n if (this.current) {\n var group = this.current;\n this.current = null;\n return {\n done: false,\n value: {\n data: group,\n groupIndex: this.currentGroupIndex,\n level: this.level,\n type: 'footer'\n }\n };\n }\n else {\n this.current = null;\n return { done: true, value: undefined };\n }\n };\n GroupIterator.prototype.innerIterator = function (group) {\n if (!this._innerIterator) {\n this._innerIterator = getIterator$1(group.items, {\n dataIndex: this.dataIndex,\n footers: this.outputFooters,\n level: this.level + 1,\n parentGroupIndex: this.currentGroupIndex\n });\n }\n return this._innerIterator;\n };\n GroupIterator.prototype.nextDataItem = function (group) {\n var iterator$$1 = this.innerIterator(group);\n var result = iterator$$1.next();\n if (isPresent(result.value) && !result.done && result.value.type === \"data\") {\n this.dataIndex = result.value.index + 1;\n }\n return !result.done ? result : undefined;\n };\n GroupIterator.prototype.next = function () {\n if (!isPresent(this.current)) {\n return this.nextGroupItem();\n }\n var item = this.nextDataItem(this.current);\n return item ? item : (this.outputFooters ? this.footerItem() : this.nextGroupItem());\n };\n Object.defineProperty(GroupIterator.prototype, \"index\", {\n /**\n * The index of the last iterated data record.\n * @readonly\n * @type {number}\n */\n get: function () {\n return this.dataIndex + 1;\n },\n enumerable: true,\n configurable: true\n });\n return GroupIterator;\n}());\n\n/**\n * @hidden\n */\nvar DataResultIterator = /** @class */ (function () {\n function DataResultIterator(source, skip, groupFooters) {\n if (skip === void 0) { skip = 0; }\n if (groupFooters === void 0) { groupFooters = false; }\n this.source = source;\n this.skip = skip;\n this.groupFooters = groupFooters;\n this.source = this.source ? this.source : [];\n this.isObject = this.isGridDataResult(this.source);\n }\n DataResultIterator.prototype.isGridDataResult = function (source) {\n return source.total !== undefined && source.data !== undefined;\n };\n Object.defineProperty(DataResultIterator.prototype, \"total\", {\n get: function () {\n return this.isObject ? this.source.total : this.source.length;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DataResultIterator.prototype, \"data\", {\n get: function () {\n return this.isObject ? this.source.data : this.source;\n },\n enumerable: true,\n configurable: true\n });\n DataResultIterator.prototype.map = function (fn) {\n return this.data.map(fn);\n };\n DataResultIterator.prototype.filter = function (fn) {\n return this.data.filter(fn);\n };\n DataResultIterator.prototype.reduce = function (fn, init) {\n return this.data.reduce(fn, init);\n };\n DataResultIterator.prototype.forEach = function (fn) {\n this.data.forEach(fn);\n };\n DataResultIterator.prototype.some = function (fn) {\n return this.data.some(fn);\n };\n DataResultIterator.prototype[iterator] = function () {\n return getIterator$1(this.data, {\n dataIndex: this.skip,\n footers: this.groupFooters,\n groupIndex: this.skip\n });\n };\n DataResultIterator.prototype.toString = function () { return this.data.toString(); };\n return DataResultIterator;\n}());\n/**\n * @hidden\n */\nvar DataCollection = /** @class */ (function () {\n function DataCollection(accessor) {\n this.accessor = accessor;\n }\n Object.defineProperty(DataCollection.prototype, \"total\", {\n get: function () { return this.accessor().total; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DataCollection.prototype, \"length\", {\n get: function () { return this.accessor().data.length; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DataCollection.prototype, \"first\", {\n get: function () { return this.accessor().data[0]; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DataCollection.prototype, \"last\", {\n get: function () { return this.accessor().data[this.length - 1]; },\n enumerable: true,\n configurable: true\n });\n DataCollection.prototype.at = function (index) {\n return itemAt(this.accessor().data, index);\n };\n DataCollection.prototype.map = function (fn) { return this.accessor().map(fn); };\n DataCollection.prototype.filter = function (fn) {\n return this.accessor().filter(fn);\n };\n DataCollection.prototype.reduce = function (fn, init) {\n return this.accessor().reduce(fn, init);\n };\n DataCollection.prototype.forEach = function (fn) {\n this.accessor().forEach(fn);\n };\n DataCollection.prototype.some = function (fn) {\n return this.accessor().some(fn);\n };\n DataCollection.prototype[iterator] = function () {\n return this.accessor()[iterator]();\n };\n DataCollection.prototype.toString = function () { return this.accessor().toString(); };\n return DataCollection;\n}());\n\n/**\n * @hidden\n */\nvar DomEventsService = /** @class */ (function () {\n function DomEventsService() {\n this.cellClick = new EventEmitter();\n this.cellMousedown = new EventEmitter();\n this.click = new EventEmitter();\n this.keydown = new EventEmitter();\n this.focus = new EventEmitter();\n this.focusIn = new EventEmitter();\n this.focusOut = new EventEmitter();\n this.windowBlur = new EventEmitter();\n }\n DomEventsService.decorators = [\n { type: Injectable },\n ];\n return DomEventsService;\n}());\n\n/**\n * @hidden\n */\nvar LocalDataChangesService = /** @class */ (function () {\n function LocalDataChangesService() {\n this.changes = new EventEmitter();\n }\n LocalDataChangesService.decorators = [\n { type: Injectable },\n ];\n return LocalDataChangesService;\n}());\n\n/**\n * @hidden\n */\nvar SelectionService = /** @class */ (function () {\n function SelectionService(domEvents, localDataChangesService) {\n var _this = this;\n this.changes = new EventEmitter();\n this.lastSelectionStartIndex = 0;\n this.currentSelection = [];\n this.selectAllChecked = false;\n this.cellClickSubscription = domEvents.cellClick.subscribe(function (args) {\n if (_this.options.enabled && !_this.options.checkboxOnly && args.type !== 'contextmenu') {\n _this.handleClick({ index: args.rowIndex, data: args.dataItem }, args.originalEvent);\n }\n });\n this.mousedownSubscription = domEvents.cellMousedown.subscribe(function (args) {\n if (_this.options.enabled && (!_this.options.mode || _this.options.mode === \"multiple\") &&\n !_this.options.checkboxOnly && args.originalEvent.shiftKey) {\n args.originalEvent.preventDefault();\n }\n });\n if (localDataChangesService) {\n this.dataChangedSubscription = localDataChangesService.changes.subscribe(function (args) {\n if (isPresent(args.action) && args.action === 'remove') {\n _this.deselect(args.item);\n }\n });\n }\n }\n SelectionService.prototype.init = function (settings) {\n this.settings = settings;\n this.currentSelection = [];\n if (settings.selectable && settings.selectable.enabled !== false) {\n var iterator_1 = this.getIterator();\n this._selectAllState = true;\n while (true) {\n var item = iterator_1.next();\n if (item.done) {\n break;\n }\n if (item.value && item.value.type === \"data\") {\n var rowArgs = {\n dataItem: item.value.data,\n index: item.value.index\n };\n if (settings.rowSelected(rowArgs)) {\n this.currentSelection[item.value.index] = rowArgs;\n }\n else {\n this._selectAllState = undefined;\n }\n }\n }\n if (this.currentSelection.length === 0) {\n this._selectAllState = false;\n }\n }\n };\n SelectionService.prototype.isSelected = function (index) {\n return this.options.enabled && isPresent(this.currentSelection[index]);\n };\n SelectionService.prototype.handleClick = function (item, event) {\n var ev;\n var ctrlKey = event.ctrlKey || event.metaKey;\n if (this.options.mode === \"single\" && ctrlKey && this.isSelected(item.index)) {\n ev = this.toggle(item);\n }\n else if (this.options.mode === \"multiple\") {\n if (ctrlKey && !event.shiftKey) {\n ev = this.toggle(item);\n }\n else if (event.shiftKey) {\n ev = this.addAllTo(item, ctrlKey);\n }\n }\n if (!isPresent(ev)) {\n ev = this.select(item);\n this.currentSelection[item.index] = {\n dataItem: item.data,\n index: item.index\n };\n }\n if (!ev.selectedRows.length && !ev.deselectedRows.length) {\n return;\n }\n ev.ctrlKey = event.ctrlKey || event.metaKey;\n ev.shiftKey = event.shiftKey;\n this.changes.emit(ev);\n };\n SelectionService.prototype.toggle = function (item) {\n var selectedRows = [];\n var deselectedRows = [];\n this.lastSelectionStartIndex = item.index;\n if (this.isSelected(item.index)) {\n deselectedRows.push({ dataItem: item.data, index: item.index });\n }\n else {\n selectedRows.push({ dataItem: item.data, index: item.index });\n }\n return {\n deselectedRows: deselectedRows,\n selectedRows: selectedRows\n };\n };\n SelectionService.prototype.toggleByIndex = function (index) {\n var iterator$$1 = this.getIterator();\n if (this.selectAllChecked && this.isSelected(index)) {\n this.selectAllChecked = false;\n }\n while (true) {\n var item = iterator$$1.next();\n if (item.done) {\n break;\n }\n if (item.value && item.value.type === \"data\" && item.value.index === index) {\n var itemToToggle = {\n data: item.value.data,\n index: item.value.index\n };\n if (this.isSelected(index) || this.options.mode === \"multiple\") {\n return this.toggle(itemToToggle);\n }\n else {\n return this.select(itemToToggle);\n }\n }\n }\n };\n SelectionService.prototype.select = function (item) {\n var deselectedRows = [];\n var selectedRows = [];\n this.lastSelectionStartIndex = item.index;\n if (!this.isSelected(item.index)) {\n selectedRows.push({ dataItem: item.data, index: item.index });\n }\n this.currentSelection.forEach(function (row) {\n if (row.index !== item.index) {\n deselectedRows.push(row);\n }\n });\n return {\n deselectedRows: deselectedRows,\n selectedRows: selectedRows\n };\n };\n //Used to manually deselect removed items\n SelectionService.prototype.deselect = function (removedItem) {\n var iterator$$1 = this.getIterator();\n while (true) {\n var item = iterator$$1.next();\n if (item.done) {\n break;\n }\n if (item.value && item.value.type === \"data\" && item.value.data === removedItem) {\n var rowArgs = {\n dataItem: item.value.data,\n index: item.value.index\n };\n if (this.isSelected(rowArgs.index)) {\n var ev = {\n ctrlKey: false,\n deselectedRows: [rowArgs],\n selectedRows: []\n };\n this.changes.emit(ev);\n }\n }\n }\n };\n SelectionService.prototype.addAllTo = function (item, ctrlKey) {\n var selectedRows = [];\n var deselectedRows = [];\n var start = Math.min(this.lastSelectionStartIndex, item.index);\n var end = Math.max(this.lastSelectionStartIndex, item.index);\n var iterator$$1 = this.getIterator();\n while (true) {\n var next = iterator$$1.next();\n if (next.done) {\n break;\n }\n if (next.value && next.value.type === \"data\") {\n var idx = next.value.index;\n if ((idx < start || idx > end) && this.isSelected(idx) && !ctrlKey) {\n deselectedRows.push({ dataItem: next.value.data, index: idx });\n }\n if ((idx >= start && idx <= end) && !this.isSelected(idx)) {\n selectedRows.push({ dataItem: next.value.data, index: idx });\n }\n }\n }\n return {\n deselectedRows: deselectedRows,\n selectedRows: selectedRows\n };\n };\n SelectionService.prototype.updateAll = function (selectAllChecked) {\n this.selectAllChecked = selectAllChecked;\n var selectedRows = [];\n var deselectedRows = [];\n var iterator$$1 = this.getIterator();\n while (true) {\n var next = iterator$$1.next();\n if (next.done) {\n break;\n }\n if (next.value && next.value.type === \"data\") {\n var idx = next.value.index;\n if (this.isSelected(idx) && !selectAllChecked) {\n deselectedRows.push({ dataItem: next.value.data, index: idx });\n }\n if (!this.isSelected(idx) && selectAllChecked) {\n selectedRows.push({ dataItem: next.value.data, index: idx });\n }\n }\n }\n if (!selectedRows.length && !deselectedRows.length) {\n return;\n }\n var ev = {\n ctrlKey: true,\n deselectedRows: deselectedRows,\n selectedRows: selectedRows,\n shiftKey: true\n };\n this.changes.emit(ev);\n };\n Object.defineProperty(SelectionService.prototype, \"selectAllState\", {\n get: function () {\n return this._selectAllState;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SelectionService.prototype, \"selected\", {\n get: function () {\n return this.currentSelection.map(function (item) {\n return item.index;\n }).filter(function (n) { return typeof n === \"number\"; });\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SelectionService.prototype, \"options\", {\n get: function () {\n var defaultOptions = {\n checkboxOnly: false,\n enabled: true,\n mode: \"multiple\"\n };\n if (!isPresent(this.settings)) {\n return defaultOptions;\n }\n if (typeof this.settings.selectable === 'boolean') {\n return {\n checkboxOnly: false,\n enabled: this.settings.selectable,\n mode: \"multiple\"\n };\n }\n else {\n return Object.assign(defaultOptions, this.settings.selectable);\n }\n },\n enumerable: true,\n configurable: true\n });\n SelectionService.prototype.ngOnDestroy = function () {\n if (this.cellClickSubscription) {\n this.cellClickSubscription.unsubscribe();\n this.cellClickSubscription = null;\n }\n if (this.mousedownSubscription) {\n this.mousedownSubscription.unsubscribe();\n this.mousedownSubscription = null;\n }\n if (this.dataChangedSubscription) {\n this.dataChangedSubscription.unsubscribe();\n this.dataChangedSubscription = null;\n }\n };\n SelectionService.prototype.getIterator = function () {\n var accessor = this.settings.view.accessor();\n if (!accessor) {\n return;\n }\n return accessor[iterator]();\n };\n SelectionService.decorators = [\n { type: Injectable },\n ];\n /** @nocollapse */\n SelectionService.ctorParameters = function () { return [\n { type: DomEventsService },\n { type: LocalDataChangesService }\n ]; };\n return SelectionService;\n}());\n\n/* tslint:disable:no-input-rename */\n/**\n * @hidden\n */\nvar Selection = /** @class */ (function () {\n function Selection(grid, cd) {\n this.grid = grid;\n this.cd = cd;\n /**\n * Defines the collection that will store the selected item keys.\n */\n this.selectedKeys = [];\n /**\n * Fires when the `selectedKeys` collection has been updated.\n */\n this.selectedKeysChange = new EventEmitter();\n this.init();\n }\n Selection.prototype.init = function () {\n var _this = this;\n if (!isPresent(this.grid.rowSelected)) {\n this.grid.rowSelected = function (row) {\n return _this.selectedKeys.indexOf(_this.getItemKey(row)) >= 0;\n };\n }\n this.selectionChangeSubscription = this.grid\n .selectionChange\n .subscribe(this.onSelectionChange.bind(this));\n };\n /**\n * @hidden\n */\n Selection.prototype.destroy = function () {\n this.selectionChangeSubscription.unsubscribe();\n };\n /**\n * @hidden\n */\n Selection.prototype.reset = function () {\n this.selectedKeys.splice(0, this.selectedKeys.length);\n };\n Selection.prototype.getItemKey = function (row) {\n if (this.selectionKey) {\n if (typeof this.selectionKey === \"string\") {\n return row.dataItem[this.selectionKey];\n }\n if (typeof this.selectionKey === \"function\") {\n return this.selectionKey(row);\n }\n }\n return row.index;\n };\n Selection.prototype.onSelectionChange = function (selection) {\n var _this = this;\n selection.deselectedRows.forEach(function (item) {\n var itemKey = _this.getItemKey(item);\n var itemIndex = _this.selectedKeys.indexOf(itemKey);\n if (itemIndex >= 0) {\n _this.selectedKeys.splice(itemIndex, 1);\n }\n });\n if (this.grid.selectableSettings.mode === \"single\" && this.selectedKeys.length > 0) {\n this.reset();\n }\n selection.selectedRows.forEach(function (item) {\n var itemKey = _this.getItemKey(item);\n if (_this.selectedKeys.indexOf(itemKey) < 0) {\n _this.selectedKeys.push(itemKey);\n }\n });\n this.cd.markForCheck();\n this.selectedKeysChange.emit(this.selectedKeys);\n };\n Selection.propDecorators = {\n selectedKeys: [{ type: Input }],\n selectionKey: [{ type: Input, args: [\"kendoGridSelectBy\",] }],\n selectedKeysChange: [{ type: Output }]\n };\n return Selection;\n}());\n\n/**\n * @hidden\n */\nvar PreventableEvent = /** @class */ (function () {\n function PreventableEvent() {\n this.prevented = false;\n }\n /**\n * Prevents the default action for a specified event.\n * In this way, the source component suppresses\n * the built-in behavior that follows the event.\n */\n PreventableEvent.prototype.preventDefault = function () {\n this.prevented = true;\n };\n /**\n * Returns `true` if the event was prevented\n * by any of its subscribers.\n *\n * @returns `true` if the default action was prevented.\n * Otherwise, returns `false`.\n */\n PreventableEvent.prototype.isDefaultPrevented = function () {\n return this.prevented;\n };\n return PreventableEvent;\n}());\n\n/**\n * Arguments for the `cellClose` event.\n */\nvar CellCloseEvent = /** @class */ (function (_super) {\n __extends(CellCloseEvent, _super);\n function CellCloseEvent(options) {\n var _this = _super.call(this) || this;\n /**\n * @hidden\n */\n _this.action = 'cellClose';\n Object.assign(_this, options);\n return _this;\n }\n return CellCloseEvent;\n}(PreventableEvent));\n\n/**\n * @hidden\n */\nvar isEqual = function (index) { return function (item) { return item.index === index; }; };\n/**\n * @hidden\n */\nvar isNotEqual = function (index) { return function (item) { return item.index !== index; }; };\n/**\n * @hidden\n */\nvar isNewRow = function (index) { return index === -1 || index === undefined; };\n/**\n * @hidden\n */\nvar EditService = /** @class */ (function () {\n function EditService(ngZone) {\n var _this = this;\n this.ngZone = ngZone;\n this.changes = new EventEmitter();\n this.editedIndices = [];\n this.keepEditCell = false;\n this.closingCell = false;\n this.changedSource = new Subject();\n this.changed = this.changedSource.asObservable().pipe(switchMap(function () { return _this.ngZone.onStable.asObservable().pipe(take(1)); }));\n }\n EditService.prototype.editRow = function (index, group) {\n if (group === void 0) { group = undefined; }\n this.editedIndices.push({ index: index, group: group });\n this.onChanged();\n };\n EditService.prototype.addRow = function (group) {\n this.newItemGroup = { group: group };\n this.onChanged();\n };\n EditService.prototype.editCell = function (rowIndex, column, group) {\n if (isNewRow(rowIndex) || column.editable === false || !(column.editTemplate || column.field)) {\n return;\n }\n this.preventCellClose();\n if (!this.closeCell()) {\n this.editRow(rowIndex, group);\n this.column = column;\n this.onChanged();\n }\n };\n EditService.prototype.isEditing = function () {\n return this.editedIndices.length > 0;\n };\n EditService.prototype.isEditingCell = function () {\n return this.isEditing() && this.column !== undefined;\n };\n Object.defineProperty(EditService.prototype, \"hasNewItem\", {\n get: function () {\n return isPresent(this.newItemGroup);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EditService.prototype, \"newDataItem\", {\n get: function () {\n if (this.hasNewItem) {\n return this.newItemGroup.group.value;\n }\n return {};\n },\n enumerable: true,\n configurable: true\n });\n EditService.prototype.close = function (index) {\n if (isNewRow(index)) {\n this.newItemGroup = undefined;\n return;\n }\n this.editedIndices = this.editedIndices.filter(isNotEqual(index));\n delete this.column;\n this.onChanged();\n };\n EditService.prototype.closeCell = function (originalEvent) {\n var _this = this;\n if (this.column && !this.closingCell) {\n return this.ngZone.run(function () {\n var _a = _this.editedIndices[0], index = _a.index, group = _a.group;\n var args = new CellCloseEvent({\n column: _this.column,\n formGroup: group,\n originalEvent: originalEvent,\n rowIndex: index\n });\n _this.closingCell = true;\n _this.changes.emit(args);\n _this.closingCell = false;\n if (!args.isDefaultPrevented()) {\n _this.cancelCell();\n }\n return args.isDefaultPrevented();\n });\n }\n };\n EditService.prototype.cancelCell = function () {\n if (this.column) {\n this.editedIndices = [];\n delete this.column;\n this.onChanged();\n }\n };\n EditService.prototype.shouldCloseCell = function () {\n return this.column && !this.keepEditCell;\n };\n EditService.prototype.preventCellClose = function () {\n var _this = this;\n this.ngZone.runOutsideAngular(function () {\n window.clearTimeout(_this.keepCellTimeout);\n _this.keepEditCell = true;\n _this.keepCellTimeout = window.setTimeout(function () {\n _this.keepEditCell = false;\n }, 0); // tslint:disable-line:align\n });\n };\n EditService.prototype.context = function (index) {\n if (isNewRow(index)) {\n return this.newItemGroup;\n }\n return this.findByIndex(index);\n };\n EditService.prototype.columnContext = function (index, column) {\n if (isNewRow(index)) {\n return this.newItemGroup;\n }\n if (!this.column || column === this.column) {\n return this.findByIndex(index);\n }\n };\n EditService.prototype.isEdited = function (index) {\n if (isNewRow(index) && isPresent(this.newItemGroup)) {\n return true;\n }\n return !this.column && isPresent(this.findByIndex(index));\n };\n EditService.prototype.hasEdited = function (index) {\n return isPresent(this.context(index));\n };\n EditService.prototype.isEditedColumn = function (index, column) {\n if (this.column && this.column === column) {\n return isPresent(this.findByIndex(index));\n }\n return false;\n };\n EditService.prototype.beginEdit = function (rowIndex) {\n this.changes.emit({ action: 'edit', rowIndex: rowIndex });\n };\n EditService.prototype.beginAdd = function () {\n this.changes.emit({ action: 'add' });\n };\n EditService.prototype.endEdit = function (rowIndex) {\n var formGroup = this.context(rowIndex).group;\n this.changes.emit({ action: 'cancel', rowIndex: rowIndex, formGroup: formGroup, isNew: isNewRow(rowIndex) });\n };\n EditService.prototype.save = function (rowIndex) {\n var formGroup = this.context(rowIndex).group;\n this.changes.emit({ action: 'save', rowIndex: rowIndex, formGroup: formGroup, isNew: isNewRow(rowIndex) });\n };\n EditService.prototype.remove = function (rowIndex) {\n this.changes.emit({ action: 'remove', rowIndex: rowIndex });\n };\n EditService.prototype.findByIndex = function (index) {\n return this.editedIndices.find(isEqual(index));\n };\n EditService.prototype.onChanged = function () {\n var _this = this;\n this.ngZone.runOutsideAngular(function () {\n _this.changedSource.next();\n });\n };\n EditService.decorators = [\n { type: Injectable },\n ];\n /** @nocollapse */\n EditService.ctorParameters = function () { return [\n { type: NgZone }\n ]; };\n return EditService;\n}());\n\n/**\n * @hidden\n */\nvar ExpandStateService = /** @class */ (function () {\n function ExpandStateService(isInitiallyCollapsed) {\n this.isInitiallyCollapsed = isInitiallyCollapsed;\n this.changes = new Subject();\n this.rowState = [];\n }\n ExpandStateService.prototype.toggleRow = function (index, dataItem) {\n var rowIndex = this.rowState.indexOf(index);\n var found = rowIndex === -1;\n if (!this.emitEvent({ dataItem: dataItem, expand: this.isInitiallyCollapsed ? found : !found, index: index })) {\n this.rowState = found ? this.rowState.concat([index]) : this.rowState.slice(0, rowIndex).concat(this.rowState.slice(rowIndex + 1));\n }\n };\n ExpandStateService.prototype.isExpanded = function (index) {\n var found = this.rowState.indexOf(index) >= 0;\n return this.isInitiallyCollapsed ? found : !found;\n };\n ExpandStateService.prototype.reset = function () {\n this.rowState = [];\n };\n ExpandStateService.prototype.emitEvent = function (args) {\n this.changes.next(args);\n return false;\n };\n return ExpandStateService;\n}());\n\n/**\n * Arguments for the `detailExpand` event.\n */\nvar DetailExpandEvent = /** @class */ (function (_super) {\n __extends(DetailExpandEvent, _super);\n function DetailExpandEvent(args) {\n var _this = _super.call(this) || this;\n Object.assign(_this, args);\n return _this;\n }\n return DetailExpandEvent;\n}(PreventableEvent));\n\n/**\n * Arguments for the `detailCollapse` event.\n */\nvar DetailCollapseEvent = /** @class */ (function (_super) {\n __extends(DetailCollapseEvent, _super);\n function DetailCollapseEvent(args) {\n var _this = _super.call(this) || this;\n Object.assign(_this, args);\n return _this;\n }\n return DetailCollapseEvent;\n}(PreventableEvent));\n\n/**\n * @hidden\n */\nvar DetailsService = /** @class */ (function (_super) {\n __extends(DetailsService, _super);\n function DetailsService() {\n return _super.call(this, true) || this;\n }\n DetailsService.prototype.emitEvent = function (args) {\n var eventArg = new (args.expand ? DetailExpandEvent : DetailCollapseEvent)(args);\n this.changes.next(eventArg);\n return eventArg.isDefaultPrevented();\n };\n DetailsService.decorators = [\n { type: Injectable },\n ];\n /** @nocollapse */\n DetailsService.ctorParameters = function () { return []; };\n return DetailsService;\n}(ExpandStateService));\n\nvar removeLast = function (groupIndex) { return groupIndex.lastIndexOf(\"_\") > -1\n ? groupIndex.slice(0, groupIndex.lastIndexOf(\"_\"))\n : \"\"; };\n/**\n * @hidden\n */\nvar GroupsService = /** @class */ (function (_super) {\n __extends(GroupsService, _super);\n function GroupsService(isCollapsed) {\n if (isCollapsed === void 0) { isCollapsed = false; }\n return _super.call(this, isCollapsed) || this;\n }\n GroupsService.prototype.isInExpandedGroup = function (groupIndex, skipSelf) {\n if (skipSelf === void 0) { skipSelf = true; }\n if (skipSelf) {\n groupIndex = removeLast(groupIndex);\n }\n var expanded = true;\n while (groupIndex && expanded) {\n expanded = this.isExpanded(groupIndex);\n groupIndex = removeLast(groupIndex);\n }\n return expanded;\n };\n GroupsService.prototype.expandChildren = function (groupIndex) {\n this.rowState = this.rowState.filter(function (x) { return !x.startsWith(groupIndex); });\n };\n GroupsService.decorators = [\n { type: Injectable },\n ];\n /** @nocollapse */\n GroupsService.ctorParameters = function () { return [\n { type: Boolean, decorators: [{ type: Optional }, { type: Inject, args: [Skip,] }] }\n ]; };\n return GroupsService;\n}(ExpandStateService));\n\nvar reset = function () {\n var lists = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n lists[_i] = arguments[_i];\n }\n var diff = false;\n for (var idx = 0; idx < lists.length; idx++) {\n var _a = lists[idx], list = _a[0], columns = _a[1];\n diff = diff || list.length !== columns.length;\n list.reset(columns);\n }\n return diff;\n};\n/**\n * @hidden\n */\nvar ColumnsContainer = /** @class */ (function () {\n function ColumnsContainer(columns) {\n this.columns = columns;\n this.allColumns = new QueryList();\n this.leafColumns = new QueryList();\n this.lockedColumns = new QueryList();\n this.nonLockedColumns = new QueryList();\n this.lockedLeafColumns = new QueryList();\n this.nonLockedLeafColumns = new QueryList();\n this.totalLevels = 0;\n this.changes = new EventEmitter();\n this.leafColumnsToRender = [];\n this.lockedColumnsToRender = [];\n this.nonLockedColumnsToRender = [];\n this.hasGroupHeaderColumn = false;\n this.hasGroupFooter = false;\n this.hasFooter = false;\n this.unlockedWidth = 0;\n }\n ColumnsContainer.prototype.refresh = function () {\n var _this = this;\n var currentLevels = this.totalLevels;\n var leafColumns$$1 = new Array();\n var lockedLeafColumns = new Array();\n var nonLockedLeafColumns = new Array();\n var lockedColumns = new Array();\n var nonLockedColumns = new Array();\n var allColumns = new Array();\n var leafColumnsToRender = new Array();\n var lockedColumnsToRender = new Array();\n var nonLockedColumnsToRender = new Array();\n var hasGroupHeaderColumn = false;\n var hasGroupFooter = false;\n var hasFooter = false;\n var unlockedWidth = 0;\n var leafIndex = 0;\n this.totalLevels = 0;\n this.columns().forEach(function (column) {\n var containerLeafColumns = column.isLocked === true ? lockedLeafColumns : nonLockedLeafColumns;\n var containerColumns = column.isLocked === true ? lockedColumns : nonLockedColumns;\n var toRenderContainer = column.isLocked === true ? lockedColumnsToRender : nonLockedColumnsToRender;\n if (!isColumnGroupComponent(column)) {\n containerLeafColumns.push(column);\n leafColumns$$1.push(column);\n leafColumnsToRender.push.apply(leafColumnsToRender, columnsToRender([column]));\n toRenderContainer.push.apply(toRenderContainer, columnsToRender([column]));\n hasGroupHeaderColumn = hasGroupHeaderColumn || someLeafColumn(function (leaf) { return Boolean(leaf.groupHeaderColumnTemplateRef); }, column);\n hasGroupFooter = hasGroupFooter || someLeafColumn(function (leaf) { return Boolean(leaf.groupFooterTemplateRef); }, column);\n hasFooter = hasFooter || someLeafColumn(function (leaf) { return Boolean(leaf.footerTemplateRef); }, column);\n if (!column.isLocked) {\n unlockedWidth += column.width || 0;\n }\n if (column.isSpanColumn) {\n column.childColumns.forEach(function (c) {\n c.leafIndex = leafIndex++;\n });\n }\n else {\n column.leafIndex = leafIndex++;\n }\n }\n containerColumns.push(column);\n allColumns.push(column);\n _this.totalLevels = column.level > _this.totalLevels ? column.level : _this.totalLevels;\n });\n this.hasGroupHeaderColumn = hasGroupHeaderColumn;\n this.hasGroupFooter = hasGroupFooter;\n this.hasFooter = hasFooter;\n this.leafColumnsToRender = leafColumnsToRender;\n this.lockedColumnsToRender = lockedColumnsToRender;\n this.nonLockedColumnsToRender = nonLockedColumnsToRender;\n this.unlockedWidth = unlockedWidth;\n var changes = reset([this.leafColumns, leafColumns$$1], [this.lockedLeafColumns, lockedLeafColumns], [this.nonLockedLeafColumns, nonLockedLeafColumns], [this.lockedColumns, lockedColumns], [this.allColumns, allColumns], [this.nonLockedColumns, nonLockedColumns]) || currentLevels !== this.totalLevels;\n if (changes) {\n this.changes.emit();\n }\n return changes;\n };\n return ColumnsContainer;\n}());\n\nvar forEachColumn = function (list, callback) {\n list.forEach(function (column) {\n callback(column);\n if (column.isColumnGroup && column.hasChildren) {\n forEachColumn(column.childrenArray, callback);\n }\n });\n};\nvar forEachLevel = function (list, callback) {\n sortColumns(list)\n .forEach(function (column) {\n callback(column);\n if (column.isColumnGroup && column.hasChildren) {\n forEachLevel(column.childrenArray, callback);\n }\n });\n};\nvar filterHierarchy = function (list, predicate) {\n var result = [];\n sortColumns(list)\n .forEach(function (column) {\n if (predicate(column)) {\n if (column.isColumnGroup) {\n var children$$1 = filterHierarchy(column.childrenArray, predicate);\n if (children$$1.length) {\n result.push.apply(result, [column].concat(children$$1));\n }\n }\n else if (!column.isSpanColumn || filterHierarchy(column.childrenArray, predicate).length) {\n result.push(column);\n }\n }\n });\n return result;\n};\n/**\n * @hidden\n */\nvar ColumnList = /** @class */ (function () {\n function ColumnList(columns) {\n this.columns = columns;\n }\n ColumnList.empty = function () {\n return new ColumnList(new QueryList());\n };\n ColumnList.prototype.forEach = function (callback) {\n forEachColumn(this.columns, callback);\n };\n ColumnList.prototype.filter = function (callback) {\n var result = [];\n forEachColumn(this.columns, function (column) {\n if (callback(column)) {\n result.push(column);\n }\n });\n return result;\n };\n ColumnList.prototype.filterHierarchy = function (predicate) {\n return filterHierarchy(this.columns.toArray(), predicate);\n };\n ColumnList.prototype.filterSort = function (callback) {\n var result = [];\n forEachLevel(this.columns.toArray(), function (column) {\n if (callback(column)) {\n result.push(column);\n }\n });\n return result;\n };\n ColumnList.prototype.toArray = function () {\n var result = [];\n forEachColumn(this.columns, function (column) {\n result.push(column);\n });\n return result;\n };\n ColumnList.prototype.rootColumns = function () {\n return this.columns.toArray();\n };\n return ColumnList;\n}());\n\n/**\n * @hidden\n */\nvar GroupInfoService = /** @class */ (function () {\n function GroupInfoService() {\n this._columnList = ColumnList.empty;\n }\n Object.defineProperty(GroupInfoService.prototype, \"columns\", {\n get: function () {\n return expandColumns(this._columnList().toArray()).filter(isColumnComponent);\n },\n enumerable: true,\n configurable: true\n });\n GroupInfoService.prototype.registerColumnsContainer = function (columns) {\n this._columnList = columns;\n };\n GroupInfoService.prototype.formatForGroup = function (item) {\n var column = this.columnForGroup(item);\n return column ? column.format : \"\";\n };\n GroupInfoService.prototype.isGroupable = function (groupField) {\n var column = this.columns.filter(function (x) { return x.field === groupField; })[0];\n return column ? column.groupable : true;\n };\n GroupInfoService.prototype.groupTitle = function (item) {\n var column = this.columnForGroup(item);\n return column ? (column.title || column.field) : this.groupField(item);\n };\n GroupInfoService.prototype.groupHeaderTemplate = function (item) {\n var column = this.columnForGroup(item);\n return column ? column.groupHeaderTemplateRef || column.groupHeaderColumnTemplateRef : undefined;\n };\n GroupInfoService.prototype.groupField = function (group) {\n return group.data ? group.data.field : group.field;\n };\n GroupInfoService.prototype.columnForGroup = function (group) {\n var field = this.groupField(group);\n var column = this.columns.filter(function (x) { return x.field === field; })[0];\n return column;\n };\n return GroupInfoService;\n}());\n\n/**\n * @hidden\n */\nvar ChangeNotificationService = /** @class */ (function () {\n function ChangeNotificationService(ngZone) {\n this.ngZone = ngZone;\n this.changes = new EventEmitter();\n }\n ChangeNotificationService.prototype.notify = function () {\n var _this = this;\n if (!this.subscription || this.subscription.closed) {\n this.subscription = this.ngZone.onStable\n .asObservable().pipe(take(1))\n .subscribe(function () { return _this.changes.emit(); });\n }\n };\n ChangeNotificationService.decorators = [\n { type: Injectable },\n ];\n /** @nocollapse */\n ChangeNotificationService.ctorParameters = function () { return [\n { type: NgZone }\n ]; };\n return ChangeNotificationService;\n}());\n\n/**\n * Represents the no-records template of the Grid. Provides an option to customize the\n * appearance of the item that is displayed when no data is present. To define the no-records template,\n * nest an `
` tag with the `kendoGridNoRecordsTemplate` directive inside ``.\n *\n * > When the locked columns of the Grid are in use, the template is displayed in the non-locked part of the content.\n *\n * @example\n * ```ts-preview\n *\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * \n * \n * \n * There are not products. Click here to refresh.\n * \n * \n * `\n * })\n *\n * class AppComponent {\n * public data = [];\n * public refresh() {\n * this.data = [{\n * \"ProductID\": 1,\n * \"ProductName\": \"Chai\",\n * \"UnitPrice\": 18.0000,\n * \"Discontinued\": false,\n * \"Category\": {\n * \"CategoryID\": 1,\n * \"CategoryName\": \"Beverages\",\n * \"Description\": \"Soft drinks, coffees, teas, beers, and ales\"\n * }\n * }, {\n * \"ProductID\": 2,\n * \"ProductName\": \"Chang\",\n * \"UnitPrice\": 19.0000,\n * \"Discontinued\": false,\n * \"Category\": {\n * \"CategoryID\": 1,\n * \"CategoryName\": \"Beverages\",\n * \"Description\": \"Soft drinks, coffees, teas, beers, and ales\"\n * }\n * }, {\n * \"ProductID\": 3,\n * \"ProductName\": \"Aniseed Syrup\",\n * \"UnitPrice\": 10.0000,\n * \"Discontinued\": false,\n * \"Category\": {\n * \"CategoryID\": 2,\n * \"CategoryName\": \"Condiments\",\n * \"Description\": \"Sweet and savory sauces, relishes, spreads, and seasonings\"\n * }\n * }];\n *\n * }\n * }\n *\n * ```\n */\nvar NoRecordsTemplateDirective = /** @class */ (function () {\n function NoRecordsTemplateDirective(templateRef) {\n this.templateRef = templateRef;\n }\n NoRecordsTemplateDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoGridNoRecordsTemplate]'\n },] },\n ];\n /** @nocollapse */\n NoRecordsTemplateDirective.ctorParameters = function () { return [\n { type: TemplateRef, decorators: [{ type: Optional }] }\n ]; };\n return NoRecordsTemplateDirective;\n}());\n\nvar set = function (value) { return function (pair) { return pair.forEach(function (x) { return x.style.height = value; }); }; };\nvar clearHeight = function (pairs) { return pairs\n .filter(function (_a) {\n var left = _a[0], right = _a[1];\n return left.style.height || right.style.height;\n})\n .forEach(set(\"\")); };\nvar zip$1 = function (arr1, arr2) {\n var result = [];\n for (var idx = 0, len = arr1.length; idx < len; idx++) {\n if (!arr2[idx]) {\n break;\n }\n result.push([arr1[idx], arr2[idx]]);\n }\n return result;\n};\nvar setHeight = function (heights) { return function (row, idx) { return set(heights[idx] + 1 + \"px\")(row); }; };\nvar getHeights = function (rows) { return rows.map(function (_a) {\n var left = _a[0], right = _a[1];\n var height = left.offsetHeight;\n var offsetHeight2 = right.offsetHeight;\n if (height < offsetHeight2) {\n return offsetHeight2;\n }\n return height;\n}); };\n/**\n * @hidden\n */\nvar syncRowsHeight = function (table1, table2) {\n var activeElement = document.activeElement;\n var rows = zip$1(table1.rows, table2.rows);\n clearHeight(rows);\n var heights = getHeights(rows);\n [table1, table2].forEach(function (x) { return x.style.display = 'none'; });\n rows.forEach(setHeight(heights));\n [table1, table2].forEach(function (x) { return x.style.display = ''; });\n if (document.activeElement !== activeElement &&\n (table1.contains(activeElement) || table2.contains(activeElement))) {\n activeElement.focus();\n }\n};\n\n/**\n * @hidden\n */\nvar CELL_CONTEXT = new InjectionToken('grid-cell-context');\n/**\n * @hidden\n */\nvar EMPTY_CELL_CONTEXT = {};\n\n/**\n * Represents a service to set the filter descriptor\n * ([see example]({% slug reusablecustomfilters_grid %})).\n */\nvar FilterService = /** @class */ (function () {\n function FilterService() {\n /**\n * Fires when the filter descriptors is set.\n */\n this.changes = new Subject();\n }\n /**\n * Sets the filter descriptor.\n *\n * @param {CompositeFilterDescriptor} value - The filter descriptor that will be set.\n */\n FilterService.prototype.filter = function (value) {\n this.changes.next(value);\n };\n return FilterService;\n}());\n\n/**\n * Represents the pager template which helps to customize the pager appearance in the Grid. To define a pager\n * template, nest an `` tag with the `kendoPagerTemplate` directive inside ``.\n *\n * The template context provides the following fields:\n * * `currentPage`—The index of the displayed page.\n * * `pageSize`—The value of the current `pageSize`.\n * * `skip`—The current skip value.\n * * `total`—The total number of records.\n * * `totalPages`—The total number of available pages.\n *\n * @example\n * ```ts-preview\n *\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * \n * \n * \n * \n * \n *\n * \n * \n * \n * \n * \n * Current page: {{currentPage}}\n * \n *\n * \n * `\n * })\n *\n * class AppComponent {\n * public gridData = [{\n * \"ProductID\": 1,\n * \"ProductName\": \"Chai\",\n * \"UnitPrice\": 18.0000,\n * \"Discontinued\": false\n * }, {\n * \"ProductID\": 2,\n * \"ProductName\": \"Chang\",\n * \"UnitPrice\": 19.0000,\n * \"Discontinued\": true\n * }\n * ];\n * }\n *\n * ```\n */\nvar PagerTemplateDirective = /** @class */ (function () {\n function PagerTemplateDirective(templateRef) {\n this.templateRef = templateRef;\n }\n PagerTemplateDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoPagerTemplate]'\n },] },\n ];\n /** @nocollapse */\n PagerTemplateDirective.ctorParameters = function () { return [\n { type: TemplateRef, decorators: [{ type: Optional }] }\n ]; };\n return PagerTemplateDirective;\n}());\n\n/**\n * @hidden\n */\nvar PagerContextService = /** @class */ (function () {\n function PagerContextService() {\n this.changes = new Subject();\n this.pageChange = new Subject();\n }\n Object.defineProperty(PagerContextService.prototype, \"currentPage\", {\n get: function () {\n return this.skip / this.pageSize;\n },\n enumerable: true,\n configurable: true\n });\n PagerContextService.prototype.notifyChanges = function (changes) {\n this.total = changes.total;\n this.pageSize = changes.pageSize;\n this.skip = changes.skip;\n this.changes.next(changes);\n };\n PagerContextService.prototype.changePage = function (page) {\n this.pageChange.next({ skip: page * this.pageSize, take: this.pageSize });\n };\n PagerContextService.prototype.changePageSize = function (value) {\n this.pageChange.next({ skip: 0, take: value });\n };\n PagerContextService.prototype.nextPage = function () {\n var nextPage = this.currentPage + 1;\n if (nextPage * this.pageSize <= this.total) {\n this.changePage(nextPage);\n }\n };\n PagerContextService.prototype.prevPage = function () {\n var prevPage = this.currentPage - 1;\n if (prevPage * this.pageSize >= 0) {\n this.changePage(prevPage);\n }\n };\n return PagerContextService;\n}());\n\n/**\n * @hidden\n */\nvar PDFService = /** @class */ (function () {\n function PDFService() {\n this.savePDF = new EventEmitter();\n this.drawPDF = new EventEmitter();\n this.exportClick = new EventEmitter();\n this.dataChanged = new EventEmitter();\n }\n PDFService.prototype.save = function (component) {\n this.emitEvent(this.savePDF, component);\n };\n PDFService.prototype.draw = function (component, promise) {\n this.emitEvent(this.drawPDF, { component: component, promise: promise });\n };\n PDFService.prototype.emitEvent = function (emitter, args) {\n if (emitter.observers.length === 0) {\n if (isDevMode()) {\n throw new Error('Creating PDF requires including the PDFModule and adding the component.');\n }\n }\n else {\n emitter.emit(args);\n }\n };\n PDFService.decorators = [\n { type: Injectable },\n ];\n return PDFService;\n}());\n\n/**\n * Arguments for the `pdfExport` event.\n */\nvar PDFExportEvent = /** @class */ (function (_super) {\n __extends(PDFExportEvent, _super);\n function PDFExportEvent() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return PDFExportEvent;\n}(PreventableEvent));\n\n/**\n * @hidden\n */\nvar SuspendService = /** @class */ (function () {\n function SuspendService() {\n this.scroll = false;\n }\n SuspendService.decorators = [\n { type: Injectable },\n ];\n return SuspendService;\n}());\n\n/* tslint:disable: object-literal-sort-keys */\nvar bootstrapToMedia = function (media) { return (({\n \"xs\": \"(max-width: 576px)\",\n \"sm\": \"(min-width: 576px)\",\n \"md\": \"(min-width: 768px)\",\n \"lg\": \"(min-width: 992px)\",\n \"xl\": \"(min-width: 1200px)\"\n})[media] || media); };\n/* tslint:enable: object-literal-sort-keys */\nvar browserMatchMedia = function (media) { return window.matchMedia(media).matches; };\n/**\n * @hidden\n */\nvar ResponsiveService = /** @class */ (function () {\n function ResponsiveService() {\n /**\n * @hidden\n */\n this.matchMedia = browserMatchMedia;\n }\n /**\n * @hidden\n */\n ResponsiveService.prototype.matchesMedia = function (media) {\n return !media || this.matchMedia(bootstrapToMedia(media));\n };\n ResponsiveService.decorators = [\n { type: Injectable },\n ];\n return ResponsiveService;\n}());\n\n/**\n * @hidden\n */\nvar ExcelService = /** @class */ (function () {\n function ExcelService() {\n this.saveToExcel = new EventEmitter();\n this.exportClick = new EventEmitter();\n }\n ExcelService.prototype.save = function (component) {\n if (this.saveToExcel.observers.length === 0) {\n if (isDevMode()) {\n throw new Error('Saving excel requires including the ExcelModule and adding the component.');\n }\n }\n else {\n this.saveToExcel.emit(component);\n }\n };\n ExcelService.decorators = [\n { type: Injectable },\n ];\n return ExcelService;\n}());\n\n/**\n * Represents the toolbar template of the Grid.\n *\n * The template context has the following field:\n * - `position`—The position at which the toolbar template is rendered. The possible values are \"top\" and \"bottom\".\n *\n * @example\n * ```ts-preview\n *\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n *
\n * \n *
\n * \n *
\n *
\n * \n * \n * \n * \n * \n * \n * \n * \n * \n * `\n * })\n *\n * class AppComponent {\n * public position: 'top' | 'bottom' | 'both' = 'top';\n *\n * public gridData = [{\n * \"ProductID\": 1,\n * \"ProductName\": \"Chai\",\n * \"UnitPrice\": 18.0000,\n * \"Discontinued\": false\n * }, {\n * \"ProductID\": 2,\n * \"ProductName\": \"Chang\",\n * \"UnitPrice\": 19.0000,\n * \"Discontinued\": true\n * }\n * ];\n *\n * public onClick(): void {\n * console.log(\"button was clicked\");\n * }\n *\n * public positionChange({ target }): void {\n * this.position = target.value;\n * }\n * }\n *\n * ```\n */\nvar ToolbarTemplateDirective = /** @class */ (function () {\n function ToolbarTemplateDirective(templateRef) {\n this.templateRef = templateRef;\n this._position = \"top\";\n }\n Object.defineProperty(ToolbarTemplateDirective.prototype, \"position\", {\n get: function () {\n return this._position;\n },\n /**\n * The position of the toolbar ([see example]({% slug toolbartemplate_grid %})).\n *\n * The possible values are:\n * - `top`—Positions the toolbar above the group panel or header.\n * - `bottom`—Positions the toolbar below the pager.\n * - `both`—Displays two toolbar instances. Positions the first one above\n * the group panel or header and the second one below the pager.\n */\n set: function (position) {\n this._position = position;\n },\n enumerable: true,\n configurable: true\n });\n ToolbarTemplateDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoGridToolbarTemplate]'\n },] },\n ];\n /** @nocollapse */\n ToolbarTemplateDirective.ctorParameters = function () { return [\n { type: TemplateRef, decorators: [{ type: Optional }] }\n ]; };\n ToolbarTemplateDirective.propDecorators = {\n position: [{ type: Input, args: [\"position\",] }]\n };\n return ToolbarTemplateDirective;\n}());\n\n/**\n * @hidden\n */\nvar ScrollSyncService = /** @class */ (function () {\n function ScrollSyncService(ngZone) {\n var _this = this;\n this.ngZone = ngZone;\n this.changes = new Subject();\n this.elements = [];\n this.subscriptions = new Subscription();\n this.headerSubscription = new Subscription();\n this.bodySubscription = new Subscription();\n this.subscriptions.add(this.changes.subscribe(function (args) { return _this.scrollLeft(args); }));\n }\n ScrollSyncService.prototype.registerEmitter = function (el, sourceType) {\n var _this = this;\n this.unregister(sourceType);\n this.elements.push({ element: el, sourceType: sourceType });\n if (sourceType === \"body\" || sourceType === \"header\") {\n this.ngZone.runOutsideAngular(function () {\n var obs = fromEvent(el, \"scroll\").pipe(map(function (_a) {\n var scrollLeft = _a.target.scrollLeft;\n return ({\n scrollLeft: scrollLeft,\n sourceType: sourceType\n });\n }));\n var subscription = obs.pipe(distinctUntilChanged(function (x, y) { return (x.scrollLeft === y.scrollLeft); }), filter(function (x) { return !_this.source || _this.source === x.sourceType; }), tap(function (x) { return _this.source = x.sourceType; }))\n .subscribe(function (x) { return _this.changes.next(x); });\n subscription.add(obs.pipe(filter(function (x) { return _this.source && _this.source !== x.sourceType; }))\n .subscribe(function () { return _this.source = undefined; }));\n if (sourceType === \"body\") {\n _this.bodySubscription.add(subscription);\n }\n else {\n _this.headerSubscription.add(subscription);\n }\n });\n }\n };\n /**\n * destroy\n */\n ScrollSyncService.prototype.destroy = function () {\n this.subscriptions.unsubscribe();\n this.headerSubscription.unsubscribe();\n this.bodySubscription.unsubscribe();\n };\n ScrollSyncService.prototype.scrollLeft = function (_a) {\n var _this = this;\n var scrollLeft = _a.scrollLeft, sourceType = _a.sourceType;\n this.ngZone.runOutsideAngular(function () {\n _this.elements\n .filter(function (x) { return sourceType !== x.sourceType; })\n .forEach(function (_a) {\n var element = _a.element;\n return element.scrollLeft = scrollLeft;\n });\n });\n };\n ScrollSyncService.prototype.unregister = function (sourceType) {\n var index = this.elements.findIndex(function (x) { return x.sourceType === sourceType; });\n if (index > -1) {\n if (sourceType === \"header\") {\n this.headerSubscription.unsubscribe();\n this.headerSubscription = new Subscription();\n }\n else if (sourceType === \"body\") {\n this.bodySubscription.unsubscribe();\n this.bodySubscription = new Subscription();\n }\n this.elements.splice(index, 1);\n }\n };\n ScrollSyncService.decorators = [\n { type: Injectable },\n ];\n /** @nocollapse */\n ScrollSyncService.ctorParameters = function () { return [\n { type: NgZone }\n ]; };\n return ScrollSyncService;\n}());\n\n/**\n * @hidden\n */\nvar ResizeService = /** @class */ (function () {\n function ResizeService() {\n this.resizeSubscription = new Subscription(function () { });\n this.dispatcher = new Subject();\n // tslint:disable-next-line:member-ordering\n this.changes = this.dispatcher.asObservable().pipe(throttleTime(100));\n }\n ResizeService.prototype.connect = function (resizes) {\n this.resizeSubscription.add(resizes.subscribe(this.dispatcher));\n };\n ResizeService.prototype.destroy = function () {\n if (this.resizeSubscription) {\n this.resizeSubscription.unsubscribe();\n }\n };\n ResizeService.decorators = [\n { type: Injectable },\n ];\n return ResizeService;\n}());\n\nvar focusableRegex = /^(?:a|input|select|option|textarea|button|object)$/i;\nvar NODE_NAME_PREDICATES = {};\nvar toClassList = function (classNames) { return String(classNames).trim().split(' '); };\n/**\n * @hidden\n */\nvar hasClasses = function (element, classNames) {\n var namesList = toClassList(classNames);\n return Boolean(toClassList(element.className).find(function (className) { return namesList.indexOf(className) >= 0; }));\n};\n/**\n * @hidden\n */\nvar matchesClasses = function (classNames) {\n return function (element) { return hasClasses(element, classNames); };\n};\n/**\n * @hidden\n */\nvar matchesNodeName = function (nodeName) {\n if (!NODE_NAME_PREDICATES[nodeName]) {\n NODE_NAME_PREDICATES[nodeName] = function (element) {\n return String(element.nodeName).toLowerCase() === nodeName.toLowerCase();\n };\n }\n return NODE_NAME_PREDICATES[nodeName];\n};\n/**\n * @hidden\n */\nvar closest = function (node, predicate) {\n while (node && !predicate(node)) {\n node = node.parentNode;\n }\n return node;\n};\n/**\n * @hidden\n */\nvar closestInScope = function (node, predicate, scope) {\n while (node && node !== scope && !predicate(node)) {\n node = node.parentNode;\n }\n if (node !== scope) {\n return node;\n }\n};\n/**\n * @hidden\n */\nvar contains = function (parent, node, matchSelf) {\n if (matchSelf === void 0) { matchSelf = false; }\n var outside = !closest(node, function (child) { return child === parent; });\n if (outside) {\n return false;\n }\n var el = closest(node, function (child) { return child === node; });\n return el && (matchSelf || el !== parent);\n};\n/**\n * @hidden\n */\nvar isVisible = function (element) {\n var rect = element.getBoundingClientRect();\n var hasSize = rect.width > 0 && rect.height > 0;\n var hasPosition = rect.x !== 0 && rect.y !== 0;\n // Elements can have zero size due to styling, but they will still count as visible.\n // For example, the selection checkbox has no size, but is made visible through styling.\n return (hasSize || hasPosition) && window.getComputedStyle(element).visibility !== 'hidden';\n};\n/**\n * @hidden\n */\nvar isFocusable = function (element) {\n if (!element.tagName) {\n return false;\n }\n var tagName = element.tagName.toLowerCase();\n var hasTabIndex = Boolean(element.getAttribute('tabIndex'));\n var focusable = !element.disabled && focusableRegex.test(tagName);\n return focusable || hasTabIndex;\n};\n/**\n * @hidden\n */\nvar isFocusableWithTabKey = function (element, checkVisibility) {\n if (checkVisibility === void 0) { checkVisibility = true; }\n if (!isFocusable(element)) {\n return false;\n }\n var tabIndex = element.getAttribute('tabIndex');\n var visible = !checkVisibility || isVisible(element);\n return visible && tabIndex !== '-1';\n};\n/**\n * @hidden\n */\nvar findElement = function (node, predicate, matchSelf) {\n if (matchSelf === void 0) { matchSelf = true; }\n if (!node) {\n return;\n }\n if (matchSelf && predicate(node)) {\n return node;\n }\n node = node.firstChild;\n while (node) {\n if (node.nodeType === 1) {\n var element = findElement(node, predicate);\n if (element) {\n return element;\n }\n }\n node = node.nextSibling;\n }\n};\n/**\n * @hidden\n */\nvar findFocusable = function (element, checkVisibility) {\n if (checkVisibility === void 0) { checkVisibility = true; }\n return findElement(element, function (node) { return isFocusableWithTabKey(node, checkVisibility); });\n};\n/**\n * @hidden\n */\nvar findFocusableChild = function (element, checkVisibility) {\n if (checkVisibility === void 0) { checkVisibility = true; }\n return findElement(element, function (node) { return isFocusableWithTabKey(node, checkVisibility); }, false);\n};\n/**\n * @hidden\n */\nfunction rtlScrollPosition(position, element, initial) {\n var result = position;\n if (initial < 0) {\n result = -position;\n }\n else if (initial > 0) {\n result = element.scrollWidth - element.offsetWidth - position;\n }\n return result;\n}\n\n/**\n * @hidden\n */\nvar isLocked = function (column) { return column.parent ? isLocked(column.parent) : !!column.locked; };\n/**\n * @hidden\n */\nvar resizeArgs = function (column, extra) { return Object.assign({\n columns: leafColumns([column]),\n locked: isLocked(column)\n}, extra); }; // tslint:disable-line:align\n/**\n * @hidden\n */\nvar ColumnResizingService = /** @class */ (function () {\n function ColumnResizingService() {\n this.changes = new EventEmitter();\n this.tables = [];\n this.batch = null;\n }\n ColumnResizingService.prototype.start = function (column) {\n this.trackColumns(column);\n var columns = (this.column.isColumnGroup ? [column] : [])\n .concat(leafColumns([column]));\n this.changes.emit({\n columns: columns,\n locked: isLocked(this.column),\n type: 'start'\n });\n };\n ColumnResizingService.prototype.resizeColumns = function (deltaPercent) {\n var action = resizeArgs(this.column, {\n deltaPercent: deltaPercent,\n type: 'resizeColumn'\n });\n this.changes.emit(action);\n };\n ColumnResizingService.prototype.resizeTable = function (column, delta) {\n var action = resizeArgs(column, {\n delta: delta,\n type: 'resizeTable'\n });\n this.changes.emit(action);\n };\n ColumnResizingService.prototype.resizedColumn = function (state$$1) {\n this.resizedColumns.push(state$$1);\n };\n ColumnResizingService.prototype.end = function () {\n this.changes.emit({\n columns: [],\n resizedColumns: this.resizedColumns,\n type: 'end'\n });\n };\n ColumnResizingService.prototype.registerTable = function (tableMetadata) {\n var _this = this;\n this.tables.push(tableMetadata);\n var unregisterTable = function () {\n _this.tables.splice(_this.tables.indexOf(tableMetadata), 1);\n };\n return unregisterTable;\n };\n ColumnResizingService.prototype.measureColumns = function (info) {\n var _this = this;\n var _a;\n if (this.batch !== null) {\n (_a = this.batch).push.apply(_a, info);\n }\n else {\n this.autoFitBatch(info, function () { return _this.end(); });\n }\n };\n ColumnResizingService.prototype.autoFit = function () {\n var _this = this;\n var columns = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n columns[_i] = arguments[_i];\n }\n var nonLockedColumns = columns.filter(function (column) { return !column.isLocked; });\n this.autoFitStart(nonLockedColumns);\n this.autoFitBatch(this.batch, function () {\n if (nonLockedColumns.length < columns.length) {\n var lockedColumns = columns.filter(function (column) { return column.isLocked; });\n _this.autoFitStart(lockedColumns);\n _this.autoFitBatch(_this.batch, function () { return _this.end(); });\n }\n else {\n _this.end();\n }\n });\n };\n ColumnResizingService.prototype.trackColumns = function (column) {\n this.resizedColumns = [];\n this.column = column;\n };\n ColumnResizingService.prototype.autoFitStart = function (columns) {\n this.batch = [];\n this.resizedColumns = [];\n if (columns.length === 0) {\n return;\n }\n var locked = columns[0].isLocked;\n this.changes.emit({\n type: 'start',\n columns: columns,\n locked: locked\n });\n this.changes.emit({\n type: 'triggerAutoFit',\n columns: columns,\n locked: locked\n });\n };\n ColumnResizingService.prototype.autoFitBatch = function (info, onComplete) {\n var _this = this;\n var locked = info.length > 0 ? info[0].column.isLocked : false;\n var observables = this.tables\n .filter(function (table) { return table.locked === locked; })\n .map(function (table) { return table.autoFit(info); });\n zip.apply(void 0, observables).pipe(take(1))\n .subscribe(function (widths) {\n _this.changes.emit({\n columns: info.map(function (i) { return i.column; }),\n type: 'autoFitComplete',\n widths: widths,\n locked: locked\n });\n if (onComplete) {\n onComplete();\n }\n });\n this.batch = null;\n };\n ColumnResizingService.decorators = [\n { type: Injectable },\n ];\n return ColumnResizingService;\n}());\n\n/**\n * @hidden\n */\n\n/**\n * @hidden\n */\nvar hasFilterMenu = function (settings) {\n return typeof settings === 'string' && settings.indexOf('menu') > -1;\n};\n/**\n * @hidden\n */\nvar hasFilterRow = function (settings) {\n return settings === true || (typeof settings === 'string' && settings.indexOf('row') > -1);\n};\n\nvar contains$1 = function (node, predicate) {\n while (node) {\n if (predicate(node)) {\n return true;\n }\n node = node.parentNode;\n }\n return false;\n};\n/**\n * Arguments for the `close` event of the filter and column-menu popup.\n */\nvar PopupCloseEvent = /** @class */ (function (_super) {\n __extends(PopupCloseEvent, _super);\n function PopupCloseEvent(e) {\n var _this = _super.call(this) || this;\n _this.originalEvent = e;\n return _this;\n }\n return PopupCloseEvent;\n}(PreventableEvent));\nvar DEFAULT_POPUP_CLASS = 'k-grid-filter-popup';\n/**\n * The service that is used for the popups of the filter and column menus\n * ([see example]({% slug reusablecustomfilters_grid %}#toc-filter-menu-with-popup)).\n */\nvar SinglePopupService = /** @class */ (function () {\n function SinglePopupService(popupService, renderer, ngZone, scrollSyncService, localization) {\n var _this = this;\n this.popupService = popupService;\n this.renderer = renderer;\n this.ngZone = ngZone;\n this.localization = localization;\n /**\n * Fires when the filter or column menus are about to close because the user clicked outside their popups.\n * Used to prevent the popup from closing.\n */\n this.onClose = new Subject();\n this.scrollSubscription = scrollSyncService.changes.subscribe(function () { return _this.destroy(); });\n }\n /**\n * @hidden\n */\n SinglePopupService.prototype.open = function (anchor, template, popupRef, popupClass) {\n if (popupClass === void 0) { popupClass = DEFAULT_POPUP_CLASS; }\n var toggle = isPresent(popupRef) && this.popupRef === popupRef;\n this.destroy();\n if (!toggle) {\n var direction = this.localization.rtl ? 'right' : 'left';\n this.popupRef = this.popupService.open({\n anchorAlign: { vertical: 'bottom', horizontal: direction },\n popupAlign: { vertical: 'top', horizontal: direction },\n anchor: anchor,\n popupClass: popupClass,\n content: template,\n positionMode: \"absolute\"\n });\n this.renderer.setAttribute(this.popupRef.popupElement, 'dir', this.localization.rtl ? 'rtl' : 'ltr');\n this.attachClose(anchor);\n }\n return this.popupRef;\n };\n /**\n * @hidden\n */\n SinglePopupService.prototype.destroy = function () {\n if (this.popupRef) {\n this.detachClose();\n this.popupRef.close();\n this.popupRef = null;\n }\n };\n SinglePopupService.prototype.ngOnDestroy = function () {\n this.destroy();\n this.scrollSubscription.unsubscribe();\n };\n SinglePopupService.prototype.detachClose = function () {\n if (this.removeClick) {\n this.removeClick();\n }\n };\n SinglePopupService.prototype.attachClose = function (skipElement) {\n var _this = this;\n this.detachClose();\n this.ngZone.runOutsideAngular(function () {\n return _this.removeClick = _this.renderer.listen(\"document\", \"click\", function (e) {\n if (!contains$1(e.target, function (x) { return _this.popupRef.popupElement === x || x === skipElement; })) {\n var args = new PopupCloseEvent(e);\n _this.onClose.next(args);\n if (!args.isDefaultPrevented()) {\n _this.destroy();\n }\n }\n });\n });\n };\n SinglePopupService.decorators = [\n { type: Injectable },\n ];\n /** @nocollapse */\n SinglePopupService.ctorParameters = function () { return [\n { type: PopupService },\n { type: Renderer2 },\n { type: NgZone },\n { type: ScrollSyncService },\n { type: LocalizationService }\n ]; };\n return SinglePopupService;\n}());\n\n/* tslint:disable: no-bitwise */\n/**\n * @hidden\n */\nvar append = function (element) {\n var appended = false;\n return function () {\n if (!appended) {\n document.body.appendChild(element);\n appended = true;\n }\n return element;\n };\n};\n/**\n * @hidden\n */\nvar getDocument = function (element) { return element.ownerDocument.documentElement; };\n/**\n * @hidden\n */\nvar getWindow = function (element) { return element.ownerDocument.defaultView; };\n/**\n * @hidden\n */\nvar offset = function (element) {\n var _a = getDocument(element), clientTop = _a.clientTop, clientLeft = _a.clientLeft;\n var _b = getWindow(element), pageYOffset = _b.pageYOffset, pageXOffset = _b.pageXOffset;\n var _c = element.getBoundingClientRect(), top = _c.top, left = _c.left;\n return {\n top: top + pageYOffset - clientTop,\n left: left + pageXOffset - clientLeft\n };\n};\n/**\n * @hidden\n * If the target is before the draggable element, returns `true`.\n *\n * DOCUMENT_POSITION_FOLLOWING = 4\n */\nvar isTargetBefore = function (draggable, target) {\n return (target.compareDocumentPosition(draggable) & 4) !== 0;\n};\n/**\n * @hidden\n * If the container and the element are the same\n * or if the container holds (contains) the element, returns `true`.\n *\n * DOCUMENT_POSITION_CONTAINED_BY = 16\n */\nvar contains$2 = function (element, container) {\n return element === container ||\n (container.compareDocumentPosition(element) & 16) !== 0;\n};\n/**\n * @hidden\n */\nvar position = function (target, before) {\n var targetRect = offset(target);\n var offsetWidth = target.offsetWidth, offsetHeight = target.offsetHeight;\n var left = targetRect.left + (before ? 0 : offsetWidth);\n var top = targetRect.top;\n var height = offsetHeight;\n return { left: left, top: top, height: height };\n};\n\n/**\n * @hidden\n */\nvar DragAndDropService = /** @class */ (function () {\n function DragAndDropService() {\n this.changes = new EventEmitter();\n this.register = [];\n this.lastTarget = null;\n }\n DragAndDropService.prototype.add = function (target) {\n this.register.push(target);\n };\n DragAndDropService.prototype.remove = function (target) {\n this.register = this.register.filter(function (current) { return current !== target; });\n };\n DragAndDropService.prototype.notifyDrag = function (draggable, element, mouseEvent) {\n var target = this.targetFor(element);\n if (this.lastTarget === target) {\n return;\n }\n this.changes.next({\n draggable: draggable,\n mouseEvent: mouseEvent,\n target: this.lastTarget,\n type: 'leave'\n });\n if (target) {\n this.changes.next({\n draggable: draggable,\n mouseEvent: mouseEvent,\n target: target,\n type: 'enter'\n });\n }\n this.lastTarget = target;\n };\n DragAndDropService.prototype.notifyDrop = function (draggable, mouseEvent) {\n this.changes.next({\n draggable: draggable,\n mouseEvent: mouseEvent,\n target: this.lastTarget,\n type: 'drop'\n });\n this.lastTarget = null;\n };\n DragAndDropService.prototype.targetFor = function (element) {\n var comparer = contains$2.bind(null, element);\n return this.register.find(function (_a) {\n var nativeElement = _a.element.nativeElement;\n return comparer(nativeElement);\n });\n };\n DragAndDropService.decorators = [\n { type: Injectable },\n ];\n return DragAndDropService;\n}());\n\nvar updateClass = function (element, valid) {\n var icon = element.querySelector('.k-icon');\n icon.className = icon.className\n .replace(/(plus|cancel)/, valid ? 'plus' : 'cancel');\n};\nvar updateLock = function (element, locked) {\n if (locked === void 0) { locked = null; }\n var icon = element.querySelectorAll('.k-icon')[1];\n var value = locked == null ? '' : (locked ? 'k-i-lock' : 'k-i-unlock');\n icon.className = icon.className\n .replace(/(k-i-unlock|k-i-lock)/, '') + (\" \" + value);\n};\nvar decorate = function (element, target) {\n var targetStyles = getComputedStyle(target);\n element.className = 'k-header k-drag-clue';\n element.style.position = 'absolute';\n element.style.zIndex = '20000';\n element.style.paddingLeft = targetStyles.paddingLeft;\n element.style.paddingTop = targetStyles.paddingTop;\n element.style.paddingBottom = targetStyles.paddingBottom;\n element.style.paddingRight = targetStyles.paddingRight;\n element.style.width = targetStyles.width;\n element.style.height = targetStyles.height;\n};\n/**\n * @hidden\n */\nvar DragHintService = /** @class */ (function () {\n function DragHintService(santizer) {\n this.santizer = santizer;\n }\n DragHintService.prototype.create = function (down, target, title) {\n this.initCoords(down);\n this.dom = document.createElement(\"div\");\n decorate(this.dom, target);\n var safeTitle = this.santizer.sanitize(SecurityContext.HTML, title);\n this.dom.innerHTML = \"\\n \\n \\n \\n \" + safeTitle + \"\\n \";\n };\n DragHintService.prototype.attach = function () {\n return append(this.dom);\n };\n DragHintService.prototype.remove = function () {\n if (this.dom && this.dom.parentNode) {\n (function (el) {\n setTimeout(function () { return document.body.removeChild(el); });\n })(this.dom); // hack for IE + pointer events!\n this.dom = null;\n }\n };\n DragHintService.prototype.show = function () {\n this.dom.style.display = \"\";\n };\n DragHintService.prototype.hide = function () {\n this.dom.style.display = \"none\";\n };\n DragHintService.prototype.enable = function () {\n updateClass(this.dom, true);\n };\n DragHintService.prototype.disable = function () {\n updateClass(this.dom, false);\n };\n DragHintService.prototype.removeLock = function () {\n updateLock(this.dom);\n };\n DragHintService.prototype.toggleLock = function (locked) {\n updateLock(this.dom, locked);\n };\n DragHintService.prototype.move = function (move) {\n this.dom.style.top = this.initialTop + move.pageY + 'px';\n this.dom.style.left = this.initialLeft + move.pageX + 'px';\n };\n DragHintService.prototype.initCoords = function (down) {\n var _a = offset(down.originalEvent.target), top = _a.top, left = _a.left;\n this.initialTop = top - down.pageY;\n this.initialLeft = left - down.pageX;\n };\n DragHintService.decorators = [\n { type: Injectable },\n ];\n /** @nocollapse */\n DragHintService.ctorParameters = function () { return [\n { type: DomSanitizer }\n ]; };\n return DragHintService;\n}());\n\n/**\n * @hidden\n */\nvar DropCueService = /** @class */ (function () {\n function DropCueService() {\n }\n DropCueService.prototype.create = function () {\n this.dom = document.createElement(\"div\");\n this.dom.className = 'k-grouping-dropclue';\n this.hide();\n };\n DropCueService.prototype.attach = function () {\n return append(this.dom);\n };\n DropCueService.prototype.remove = function () {\n if (this.dom && this.dom.parentElement) {\n document.body.removeChild(this.dom);\n this.dom = null;\n }\n };\n DropCueService.prototype.hide = function () {\n this.dom.style.display = \"none\";\n };\n DropCueService.prototype.position = function (_a) {\n var left = _a.left, top = _a.top, height = _a.height;\n this.dom.style.display = 'block';\n this.dom.style.height = height + 'px';\n this.dom.style.top = top + 'px';\n var width = this.dom.offsetWidth / 2;\n this.dom.style.left = left - width + 'px';\n };\n DropCueService.decorators = [\n { type: Injectable },\n ];\n return DropCueService;\n}());\n\n/**\n * @hidden\n */\nvar ColumnReorderService = /** @class */ (function () {\n function ColumnReorderService() {\n this.changes = new EventEmitter();\n }\n ColumnReorderService.prototype.reorder = function (e) {\n this.changes.emit(e);\n };\n ColumnReorderService.decorators = [\n { type: Injectable },\n ];\n return ColumnReorderService;\n}());\n\n/**\n * Arguments for the `columnReorder` event.\n */\nvar ColumnReorderEvent = /** @class */ (function (_super) {\n __extends(ColumnReorderEvent, _super);\n /**\n * @hidden\n */\n function ColumnReorderEvent(_a) {\n var column = _a.column, newIndex = _a.newIndex, oldIndex = _a.oldIndex;\n var _this = _super.call(this) || this;\n _this.column = column;\n _this.newIndex = newIndex;\n _this.oldIndex = oldIndex;\n return _this;\n }\n return ColumnReorderEvent;\n}(PreventableEvent));\n\n/**\n * @hidden\n */\nvar FocusRoot = /** @class */ (function () {\n function FocusRoot() {\n this.groups = new Set();\n }\n FocusRoot.prototype.registerGroup = function (group) {\n if (this.alive) {\n this.groups.add(group);\n }\n };\n FocusRoot.prototype.unregisterGroup = function (group) {\n if (this.alive) {\n this.groups.delete(group);\n }\n };\n FocusRoot.prototype.activate = function () {\n if (this.alive) {\n this.groups.forEach(function (f) { return f.activate(); });\n }\n };\n FocusRoot.prototype.deactivate = function () {\n if (this.alive) {\n this.groups.forEach(function (f) { return f.deactivate(); });\n }\n };\n FocusRoot.decorators = [\n { type: Injectable },\n ];\n return FocusRoot;\n}());\n\nvar isButton = matchesNodeName('button');\nvar isInputTag = matchesNodeName('input');\nvar navigableRegex = /(button|checkbox|color|file|radio|reset|submit)/i;\nvar isNavigableInput = function (element) { return isInputTag(element) && navigableRegex.test(element.type); };\nvar isNavigable = function (element) { return !element.disabled && (isButton(element) || isNavigableInput(element)); };\n/**\n * @hidden\n */\nvar DefaultFocusableElement = /** @class */ (function () {\n function DefaultFocusableElement(host, renderer) {\n this.renderer = renderer;\n this.element = host.nativeElement;\n this.focusable = findFocusable(this.element, false) || this.element;\n }\n Object.defineProperty(DefaultFocusableElement.prototype, \"enabled\", {\n get: function () {\n return this.focusable && !this.focusable.disabled;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DefaultFocusableElement.prototype, \"visible\", {\n get: function () {\n return this.focusable && isVisible(this.focusable);\n },\n enumerable: true,\n configurable: true\n });\n DefaultFocusableElement.prototype.isNavigable = function () {\n return this.canFocus() && isNavigable(this.element);\n };\n DefaultFocusableElement.prototype.toggle = function (active) {\n this.renderer.setAttribute(this.focusable, 'tabIndex', active ? '0' : '-1');\n };\n DefaultFocusableElement.prototype.focus = function () {\n if (this.focusable) {\n this.focusable.focus();\n }\n };\n DefaultFocusableElement.prototype.canFocus = function () {\n return this.visible && this.enabled;\n };\n DefaultFocusableElement.prototype.hasFocus = function () {\n var _this = this;\n return document.activeElement !== this.element && closest(document.activeElement, function (e) { return e === _this.element; });\n };\n return DefaultFocusableElement;\n}());\n\n/**\n * A directive that controls the way focusable elements receive\n * [focus in a navigable Grid]({% slug keyboard_navigation_grid %}).\n *\n * @example\n * ```ts-preview\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * `\n * })\n *\n * class AppComponent {\n * public readonly data: any = [{\n * \"ProductID\": 1,\n * \"ProductName\": \"Chai\",\n * \"UnitPrice\": 18.0000,\n * \"Discontinued\": true\n * }, {\n * \"ProductID\": 2,\n * \"ProductName\": \"Chang\",\n * \"UnitPrice\": 19.0000,\n * \"Discontinued\": false\n * }];\n * }\n * ```\n */\nvar FocusableDirective = /** @class */ (function () {\n function FocusableDirective(cellContext, hostElement, renderer) {\n this.cellContext = cellContext;\n this.hostElement = hostElement;\n this.renderer = renderer;\n this.active = true;\n if (this.cellContext) {\n this.group = this.cellContext.focusGroup;\n }\n if (this.group) {\n this.group.registerElement(this);\n }\n }\n FocusableDirective.prototype.ngAfterViewInit = function () {\n if (!this.element) {\n this.element = new DefaultFocusableElement(this.hostElement, this.renderer);\n }\n if (this.group) {\n var isActive = this.group.isActive;\n this.toggle(isActive);\n }\n };\n FocusableDirective.prototype.ngOnDestroy = function () {\n if (this.group) {\n this.group.unregisterElement(this);\n }\n };\n /**\n * @hidden\n */\n FocusableDirective.prototype.toggle = function (active) {\n if (this.element && active !== this.active) {\n this.active = active;\n this.element.toggle(active);\n }\n };\n /**\n * @hidden\n */\n FocusableDirective.prototype.canFocus = function () {\n return this.element && this.element.canFocus();\n };\n /**\n * @hidden\n */\n FocusableDirective.prototype.isNavigable = function () {\n return this.element && this.element.isNavigable();\n };\n /**\n * @hidden\n */\n FocusableDirective.prototype.focus = function () {\n if (this.element) {\n this.element.focus();\n }\n };\n /**\n * @hidden\n */\n FocusableDirective.prototype.hasFocus = function () {\n return this.element && this.element.hasFocus();\n };\n /**\n * @hidden\n */\n FocusableDirective.prototype.registerElement = function (element) {\n this.element = element;\n };\n FocusableDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoGridFocusable]' + \",\\n [kendoGridEditCommand],\\n [kendoGridRemoveCommand],\\n [kendoGridSaveCommand],\\n [kendoGridCancelCommand],\\n [kendoGridSelectionCheckbox]\\n \"\n },] },\n ];\n /** @nocollapse */\n FocusableDirective.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [CELL_CONTEXT,] }, { type: SkipSelf }] },\n { type: ElementRef },\n { type: Renderer2 }\n ]; };\n return FocusableDirective;\n}());\n\n/**\n * @hidden\n */\nvar GridFocusableElement = /** @class */ (function () {\n function GridFocusableElement(navigationService) {\n this.navigationService = navigationService;\n }\n GridFocusableElement.prototype.focus = function () {\n this.navigationService.focusCell();\n };\n GridFocusableElement.prototype.toggle = function (active) {\n this.navigationService.toggle(active);\n };\n GridFocusableElement.prototype.canFocus = function () {\n return true;\n };\n GridFocusableElement.prototype.hasFocus = function () {\n return this.navigationService.hasFocus();\n };\n GridFocusableElement.prototype.isNavigable = function () {\n return false;\n };\n return GridFocusableElement;\n}());\n\n/**\n * @hidden\n */\nvar NavigationCursor = /** @class */ (function () {\n function NavigationCursor(model) {\n this.model = model;\n this.changes = new Subject();\n this.activeRow = 0;\n this.activeCol = 0;\n this.virtualCol = 0;\n this.virtualRow = 0;\n }\n Object.defineProperty(NavigationCursor.prototype, \"row\", {\n get: function () {\n return this.model.findRow(this.activeRow);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NavigationCursor.prototype, \"cell\", {\n get: function () {\n var row = this.row;\n if (row) {\n return this.model.findCell(this.activeCol, row);\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NavigationCursor.prototype, \"dataRowIndex\", {\n get: function () {\n var row = this.row;\n if (row) {\n return row.dataRowIndex;\n }\n return -1;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Assumes and announces a new cursor position.\n */\n NavigationCursor.prototype.reset = function (rowIndex, colIndex, force) {\n if (rowIndex === void 0) { rowIndex = this.activeRow; }\n if (colIndex === void 0) { colIndex = this.activeCol; }\n if (force === void 0) { force = true; }\n if (this.activate(rowIndex, colIndex, force)) {\n this.virtualRow = rowIndex;\n this.virtualCol = colIndex;\n }\n };\n NavigationCursor.prototype.activate = function (rowIndex, colIndex, force) {\n if (!force && this.isActiveRange(rowIndex, colIndex)) {\n return false;\n }\n var prevColIndex = this.activeCol;\n var prevRowIndex = this.activeRow;\n this.activeCol = colIndex;\n this.activeRow = rowIndex;\n this.changes.next({\n colIndex: colIndex,\n prevColIndex: prevColIndex,\n prevRowIndex: prevRowIndex,\n rowIndex: rowIndex\n });\n return true;\n };\n NavigationCursor.prototype.isActiveRange = function (rowIndex, colIndex) {\n if (this.activeRow !== rowIndex) {\n return false;\n }\n var cell = this.cell;\n var _a = this.model.cellRange(cell), start = _a.start, end = _a.end;\n return !Boolean(cell) || (start <= colIndex && colIndex <= end);\n };\n /**\n * Assumes a new cursor position without announcing it.\n */\n NavigationCursor.prototype.assume = function (rowIndex, colIndex) {\n if (rowIndex === void 0) { rowIndex = this.activeRow; }\n if (colIndex === void 0) { colIndex = this.activeCol; }\n this.virtualRow = rowIndex;\n this.virtualCol = colIndex;\n this.activeCol = colIndex;\n this.activeRow = rowIndex;\n };\n /**\n * Announces a current cursor position to subscribers.\n */\n NavigationCursor.prototype.announce = function () {\n this.changes.next({\n colIndex: this.activeCol,\n prevColIndex: this.activeCol,\n prevRowIndex: this.activeRow,\n rowIndex: this.activeRow\n });\n };\n NavigationCursor.prototype.activateVirtualCell = function (cell) {\n var rowRange = this.model.rowRange(cell);\n var cellRange = this.model.cellRange(cell);\n var activeCol = this.activeCol;\n var activeRow = this.activeRow;\n if (rowRange.start <= activeRow && activeRow <= rowRange.end &&\n cellRange.start <= activeCol && activeCol <= cellRange.end) {\n this.activeRow = cell.rowIndex;\n this.activeCol = cell.colIndex;\n return true;\n }\n };\n NavigationCursor.prototype.isActive = function (rowIndex, colIndex) {\n return this.activeCol === colIndex && this.activeRow === rowIndex;\n };\n NavigationCursor.prototype.moveUp = function (offset) {\n if (offset === void 0) { offset = 1; }\n return this.offsetRow(-offset);\n };\n NavigationCursor.prototype.moveDown = function (offset) {\n if (offset === void 0) { offset = 1; }\n return this.offsetRow(offset);\n };\n NavigationCursor.prototype.moveLeft = function (offset) {\n if (offset === void 0) { offset = 1; }\n return this.offsetCol(-offset);\n };\n NavigationCursor.prototype.moveRight = function (offset) {\n if (offset === void 0) { offset = 1; }\n return this.offsetCol(offset);\n };\n NavigationCursor.prototype.lastCellIndex = function (row) {\n return this.metadata.columns.leafColumnsToRender.length - 1 +\n (this.metadata.hasDetailTemplate && (!row || !row.groupItem) ? 1 : 0);\n };\n NavigationCursor.prototype.offsetCol = function (offset) {\n var prevRow = this.model.findRow(this.virtualRow);\n var lastIndex = this.lastCellIndex(prevRow);\n var virtualCol = this.virtualCol;\n this.virtualCol = Math.max(0, Math.min(virtualCol + offset, lastIndex));\n var nextColIndex = this.virtualCol;\n var nextRowIndex = this.virtualRow;\n var cell = this.model.findCell(this.virtualCol, prevRow);\n if (!cell && this.metadata.virtualColumns) {\n return this.activate(nextRowIndex, nextColIndex);\n }\n if (cell.colSpan > 1 && cell.colIndex <= virtualCol && virtualCol < cell.colIndex + cell.colSpan) {\n nextColIndex = offset > 0 ? Math.min(cell.colIndex + cell.colSpan, lastIndex) : Math.max(0, cell.colIndex + offset);\n var nextCell = this.model.findCell(nextColIndex, prevRow);\n if (cell !== nextCell) {\n cell = nextCell;\n this.virtualCol = cell.colIndex;\n }\n else {\n this.virtualCol = virtualCol;\n }\n }\n return this.activate(cell.rowIndex, cell.colIndex);\n };\n NavigationCursor.prototype.offsetRow = function (offset) {\n var nextColIndex = this.virtualCol;\n if (this.metadata && this.metadata.isVirtual) {\n var maxIndex = this.metadata.maxLogicalRowIndex;\n var nextIndex = Math.max(0, Math.min(this.activeRow + offset, maxIndex));\n if (this.metadata.hasDetailTemplate && !this.model.findRow(nextIndex)) {\n nextIndex = offset > 0 ? nextIndex + 1 : nextIndex - 1;\n nextIndex = Math.max(0, Math.min(nextIndex, maxIndex));\n }\n if (this.metadata.hasDetailTemplate && nextIndex === maxIndex) {\n if (this.model.lastRow.index !== maxIndex) {\n // Don't attempt to navigate past the last collapsed row.\n nextIndex--;\n }\n }\n var nextRow_1 = this.model.findRow(nextIndex);\n if (nextRow_1) {\n // remove duplication\n var cell_1 = this.model.findCell(this.virtualCol, nextRow_1);\n if (cell_1.rowIndex <= this.virtualRow && offset > 0 && cell_1.rowSpan > 1) {\n cell_1 = this.model.findCell(this.virtualCol, this.model.findRow(cell_1.rowIndex + cell_1.rowSpan - 1 + offset));\n }\n nextIndex = cell_1.rowIndex;\n nextColIndex = cell_1.colIndex;\n }\n this.virtualRow = nextIndex;\n return this.activate(nextIndex, nextColIndex);\n }\n var nextRow = this.model.findRow(this.virtualRow + offset) || this.model.nextRow(this.virtualRow, offset);\n if (!nextRow) {\n return false;\n }\n var cell = this.model.findCell(this.virtualCol, nextRow);\n if (cell && cell.rowIndex <= this.virtualRow && offset > 0 && cell.rowSpan > 1) { // spanned cell go to next\n var nextPos = cell.rowIndex + cell.rowSpan - 1 + offset;\n cell = this.model.findCell(this.virtualCol, this.model.findRow(nextPos));\n }\n if (!cell && this.metadata.virtualColumns) {\n return this.activate(this.virtualRow + offset, this.virtualCol);\n }\n this.virtualRow = cell.rowIndex;\n return this.activate(this.virtualRow, cell.colIndex);\n };\n return NavigationCursor;\n}());\n\n/**\n * @hidden\n */\nvar ItemMap = /** @class */ (function () {\n function ItemMap() {\n this.count = 0;\n this.items = {};\n }\n Object.defineProperty(ItemMap.prototype, \"first\", {\n get: function () {\n if (this.count > 0) {\n var result_1;\n this.forEach(function (item) {\n result_1 = item;\n return true;\n });\n return result_1;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ItemMap.prototype, \"last\", {\n get: function () {\n if (this.count > 0) {\n var keys = Object.keys(this.items);\n return this.items[keys[keys.length - 1]];\n }\n },\n enumerable: true,\n configurable: true\n });\n ItemMap.prototype.removeItem = function (key) {\n if (this.items[key]) {\n delete this.items[key];\n this.count--;\n }\n };\n ItemMap.prototype.setItem = function (key, item) {\n if (!this.items[key]) {\n this.count++;\n }\n this.items[key] = item;\n };\n ItemMap.prototype.getItem = function (key) {\n return this.items[key];\n };\n ItemMap.prototype.toArray = function () {\n var result = [];\n this.forEach(function (item) {\n result.push(item);\n });\n return result;\n };\n ItemMap.prototype.forEach = function (callback) {\n for (var key in this.items) {\n if (this.items.hasOwnProperty(key) && callback(this.items[key])) {\n return this.items[key];\n }\n }\n };\n ItemMap.prototype.find = function (callback) {\n return this.forEach(callback);\n };\n return ItemMap;\n}());\n\n/**\n * @hidden\n *\n * Contains information for the currently rendered rows and cells.\n */\nvar NavigationModel = /** @class */ (function () {\n function NavigationModel() {\n this.rows = new ItemMap();\n }\n Object.defineProperty(NavigationModel.prototype, \"firstRow\", {\n get: function () {\n return this.rows.first;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NavigationModel.prototype, \"lastRow\", {\n get: function () {\n return this.rows.last;\n },\n enumerable: true,\n configurable: true\n });\n NavigationModel.prototype.registerCell = function (cell) {\n var row = this.rows.getItem(cell.logicalRowIndex);\n if (!row) {\n return;\n }\n var colIndex = cell.logicalColIndex;\n var modelCell = {\n uid: cell.uid,\n colIndex: colIndex,\n rowIndex: row.index,\n colSpan: cell.colSpan,\n rowSpan: cell.rowSpan,\n detailExpandCell: cell.detailExpandCell,\n dataItem: row.dataItem,\n dataRowIndex: row.dataRowIndex,\n focusGroup: cell.focusGroup\n };\n row.cells.setItem(colIndex, modelCell);\n if (cell.groupItem) {\n row.groupItem = cell.groupItem;\n }\n return modelCell;\n };\n NavigationModel.prototype.unregisterCell = function (index, rowIndex, cell) {\n var row = this.rows.getItem(rowIndex);\n if (row) {\n var match = row.cells.getItem(index);\n if (match && match.uid === cell.uid) {\n row.cells.removeItem(index);\n }\n }\n };\n NavigationModel.prototype.registerRow = function (row) {\n var modelRow = {\n uid: row.uid,\n index: row.logicalRowIndex,\n dataItem: row.dataItem,\n dataRowIndex: row.dataRowIndex,\n cells: new ItemMap()\n };\n this.rows.setItem(row.logicalRowIndex, modelRow);\n };\n NavigationModel.prototype.updateRow = function (row) {\n var current = this.rows.getItem(row.logicalRowIndex);\n if (current) {\n Object.assign(current, {\n dataItem: row.dataItem,\n dataRowIndex: row.dataRowIndex\n });\n }\n };\n NavigationModel.prototype.unregisterRow = function (index, row) {\n var match = this.rows.getItem(index);\n if (match && match.uid === row.uid) {\n this.rows.removeItem(index);\n }\n };\n NavigationModel.prototype.cellRange = function (cell) {\n if (cell) {\n var start = cell.colIndex;\n var end = cell.colIndex + (cell.colSpan || 1) - 1;\n return {\n start: start,\n end: end\n };\n }\n return {};\n };\n NavigationModel.prototype.rowRange = function (cell) {\n if (cell) {\n var start = cell.rowIndex;\n var end = cell.rowIndex + (cell.rowSpan || 1) - 1;\n return {\n start: start,\n end: end\n };\n }\n return {};\n };\n NavigationModel.prototype.nextRow = function (rowIndex, offset) {\n var rows = this.rows.toArray();\n var row = this.rows.getItem(rowIndex);\n var position = rows.indexOf(row);\n var next = rows[position + offset];\n return next;\n };\n NavigationModel.prototype.findRow = function (index) {\n return this.rows.getItem(index);\n };\n NavigationModel.prototype.findCell = function (index, row) {\n if (!row) {\n return;\n }\n var rowIndex = row.index;\n var cell = row.cells.getItem(index);\n var currentIndex = rowIndex;\n while (!cell && row) {\n row = this.rows.getItem(currentIndex);\n cell = this.rowCell(index, row);\n currentIndex--;\n }\n if (cell && rowIndex <= row.index + (cell.rowSpan || 1) - 1) {\n return cell;\n }\n };\n NavigationModel.prototype.rowCell = function (index, row) {\n if (!row || !row.cells.count) {\n return;\n }\n var firstCell = row.cells.first;\n var cell, currentIndex = index;\n while (!cell && currentIndex >= firstCell.colIndex) {\n cell = row.cells.getItem(currentIndex);\n currentIndex--;\n }\n if (cell && index <= cell.colIndex + (cell.colSpan || 1) - 1) {\n return cell;\n }\n };\n return NavigationModel;\n}());\n\n/**\n * @hidden\n */\nvar ScrollRequestService = /** @class */ (function () {\n function ScrollRequestService() {\n this.requests = new Subject();\n }\n ScrollRequestService.prototype.scrollTo = function (request) {\n this.requests.next(request);\n };\n ScrollRequestService.decorators = [\n { type: Injectable },\n ];\n return ScrollRequestService;\n}());\n\nvar isInSameGrid = function (element, gridElement) {\n return closest(element, matchesNodeName('kendo-grid')) === gridElement;\n};\nvar matchHeaderCell = matchesNodeName('th');\nvar matchDataCell = matchesNodeName('td');\nvar matchCell = function (element) { return matchDataCell(element) || matchHeaderCell(element); };\nvar gridCell = function (element, gridElement) {\n var target = closest(element, matchCell);\n while (target && !isInSameGrid(target, gridElement)) {\n target = closest(target.parentElement, matchCell);\n }\n return target;\n};\nvar targetCell = function (target, gridElement) {\n var cell = gridCell(target, gridElement);\n var row = closest(cell, matchesNodeName('tr'));\n if (cell && row) {\n var rowIndex = row.getAttribute('aria-rowindex');\n rowIndex = rowIndex ? parseInt(rowIndex, 10) - 1 : null;\n var colIndex = cell.getAttribute('aria-colindex');\n colIndex = colIndex ? parseInt(colIndex, 10) - 1 : null;\n if (rowIndex !== null && colIndex !== null) {\n return { colIndex: colIndex, rowIndex: rowIndex, element: cell };\n }\n }\n};\nvar isArrowKey = function (keyCode) {\n return keyCode === Keys.ArrowLeft || keyCode === Keys.ArrowRight ||\n keyCode === Keys.ArrowUp || keyCode === Keys.ArrowDown;\n};\nvar isNavigationKey = function (keyCode) {\n return isArrowKey(keyCode) ||\n keyCode === Keys.PageUp || keyCode === Keys.PageDown ||\n keyCode === Keys.Home || keyCode === Keys.End;\n};\nvar isInput = matchesNodeName('input');\nvar isTextInput = function (element) {\n return element && isInput(element) && element.type.toLowerCase() === 'text';\n};\nvar isPrintableCharacter = function (str) {\n return str.length === 1 && str.match(/\\S/);\n};\n/**\n * @hidden\n */\nvar NavigationViewport = /** @class */ (function () {\n function NavigationViewport(firstItemIndex, lastItemIndex) {\n this.firstItemIndex = firstItemIndex;\n this.lastItemIndex = lastItemIndex;\n }\n NavigationViewport.prototype.containsRow = function (dataRowIndex) {\n var headerRow = dataRowIndex < 0;\n return headerRow || (dataRowIndex >= this.firstItemIndex && dataRowIndex <= this.lastItemIndex);\n };\n NavigationViewport.prototype.intersects = function (start, end) {\n return (start <= this.firstItemIndex && this.lastItemIndex <= end) ||\n (this.firstItemIndex <= start && start <= this.lastItemIndex) ||\n (this.firstItemIndex <= end && end <= this.lastItemIndex);\n };\n return NavigationViewport;\n}());\n/**\n * @hidden\n */\nvar NavigationService = /** @class */ (function () {\n function NavigationService(zone, domEvents, pagerContextService, scrollRequestService, groupsService, detailsService, focusRoot, editService, cd, localization, focusableParent) {\n this.zone = zone;\n this.domEvents = domEvents;\n this.pagerContextService = pagerContextService;\n this.scrollRequestService = scrollRequestService;\n this.groupsService = groupsService;\n this.detailsService = detailsService;\n this.focusRoot = focusRoot;\n this.editService = editService;\n this.cd = cd;\n this.localization = localization;\n this.focusableParent = focusableParent;\n this.cellKeydown = new EventEmitter();\n this.activeRowIndex = 0;\n this.alive = false;\n this.active = true;\n this.mode = 0 /* Standby */;\n this.model = new NavigationModel();\n this.cursor = new NavigationCursor(this.model);\n this.changes = this.cursor.changes;\n }\n Object.defineProperty(NavigationService.prototype, \"metadata\", {\n get: function () {\n return this.meta;\n },\n set: function (value) {\n this.meta = value;\n this.cursor.metadata = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NavigationService.prototype, \"enabled\", {\n get: function () {\n return this.alive;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NavigationService.prototype, \"activeCell\", {\n get: function () {\n if (this.mode !== 0 /* Standby */) {\n return this.cursor.cell;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NavigationService.prototype, \"activeRow\", {\n get: function () {\n if (this.mode !== 0 /* Standby */) {\n return Object.assign({}, this.cursor.row, {\n cells: this.cursor.row.cells.toArray()\n });\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NavigationService.prototype, \"activeDataRow\", {\n get: function () {\n return Math.max(0, this.activeRowIndex - this.meta.headerRows);\n },\n enumerable: true,\n configurable: true\n });\n NavigationService.prototype.init = function (meta) {\n var _this = this;\n this.alive = true;\n this.focusRoot.alive = true;\n this.metadata = meta;\n var onStableSubscriber = function () {\n var operators$$1 = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operators$$1[_i] = arguments[_i];\n }\n return function (args) {\n var _a;\n return _this.zone.isStable ?\n from([true]).pipe(map(function () { return args; })) : (_a = _this.zone.onStable).pipe.apply(_a, [take(1), map(function () { return args; })].concat(operators$$1));\n };\n };\n var onStable = onStableSubscriber();\n this.subs = new Subscription();\n this.subs.add(this.cursor.changes\n .subscribe(function (args) { return _this.onCursorChanges(args); }));\n this.subs.add(this.domEvents.focus.pipe(switchMap(onStable))\n .subscribe(function (args) { return _this.navigateTo(args.target); }));\n this.subs.add(this.domEvents.focusOut.pipe(filter(function () { return _this.mode !== 0 /* Standby */; }), switchMap(onStableSubscriber(takeUntil(this.domEvents.focus))))\n .subscribe(function (args) { return _this.onFocusOut(args); }));\n this.subs.add(this.domEvents.windowBlur.pipe(filter(function () { return _this.mode !== 0 /* Standby */; }))\n .subscribe(function () { return _this.onWindowBlur(); }));\n this.subs.add(\n // Closing the editor will not always trigger focusout in Firefox.\n // To get around this, we ensure that the cell is closed after editing.\n this.editService.changes.pipe(filter(function (e) { return e.action !== 'edit' && _this.mode === 2 /* Content */; }), filter(function (e) { return e.action === 'cellClose' && !e.prevented; }), switchMap(onStable))\n .subscribe(function () { return _this.leaveCell(); }));\n this.subs.add(this.pagerContextService.pageChange\n .subscribe(function () { return _this.cursor.reset(0, 0); }));\n this.subs.add(this.domEvents.keydown\n .subscribe(function (args) { return _this.onKeydown(args); }));\n this.subs.add(this.domEvents.keydown.pipe(filter(function (args) {\n return args.keyCode === Keys.Tab && _this.mode === 2 /* Content */;\n }), switchMapTo(this.domEvents.focusOut.pipe(takeUntil(\n // Timeout if focusOut doesn't fire very soon\n interval(0).pipe(take(1))))))\n .subscribe(function () { return _this.onTabout(); }));\n if (this.focusableParent) {\n var element = new GridFocusableElement(this);\n this.focusableParent.registerElement(element);\n }\n this.deactivateElements();\n };\n NavigationService.prototype.ngOnDestroy = function () {\n if (this.subs) {\n this.subs.unsubscribe();\n }\n this.alive = false;\n };\n NavigationService.prototype.registerCell = function (cell) {\n if (cell.logicalRowIndex !== this.pendingRowIndex) {\n var modelCell = this.model.registerCell(cell);\n if (this.virtualCell && this.cursor.activateVirtualCell(modelCell)) {\n this.virtualCell = false;\n }\n }\n };\n NavigationService.prototype.registerCellOnCurrentRow = function (cell) {\n if (cell.logicalRowIndex === this.pendingRowIndex) {\n this.model.registerCell(cell);\n }\n };\n NavigationService.prototype.unregisterCell = function (index, rowIndex, cell) {\n this.model.unregisterCell(index, rowIndex, cell);\n };\n NavigationService.prototype.registerRow = function (row) {\n this.model.registerRow(row);\n this.pendingRowIndex = row.logicalRowIndex;\n };\n NavigationService.prototype.updateRow = function (row) {\n this.model.updateRow(row);\n };\n NavigationService.prototype.unregisterRow = function (index, row) {\n this.model.unregisterRow(index, row);\n };\n NavigationService.prototype.isCellFocusable = function (cell) {\n return this.alive &&\n this.active &&\n this.mode !== 2 /* Content */ &&\n this.cursor.isActive(cell.logicalRowIndex, cell.logicalColIndex);\n };\n NavigationService.prototype.isCellFocused = function (cell) {\n return this.mode === 1 /* Cursor */ && this.isCellFocusable(cell);\n };\n NavigationService.prototype.navigateTo = function (el) {\n if (!this.alive) {\n return;\n }\n var cell = targetCell(el, this.meta.gridElement.nativeElement);\n if (!cell) {\n return;\n }\n var oldMode = this.mode;\n var focusInCell = contains(cell.element, document.activeElement);\n var focusInActiveRowContent = this.mode === 2 /* Content */ &&\n this.activeRowIndex === cell.rowIndex &&\n el !== cell.element;\n if (focusInCell) {\n this.mode = 2 /* Content */;\n this.cursor.reset(cell.rowIndex, cell.colIndex);\n this.activateRow();\n }\n else if (!focusInActiveRowContent) {\n this.mode = 1 /* Cursor */;\n this.deactivateElements();\n var alreadyActive = this.cursor.isActive(cell.rowIndex, cell.colIndex);\n var isCursor = oldMode === 1 /* Cursor */ && alreadyActive;\n if (!isCursor) {\n this.cursor.reset(cell.rowIndex, cell.colIndex);\n }\n }\n };\n NavigationService.prototype.tryFocus = function (el) {\n this.activateElements();\n var focusable = findFocusableChild(el);\n if (focusable) {\n var cell = targetCell(focusable, this.meta.gridElement.nativeElement);\n if (cell) {\n this.cursor.reset(cell.rowIndex, cell.colIndex);\n this.deactivateElements();\n this.enterCell();\n }\n focusable.focus();\n }\n else {\n this.deactivateElements();\n }\n return !!focusable;\n };\n NavigationService.prototype.needsViewport = function () {\n return this.meta && this.meta.isVirtual;\n };\n NavigationService.prototype.setViewport = function (firstItemIndex, lastItemIndex) {\n this.viewport = new NavigationViewport(firstItemIndex, lastItemIndex);\n if (this.meta && this.meta.isVirtual && this.activeDataRow > -1) {\n var dataRowIndex = this.activeDataRow;\n var ahead = firstItemIndex - dataRowIndex;\n var behind = dataRowIndex - lastItemIndex;\n if (ahead > 0) {\n this.cursor.reset(firstItemIndex + this.meta.headerRows);\n }\n else if (behind > 0) {\n this.cursor.reset(lastItemIndex - this.meta.headerRows);\n }\n }\n };\n NavigationService.prototype.setColumnViewport = function (firstItemIndex, lastItemIndex) {\n this.columnViewport = new NavigationViewport(firstItemIndex, lastItemIndex);\n };\n NavigationService.prototype.focusCell = function (rowIndex, colIndex) {\n if (rowIndex === void 0) { rowIndex = undefined; }\n if (colIndex === void 0) { colIndex = undefined; }\n this.mode = 1 /* Cursor */;\n this.cursor.reset(rowIndex, colIndex);\n return this.activeCell;\n };\n NavigationService.prototype.focusNextCell = function (wrap) {\n if (wrap === void 0) { wrap = true; }\n return this.focusAdjacentCell(true, wrap);\n };\n NavigationService.prototype.focusPrevCell = function (wrap) {\n if (wrap === void 0) { wrap = true; }\n return this.focusAdjacentCell(false, wrap);\n };\n NavigationService.prototype.toggle = function (active) {\n this.active = active;\n this.cursor.announce();\n };\n NavigationService.prototype.hasFocus = function () {\n return this.mode === 1 /* Cursor */ || this.mode === 2 /* Content */;\n };\n NavigationService.prototype.autoFocusCell = function (start, end) {\n return !this.meta.virtualColumns || end < this.meta.columns.lockedLeafColumns.length || this.columnViewport.intersects(start, end);\n };\n NavigationService.prototype.focusAdjacentCell = function (fwd, wrap) {\n this.focusCell();\n var success = fwd ? this.moveCursorFwd() : this.moveCursorBwd();\n if (wrap && !success) {\n success = fwd ? this.cursor.moveDown(1) : this.cursor.moveUp(1);\n if (success) {\n var row = this.cursor.row;\n var colIdx = fwd ? 0 : this.cursor.lastCellIndex(row);\n this.cursor.reset(row.index, colIdx);\n }\n }\n if (success) {\n return this.activeCell;\n }\n else {\n this.mode = 0 /* Standby */;\n this.cursor.announce();\n }\n return null;\n };\n NavigationService.prototype.enterCell = function () {\n var cell = this.cursor.cell;\n if (!cell) {\n return;\n }\n var group = cell.focusGroup;\n var focusable = group && group.canFocus();\n this.mode = focusable ? 2 /* Content */ : 1 /* Cursor */;\n this.cursor.announce();\n if (focusable) {\n this.activateRow();\n group.focus();\n }\n };\n NavigationService.prototype.leaveCell = function () {\n var cell = this.cursor.cell;\n if (!cell) {\n return;\n }\n var group = cell.focusGroup;\n var focusable = group && group.canFocus();\n if (!focusable) {\n this.deactivateElements();\n }\n this.mode = 1 /* Cursor */;\n this.cursor.announce();\n };\n NavigationService.prototype.activateElements = function () {\n this.focusRoot.activate();\n };\n NavigationService.prototype.deactivateElements = function () {\n this.focusRoot.deactivate();\n };\n NavigationService.prototype.activateRow = function () {\n this.cursor.row.cells\n .forEach(function (cell) { return cell.focusGroup && cell.focusGroup.activate(); });\n };\n NavigationService.prototype.moveCursorFwd = function () {\n return this.localization.rtl ? this.cursor.moveLeft() : this.cursor.moveRight();\n };\n NavigationService.prototype.moveCursorBwd = function () {\n return this.localization.rtl ? this.cursor.moveRight() : this.cursor.moveLeft();\n };\n NavigationService.prototype.onCursorKeydown = function (args) {\n var _this = this;\n var preventDefault = false;\n var modifier = args.ctrlKey || args.metaKey;\n var step = modifier ? 5 : 1;\n if (!this.onCellKeydown(args)) {\n return;\n }\n var row = this.cursor.row;\n switch (args.keyCode) {\n case Keys.ArrowDown:\n preventDefault = this.cursor.moveDown(step);\n break;\n case Keys.ArrowUp:\n preventDefault = this.cursor.moveUp(step);\n break;\n case Keys.ArrowRight:\n preventDefault = this.moveCursorFwd();\n break;\n case Keys.ArrowLeft:\n preventDefault = this.moveCursorBwd();\n break;\n case Keys.PageDown:\n if (this.metadata.isVirtual && this.viewport) {\n var nextItemIndex = this.meta.headerRows + this.viewport.lastItemIndex + 1;\n if (this.metadata.hasDetailTemplate) {\n nextItemIndex++;\n }\n nextItemIndex = Math.min(this.meta.maxLogicalRowIndex, nextItemIndex);\n this.cursor.reset(nextItemIndex);\n preventDefault = true;\n }\n else if (this.metadata.hasPager) {\n this.zone.run(function () { return _this.pagerContextService.nextPage(); });\n preventDefault = true;\n }\n break;\n case Keys.PageUp:\n if (this.metadata.isVirtual && this.viewport) {\n var viewportSize = this.viewport.lastItemIndex - this.viewport.firstItemIndex;\n var firstItemIndex = this.viewport.firstItemIndex;\n var nextItemIndex = Math.max(this.meta.headerRows, firstItemIndex - viewportSize - 1);\n this.cursor.reset(nextItemIndex);\n preventDefault = true;\n }\n else if (this.metadata.hasPager) {\n this.zone.run(function () { return _this.pagerContextService.prevPage(); });\n preventDefault = true;\n }\n break;\n case Keys.Home:\n if (modifier) {\n if (this.meta.isVirtual) {\n this.cursor.reset(this.meta.headerRows, 0, false);\n }\n else {\n this.cursor.reset(this.model.firstRow.index, 0, false);\n }\n }\n else {\n this.cursor.reset(row.index, 0, false);\n }\n preventDefault = true;\n break;\n case Keys.End:\n if (modifier) {\n if (this.meta.isVirtual) {\n var lastRowIndex = this.meta.maxLogicalRowIndex;\n if (this.meta.hasDetailTemplate) {\n lastRowIndex--;\n }\n this.cursor.reset(lastRowIndex, this.cursor.lastCellIndex(), false);\n }\n else {\n this.cursor.reset(this.model.lastRow.index, this.cursor.lastCellIndex(this.model.lastRow), false);\n }\n }\n else {\n var lastIndex = this.cursor.lastCellIndex(row);\n var cell = this.model.findCell(lastIndex, row);\n if (cell) {\n this.cursor.reset(cell.rowIndex, cell.colIndex);\n }\n else {\n this.cursor.reset(row.index, lastIndex);\n }\n }\n preventDefault = true;\n break;\n case Keys.Enter:\n case Keys.F2:\n var groupItem_1 = row.groupItem;\n if (groupItem_1) {\n this.zone.run(function () {\n return _this.groupsService.toggleRow(groupItem_1.index, groupItem_1.data);\n });\n }\n else if (this.cursor.cell.detailExpandCell) {\n this.zone.run(function () {\n return _this.detailsService.toggleRow(row.dataRowIndex, row.dataItem);\n });\n }\n else {\n this.enterCell();\n if (!this.cursor.cell.focusGroup.isNavigable()) {\n preventDefault = true;\n }\n }\n break;\n default:\n if (!args.ctrlKey && !args.altKey && isPrintableCharacter(args.key)) {\n this.enterCell();\n }\n }\n if (preventDefault) {\n args.preventDefault();\n }\n };\n NavigationService.prototype.onContentKeydown = function (args) {\n if (!this.onCellKeydown(args)) {\n return;\n }\n var confirm = !args.defaultPrevented && args.keyCode === Keys.Enter && isTextInput(args.srcElement);\n if (args.keyCode === Keys.Escape || args.keyCode === Keys.F2 || confirm) {\n this.leaveCell();\n this.cursor.reset();\n args.stopPropagation();\n }\n else if (isNavigationKey(args.keyCode) && this.cursor.cell.focusGroup.isNavigable()) {\n this.onCursorKeydown(args);\n if (args.defaultPrevented) {\n this.leaveCell();\n }\n }\n };\n NavigationService.prototype.onCellKeydown = function (args) {\n if (this.editService.isEditingCell()) {\n var confirm_1 = args.keyCode === Keys.Enter;\n var cancel = args.keyCode === Keys.Escape;\n var navigate = isNavigationKey(args.keyCode);\n if (confirm_1) {\n this.editService.closeCell(args);\n }\n else if (cancel) {\n this.editService.cancelCell();\n this.cd.detectChanges();\n }\n else if (navigate) {\n return false;\n }\n }\n this.cellKeydown.emit(args);\n return true;\n };\n NavigationService.prototype.onCursorChanges = function (args) {\n this.activeRowIndex = args.rowIndex;\n var dataRowIndex = this.activeDataRow;\n if (this.meta && (this.meta.isVirtual && this.viewport &&\n !this.viewport.containsRow(dataRowIndex) && dataRowIndex > -1)) {\n this.scrollRequestService.scrollTo({ row: dataRowIndex });\n }\n if (this.meta.virtualColumns && args.colIndex >= this.meta.columns.lockedLeafColumns.length) {\n var cell = this.activeCell;\n var _a = this.model.cellRange(cell), start = _a.start, end = _a.end;\n if (!cell) {\n this.virtualCell = true;\n }\n if ((!cell && this.mode !== 0 /* Standby */) || (cell && !this.columnViewport.intersects(start, end))) {\n this.scrollRequestService.scrollTo({ column: args.colIndex - (this.metadata.hasDetailTemplate ? 1 : 0) });\n }\n }\n };\n NavigationService.prototype.onFocusOut = function (args) {\n if (isVisible(args.target)) {\n this.mode = 0 /* Standby */;\n }\n else {\n // Focused target is no longer visible,\n // reset to cursor mode and recapture focus.\n this.mode = 1 /* Cursor */;\n }\n this.deactivateElements();\n this.cursor.announce();\n };\n NavigationService.prototype.onWindowBlur = function () {\n this.mode = 0 /* Standby */;\n this.deactivateElements();\n this.cursor.announce();\n };\n NavigationService.prototype.onKeydown = function (args) {\n if (this.mode === 1 /* Cursor */) {\n this.onCursorKeydown(args);\n }\n else if (this.mode === 2 /* Content */) {\n this.onContentKeydown(args);\n }\n };\n NavigationService.prototype.onTabout = function () {\n // Tabbed out of the last focusable content element\n // reset to cursor mode and recapture focus.\n if (this.cursor.cell.focusGroup.isNavigable()) {\n // Unless the cell has a single focusable element,\n // otherwise we'd return to Content mode and enter an endless loop\n return;\n }\n this.leaveCell();\n this.cursor.reset();\n };\n NavigationService.decorators = [\n { type: Injectable },\n ];\n /** @nocollapse */\n NavigationService.ctorParameters = function () { return [\n { type: NgZone },\n { type: DomEventsService },\n { type: PagerContextService },\n { type: ScrollRequestService },\n { type: GroupsService },\n { type: DetailsService },\n { type: FocusRoot },\n { type: EditService },\n { type: ChangeDetectorRef },\n { type: LocalizationService },\n { type: FocusableDirective, decorators: [{ type: Optional }] }\n ]; };\n return NavigationService;\n}());\n\n/**\n * @hidden\n */\nvar NavigationMetadata = /** @class */ (function () {\n function NavigationMetadata(dataRows, headerRows, isVirtual, hasPager, hasDetailTemplate, gridElement, virtualColumns, columns) {\n this.dataRows = dataRows;\n this.headerRows = headerRows;\n this.isVirtual = isVirtual;\n this.hasPager = hasPager;\n this.hasDetailTemplate = hasDetailTemplate;\n this.gridElement = gridElement;\n this.virtualColumns = virtualColumns;\n this.columns = columns;\n }\n Object.defineProperty(NavigationMetadata.prototype, \"maxLogicalRowIndex\", {\n get: function () {\n var dataRows = this.hasDetailTemplate ? this.dataRows * 2 : this.dataRows;\n return this.headerRows + dataRows - 1;\n },\n enumerable: true,\n configurable: true\n });\n return NavigationMetadata;\n}());\n\n// Incremented each time the service is instantiated.\nvar sequence = 0;\n/**\n * @hidden\n */\nvar IdService = /** @class */ (function () {\n function IdService() {\n this.prefix = \"k-grid\" + sequence++;\n }\n IdService.prototype.cellId = function (rowIndex, colIndex) {\n return this.prefix + \"-r\" + rowIndex + \"c\" + colIndex;\n };\n IdService.prototype.selectionCheckboxId = function (itemIndex) {\n return this.prefix + \"-checkbox\" + itemIndex;\n };\n IdService.prototype.selectAllCheckboxId = function () {\n return this.prefix + \"-select-all\";\n };\n IdService.decorators = [\n { type: Injectable },\n ];\n /** @nocollapse */\n IdService.ctorParameters = function () { return []; };\n return IdService;\n}());\n\n/**\n * @hidden\n */\nvar ColumnInfoService = /** @class */ (function () {\n function ColumnInfoService() {\n this.visibilityChange = new EventEmitter();\n this.lockedChange = new EventEmitter();\n this.columnRangeChange = new EventEmitter();\n this.columnsContainer = new ColumnsContainer(function () { return []; });\n }\n Object.defineProperty(ColumnInfoService.prototype, \"lockedLeafColumns\", {\n get: function () {\n return this.columnsContainer.lockedLeafColumns;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ColumnInfoService.prototype, \"nonLockedLeafColumns\", {\n get: function () {\n return this.columnsContainer.nonLockedLeafColumns;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ColumnInfoService.prototype, \"isLocked\", {\n get: function () {\n return this.lockedLeafColumns.length > 0;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ColumnInfoService.prototype, \"totalLevels\", {\n get: function () {\n return this.columnsContainer.totalLevels;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ColumnInfoService.prototype, \"leafNamedColumns\", {\n get: function () {\n var columns = expandColumns(this.list().filterSort(function (column) { return !column.isColumnGroup; }))\n .filter(function (column) { return column.matchesMedia && column.displayTitle; });\n return orderBy(columns, [{ field: 'locked', dir: 'desc' }]);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ColumnInfoService.prototype, \"unlockedRootCount\", {\n get: function () {\n return this.list().rootColumns().filter(function (column) { return !column.locked && column.isVisible; }).length;\n },\n enumerable: true,\n configurable: true\n });\n ColumnInfoService.prototype.init = function (columns, list) {\n this.columnsContainer = columns;\n this.list = list;\n };\n ColumnInfoService.prototype.changeVisibility = function (columns) {\n this.visibilityChange.emit(columns);\n };\n ColumnInfoService.prototype.changeLocked = function (columns) {\n this.lockedChange.emit(columns);\n };\n ColumnInfoService.decorators = [\n { type: Injectable },\n ];\n return ColumnInfoService;\n}());\n\n/**\n * @hidden\n */\nvar SortService = /** @class */ (function () {\n function SortService() {\n this.changes = new Subject();\n }\n SortService.prototype.sort = function (value) {\n this.changes.next(value);\n };\n return SortService;\n}());\n\n/**\n * Arguments for the `columnVisibilityChange` event.\n */\nvar ColumnVisibilityChangeEvent = /** @class */ (function () {\n /**\n * @hidden\n */\n function ColumnVisibilityChangeEvent(columns) {\n this.columns = columns;\n }\n return ColumnVisibilityChangeEvent;\n}());\n\n/**\n * Arguments for the `columnLockedChange` event.\n */\nvar ColumnLockedChangeEvent = /** @class */ (function () {\n /**\n * @hidden\n */\n function ColumnLockedChangeEvent(columns) {\n this.columns = columns;\n }\n return ColumnLockedChangeEvent;\n}());\n\n/**\n * @hidden\n */\nvar GROUP_CELL_WIDTH = 32; // this should be the value of group-cell inside the theme!\n\n/**\n * @hidden\n */\nfunction defaultTrackBy(index, item) {\n if (item.type === 'data' && item.isEditing) {\n return item.data;\n }\n return index;\n}\n\nvar createControl = function (source) { return function (acc, key) {\n acc[key] = new FormControl(source[key]);\n return acc;\n}; };\nvar validateColumnsField = function (columns) {\n return expandColumns(columns.toArray())\n .filter(isColumnComponent)\n .filter(function (_a) {\n var field = _a.field;\n return !isValidFieldName(field);\n })\n .forEach(function (_a) {\n var field = _a.field;\n return console.warn(\"\\n Grid column field name '\" + field + \"' does not look like a valid JavaScript identifier.\\n Identifiers can contain only alphanumeric characters (including \\\"$\\\" or \\\"_\\\"), and may not start with a digit.\\n Please use only valid identifier names to ensure error-free operation.\\n \");\n });\n};\nvar handleExpandCollapseService = function (service, expandEmitter, collapseEmitter, map$$1) { return (service.changes.pipe(filter(function (_a) {\n var dataItem = _a.dataItem;\n return isPresent(dataItem);\n}))\n .subscribe(function (x) { return x.expand ? expandEmitter.emit(map$$1(x)) : collapseEmitter.emit(map$$1(x)); })); };\nvar isInEditedCell = function (element, gridElement) {\n return closest(element, matchesClasses('k-grid-edit-cell')) &&\n closest(element, matchesNodeName('kendo-grid')) === gridElement;\n};\nvar ɵ4$2 = EMPTY_CELL_CONTEXT;\n/**\n * Represents the Kendo UI Grid component for Angular.\n *\n * @example\n * ```ts-preview\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * `\n * })\n * class AppComponent {\n * public gridData: any[] = products;\n * }\n *\n * const products = [{\n * \"ProductID\": 1,\n * \"ProductName\": \"Chai\",\n * \"UnitPrice\": 18.0000,\n * \"Discontinued\": true\n * }, {\n * \"ProductID\": 2,\n * \"ProductName\": \"Chang\",\n * \"UnitPrice\": 19.0000,\n * \"Discontinued\": false\n * }\n * ];\n * ```\n */\nvar GridComponent = /** @class */ (function () {\n function GridComponent(supportService, selectionService, wrapper, groupInfoService, groupsService, changeNotification, detailsService, editService, filterService, pdfService, responsiveService, renderer, excelService, ngZone, scrollSyncService, domEvents, columnResizingService, changeDetectorRef, columnReorderService, columnInfoService, navigationService, sortService, scrollRequestService, localization) {\n var _this = this;\n this.supportService = supportService;\n this.selectionService = selectionService;\n this.wrapper = wrapper;\n this.groupInfoService = groupInfoService;\n this.groupsService = groupsService;\n this.changeNotification = changeNotification;\n this.detailsService = detailsService;\n this.editService = editService;\n this.filterService = filterService;\n this.pdfService = pdfService;\n this.responsiveService = responsiveService;\n this.renderer = renderer;\n this.excelService = excelService;\n this.ngZone = ngZone;\n this.scrollSyncService = scrollSyncService;\n this.domEvents = domEvents;\n this.columnResizingService = columnResizingService;\n this.changeDetectorRef = changeDetectorRef;\n this.columnReorderService = columnReorderService;\n this.columnInfoService = columnInfoService;\n this.navigationService = navigationService;\n this.sortService = sortService;\n this.scrollRequestService = scrollRequestService;\n /**\n * Sets the data of the Grid. If an array is provided, the Grid automatically gets the total count\n * ([more information and example]({% slug databinding_grid %})).\n */\n this.data = [];\n /**\n * Defines the scroll mode used by the Grid.\n *\n * The available options are:\n * - `none`—Renders no scrollbar.\n * - `scrollable`—The default scroll mode. It requires the setting of the `height` option.\n * - `virtual`—Displays no pager and renders a portion of the data (optimized rendering) while the user is scrolling the content.\n */\n this.scrollable = 'scrollable';\n /**\n * Enables the single-row [selection]({% slug selection_grid %}) of the Grid.\n */\n this.selectable = false;\n /**\n * A function that defines how to track changes for the data rows.\n *\n * By default, the Grid tracks changes by the index of the data item.\n * Edited rows are tracked by reference.\n * In some cases, you might need to override the default behavior,\n * for example, when you implement editing with immutable data items.\n *\n * The following example demonstrates how to track items only by index.\n *\n * @example\n * ```ts\n * import { Component } from '@angular/core';\n * import { GridItem } from '@progress/kendo-angular-grid';\n *\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * `\n * })\n * class AppComponent {\n * public gridData: any[] = products;\n *\n * public trackBy(index: number, item: GridItem): any {\n * console.log(item);\n * return index;\n * }\n * }\n *\n * const products = [{\n * \"ProductID\": 1,\n * \"ProductName\": \"Chai\",\n * \"UnitPrice\": 18.0000,\n * \"Discontinued\": true\n * }, {\n * \"ProductID\": 2,\n * \"ProductName\": \"Chang\",\n * \"UnitPrice\": 19.0000,\n * \"Discontinued\": false\n * }\n * ];\n * ```\n */\n this.trackBy = defaultTrackBy;\n /**\n * If set to `true`, the grid will render only the columns in the current viewport.\n */\n this.virtualColumns = false;\n /**\n * Enables the [filtering]({% slug filtering_grid %}) of the Grid columns that have their `field` option set.\n */\n this.filterable = false;\n /**\n * Enables the [sorting]({% slug sorting_grid %}) of the Grid columns that have their `field` option set.\n */\n this.sortable = false;\n /**\n * Configures the pager of the Grid ([see example]({% slug paging_grid %})).\n *\n * The available options are:\n * - `buttonCount: Number`—Sets the maximum numeric buttons count before the buttons are collapsed.\n * - `info: Boolean`—Toggles the information about the current page and the total number of records.\n * - `type: PagerType`—Accepts the `numeric` (buttons with numbers) and `input` (input for typing the page number) values.\n * - `pageSizes: Boolean` or `Array`—Shows a menu for selecting the page size.\n * - `previousNext: Boolean`—Toggles the **Previous** and **Next** buttons.\n */\n this.pageable = false;\n /**\n * If set to `true`, the user can group the Grid by dragging the column header cells.\n * By default, grouping is disabled ([see example]({% slug groupingbasics_grid %})).\n */\n this.groupable = false;\n /**\n * If set to `true`, the user can use dedicated shortcuts to interact with the Grid.\n * By default, navigation is disabled and the Grid content is accessible in the normal tab sequence.\n */\n this.navigable = false;\n /**\n * Indicates whether the Grid columns will be resized during initialization so that\n * they fit their headers and row content. Defaults to `false`.\n * Columns with `autoSize` set to `false` are excluded.\n * To dynamically update the column width to match the new content,\n * refer to [this example]({% slug resizing_columns_grid %}).\n */\n this.autoSize = false;\n /**\n * If set to `true`, the user can resize columns by dragging the edges (resize handles) of their header cells\n * ([see example]({% slug resizing_columns_grid %})).\n *\n * @default false\n */\n this.resizable = false;\n /**\n * If set to `true`, the user can reorder columns by dragging their header cells\n * ([see example]({% slug reordering_columns_grid %})).\n *\n * @default false\n */\n this.reorderable = false;\n /**\n * Specifies if the loading indicator of the Grid will be displayed ([see example]({% slug databinding_grid %})).\n *\n * @default false\n */\n this.loading = false;\n /**\n * Specifies if the column menu of the columns will be displayed ([see example]({% slug columnmenu_grid %})).\n *\n * @default false\n */\n this.columnMenu = false;\n /**\n * Specifies if the header of the grid will be hidden. The header is visible by default.\n *\n * > The header includes column headers and the [filter row]({% slug filtering_grid %}#toc-filter-row).\n */\n this.hideHeader = false;\n /**\n * Fires when the Grid filter is modified through the UI.\n * You have to handle the event yourself and filter the data.\n */\n this.filterChange = new EventEmitter();\n /**\n * Fires when the page of the Grid is changed ([see example]({% slug paging_grid %})).\n * You have to handle the event yourself and page the data.\n */\n this.pageChange = new EventEmitter();\n /**\n * Fires when the grouping of the Grid is changed.\n * You have to handle the event yourself and group the data ([see example]({% slug groupingbasics_grid %})).\n */\n this.groupChange = new ZoneAwareEventEmitter(this.ngZone);\n /**\n * Fires when the sorting of the Grid is changed ([see example]({% slug sorting_grid %})).\n * You have to handle the event yourself and sort the data.\n */\n this.sortChange = new EventEmitter();\n /**\n * Fires when the user selects a Grid row.\n * Emits the [`SelectionEvent`]({% slug api_grid_selectionevent %}#toc-selectionchange).\n */\n this.selectionChange = new EventEmitter();\n /**\n * Fires when the data state of the Grid is changed.\n */\n this.dataStateChange = new EventEmitter();\n /**\n * Fires when the user expands a group header.\n */\n this.groupExpand = new EventEmitter();\n /**\n * Fires when the user collapses a group header.\n */\n this.groupCollapse = new EventEmitter();\n /**\n * Fires when the user expands a master row.\n */\n this.detailExpand = new EventEmitter();\n /**\n * Fires when the user collapses a master row.\n */\n this.detailCollapse = new EventEmitter();\n /**\n * Fires when the user clicks the **Edit** command button to edit a row\n * ([see example]({% slug editing_template_forms_grid %}#toc-editing-records)).\n */\n this.edit = new EventEmitter();\n /**\n * Fires when the user clicks the **Cancel** command button to close a row\n * ([see example]({% slug editing_template_forms_grid %}#toc-cancelling-editing)).\n */\n this.cancel = new EventEmitter();\n /**\n * Fires when the user clicks the **Save** command button to save changes in a row\n * ([see example]({% slug editing_template_forms_grid %}#toc-saving-records)).\n */\n this.save = new EventEmitter();\n /**\n * Fires when the user clicks the **Remove** command button to remove a row\n * ([see example]({% slug editing_template_forms_grid %}#toc-removing-records)).\n */\n this.remove = new EventEmitter();\n /**\n * Fires when the user clicks the **Add** command button to add a new row\n * ([see example]({% slug editing_template_forms_grid %}#toc-adding-records)).\n */\n this.add = new EventEmitter();\n /**\n * Fires when the user leaves an edited cell ([see example]({% slug editing_incell_grid %}#toc-basic-concepts)).\n */\n this.cellClose = new EventEmitter();\n /**\n * Fires when the user clicks a cell ([see example]({% slug editing_incell_grid %}#toc-basic-concepts)).\n */\n this.cellClick = new ZoneAwareEventEmitter(this.ngZone);\n /**\n * Fires when the user clicks the **Export to PDF** command button.\n */\n this.pdfExport = new EventEmitter();\n /**\n * Fires when the user clicks the **Export to Excel** command button.\n */\n this.excelExport = new EventEmitter();\n /**\n * Fires when the user completes the resizing of the column.\n */\n this.columnResize = new ZoneAwareEventEmitter(this.ngZone);\n /**\n * Fires when the user completes the reordering of the column.\n */\n this.columnReorder = new EventEmitter();\n /**\n * Fires when the user changes the visibility of the columns from the column menu or column chooser.\n */\n this.columnVisibilityChange = new EventEmitter();\n /**\n * Fires when the user changes the locked state of the columns from the column menu or by reordering the columns.\n */\n this.columnLockedChange = new EventEmitter();\n /**\n * Fires when the user scrolls to the last record on the page and enables endless scrolling\n * ([see example]({% slug scrollmmodes_grid %}#toc-endless-scrolling)).\n * You have to handle the event yourself and page the data.\n */\n this.scrollBottom = new EventEmitter();\n /**\n * Fires when the grid content is scrolled.\n * For performance reasons, the event is triggered outside the Angular zone. Enter the Angular zone if you make any changes that require change detection.\n */\n this.contentScroll = new EventEmitter();\n /**\n * A query list of all declared columns.\n */\n this.columns = new QueryList();\n this.footer = new QueryList();\n this.selectionDirective = false;\n this.columnsContainer = new ColumnsContainer(function () { return _this.columnList.filterHierarchy(function (column) {\n column.matchesMedia = _this.matchesMedia(column);\n return column.isVisible;\n }); });\n this.view = new DataCollection(function () { return new DataResultIterator(_this.data, _this.skip, _this.hasGroupFooters); });\n this.shouldGenerateColumns = true;\n this._sort = new Array();\n this._group = new Array();\n this._skip = 0;\n this.cachedWindowWidth = 0;\n this._rowSelected = null;\n this.rtl = false;\n this._rowClass = function () { return null; };\n this.localizationSubscription = localization.changes.subscribe(function (_a) {\n var rtl = _a.rtl;\n _this.rtl = rtl;\n _this.direction = _this.rtl ? 'rtl' : 'ltr';\n });\n this.groupInfoService.registerColumnsContainer(function () { return _this.columnList; });\n this.columnInfoService.init(this.columnsContainer, function () { return _this.columnList; });\n this.columnVisibilityChangeSubscription = this.columnInfoService.visibilityChange.subscribe(function (changed) {\n _this.columnVisibilityChange.emit(new ColumnVisibilityChangeEvent(changed));\n });\n this.columnLockedChangeSubscription = this.columnInfoService.lockedChange.subscribe(function (changed) {\n _this.columnLockedChange.emit(new ColumnLockedChangeEvent(changed));\n });\n if (selectionService) {\n this.selectionSubscription = selectionService.changes.subscribe(function (event) {\n _this.ngZone.run(function () { return _this.selectionChange.emit(event); });\n });\n }\n this.groupExpandCollapseSubscription = handleExpandCollapseService(groupsService, this.groupExpand, this.groupCollapse, function (_a) {\n var group = _a.dataItem, index = _a.index;\n return ({ group: group, groupIndex: index });\n });\n this.detailsServiceSubscription = handleExpandCollapseService(detailsService, this.detailExpand, this.detailCollapse, function (args) { return args; });\n this.filterSubscription = this.filterService.changes.subscribe(function (x) {\n _this.filterChange.emit(x);\n });\n this.sortSubscription = this.sortService.changes.subscribe(function (x) {\n _this.sortChange.emit(x);\n });\n this.attachStateChangesEmitter();\n this.attachEditHandlers();\n this.attachDomEventHandlers();\n this.pdfSubscription = this.pdfService.exportClick.subscribe(this.emitPDFExportEvent.bind(this));\n this.excelSubscription = this.excelService.exportClick.subscribe(this.saveAsExcel.bind(this));\n this.columnsContainerChange();\n this.handleColumnResize();\n this.columnList = new ColumnList(this.columns);\n this.columnReorderSubscription = this.columnReorderService\n .changes.subscribe(this.reorder.bind(this));\n this.columnRangeChangeSubscription = this.columnInfoService.columnRangeChange.subscribe(this.onColumnRangeChange.bind(this));\n }\n Object.defineProperty(GridComponent.prototype, \"skip\", {\n /**\n * Defines the number of records to be skipped by the pager.\n * Required by the [paging]({% slug paging_grid %}) functionality.\n */\n get: function () {\n return this._skip;\n },\n set: function (value) {\n if (value >= 0) {\n this._skip = value;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"sort\", {\n get: function () {\n return this._sort;\n },\n /**\n * The descriptors by which the data will be sorted ([see example]({% slug sorting_grid %})).\n */\n set: function (value) {\n if (isArray(value)) {\n this._sort = value;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"group\", {\n /**\n */\n get: function () {\n return this._group;\n },\n /**\n * The descriptors by which the data will be grouped ([see example]({% slug groupingbasics_grid %})).\n */\n set: function (value) {\n if (isArray(value)) {\n this._group = value;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"showTopToolbar\", {\n /**\n * @hidden\n */\n get: function () {\n return this.toolbarTemplate && ['top', 'both'].indexOf(this.toolbarTemplate.position) > -1;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"showBottomToolbar\", {\n /**\n * @hidden\n */\n get: function () {\n return this.toolbarTemplate && ['bottom', 'both'].indexOf(this.toolbarTemplate.position) > -1;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"isLocked\", {\n /**\n * @hidden\n */\n get: function () {\n return this.lockedLeafColumns.length > 0;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"showPager\", {\n /**\n * @hidden\n */\n get: function () {\n return !this.isVirtual && this.pageable !== false;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"showGroupPanel\", {\n /**\n * @hidden\n */\n get: function () {\n return this.groupable && this.groupable.enabled !== false;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"groupableEmptyText\", {\n /**\n * @hidden\n */\n get: function () {\n return this.groupable.emptyText;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"navigatable\", {\n /**\n * @hidden\n */\n get: function () {\n return this.navigable;\n },\n /**\n * @hidden\n *\n * An alias for `navigable` for users who migrate from Kendo UI for jQuery.\n */\n set: function (value) {\n this.navigable = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"rowClass\", {\n get: function () {\n return this._rowClass;\n },\n /**\n * Defines a function that is executed for every data row in the component.\n *\n * @example\n * ```ts\n * import { Component, ViewEncapsulation } from '@angular/core';\n * import { RowClassArgs } from '@progress/kendo-angular-grid';\n *\n * _@Component({\n * selector: 'my-app',\n * encapsulation: ViewEncapsulation.None,\n * styles: [`\n * .k-grid tr.even { background-color: #f45c42; }\n * .k-grid tr.odd { background-color: #41f4df; }\n * `],\n * template: `\n * \n * \n * `\n * })\n * class AppComponent {\n * public gridData: any[] = products;\n *\n * public rowCallback(context: RowClassArgs) {\n * const isEven = context.index % 2 == 0;\n * return {\n * even: isEven,\n * odd: !isEven\n * };\n * }\n * }\n *\n * const products = [{\n * \"ProductID\": 1,\n * \"ProductName\": \"Chai\",\n * \"UnitPrice\": 18.0000,\n * \"Discontinued\": true\n * }, {\n * \"ProductID\": 2,\n * \"ProductName\": \"Chang\",\n * \"UnitPrice\": 19.0000,\n * \"Discontinued\": false\n * }\n * ];\n * ```\n */\n set: function (fn) {\n if (typeof fn !== 'function') {\n throw new Error(\"rowClass must be a function, but received \" + JSON.stringify(fn) + \".\");\n }\n this._rowClass = fn;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"rowSelected\", {\n get: function () {\n return this._rowSelected;\n },\n /**\n * Defines a Boolean function that is executed for each data row in the component\n * ([see example]({% slug selection_grid %}#toc-setting-the-selected-rows)).\n * Determines whether the row will be selected.\n */\n set: function (fn) {\n if (typeof fn !== 'function') {\n throw new Error(\"rowSelected must be a function, but received \" + JSON.stringify(fn) + \".\");\n }\n this._rowSelected = fn;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"activeCell\", {\n /**\n * Returns the currently focused cell (if any).\n */\n get: function () {\n return this.navigationService.activeCell;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"activeRow\", {\n /**\n * Returns the currently focused row (if any).\n */\n get: function () {\n return this.navigationService.activeRow;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"dir\", {\n get: function () {\n return this.direction;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"hostClasses\", {\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"lockedClasses\", {\n get: function () {\n return this.lockedLeafColumns.length > 0;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"virtualClasses\", {\n get: function () {\n return this.isVirtual;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"noScrollbarClass\", {\n get: function () {\n return this.scrollbarWidth === 0;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"detailTemplate\", {\n get: function () {\n if (this._customDetailTemplate) {\n return this._customDetailTemplate;\n }\n return this.detailTemplateChildren ? this.detailTemplateChildren.first : undefined;\n },\n set: function (detailTemplate) {\n this._customDetailTemplate = detailTemplate;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"noRecordsTemplate\", {\n get: function () {\n if (this._customNoRecordsTemplate) {\n return this._customNoRecordsTemplate;\n }\n return this.noRecordsTemplateChildren ? this.noRecordsTemplateChildren.first : undefined;\n },\n set: function (customNoRecordsTemplate) {\n this._customNoRecordsTemplate = customNoRecordsTemplate;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"pagerTemplate\", {\n get: function () {\n if (this._customPagerTemplate) {\n return this._customPagerTemplate;\n }\n return this.pagerTemplateChildren ? this.pagerTemplateChildren.first : undefined;\n },\n set: function (customPagerTemplate) {\n this._customPagerTemplate = customPagerTemplate;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"toolbarTemplate\", {\n get: function () {\n if (this._customToolbarTemplate) {\n return this._customToolbarTemplate;\n }\n return this.toolbarTemplateChildren ? this.toolbarTemplateChildren.first : undefined;\n },\n set: function (customToolbarTemplate) {\n this._customToolbarTemplate = customToolbarTemplate;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"scrollbarWidth\", {\n get: function () {\n return this.supportService.scrollbarWidth;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"headerPadding\", {\n get: function () {\n if (isUniversal()) {\n return \"\";\n }\n var padding = Math.max(0, this.scrollbarWidth - 1) + 'px';\n var right = this.rtl ? 0 : padding;\n var left = this.rtl ? padding : 0;\n return \"0 \" + right + \" 0 \" + left;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"hasGroupFooters\", {\n get: function () {\n return this.columnsContainer.hasGroupFooter;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"showFooter\", {\n get: function () {\n return this.columnsContainer.hasFooter;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"showGroupFooters\", {\n get: function () {\n return this.groupable && this.groupable.showFooter;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"ariaRowCount\", {\n get: function () {\n return this.totalColumnLevels + 1 + this.view.total;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"ariaColCount\", {\n get: function () {\n return this.columnsContainer.leafColumnsToRender.length;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"isVirtual\", {\n get: function () {\n return this.scrollable === 'virtual';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"isScrollable\", {\n get: function () {\n return this.scrollable !== 'none';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"visibleColumns\", {\n get: function () {\n return this.columnsContainer.allColumns;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"lockedColumns\", {\n get: function () {\n return this.columnsContainer.lockedColumns;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"nonLockedColumns\", {\n get: function () {\n return this.columnsContainer.nonLockedColumns;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"lockedLeafColumns\", {\n get: function () {\n return this.columnsContainer.lockedLeafColumns;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"nonLockedLeafColumns\", {\n get: function () {\n return this.columnsContainer.nonLockedLeafColumns;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"leafColumns\", {\n get: function () {\n return this.columnsContainer.leafColumns;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"totalColumnLevels\", {\n get: function () {\n return this.columnsContainer.totalLevels;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"headerColumns\", {\n get: function () {\n if (this.virtualColumns && !this.pdfService.exporting) {\n return this.viewportColumns;\n }\n return this.nonLockedColumns;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"headerLeafColumns\", {\n get: function () {\n if (this.virtualColumns && !this.pdfService.exporting) {\n return this.leafViewportColumns;\n }\n return this.nonLockedLeafColumns;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"lockedWidth\", {\n get: function () {\n var groupCellsWidth = this.group.length * GROUP_CELL_WIDTH;\n return expandColumns(this.lockedLeafColumns.toArray()).reduce(function (prev, curr) { return prev + (curr.width || 0); }, groupCellsWidth);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"nonLockedWidth\", {\n get: function () {\n if ((!this.rtl && this.lockedLeafColumns.length) || this.virtualColumns) {\n return !this.virtualColumns ? this.columnsContainer.unlockedWidth :\n this.leafViewportColumns.reduce(function (acc, column) { return acc + (column.width || 0); }, 0);\n }\n return undefined;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"selectableSettings\", {\n get: function () {\n if (this.selectionService) {\n return this.selectionService.options;\n }\n return undefined;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"columnMenuTemplate\", {\n get: function () {\n var template = this.columnMenuTemplates.first;\n return template ? template.templateRef : null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GridComponent.prototype, \"totalCount\", {\n get: function () {\n if (this.isVirtual || !isPresent(this.pageSize)) {\n return this.view.total;\n }\n return this.pageSize;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Expands the specified master row ([see example]({% slug hierarchy_grid %})).\n *\n * @param {number} index - The absolute index of the master row.\n */\n GridComponent.prototype.expandRow = function (index) {\n if (!this.detailsService.isExpanded(index)) {\n this.detailsService.toggleRow(index, null);\n }\n };\n /**\n * Collapses the specified master row.\n *\n * @param {number} index - The absolute index of the master row.\n */\n GridComponent.prototype.collapseRow = function (index) {\n if (this.detailsService.isExpanded(index)) {\n this.detailsService.toggleRow(index, null);\n }\n };\n /**\n * Expands a group header item for the given index. For example,\n * `0_1` expands the second inner group of the first master group.\n *\n * > * When you use the [`kendoGridGroupBinding`]({% slug api_grid_groupbindingdirective %}) directive,\n * > the `expandGroup` method is not supported.\n * > * When a Grid is pageable, the indexes of the groups are offset by the current Grid [`skip`]({% slug api_grid_gridcomponent %}#toc-skip).\n *\n * @param {string} index - The underscore separated hierarchical index of the group.\n */\n GridComponent.prototype.expandGroup = function (index) {\n if (!this.groupsService.isExpanded(index)) {\n this.groupsService.toggleRow(index, null);\n }\n };\n /**\n * Collapses a group header item for the given index. For example,\n * `0_1` collapses the second inner group of the first master group.\n *\n * > * When you use the [`kendoGridGroupBinding`]({% slug api_grid_groupbindingdirective %}) directive,\n * > the `expandGroup` method is not supported.\n * > * When a Grid is pageable, the indexes of the groups are offset by the current Grid [`skip`]({% slug api_grid_gridcomponent %}#toc-skip).\n *\n * @param {string} index - The underscore separated hierarchical index of the group.\n */\n GridComponent.prototype.collapseGroup = function (index) {\n if (this.groupsService.isExpanded(index)) {\n this.groupsService.toggleRow(index, null);\n }\n };\n /**\n * @hidden\n */\n GridComponent.prototype.resetGroupsState = function () {\n this.groupsService.reset();\n };\n /**\n * @hidden\n */\n GridComponent.prototype.expandGroupChildren = function (groupIndex) {\n this.groupsService.expandChildren(groupIndex);\n };\n /**\n * @hidden\n */\n GridComponent.prototype.onDataChange = function () {\n this.autoGenerateColumns();\n this.changeNotification.notify();\n this.pdfService.dataChanged.emit();\n if (isPresent(this.defaultSelection)) {\n this.defaultSelection.reset();\n }\n this.initSelectionService();\n this.updateNavigationMetadata();\n };\n GridComponent.prototype.ngOnChanges = function (changes) {\n var _this = this;\n if (isChanged(\"data\", changes)) {\n this.onDataChange();\n }\n if (this.lockedLeafColumns.length && anyChanged([\"pageSize\", \"skip\", \"sort\", \"group\"], changes)) {\n this.changeNotification.notify();\n }\n if (anyChanged([\"pageSize\", \"scrollable\", 'virtualColumns'], changes)) {\n this.updateNavigationMetadata();\n }\n if (isChanged(\"virtualColumns\", changes)) {\n this.viewportColumns = this.leafViewportColumns = null;\n }\n if (isChanged(\"height\", changes, false)) {\n this.renderer.setStyle(this.wrapper.nativeElement, 'height', this.height + \"px\");\n }\n if (isChanged(\"filterable\", changes) && this.lockedColumns.length) {\n this.syncHeaderHeight(this.ngZone.onStable.asObservable().pipe(take(1)));\n }\n if (anyChanged([\"columnMenu\", \"sortable\", \"filterable\"], changes, false)) {\n this.columnMenuOptions = this.columnMenu && Object.assign({\n filter: Boolean(this.filterable),\n sort: Boolean(this.sortable)\n }, this.columnMenu); // tslint:disable-line:align\n }\n if (isChanged(\"scrollable\", changes) && this.isScrollable) {\n this.ngZone.onStable.pipe(take(1)).subscribe(function () { return _this.attachScrollSync(); });\n }\n };\n GridComponent.prototype.ngAfterViewInit = function () {\n this.attachScrollSync();\n this.attachElementEventHandlers();\n this.updateNavigationMetadata();\n this.applyAutoSize();\n };\n GridComponent.prototype.ngAfterContentChecked = function () {\n this.columnsContainer.refresh();\n this.verifySettings();\n this.initSelectionService();\n };\n GridComponent.prototype.ngAfterContentInit = function () {\n var _this = this;\n this.shouldGenerateColumns = !this.columns.length;\n this.autoGenerateColumns();\n this.columnList = new ColumnList(this.columns);\n this.columnsChangeSubscription = this.columns.changes.subscribe(function () { return _this.verifySettings(); });\n };\n GridComponent.prototype.ngOnInit = function () {\n if (this.navigable) {\n this.navigationService.init(this.navigationMetadata());\n }\n };\n GridComponent.prototype.ngOnDestroy = function () {\n if (this.selectionSubscription) {\n this.selectionSubscription.unsubscribe();\n }\n if (this.stateChangeSubscription) {\n this.stateChangeSubscription.unsubscribe();\n }\n if (this.groupExpandCollapseSubscription) {\n this.groupExpandCollapseSubscription.unsubscribe();\n }\n if (this.detailsServiceSubscription) {\n this.detailsServiceSubscription.unsubscribe();\n }\n if (this.editServiceSubscription) {\n this.editServiceSubscription.unsubscribe();\n }\n if (this.pdfSubscription) {\n this.pdfSubscription.unsubscribe();\n }\n if (this.filterSubscription) {\n this.filterSubscription.unsubscribe();\n }\n if (this.sortSubscription) {\n this.sortSubscription.unsubscribe();\n }\n if (this.columnsChangeSubscription) {\n this.columnsChangeSubscription.unsubscribe();\n }\n if (this.excelSubscription) {\n this.excelSubscription.unsubscribe();\n }\n if (this.columnsContainerChangeSubscription) {\n this.columnsContainerChangeSubscription.unsubscribe();\n }\n if (this.scrollSyncService) {\n this.scrollSyncService.destroy();\n }\n if (this.detachElementEventHandlers) {\n this.detachElementEventHandlers();\n }\n if (this.defaultSelection) {\n this.defaultSelection.destroy();\n }\n if (this.cellClickSubscription) {\n this.cellClickSubscription.unsubscribe();\n }\n if (this.footerChangeSubscription) {\n this.footerChangeSubscription.unsubscribe();\n }\n this.ngZone = null;\n if (this.columnResizingSubscription) {\n this.columnResizingSubscription.unsubscribe();\n }\n if (this.columnReorderSubscription) {\n this.columnReorderSubscription.unsubscribe();\n }\n if (this.localizationSubscription) {\n this.localizationSubscription.unsubscribe();\n }\n if (this.columnVisibilityChangeSubscription) {\n this.columnVisibilityChangeSubscription.unsubscribe();\n }\n if (this.columnLockedChangeSubscription) {\n this.columnLockedChangeSubscription.unsubscribe();\n }\n if (this.focusElementSubscription) {\n this.focusElementSubscription.unsubscribe();\n }\n this.columnRangeChangeSubscription.unsubscribe();\n };\n /**\n * @hidden\n */\n GridComponent.prototype.attachScrollSync = function () {\n var _this = this;\n if (isUniversal()) {\n return;\n }\n if (this.header) {\n this.scrollSyncService.registerEmitter(this.header.nativeElement, \"header\");\n }\n if (this.footer) {\n this.footerChangeSubscription = observe(this.footer)\n .subscribe(function (footers) {\n return footers\n .map(function (footer) { return footer.nativeElement; })\n .filter(isPresent)\n .forEach(function (element) {\n return _this.scrollSyncService.registerEmitter(element, \"footer\");\n });\n });\n }\n };\n /**\n * Switches the specified table row in the edit mode ([see example]({% slug editing_template_forms_grid %}#toc-editing-records)).\n *\n * @param index - The row index that will be switched in the edit mode.\n * @param group - The [`FormGroup`]({{ site.data.urls.angular['formgroupapi'] }})\n * that describes the edit form.\n * @param options - Additional options. Use skipFocus to determine if the row's edit element should be focused. Defaults to `false`.\n */\n GridComponent.prototype.editRow = function (index, group, options) {\n this.editService.editRow(index, group);\n if (options && options.skipFocus) {\n return;\n }\n this.focusEditElement(\"tr[data-kendo-grid-item-index=\\\"\" + index + \"\\\"]\");\n };\n /**\n * Closes the editor for a given row ([see example]({% slug editing_template_forms_grid %}#toc-cancelling-editing)).\n *\n * @param {number} index - The row index that will be switched out of the edit mode. If no index is provided, it is assumed\n * that the new item editor will be closed.\n */\n GridComponent.prototype.closeRow = function (index) {\n this.editService.close(index);\n };\n /**\n * Creates a new row editor ([see example]({% slug editing_template_forms_grid %}#toc-adding-records)).\n *\n * @param {FormGroup} group - The [`FormGroup`]({{ site.data.urls.angular['formgroupapi'] }}) that describes\n * the edit form. If called with a data item, it will build the `FormGroup` from the data item fields.\n */\n GridComponent.prototype.addRow = function (group) {\n var isFormGroup = group instanceof FormGroup;\n if (!isFormGroup) {\n var fields = Object.keys(group).reduce(createControl(group), {}); // FormBuilder?\n group = new FormGroup(fields);\n }\n this.editService.addRow(group);\n this.focusEditElement('.k-grid-add-row');\n };\n /**\n * Puts the cell that is specified by the table row and column in edit mode.\n *\n * @param {number} rowIndex - The data row index that will be switched in the edit mode.\n * @param {number|string|any} column - The leaf column index, or the field name or the column instance that should be edited.\n * @param {FormGroup} group - The [`FormGroup`]({{ site.data.urls.angular['formgroupapi'] }})\n * that describes the edit form.\n */\n GridComponent.prototype.editCell = function (rowIndex, column, group) {\n var instance = this.columnInstance(column);\n this.editService.editCell(rowIndex, instance, group);\n this.focusEditElement('.k-grid-edit-cell');\n };\n /**\n * Closes the current cell in edit mode and fires\n * the [`cellClose`]({% slug api_grid_gridcomponent %}#toc-cellclose) event.\n *\n * @return {boolean} Indicates whether the edited cell was closed.\n * A `false` value indicates that the\n * [`cellClose`]({% slug api_grid_gridcomponent %}#toc-cellclose) event was prevented.\n */\n GridComponent.prototype.closeCell = function () {\n return !this.editService.closeCell();\n };\n /**\n * Closes the current cell in edit mode.\n */\n GridComponent.prototype.cancelCell = function () {\n this.editService.cancelCell();\n };\n /**\n * Returns a flag which indicates if a row or a cell is currently edited.\n *\n * @return {boolean} A flag which indicates if a row or a cell is currently edited.\n */\n GridComponent.prototype.isEditing = function () {\n return this.editService.isEditing();\n };\n /**\n * Returns a flag which indicates if a cell is currently edited.\n *\n * @return {boolean} A flag which indicates if a cell is currently being edited.\n */\n GridComponent.prototype.isEditingCell = function () {\n return this.editService.isEditingCell();\n };\n /**\n * Initiates the PDF export ([see example]({% slug pdfexport_grid %})).\n */\n GridComponent.prototype.saveAsPDF = function () {\n this.pdfService.save(this);\n };\n /**\n * Exports the Grid element to a Drawing [`Group`]({% slug api_kendo-drawing_group %}) by using the `kendo-grid-pdf` component options.\n * ([see example]({% slug pdfexport_grid %}#toc-exporting-multiple-grids-to-the-same-pdf)).\n *\n * @return {Promise} - A promise that will be resolved with the Drawing `Group`.\n */\n GridComponent.prototype.drawPDF = function () {\n var promise = createPromise();\n this.pdfService.draw(this, promise);\n return promise;\n };\n /**\n * Initiates the Excel export ([see example]({% slug excelexport_grid %})).\n */\n GridComponent.prototype.saveAsExcel = function () {\n this.excelService.save(this);\n };\n /**\n * Applies the minimum possible width for the specified column,\n * so that the whole text fits without wrapping. This method expects the Grid\n * to be resizable (set `resizable` to `true`).\n * Makes sense to execute this method only\n * after the Grid is already populated with data.\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * \n * \n * \n * \n * \n *\n * \n * \n * \n *\n * \n * \n * \n * `\n * })\n * class AppComponent {\n * public gridData: any[] = products;\n * }\n *\n * const products = [{\n * \"ProductID\": 1,\n * \"ProductName\": \"Chai\",\n * \"UnitPrice\": 18.0000,\n * \"Discontinued\": true\n * }, {\n * \"ProductID\": 2,\n * \"ProductName\": \"Chang\",\n * \"UnitPrice\": 19.0000,\n * \"Discontinued\": false\n * }\n * ];\n * ```\n */\n GridComponent.prototype.autoFitColumn = function (column) {\n this.columnResizingService.autoFit(column);\n };\n /**\n * Adjusts the width of the specified columns to fit the entire content, including headers, without wrapping.\n * If no columns are specified, `autoFitColumns` is applied to all columns.\n *\n * This method requires the Grid to be resizable (set `resizable` to `true`).\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * \n * \n * \n * \n * \n * \n *\n * \n * \n * \n *\n * \n * \n * \n * `\n * })\n * class AppComponent {\n * public gridData: any[] = products;\n * }\n *\n * const products = [{\n * \"ProductID\": 1,\n * \"ProductName\": \"Chai\",\n * \"UnitPrice\": 18.0000,\n * \"Discontinued\": true\n * }, {\n * \"ProductID\": 2,\n * \"ProductName\": \"Chang\",\n * \"UnitPrice\": 19.0000,\n * \"Discontinued\": false\n * }\n * ];\n * ```\n */\n GridComponent.prototype.autoFitColumns = function (columns) {\n if (columns === void 0) { columns = this.columns; }\n var _a;\n var cols;\n if (columns instanceof QueryList) {\n cols = columns.toArray();\n }\n else {\n cols = columns;\n }\n (_a = this.columnResizingService).autoFit.apply(_a, cols);\n };\n /**\n * @hidden\n */\n GridComponent.prototype.notifyPageChange = function (source, event) {\n if (source === \"list\" && !this.isVirtual) {\n return;\n }\n this.pageChange.emit(event);\n };\n /**\n * @hidden\n */\n GridComponent.prototype.notifyScrollBottom = function () {\n var _this = this;\n if (this.scrollable === 'none') {\n return;\n }\n if (hasObservers(this.scrollBottom)) {\n this.ngZone.run(function () { return _this.scrollBottom.emit({ sender: _this }); });\n }\n };\n /**\n * @hidden\n */\n GridComponent.prototype.focusEditElement = function (containerSelector) {\n var _this = this;\n if (this.focusElementSubscription) {\n this.focusElementSubscription.unsubscribe();\n }\n this.ngZone.runOutsideAngular(function () {\n _this.focusElementSubscription = _this.ngZone.onStable.asObservable().pipe(take(1)).subscribe(function () {\n var wrapper = _this.wrapper.nativeElement;\n if (!_this.setEditFocus(wrapper.querySelector(containerSelector)) && _this.isLocked) {\n _this.setEditFocus(wrapper.querySelector(\".k-grid-content \" + containerSelector));\n }\n _this.focusElementSubscription = null;\n });\n });\n };\n /**\n * Focuses the last active or the first cell of the Grid.\n *\n * @returns {NavigationCell} The focused cell.\n */\n GridComponent.prototype.focus = function () {\n this.assertNavigable();\n return this.navigationService.focusCell();\n };\n /**\n * Focuses the cell with the specified row and column index.\n *\n * The row index is based on the logical structure of the Grid and does not correspond to the data item index:\n * * Header rows are included, starting at index 0.\n * * Group headers and footers are included.\n * * The row indexing is absolute and does not change with paging.\n *\n * If the Grid is configured for scrolling, including virtual scrolling, the scroll position will be updated.\n * If the row is not present on the current page, the method will have no effect.\n *\n * @param rowIndex - The logical row index to focus. The top header row has an index 0.\n * @param colIndex - The column index to focus.\n * @returns {NavigationCell} The focused cell.\n *\n */\n GridComponent.prototype.focusCell = function (rowIndex, colIndex) {\n this.assertNavigable();\n return this.navigationService.focusCell(rowIndex, colIndex);\n };\n /**\n * Focuses the next cell, optionally wrapping to the next row.\n *\n * @param wrap - A Boolean value which indicates if the focus will move to the next row. Defaults to `true`.\n * @returns {NavigationCell} The focused cell. If the focus is already on the last cell, returns `null`.\n */\n GridComponent.prototype.focusNextCell = function (wrap) {\n if (wrap === void 0) { wrap = true; }\n this.assertNavigable();\n return this.navigationService.focusNextCell(wrap);\n };\n /**\n * Focuses the previous cell. Optionally wraps to the previous row.\n *\n * @param wrap - A Boolean value which indicates if the focus will move to the next row. Defaults to `true`.\n * @returns {NavigationCell} The focused cell. If the focus is already on the first cell, returns `null`.\n */\n GridComponent.prototype.focusPrevCell = function (wrap) {\n if (wrap === void 0) { wrap = true; }\n this.assertNavigable();\n return this.navigationService.focusPrevCell(wrap);\n };\n /**\n * Scrolls to the specified row and column\n */\n GridComponent.prototype.scrollTo = function (request) {\n this.scrollRequestService.scrollTo(request);\n };\n /**\n * Changes the position of the specified column.\n * The reordering of columns operates only on the level\n * which is inferred by the source column.\n * For the `reorderColumn` method to work properly,\n * the `source` column has to be visible.\n *\n * @param {ColumnBase} source - The column whose position will be changed.\n * @param {number} destIndex - The new position of the column.\n * @param {ColumnReorderConfig} options - Additional options.\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * \n * \n * \n * \n * \n *\n * \n * \n * \n *\n * \n * \n *\n * \n * \n * \n * `\n * })\n * class AppComponent {\n * public gridData: any[] = products;\n * }\n *\n * const products = [{\n * \"ProductID\": 1,\n * \"ProductName\": \"Chai\",\n * \"UnitPrice\": 18.0000,\n * \"Discontinued\": true\n * }, {\n * \"ProductID\": 2,\n * \"ProductName\": \"Chang\",\n * \"UnitPrice\": 19.0000,\n * \"Discontinued\": false\n * }\n * ];\n * ```\n */\n GridComponent.prototype.reorderColumn = function (source, destIndex, options) {\n if (options === void 0) { options = { before: false }; }\n var columnsForLevel = this.columnsForLevel(source.level);\n var target = columnsForLevel[destIndex];\n if (!target) {\n return;\n }\n var lastNonLocked = target.isLocked &&\n !source.isLocked &&\n this.columnsContainer.nonLockedColumns.length === 1;\n if (lastNonLocked) {\n return;\n }\n if (isSpanColumnComponent(target) && !options.before) {\n target = target.childColumns.last;\n }\n this.reorder({\n before: options.before,\n source: source,\n target: target\n });\n };\n /**\n * @hidden\n */\n GridComponent.prototype.reorder = function (_a) {\n var _this = this;\n var target = _a.target, source = _a.source, before = _a.before, changeContainer = _a.changeContainer;\n this.ngZone.run(function () {\n var columnsForLevel = _this.columnsForLevel(source.level);\n var newIndex = columnsForLevel.indexOf(target);\n if (target.parent && target.parent.isSpanColumn) {\n newIndex = columnsForLevel.indexOf(target.parent);\n if (before) {\n target = target.parent;\n }\n }\n var oldIndex = columnsForLevel.indexOf(source);\n if (changeContainer) {\n if (before && 0 < newIndex && oldIndex < newIndex) { // dropped before the first not locked column\n newIndex--;\n }\n else if (!before && oldIndex > newIndex) { // dropped after the last locked column\n newIndex++;\n }\n }\n var args = new ColumnReorderEvent({\n column: source,\n oldIndex: oldIndex,\n newIndex: newIndex\n });\n _this.columnReorder.emit(args);\n if (args.isDefaultPrevented()) {\n return;\n }\n if (changeContainer) {\n _this.columnLockedChange.emit(new ColumnLockedChangeEvent([source]));\n }\n _this.updateColumnIndices({ source: source, target: target, before: before });\n if (source.locked !== target.locked) {\n source.locked = target.locked;\n }\n _this.columnsContainer.refresh();\n _this.changeDetectorRef.markForCheck();\n });\n };\n GridComponent.prototype.updateColumnIndices = function (_a) {\n var source = _a.source, target = _a.target, before = _a.before;\n var expandedColumns = expandColumnsWithSpan(this.columnsForLevel(source.level));\n var sourceColumnIndex = expandedColumns.indexOf(source);\n var nextSourceIndex = 0;\n var nextIndex = 0;\n var toSkip = 1;\n // Possible only when called from the API.\n if (source.isSpanColumn) {\n toSkip += source.childColumns.length;\n }\n var i = 0;\n while (i < expandedColumns.length) {\n var column = expandedColumns[i];\n if (column === target) {\n nextSourceIndex = before ? nextIndex : nextIndex + 1;\n nextIndex = before ? nextIndex + toSkip : nextIndex;\n column.orderIndex = nextIndex;\n if (nextSourceIndex === nextIndex + 1) {\n nextIndex += toSkip;\n }\n }\n else if (column === source) {\n i += toSkip;\n continue;\n }\n else {\n column.orderIndex = nextIndex;\n }\n nextIndex++;\n i++;\n }\n for (i = sourceColumnIndex; i < sourceColumnIndex + toSkip; i++) {\n expandedColumns[i].orderIndex = nextSourceIndex++;\n }\n this.updateIndicesForLevel(source.level + 1);\n };\n GridComponent.prototype.updateIndicesForLevel = function (level) {\n var colsForParentLevel = this.columnsForLevel(level - 1);\n var colsForLevel = [];\n sortColumns(colsForParentLevel).forEach(function (c) {\n if (c.isColumnGroup) {\n colsForLevel.push.apply(colsForLevel, c.childrenArray.sort(function (a, b) { return a.orderIndex - b.orderIndex; }));\n }\n });\n expandColumnsWithSpan(colsForLevel).map(function (c, i) { return c.orderIndex = i; });\n if (level < this.columnsContainer.totalLevels) {\n this.updateIndicesForLevel(level + 1);\n }\n };\n GridComponent.prototype.columnsForLevel = function (level) {\n return this.columnsContainer\n .allColumns.filter(function (column) { return column.level === level; });\n };\n GridComponent.prototype.initSelectionService = function () {\n if (!this.selectionDirective && !isPresent(this.defaultSelection)) {\n this.defaultSelection = new Selection(this, this.changeDetectorRef);\n }\n this.selectionService.init({\n rowSelected: this.rowSelected,\n selectable: this.selectable,\n view: this.view\n });\n if (!this.selectionDirective && !this.selectableSettings.enabled) {\n this.defaultSelection.reset();\n }\n };\n GridComponent.prototype.setEditFocus = function (element) {\n if (element) {\n return this.navigationService.tryFocus(element);\n }\n };\n GridComponent.prototype.columnInstance = function (column) {\n var instance;\n if (typeof column === 'number') {\n instance = this.columnsContainer.lockedLeafColumns.toArray()\n .concat(this.columnsContainer.nonLockedLeafColumns.toArray())[column];\n }\n else if (typeof column === 'string') {\n instance = this.columnList.filter(function (item) { return item.field === column; })[0];\n }\n else {\n instance = column;\n }\n if (!instance && isDevMode()) {\n throw new Error(\"Invalid column \" + column);\n }\n return instance;\n };\n GridComponent.prototype.verifySettings = function () {\n if (isDevMode()) {\n var locked = this.lockedLeafColumns.length || (this.columnMenu && this.columnMenu.lock);\n if (locked && this.detailTemplate) {\n throw new Error('Having both detail template and locked columns is not supported.');\n }\n if (this.lockedLeafColumns.length && !this.nonLockedLeafColumns.length) {\n throw new Error('There should be at least one non-locked column');\n }\n if ((locked || this.virtualColumns) && expandColumns(this.columnList.toArray()).filter(function (column) { return !column.width && !isColumnGroupComponent(column); }).length) {\n throw new Error((locked ? 'Locked' : 'Virtual') + ' columns feature requires all columns to have set width.');\n }\n if (locked && !this.isScrollable) {\n throw new Error('Locked columns are only supported when scrolling is enabled.');\n }\n if (this.columnList.filter(isColumnGroupComponent).filter(function (x) { return !x.hasChildren; }).length) {\n throw new Error('ColumnGroupComponent should contain ColumnComponent or CommandColumnComponent.');\n }\n if (this.columnList.filter(function (x) { return x.locked && x.parent && !x.parent.isLocked; }).length) {\n throw new Error('Locked child columns require their parent columns to be locked.');\n }\n if ((this.rowHeight || this.detailRowHeight) && !this.isVirtual) {\n throw new Error('Row height and detail row height settings require virtual scrolling mode to be enabled.');\n }\n validateColumnsField(this.columnList);\n }\n };\n GridComponent.prototype.autoGenerateColumns = function () {\n if (this.shouldGenerateColumns && !this.columns.length && this.view.length) {\n this.columns.reset(Object.keys(this.view.at(0)).map(function (field) {\n var column = new ColumnComponent();\n column.field = field;\n return column;\n }));\n }\n };\n GridComponent.prototype.attachStateChangesEmitter = function () {\n var _this = this;\n this.stateChangeSubscription =\n merge(this.pageChange.pipe(map(function (x) { return ({\n filter: _this.filter, group: _this.group, skip: x.skip, sort: _this.sort, take: x.take\n }); })), this.sortChange.pipe(map(function (sort) { return ({ filter: _this.filter, group: _this.group, skip: _this.skip, sort: sort, take: _this.pageSize }); })), this.groupChange.pipe(map(function (group) { return ({\n filter: _this.filter, group: group, skip: _this.skip, sort: _this.sort, take: _this.pageSize\n }); })), this.filterChange.pipe(map(function (filter$$1) { return ({\n filter: filter$$1, group: _this.group, skip: 0, sort: _this.sort, take: _this.pageSize\n }); })))\n .subscribe(function (x) {\n _this.closeCell();\n _this.cancelCell();\n _this.dataStateChange.emit(x);\n });\n };\n GridComponent.prototype.attachEditHandlers = function () {\n if (!this.editService) {\n return;\n }\n this.editServiceSubscription = this.editService\n .changes.subscribe(this.emitCRUDEvent.bind(this));\n };\n GridComponent.prototype.emitCRUDEvent = function (args) {\n var action = args.action, rowIndex = args.rowIndex, formGroup = args.formGroup;\n var dataItem = this.view.at(rowIndex - this.skip);\n if (action !== 'add' && !dataItem) {\n dataItem = formGroup.value;\n }\n this.closeCell();\n Object.assign(args, {\n dataItem: dataItem,\n sender: this\n });\n switch (action) {\n case 'add':\n this.add.emit(args);\n break;\n case 'cancel':\n this.cancel.emit(args);\n break;\n case 'edit':\n this.edit.emit(args);\n break;\n case 'remove':\n this.remove.emit(args);\n break;\n case 'save':\n this.save.emit(args);\n break;\n case 'cellClose':\n this.cellClose.emit(args);\n break;\n default: break;\n }\n };\n GridComponent.prototype.attachDomEventHandlers = function () {\n var _this = this;\n this.cellClickSubscription = this.domEvents.cellClick.subscribe(function (args) {\n _this.cellClick.emit(Object.assign({ sender: _this }, args));\n });\n };\n GridComponent.prototype.attachElementEventHandlers = function () {\n var _this = this;\n if (isUniversal()) {\n return;\n }\n var wrapper = this.wrapper.nativeElement;\n var ariaRoot = this.ariaRoot.nativeElement;\n this.ngZone.runOutsideAngular(function () {\n var resizeCheck = _this.resizeCheck.bind(_this);\n var resizeSubscription = _this.renderer.listen('window', 'resize', resizeCheck);\n var orientationSubscription = _this.renderer.listen('window', 'orientationchange', resizeCheck);\n var documentClickSubscription = _this.renderer.listen('document', 'click', function (args) {\n var activeElement = document.activeElement;\n if (_this.editService.shouldCloseCell() &&\n !closest(args.target, matchesClasses('k-animation-container k-grid-ignore-click')) &&\n !(activeElement &&\n (closest(activeElement, matchesClasses('k-animation-container')) ||\n isInEditedCell(activeElement, _this.wrapper.nativeElement)))) {\n _this.editService.closeCell(args);\n }\n });\n var windowBlurSubscription = _this.renderer.listen('window', 'blur', function (args) {\n var activeElement = document.activeElement;\n if (activeElement && !(matchesNodeName('input')(activeElement) && activeElement.type === 'file' &&\n isInEditedCell(activeElement, _this.wrapper.nativeElement))) {\n _this.editService.closeCell(args);\n }\n _this.domEvents.windowBlur.emit(args);\n });\n var clickSubscription = _this.renderer.listen(wrapper, 'click', function (args) {\n _this.domEvents.click.emit(args);\n });\n var keydownSubscription = _this.renderer.listen(wrapper, 'keydown', function (args) {\n _this.domEvents.keydown.emit(args);\n });\n // focusIn and focusOut are relative to the element with ARIA role \"grid\"\n var focused = false;\n var focusInSubscription = _this.renderer.listen(ariaRoot, 'focusin', function (args) {\n _this.domEvents.focus.emit(args);\n if (!focused) {\n _this.domEvents.focusIn.emit(args);\n focused = true;\n }\n });\n var focusOutSubscription = _this.renderer.listen(ariaRoot, 'focusout', function (args) {\n var next = args.relatedTarget || document.activeElement;\n var outside = !closest(next, function (node) { return node === ariaRoot; });\n if (outside) {\n _this.domEvents.focusOut.emit(args);\n focused = false;\n }\n });\n _this.detachElementEventHandlers = function () {\n resizeSubscription();\n orientationSubscription();\n documentClickSubscription();\n windowBlurSubscription();\n clickSubscription();\n keydownSubscription();\n focusInSubscription();\n focusOutSubscription();\n };\n });\n };\n GridComponent.prototype.matchesMedia = function (c) {\n return this.responsiveService.matchesMedia(c.media);\n };\n GridComponent.prototype.resizeCheck = function () {\n var _this = this;\n if (window.innerWidth !== this.cachedWindowWidth) {\n this.cachedWindowWidth = window.innerWidth;\n var hasChanges_1 = false;\n this.columnList.filterHierarchy(function (column) {\n var matchesMedia = _this.matchesMedia(column);\n if (column.matchesMedia !== matchesMedia) {\n hasChanges_1 = true;\n column.matchesMedia = matchesMedia;\n }\n return column.isVisible;\n });\n if (hasChanges_1) {\n this.ngZone.run(function () {\n _this.changeDetectorRef.markForCheck();\n });\n }\n }\n };\n GridComponent.prototype.emitPDFExportEvent = function () {\n var args = new PDFExportEvent();\n this.pdfExport.emit(args);\n if (!args.isDefaultPrevented()) {\n this.saveAsPDF();\n }\n };\n GridComponent.prototype.syncHeaderHeight = function (observable) {\n var _this = this;\n return observable\n .pipe(filter(function () { return isPresent(_this.lockedHeader); }))\n .subscribe(function () {\n return syncRowsHeight(_this.lockedHeader.nativeElement.children[0], _this.header.nativeElement.children[0]);\n });\n };\n GridComponent.prototype.columnsContainerChange = function () {\n var _this = this;\n this.columnsContainerChangeSubscription =\n this.syncHeaderHeight(this.columnsContainer.changes.pipe(filter(function () { return _this.lockedColumns.length > 0; }), switchMap(function () { return _this.ngZone.onStable.asObservable().pipe(take(1)); })));\n };\n GridComponent.prototype.handleColumnResize = function () {\n var _this = this;\n var resizes = this.columnResizingService.changes;\n this.columnResizingSubscription = resizes.pipe(tap(function (e) {\n if (e.type === 'start') {\n _this.renderer.addClass(_this.wrapper.nativeElement, 'k-grid-column-resizing');\n }\n else if (e.type === 'end') {\n _this.renderer.removeClass(_this.wrapper.nativeElement, 'k-grid-column-resizing');\n }\n }), filter(function (e) { return e.type === 'start'; }), switchMap(function () {\n return resizes.pipe(\n // tslint:disable-next-line: rxjs-no-unsafe-takeuntil\n takeUntil(resizes.pipe(filter(function (e) { return e.type === 'triggerAutoFit'; }))), filter(function (e) { return e.type === 'end'; }));\n }))\n .subscribe(this.notifyResize.bind(this));\n };\n GridComponent.prototype.notifyResize = function (e) {\n var args = e.resizedColumns\n .filter(function (item) { return isTruthy(item.column.resizable) && !item.column.isColumnGroup; })\n .map(function (item) { return ({\n column: item.column,\n newWidth: item.column.width,\n oldWidth: item.oldWidth\n }); });\n this.columnResize.emit(args);\n };\n GridComponent.prototype.assertNavigable = function () {\n if (isDevMode() && !this.navigable) {\n throw new Error('The Grid should be configured as [navigable]=\"true\" to control focus');\n }\n };\n GridComponent.prototype.navigationMetadata = function () {\n var isVirtual = this.isVirtual;\n var pageSize = this.pageSize;\n var dataRows = isVirtual ? this.view.total : pageSize;\n var addRowOffset = this.editService.hasNewItem ? 1 : 0;\n var filterRowOffset = hasFilterRow(this.filterable) ? 1 : 0;\n var headerRows = this.totalColumnLevels + 1 + filterRowOffset + addRowOffset;\n return new NavigationMetadata(dataRows, headerRows, isVirtual, this.showPager, isPresent(this.detailTemplate), this.wrapper, this.virtualColumns, this.columnsContainer);\n };\n GridComponent.prototype.updateNavigationMetadata = function () {\n this.navigationService.metadata = this.navigationMetadata();\n };\n GridComponent.prototype.applyAutoSize = function () {\n var _this = this;\n var cols = this.columns.filter(function (c) { return _this.autoSize ? c.autoSize !== false : c.autoSize; });\n if (cols.length > 0) {\n this.ngZone.onStable.pipe(take(1)).subscribe(function (_) { return _this.autoFitColumns(cols); });\n }\n };\n GridComponent.prototype.onColumnRangeChange = function (range) {\n var viewportColumns = this.viewportColumns = [];\n var leafViewportColumns = this.columnsContainer\n .nonLockedLeafColumns.toArray().slice(range.start, range.end + 1);\n for (var idx = 0; idx < leafViewportColumns.length; idx++) {\n var column = leafViewportColumns[idx];\n while (column.parent) {\n column = column.parent;\n }\n var toAdd = [column];\n while (toAdd.length) {\n column = toAdd.shift();\n viewportColumns.push(column);\n if (column.isColumnGroup) {\n toAdd.unshift.apply(toAdd, column.childrenArray);\n }\n }\n var lastFromGroup = viewportColumns[viewportColumns.length - 1];\n column = leafViewportColumns[idx];\n while (column !== lastFromGroup && idx < leafViewportColumns.length) {\n idx++;\n column = leafViewportColumns[idx];\n }\n }\n if (range.start > 0) {\n var first = leafViewportColumns[0];\n var offset = range.offset;\n var current = viewportColumns[0];\n var index = 0;\n while (current !== first) {\n offset -= current.isColumnGroup ? 0 : current.width;\n index++;\n current = viewportColumns[index];\n }\n if (offset > 0) {\n var totalLevels = this.columnsContainer.totalLevels;\n var previous = void 0;\n for (var idx = 0; idx <= totalLevels; idx++) {\n var offsetColumn = idx < totalLevels ? new ColumnGroupComponent(previous) : new ColumnBase$1(previous);\n previous = offsetColumn;\n offsetColumn.title = \"\\u00A0\";\n offsetColumn.width = offset;\n viewportColumns.unshift(offsetColumn);\n }\n }\n }\n this.leafViewportColumns = viewportColumns.filter(function (c) { return !c.isColumnGroup; });\n };\n GridComponent.decorators = [\n { type: Component, args: [{\n encapsulation: ViewEncapsulation.None,\n exportAs: 'kendoGrid',\n providers: [\n BrowserSupportService,\n LocalizationService,\n ColumnInfoService,\n SelectionService,\n DetailsService,\n GroupsService,\n GroupInfoService,\n ChangeNotificationService,\n EditService,\n PDFService,\n SuspendService,\n {\n provide: CELL_CONTEXT,\n useValue: ɵ4$2\n },\n {\n provide: L10N_PREFIX,\n useValue: 'kendo.grid'\n },\n FilterService,\n ResponsiveService,\n PagerContextService,\n ExcelService,\n ScrollSyncService,\n ResizeService,\n LocalDataChangesService,\n DomEventsService,\n ColumnResizingService,\n SinglePopupService,\n DragAndDropService,\n DragHintService,\n DropCueService,\n ColumnReorderService,\n NavigationService,\n FocusRoot,\n IdService,\n ScrollRequestService,\n SortService\n ],\n selector: 'kendo-grid',\n styles: [\n // Styles for backwards compatibility with kendo-theme-default@v2.46.0 and earlier.\n \" .k-grid .k-grid-aria-root {\\n display: flex;\\n flex-direction: column;\\n flex: 1 1 auto;\\n overflow: hidden;\\n }\\n\\n .k-grid .k-filter-row td {\\n white-space: nowrap;\\n }\"\n ],\n template: \"\\n \\n \\n \\n \\n \\n \\n
\\n \\n \\n \\n \\n \\n
\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n \\n
\\n \\n
\\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n GridComponent.ctorParameters = function () { return [\n { type: BrowserSupportService },\n { type: SelectionService },\n { type: ElementRef },\n { type: GroupInfoService },\n { type: GroupsService },\n { type: ChangeNotificationService },\n { type: DetailsService },\n { type: EditService },\n { type: FilterService },\n { type: PDFService },\n { type: ResponsiveService },\n { type: Renderer2 },\n { type: ExcelService },\n { type: NgZone },\n { type: ScrollSyncService },\n { type: DomEventsService },\n { type: ColumnResizingService },\n { type: ChangeDetectorRef },\n { type: ColumnReorderService },\n { type: ColumnInfoService },\n { type: NavigationService },\n { type: SortService },\n { type: ScrollRequestService },\n { type: LocalizationService }\n ]; };\n GridComponent.propDecorators = {\n data: [{ type: Input }],\n pageSize: [{ type: Input }],\n height: [{ type: Input }],\n rowHeight: [{ type: Input }],\n detailRowHeight: [{ type: Input }],\n skip: [{ type: Input }],\n scrollable: [{ type: Input }],\n selectable: [{ type: Input }],\n sort: [{ type: Input }],\n trackBy: [{ type: Input }],\n filter: [{ type: Input }],\n group: [{ type: Input }],\n virtualColumns: [{ type: Input }],\n filterable: [{ type: Input }],\n sortable: [{ type: Input }],\n pageable: [{ type: Input }],\n groupable: [{ type: Input }],\n navigable: [{ type: Input }],\n navigatable: [{ type: Input }],\n autoSize: [{ type: Input }],\n rowClass: [{ type: Input }],\n rowSelected: [{ type: Input }],\n resizable: [{ type: Input }],\n reorderable: [{ type: Input }],\n loading: [{ type: Input }],\n columnMenu: [{ type: Input }],\n hideHeader: [{ type: Input }],\n filterChange: [{ type: Output }],\n pageChange: [{ type: Output }],\n groupChange: [{ type: Output }],\n sortChange: [{ type: Output }],\n selectionChange: [{ type: Output }],\n dataStateChange: [{ type: Output }],\n groupExpand: [{ type: Output }],\n groupCollapse: [{ type: Output }],\n detailExpand: [{ type: Output }],\n detailCollapse: [{ type: Output }],\n edit: [{ type: Output }],\n cancel: [{ type: Output }],\n save: [{ type: Output }],\n remove: [{ type: Output }],\n add: [{ type: Output }],\n cellClose: [{ type: Output }],\n cellClick: [{ type: Output }],\n pdfExport: [{ type: Output }],\n excelExport: [{ type: Output }],\n columnResize: [{ type: Output }],\n columnReorder: [{ type: Output }],\n columnVisibilityChange: [{ type: Output }],\n columnLockedChange: [{ type: Output }],\n scrollBottom: [{ type: Output }],\n contentScroll: [{ type: Output }],\n columns: [{ type: ContentChildren, args: [ColumnBase$1,] }],\n dir: [{ type: HostBinding, args: ['attr.dir',] }],\n hostClasses: [{ type: HostBinding, args: ['class.k-widget',] }, { type: HostBinding, args: ['class.k-grid',] }],\n lockedClasses: [{ type: HostBinding, args: ['class.k-grid-lockedcolumns',] }],\n virtualClasses: [{ type: HostBinding, args: ['class.k-grid-virtual',] }],\n noScrollbarClass: [{ type: HostBinding, args: ['class.k-grid-no-scrollbar',] }],\n detailTemplateChildren: [{ type: ContentChildren, args: [DetailTemplateDirective,] }],\n noRecordsTemplateChildren: [{ type: ContentChildren, args: [NoRecordsTemplateDirective,] }],\n pagerTemplateChildren: [{ type: ContentChildren, args: [PagerTemplateDirective,] }],\n toolbarTemplateChildren: [{ type: ContentChildren, args: [ToolbarTemplateDirective,] }],\n columnMenuTemplates: [{ type: ContentChildren, args: [ColumnMenuTemplateDirective,] }],\n lockedHeader: [{ type: ViewChild, args: [\"lockedHeader\",] }],\n header: [{ type: ViewChild, args: [\"header\",] }],\n footer: [{ type: ViewChildren, args: [\"footer\",] }],\n ariaRoot: [{ type: ViewChild, args: ['ariaRoot',] }]\n };\n return GridComponent;\n}());\n\n/**\n * @hidden\n */\nvar update = function (arr, idx, value) { return (arr.slice(0, idx + 1).concat((arr.slice(idx + 1).map(function (x) { return x + value; })))); };\n/**\n * @hidden\n */\nvar RowHeightService = /** @class */ (function () {\n function RowHeightService(total, rowHeight, detailRowHeight) {\n if (total === void 0) { total = 0; }\n this.total = total;\n this.rowHeight = rowHeight;\n this.detailRowHeight = detailRowHeight;\n this.offsets = [];\n this.heights = [];\n var agg = 0;\n for (var idx = 0; idx < total; idx++) {\n this.offsets.push(agg);\n agg += rowHeight;\n this.heights.push(rowHeight);\n }\n }\n RowHeightService.prototype.height = function (rowIndex) {\n return this.heights[rowIndex];\n };\n RowHeightService.prototype.expandDetail = function (rowIndex) {\n if (this.height(rowIndex) === this.rowHeight) {\n this.updateRowHeight(rowIndex, this.detailRowHeight);\n }\n };\n RowHeightService.prototype.collapseDetail = function (rowIndex) {\n if (this.height(rowIndex) > this.rowHeight) {\n this.updateRowHeight(rowIndex, this.detailRowHeight * -1);\n }\n };\n RowHeightService.prototype.isExpanded = function (rowIndex) {\n return this.height(rowIndex) > this.rowHeight;\n };\n RowHeightService.prototype.index = function (position) {\n if (position < 0) {\n return undefined;\n }\n var result = this.offsets.reduce(function (prev, current, idx) {\n if (prev !== undefined) {\n return prev;\n }\n else if (current === position) {\n return idx;\n }\n else if (current > position) {\n return idx - 1;\n }\n return undefined;\n }, undefined); // tslint:disable-line:align\n return result === undefined ? this.total - 1 : result;\n };\n RowHeightService.prototype.offset = function (rowIndex) {\n return this.offsets[rowIndex];\n };\n RowHeightService.prototype.totalHeight = function () {\n return this.heights.reduce(function (prev, curr) { return prev + curr; }, 0);\n };\n RowHeightService.prototype.updateRowHeight = function (rowIndex, value) {\n if (this.total > 0) {\n this.heights[rowIndex] += value;\n this.offsets = update(this.offsets, rowIndex, value);\n }\n };\n return RowHeightService;\n}());\n\n/**\n * @hidden\n */\nvar ScrollAction = /** @class */ (function () {\n function ScrollAction(offset) {\n this.offset = offset;\n }\n return ScrollAction;\n}());\n/**\n * @hidden\n */\nvar PageAction = /** @class */ (function () {\n function PageAction(skip, take$$1) {\n this.skip = skip;\n this.take = take$$1;\n }\n return PageAction;\n}());\n/**\n * @hidden\n */\nvar ScrollBottomAction = /** @class */ (function () {\n function ScrollBottomAction() {\n }\n return ScrollBottomAction;\n}());\nvar SCROLL_BOTTOM_THRESHOLD = 1;\n/**\n * @hidden\n */\nvar ScrollerService = /** @class */ (function () {\n function ScrollerService(scrollObservable) {\n this.scrollObservable = scrollObservable;\n this.firstLoaded = 0;\n }\n ScrollerService.prototype.create = function (rowHeightService, skip, take$$1, total) {\n var _this = this;\n this.rowHeightService = rowHeightService;\n this.firstLoaded = skip;\n this.lastLoaded = skip + take$$1;\n this.take = take$$1;\n this.total = total;\n this.lastScrollTop = 0;\n var subject = new BehaviorSubject(new ScrollAction(this.rowHeightService.offset(skip)));\n this.subscription = Observable.create(function (observer) {\n _this.unsubscribe();\n _this.scrollSubscription = _this.scrollObservable.subscribe(function (x) { return _this.onScroll(x, observer); });\n }).subscribe(function (x) { return subject.next(x); });\n return subject;\n };\n ScrollerService.prototype.destroy = function () {\n this.unsubscribe();\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n };\n ScrollerService.prototype.onScroll = function (_a, observer) {\n var scrollTop = _a.scrollTop, offsetHeight = _a.offsetHeight, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;\n if (this.lastScrollTop === scrollTop) {\n return;\n }\n var up = this.lastScrollTop >= scrollTop;\n this.lastScrollTop = scrollTop;\n var firstItemIndex = this.rowHeightService.index(scrollTop);\n var firstItemOffset = this.rowHeightService.offset(firstItemIndex);\n var lastItemIndex = this.rowHeightService.index(scrollTop + offsetHeight);\n if (!up) {\n if (lastItemIndex >= this.lastLoaded && this.lastLoaded < this.total) {\n var overflow = (firstItemIndex + this.take) - this.total;\n if (overflow > 0) {\n firstItemIndex = firstItemIndex - overflow;\n firstItemOffset = this.rowHeightService.offset(firstItemIndex);\n }\n this.firstLoaded = firstItemIndex;\n observer.next(new ScrollAction(firstItemOffset));\n var nextTake = this.firstLoaded + this.take;\n this.lastLoaded = Math.min(nextTake, this.total);\n nextTake = nextTake > this.total ? this.total - this.firstLoaded : this.take;\n observer.next(new PageAction(this.firstLoaded, this.take));\n }\n else {\n var atBottom = scrollHeight - clientHeight - scrollTop < SCROLL_BOTTOM_THRESHOLD;\n if (atBottom) {\n observer.next(new ScrollBottomAction());\n }\n }\n }\n if (up && firstItemIndex < this.firstLoaded) {\n var nonVisibleBuffer = Math.floor(this.take * 0.3);\n this.firstLoaded = Math.max(firstItemIndex - nonVisibleBuffer, 0);\n observer.next(new ScrollAction(this.rowHeightService.offset(this.firstLoaded)));\n this.lastLoaded = Math.min(this.firstLoaded + this.take, this.total);\n observer.next(new PageAction(this.firstLoaded, this.take));\n }\n };\n ScrollerService.prototype.unsubscribe = function () {\n if (this.scrollSubscription) {\n this.scrollSubscription.unsubscribe();\n this.scrollSubscription = undefined;\n }\n };\n return ScrollerService;\n}());\n\n/**\n * @hidden\n */\nvar NON_DATA_CELL_CLASSES = 'k-hierarchy-cell k-detail-cell k-group-cell';\n/**\n * @hidden\n */\nvar NON_DATA_ROW_CLASSES = 'k-grouping-row k-group-footer k-detail-row k-grid-norecords';\n/**\n * @hidden\n */\nvar IGNORE_TARGET_CLASSSES = 'k-icon';\n/**\n * @hidden\n */\nvar IGNORE_CONTAINER_CLASSES = 'k-widget k-grid-ignore-click';\n\nvar elementAt = function (index, elements, elementOffset) {\n for (var idx = 0, elementIdx = 0; idx < elements.length; idx++) {\n var offset = elementOffset(elements[idx]);\n if (elementIdx <= index && index <= elementIdx + offset - 1) {\n return elements[idx];\n }\n elementIdx += offset;\n }\n};\nvar rowAt = function (index, rows) {\n return elementAt(index, rows, function (row) { return row.hasAttribute('data-kendo-grid-item-index') ? 1 : 0; });\n};\nvar cellAt = function (index, cells) {\n return elementAt(index, cells, function (cell) { return !hasClasses(cell, NON_DATA_CELL_CLASSES) ? parseInt(cell.getAttribute('colSpan'), 10) || 1 : 0; });\n};\nvar EMPTY_OBJECT = {};\n/**\n * @hidden\n */\nvar SCROLLER_FACTORY_TOKEN = new InjectionToken('grid-scroll-service-factory');\n/**\n * @hidden\n */\nfunction DEFAULT_SCROLLER_FACTORY(observable) {\n return new ScrollerService(observable);\n}\nvar wheelDeltaY = function (e) {\n var deltaY = e.wheelDeltaY;\n if (e.wheelDelta && (deltaY === undefined || deltaY)) {\n return e.wheelDelta;\n }\n else if (e.detail && e.axis === e.VERTICAL_AXIS) {\n return (-e.detail) * 10;\n }\n return 0;\n};\nvar preventLockedScroll = function (el) { return function (event) {\n var delta = wheelDeltaY(event);\n var scrollTop = el.scrollTop;\n var allowScroll = (scrollTop === 0 && 0 < delta) || (el.scrollHeight <= el.offsetHeight + scrollTop && delta < 0);\n if (!allowScroll) {\n event.preventDefault();\n }\n}; };\nvar translateY = function (renderer, value) { return function (el) { return renderer.setStyle(el, \"transform\", \"translateY(\" + value + \"px)\"); }; };\nvar maybeNativeElement = function (el) { return el ? el.nativeElement : null; };\nvar hasScrollbar = function (el, parent) { return el.nativeElement.offsetWidth > parent.nativeElement.clientWidth; };\nvar setHeight$1 = function (renderer) { return function (_a) {\n var el = _a.el, height = _a.height;\n return renderer.setStyle(el, \"height\", height + \"px\");\n}; };\nvar bufferSize = 1;\n/**\n * @hidden\n */\nvar ListComponent = /** @class */ (function () {\n function ListComponent(scrollerFactory, detailsService, changeNotification, suspendService, groupsService, ngZone, renderer, scrollSyncService, resizeService, editService, supportService, navigationService, scrollRequestService, localization, columnResizingService, changeDetector, pdfService, columnInfo) {\n var _this = this;\n this.changeNotification = changeNotification;\n this.suspendService = suspendService;\n this.groupsService = groupsService;\n this.ngZone = ngZone;\n this.renderer = renderer;\n this.scrollSyncService = scrollSyncService;\n this.resizeService = resizeService;\n this.editService = editService;\n this.supportService = supportService;\n this.navigationService = navigationService;\n this.localization = localization;\n this.columnResizingService = columnResizingService;\n this.changeDetector = changeDetector;\n this.pdfService = pdfService;\n this.columnInfo = columnInfo;\n this.groups = [];\n this.skip = 0;\n this.columns = new ColumnsContainer(function () { return []; });\n this.selectable = false;\n this.groupable = false;\n this.trackBy = defaultTrackBy;\n this.contentScroll = new EventEmitter();\n this.pageChange = new EventEmitter();\n this.scrollBottom = new EventEmitter();\n this.columnsStartIdx = 0;\n this.resizeSensors = new QueryList();\n this.dispatcher = new Subject();\n this.containerScrollTop = 0;\n this.scrollLeft = 0;\n this.rtl = false;\n this.scroller = scrollerFactory(this.dispatcher);\n this.subscriptions =\n detailsService.changes.subscribe(function (x) { return _this.detailExpand(x); }).add(scrollRequestService.requests.subscribe(function (x) { return _this.scrollTo(x); }));\n }\n Object.defineProperty(ListComponent.prototype, \"hostClass\", {\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ListComponent.prototype, \"hostRole\", {\n get: function () {\n return 'presentation';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ListComponent.prototype, \"showFooter\", {\n get: function () {\n return this.groupable && this.groupable.showFooter;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ListComponent.prototype, \"totalWidth\", {\n get: function () {\n if (this.virtualColumns && this.columns.unlockedWidth) {\n return this.columns.unlockedWidth;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ListComponent.prototype, \"lockedLeafColumns\", {\n get: function () {\n return this.columns.lockedLeafColumns;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ListComponent.prototype, \"nonLockedLeafColumns\", {\n get: function () {\n return this.columns.nonLockedLeafColumns;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ListComponent.prototype, \"nonLockedColumnsToRender\", {\n get: function () {\n if (this.virtualColumns && !this.pdfService.exporting) {\n return this.viewportColumns;\n }\n return this.nonLockedLeafColumns;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ListComponent.prototype, \"leafColumns\", {\n get: function () {\n return this.columns.leafColumnsToRender;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ListComponent.prototype, \"lockedWidth\", {\n get: function () {\n var groupCellsWidth = this.groups.length * GROUP_CELL_WIDTH;\n return expandColumns(this.lockedLeafColumns.toArray()).reduce(function (prev, curr) { return prev + (curr.width || 0); }, groupCellsWidth);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ListComponent.prototype, \"nonLockedWidth\", {\n get: function () {\n if ((!this.rtl && this.lockedLeafColumns.length) || this.virtualColumns) {\n return sumColumnWidths(expandColumns(this.nonLockedColumnsToRender.toArray()));\n }\n return undefined;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ListComponent.prototype, \"isLocked\", {\n get: function () {\n return this.lockedLeafColumns.length > 0;\n },\n enumerable: true,\n configurable: true\n });\n ListComponent.prototype.ngOnInit = function () {\n var _this = this;\n this.init();\n this.subscriptions.add(this.ngZone.runOutsideAngular(this.handleRowSync.bind(this)));\n this.subscriptions.add(this.ngZone.runOutsideAngular(this.handleRowNavigationLocked.bind(this)));\n this.subscriptions.add(merge(this.columns.changes, this.resizeService.changes).subscribe(function () {\n if (_this.virtualColumns) {\n _this.ngZone.run(function () {\n _this.updateViewportColumns();\n _this.changeDetector.markForCheck();\n });\n }\n }));\n this.subscriptions.add(this.localization.changes.subscribe(function (_a) {\n var rtl = _a.rtl;\n return _this.rtl = rtl;\n }));\n };\n ListComponent.prototype.ngOnChanges = function (changes) {\n if (isChanged(\"skip\", changes) && !this.rebind) {\n this.skipScroll = true;\n this.container.nativeElement.scrollTop = this.rowHeightService.offset(this.skip);\n }\n if (anyChanged([\"total\", \"take\"], changes)) {\n this.init();\n }\n this.rebind = false;\n };\n ListComponent.prototype.ngDoCheck = function () {\n if (this.virtualColumns && (!this.viewportColumns || this.viewportWidthChange())) {\n this.updateViewportColumns();\n }\n };\n ListComponent.prototype.ngAfterViewInit = function () {\n if (this.skip && this.isVirtual) {\n this.container.nativeElement.scrollTop = this.rowHeightService.offset(this.skip);\n }\n this.resetNavigationViewport();\n this.attachContainerScroll();\n this.initResizeService();\n };\n ListComponent.prototype.syncRowsHeight = function () {\n if (this.lockedContainer) {\n syncRowsHeight(this.lockedTable.nativeElement, this.table.nativeElement);\n }\n };\n ListComponent.prototype.ngOnDestroy = function () {\n if (this.subscriptions) {\n this.subscriptions.unsubscribe();\n }\n if (this.resizeService) {\n this.resizeService.destroy();\n }\n this.cleanupScroller();\n };\n ListComponent.prototype.init = function () {\n if (this.suspendService.scroll) {\n return;\n }\n this.rowHeightService = new RowHeightService(this.total, this.rowHeight, this.detailRowHeight);\n this.totalHeight = this.rowHeightService.totalHeight();\n if (!isUniversal()) {\n this.ngZone.runOutsideAngular(this.createScroller.bind(this));\n }\n };\n ListComponent.prototype.detailExpand = function (_a) {\n var index = _a.index, expand = _a.expand;\n if (expand) {\n this.rowHeightService.expandDetail(index);\n }\n else {\n this.rowHeightService.collapseDetail(index);\n }\n this.totalHeight = this.rowHeightService.totalHeight();\n this.resetNavigationViewport();\n };\n ListComponent.prototype.attachContainerScroll = function () {\n var _this = this;\n if (isUniversal()) {\n return;\n }\n this.ngZone.runOutsideAngular(function () {\n _this.subscriptions.add(fromEvent(_this.container.nativeElement, 'scroll').pipe(map(function (event) { return event.target; }), filter(function () { return !_this.suspendService.scroll; }), tap(function (target) {\n _this.onContainerScroll(target);\n _this.resetNavigationViewport();\n if (_this.virtualColumns) {\n _this.handleColumnScroll();\n }\n var rowViewport = _this.navigationService.viewport || EMPTY_OBJECT;\n var columnViewport = _this.navigationService.columnViewport || EMPTY_OBJECT;\n _this.contentScroll.emit({\n scrollLeft: target.scrollLeft,\n scrollTop: target.scrollTop,\n startRow: rowViewport.firstItemIndex,\n endRow: rowViewport.lastItemIndex,\n startColumn: columnViewport.firstItemIndex,\n endColumn: columnViewport.lastItemIndex\n });\n })).subscribe(_this.dispatcher));\n });\n this.scrollSyncService.registerEmitter(this.container.nativeElement, \"body\");\n if (this.lockedContainer) {\n this.ngZone.runOutsideAngular(function () {\n _this.subscriptions.add(merge(fromEvent(_this.lockedContainer.nativeElement, 'mousewheel'), fromEvent(_this.lockedContainer.nativeElement, 'DOMMouseScroll')).pipe(filter(function (event) { return !event.ctrlKey; }), tap(preventLockedScroll(_this.container.nativeElement)), map(wheelDeltaY))\n .subscribe(function (x) { return _this.container.nativeElement.scrollTop -= x; }));\n _this.subscriptions.add(fromEvent(_this.lockedContainer.nativeElement, 'scroll').pipe(filter(function () { return !_this.suspendService.scroll; }))\n .subscribe(function () {\n var lockedScrollTop = _this.lockedContainer.nativeElement.scrollTop;\n if (lockedScrollTop !== _this.containerScrollTop) {\n _this.container.nativeElement.scrollTop = _this.containerScrollTop = lockedScrollTop;\n }\n }));\n _this.subscriptions.add(fromEvent(_this.lockedContainer.nativeElement, 'keydown').pipe(filter(function (event) { return event.keyCode === Keys.PageDown || event.keyCode === Keys.PageUp; })).subscribe(function (event) {\n var dir = event.keyCode === Keys.PageDown ? 1 : -1;\n var element = _this.container.nativeElement;\n element.scrollTop += element.offsetHeight * dir * 0.8;\n event.preventDefault();\n }));\n });\n this.syncRowsHeight();\n }\n };\n ListComponent.prototype.createScroller = function () {\n var _this = this;\n this.cleanupScroller();\n var observable = this.scroller\n .create(this.rowHeightService, this.skip, this.take, this.total);\n this.skipScroll = false;\n this.scrollerSubscription = observable.pipe(filter(function (x) { return x instanceof PageAction; }), filter(function () {\n var temp = _this.skipScroll;\n _this.skipScroll = false;\n return !temp;\n }), tap(function () { return _this.rebind = true; }))\n .subscribe(function (x) { return _this.ngZone.run(function () { return _this.pageChange.emit(x); }); });\n this.scrollerSubscription.add(observable.pipe(filter(function (x) { return x instanceof ScrollAction; }))\n .subscribe(this.scroll.bind(this)));\n this.scrollerSubscription.add(observable.pipe(filter(function (x) { return x instanceof ScrollBottomAction; }))\n .subscribe(function () { return _this.scrollBottom.emit(); }));\n };\n ListComponent.prototype.scroll = function (_a) {\n var _b = _a.offset, offset = _b === void 0 ? 0 : _b;\n if (this.isVirtual) {\n [\n maybeNativeElement(this.table),\n maybeNativeElement(this.lockedTable)\n ].filter(isPresent).forEach(translateY(this.renderer, offset));\n }\n this.resetNavigationViewport();\n };\n ListComponent.prototype.onContainerScroll = function (_a) {\n var scrollTop = _a.scrollTop;\n this.containerScrollTop = scrollTop;\n if (this.lockedContainer) {\n this.lockedContainer.nativeElement.scrollTop = scrollTop;\n }\n };\n ListComponent.prototype.handleRowSync = function () {\n var _this = this;\n var isLocked = function () { return isPresent(_this.lockedContainer); };\n var onStable = function () { return _this.ngZone.onStable.asObservable().pipe(take(1)); };\n return merge(this.changeNotification.changes, this.groupsService.changes\n .pipe(filter(isLocked), switchMapTo(onStable())), this.editService.changed, this.resizeService.changes, this.columnResizingService.changes\n .pipe(filter(function (change) { return change.type === 'end'; })), this.supportService.changes)\n .pipe(tap(function () { return _this.resetNavigationViewport(); }), filter(isLocked))\n .subscribe(function () {\n var scrollTop = _this.container.nativeElement.scrollTop;\n var scrollLeft = _this.container.nativeElement.scrollLeft;\n _this.syncRowsHeight();\n _this.syncContainerHeight();\n _this.lockedContainer.nativeElement.scrollTop = _this.container.nativeElement.scrollTop = scrollTop;\n // fixes scroll left position in IE when editing\n _this.container.nativeElement.scrollLeft = scrollLeft;\n _this.resizeSensors.forEach(function (sensor) { return sensor.acceptSize(); });\n });\n };\n ListComponent.prototype.handleRowNavigationLocked = function () {\n var _this = this;\n return this.navigationService.changes.pipe(filter(function () { return isPresent(_this.lockedContainer); }), delay(10)).subscribe(function (args) {\n if (_this.lockedLeafColumns.length <= args.prevColIndex && args.colIndex < _this.lockedLeafColumns.length) {\n var cell = _this.navigationService.activeCell;\n if (cell && cell.colIndex + cell.colSpan < args.prevColIndex) {\n _this.container.nativeElement.scrollLeft = 0;\n }\n }\n });\n };\n ListComponent.prototype.scrollToVirtualRow = function (itemIndex) {\n if (isPresent(this.detailTemplate)) {\n itemIndex = Math.floor(itemIndex / 2);\n }\n var offset = this.rowHeightService.offset(itemIndex);\n this.container.nativeElement.scrollTop = offset;\n this.resetNavigationViewport();\n };\n ListComponent.prototype.scrollTo = function (_a) {\n var row = _a.row, column = _a.column;\n if (isNumber(row)) {\n if (this.isVirtual) {\n this.scrollToVirtualRow(row);\n }\n else {\n var element = rowAt(row, this.table.nativeElement.rows);\n if (element) {\n this.container.nativeElement.scrollTop = element.offsetTop;\n }\n }\n }\n if (isNumber(column)) {\n column -= this.lockedLeafColumns.length;\n if (this.virtualColumns) {\n var columns = this.columns.leafColumnsToRender;\n var offset = 0;\n for (var idx = 0; idx < column; idx++) {\n offset += columns[idx].width || 0;\n }\n var startOffset = this.lockedLeafColumns.length ? 0 : this.groups.length * GROUP_CELL_WIDTH + (this.detailTemplate && column > 0 ? GROUP_CELL_WIDTH : 0);\n this.container.nativeElement.scrollLeft = this.normalizeScrollLeft(offset + startOffset);\n }\n else if (column === 0 && this.detailTemplate) {\n this.container.nativeElement.scrollLeft = this.normalizeScrollLeft(0);\n }\n else {\n var firstRow = rowAt(0, this.table.nativeElement.rows);\n if (firstRow) {\n var element = cellAt(column, firstRow.cells);\n if (element) {\n this.container.nativeElement.scrollLeft = this.elementScrollLeft(element);\n }\n }\n }\n }\n };\n ListComponent.prototype.resetNavigationViewport = function () {\n if (!this.container || !this.navigationService.enabled ||\n !this.navigationService.needsViewport() || this.data.length === 0) {\n return;\n }\n var _a = this.container.nativeElement, scrollTop = _a.scrollTop, offsetHeight = _a.offsetHeight;\n var scrollBottom = scrollTop + offsetHeight;\n var firstItemIndex = this.rowHeightService.index(scrollTop);\n var lastItemIndex = this.rowHeightService.index(scrollBottom);\n var lastItemOffset = this.rowHeightService.offset(lastItemIndex);\n var lastItemOverflows = lastItemOffset + this.rowHeight > scrollBottom;\n if (lastItemIndex > 0 && lastItemOverflows) {\n lastItemIndex--;\n }\n var viewportStart = firstItemIndex;\n var viewportEnd = lastItemIndex;\n if (isPresent(this.detailTemplate)) {\n viewportStart *= 2;\n viewportEnd *= 2;\n var firstItemHeight = this.rowHeightService.offset(firstItemIndex);\n if (firstItemHeight + this.rowHeight < scrollTop) {\n viewportStart++;\n }\n var lastItemHeight = this.rowHeightService.height(lastItemIndex);\n var lastItemExpanded = this.rowHeightService.isExpanded(lastItemIndex);\n var lastItemDetailOverflows = lastItemOffset + lastItemHeight > scrollBottom;\n if (lastItemExpanded && !lastItemDetailOverflows) {\n viewportEnd++;\n }\n }\n this.navigationService.setViewport(viewportStart, viewportEnd);\n };\n ListComponent.prototype.cleanupScroller = function () {\n if (this.scrollerSubscription) {\n this.scrollerSubscription.unsubscribe();\n }\n if (this.scroller) {\n this.scroller.destroy();\n }\n };\n ListComponent.prototype.initResizeService = function () {\n this.resizeService.connect(merge.apply(void 0, this.resizeSensors.map(function (sensor) { return sensor.resize; })));\n };\n ListComponent.prototype.syncContainerHeight = function () {\n var _this = this;\n [maybeNativeElement(this.lockedContainer)]\n .filter(isPresent)\n .map(function (el) {\n el.style.height = '';\n var height = _this.container.nativeElement.offsetHeight;\n if (hasScrollbar(_this.table, _this.container)) {\n height -= _this.supportService.scrollbarWidth;\n }\n return { el: el, height: height };\n })\n .forEach(setHeight$1(this.renderer));\n };\n ListComponent.prototype.updateViewportColumns = function (range) {\n var columns = this.columns.nonLockedLeafColumns.toArray();\n var _a = range || this.calculateViewportColumns(), startIdx = _a.startIdx, endIdx = _a.endIdx, offset = _a.offset;\n var start = Math.max(0, startIdx - bufferSize);\n var end = Math.min(endIdx + bufferSize, columns.length - 1);\n if (start < startIdx) {\n for (var idx = startIdx - 1; idx >= start; idx--) {\n offset -= columns[idx].width;\n }\n }\n var currentColumns = columns.slice(start, end + 1);\n this.viewportColumnsWidth = currentColumns.reduce(function (total, column) { return total + column.width; }, 0);\n if (start > 0) {\n var offsetColumn = new ColumnBase$1();\n offsetColumn.width = offset;\n currentColumns.unshift(offsetColumn);\n }\n this.viewportColumns = new QueryList();\n this.viewportColumns.reset(currentColumns);\n this.columnsStartIdx = start;\n this.columnsEndIdx = end;\n this.columnInfo.columnRangeChange.emit({ start: start, end: end, offset: offset });\n if (!range) {\n this.updateColumnViewport(startIdx, endIdx);\n }\n };\n ListComponent.prototype.handleColumnScroll = function () {\n var _this = this;\n var container = this.container.nativeElement;\n var scrollLeft = container.scrollLeft;\n if (this.scrollLeft !== scrollLeft) {\n this.scrollLeft = scrollLeft;\n var range_1 = this.calculateViewportColumns();\n this.updateColumnViewport(range_1.startIdx, range_1.endIdx);\n if (range_1.startIdx < this.columnsStartIdx || this.columnsEndIdx < range_1.endIdx) {\n cancelAnimationFrame(this.columnUpdateFrame);\n this.columnUpdateFrame = requestAnimationFrame(function () {\n _this.ngZone.run(function () {\n _this.updateViewportColumns(range_1);\n _this.changeDetector.markForCheck();\n });\n });\n }\n }\n };\n ListComponent.prototype.updateColumnViewport = function (startIdx, endIdx) {\n var lockedCount = this.lockedLeafColumns.length;\n var leafColumns$$1 = this.nonLockedLeafColumns.toArray();\n var viewportStart = lockedCount + startIdx + (this.detailTemplate && startIdx > 0 ? 1 : 0);\n var viewportEnd = lockedCount + endIdx + (this.detailTemplate ? 1 : 0);\n for (var idx = 0; idx < leafColumns$$1.length; idx++) {\n var column = leafColumns$$1[idx];\n if (column.isSpanColumn) {\n viewportEnd += column.childColumns.length;\n }\n }\n this.navigationService.setColumnViewport(viewportStart, viewportEnd);\n };\n ListComponent.prototype.calculateViewportColumns = function () {\n var _a = this.container.nativeElement, scrollLeft = _a.scrollLeft, clientWidth = _a.clientWidth;\n var columns = this.columns.nonLockedLeafColumns.toArray();\n var normalizedScrollLeft = this.normalizeScrollLeft(scrollLeft);\n var viewportEnd = normalizedScrollLeft + clientWidth;\n var startIdx;\n var endIdx = 0;\n var current = 0;\n var offset = 0;\n var idx;\n for (idx = 0; idx < columns.length; idx++) {\n var column = columns[idx];\n current += column.width || 0;\n if (startIdx === undefined && current > normalizedScrollLeft) {\n startIdx = idx;\n offset = current - (column.width || 0);\n }\n if (current >= viewportEnd) {\n endIdx = idx;\n break;\n }\n }\n if (!endIdx && idx > 0) {\n endIdx = columns.length - 1;\n }\n return { startIdx: startIdx, endIdx: endIdx, offset: offset };\n };\n ListComponent.prototype.viewportWidthChange = function () {\n var currentWidth = this.viewportColumns.toArray().reduce(function (total, column) { return total + column.width; }, 0);\n return currentWidth !== this.viewportColumnsWidth;\n };\n ListComponent.prototype.normalizeScrollLeft = function (position) {\n return this.rtl ? rtlScrollPosition(position, this.container.nativeElement, this.supportService.rtlScrollLeft) : position;\n };\n ListComponent.prototype.elementScrollLeft = function (element) {\n if (this.rtl) {\n return this.normalizeScrollLeft(this.container.nativeElement.scrollWidth - element.offsetLeft - element.offsetWidth);\n }\n return element.offsetLeft;\n };\n ListComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: SCROLLER_FACTORY_TOKEN,\n useValue: DEFAULT_SCROLLER_FACTORY\n }\n ],\n selector: 'kendo-grid-list',\n template: \"\\n \\n \\n
\\n \"\n },] },\n ];\n /** @nocollapse */\n ListComponent.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: Inject, args: [SCROLLER_FACTORY_TOKEN,] }] },\n { type: DetailsService },\n { type: ChangeNotificationService },\n { type: SuspendService },\n { type: GroupsService },\n { type: NgZone },\n { type: Renderer2 },\n { type: ScrollSyncService },\n { type: ResizeService },\n { type: EditService },\n { type: BrowserSupportService },\n { type: NavigationService },\n { type: ScrollRequestService },\n { type: LocalizationService },\n { type: ColumnResizingService },\n { type: ChangeDetectorRef },\n { type: PDFService },\n { type: ColumnInfoService }\n ]; };\n ListComponent.propDecorators = {\n hostClass: [{ type: HostBinding, args: [\"class.k-grid-container\",] }],\n hostRole: [{ type: HostBinding, args: [\"attr.role\",] }],\n data: [{ type: Input }],\n groups: [{ type: Input }],\n total: [{ type: Input }],\n rowHeight: [{ type: Input }],\n detailRowHeight: [{ type: Input }],\n take: [{ type: Input }],\n skip: [{ type: Input }],\n columns: [{ type: Input }],\n detailTemplate: [{ type: Input }],\n noRecordsTemplate: [{ type: Input }],\n selectable: [{ type: Input }],\n groupable: [{ type: Input }],\n filterable: [{ type: Input }],\n rowClass: [{ type: Input }],\n loading: [{ type: Input }],\n trackBy: [{ type: Input }],\n virtualColumns: [{ type: Input }],\n isVirtual: [{ type: Input }],\n contentScroll: [{ type: Output }],\n pageChange: [{ type: Output }],\n scrollBottom: [{ type: Output }],\n container: [{ type: ViewChild, args: [\"container\", { static: true },] }],\n lockedContainer: [{ type: ViewChild, args: [\"lockedContainer\",] }],\n lockedTable: [{ type: ViewChild, args: [\"lockedTable\",] }],\n table: [{ type: ViewChild, args: [\"table\",] }],\n resizeSensors: [{ type: ViewChildren, args: [ResizeSensorComponent,] }]\n };\n return ListComponent;\n}());\n\n/**\n * A directive which encapsulates the in-memory handling of data operations such as [paging]({% slug paging_grid %}),\n * [sorting]({% slug sorting_grid %}), and [grouping]({% slug groupingbasics_grid %})\n * ([more information and examples]({% slug automaticoperations_grid %})).\n */\nvar DataBindingDirective = /** @class */ (function () {\n function DataBindingDirective(grid, changeDetector, localDataChangesService) {\n this.grid = grid;\n this.changeDetector = changeDetector;\n this.localDataChangesService = localDataChangesService;\n this.state = {\n skip: 0\n };\n this.originalData = [];\n if (localDataChangesService) {\n this.dataChangedSubscription = this.localDataChangesService.changes.subscribe(this.rebind.bind(this));\n }\n }\n Object.defineProperty(DataBindingDirective.prototype, \"skip\", {\n /**\n * Defines the number of records that will be skipped by the pager.\n */\n set: function (value) {\n if (!isPresent(value)) {\n value = 0;\n }\n this.grid.skip = this.state.skip = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DataBindingDirective.prototype, \"sort\", {\n /**\n * Defines the descriptors by which the data will be sorted.\n */\n set: function (value) {\n this.grid.sort = this.state.sort = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DataBindingDirective.prototype, \"filter\", {\n /**\n * Defines the descriptor by which the data will be filtered.\n */\n set: function (value) {\n this.grid.filter = this.state.filter = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DataBindingDirective.prototype, \"pageSize\", {\n /**\n * Defines the page size used by the Grid pager.\n */\n set: function (value) {\n this.grid.pageSize = this.state.take = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DataBindingDirective.prototype, \"group\", {\n /**\n * The descriptors by which the data will be grouped.\n */\n set: function (value) {\n this.grid.group = this.state.group = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DataBindingDirective.prototype, \"data\", {\n /**\n * The array of data which will be used to populate the Grid.\n */\n set: function (value) {\n this.originalData = value || [];\n if (this.localDataChangesService) {\n this.localDataChangesService.data = value;\n }\n this.dataChanged = true;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n */\n DataBindingDirective.prototype.ngOnInit = function () {\n this.applyState(this.state);\n this.stateChangeSubscription = this.grid\n .dataStateChange\n .subscribe(this.onStateChange.bind(this));\n };\n /**\n * @hidden\n */\n DataBindingDirective.prototype.ngOnDestroy = function () {\n if (this.stateChangeSubscription) {\n this.stateChangeSubscription.unsubscribe();\n }\n if (this.dataChangedSubscription) {\n this.dataChangedSubscription.unsubscribe();\n }\n };\n /**\n * @hidden\n */\n DataBindingDirective.prototype.ngOnChanges = function (changes) {\n if (anyChanged([\"pageSize\", \"skip\", \"sort\", \"group\", \"filter\"], changes)) {\n this.rebind();\n }\n };\n DataBindingDirective.prototype.ngDoCheck = function () {\n if (this.dataChanged) {\n this.updateGridData();\n }\n };\n /**\n * @hidden\n */\n DataBindingDirective.prototype.onStateChange = function (state$$1) {\n this.applyState(state$$1);\n this.rebind();\n };\n /**\n * @hidden\n */\n DataBindingDirective.prototype.rebind = function () {\n this.data = this.originalData;\n this.updateGridData();\n this.notifyDataChange();\n };\n /**\n * Notifies the Grid that its data has changed.\n */\n DataBindingDirective.prototype.notifyDataChange = function () {\n this.grid.onDataChange();\n if (this.changeDetector) {\n this.changeDetector.markForCheck();\n }\n };\n DataBindingDirective.prototype.process = function (state$$1) {\n return process(this.originalData, state$$1);\n };\n DataBindingDirective.prototype.applyState = function (_a) {\n var skip = _a.skip, take$$1 = _a.take, sort = _a.sort, group = _a.group, filter$$1 = _a.filter;\n this.skip = skip;\n this.pageSize = take$$1;\n this.sort = sort;\n this.group = group;\n this.filter = filter$$1;\n };\n DataBindingDirective.prototype.updateGridData = function () {\n this.grid.data = this.process(this.state);\n this.dataChanged = false;\n };\n DataBindingDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoGridBinding]'\n },] },\n ];\n /** @nocollapse */\n DataBindingDirective.ctorParameters = function () { return [\n { type: GridComponent },\n { type: ChangeDetectorRef },\n { type: LocalDataChangesService }\n ]; };\n DataBindingDirective.propDecorators = {\n skip: [{ type: Input }],\n sort: [{ type: Input }],\n filter: [{ type: Input }],\n pageSize: [{ type: Input }],\n group: [{ type: Input }],\n data: [{ type: Input, args: [\"kendoGridBinding\",] }]\n };\n return DataBindingDirective;\n}());\n\n/**\n * A directive which stores the row selection state of the Grid in memory\n * ([see example]({% slug selection_grid %}#toc-during-data-operations)).\n */\nvar SelectionDirective = /** @class */ (function (_super) {\n __extends(SelectionDirective, _super);\n function SelectionDirective(grid, cd) {\n var _this = _super.call(this, grid, cd) || this;\n _this.grid = grid;\n return _this;\n }\n /**\n * @hidden\n */\n SelectionDirective.prototype.ngOnInit = function () {\n if (this.grid.selectable === false) {\n this.grid.selectable = true;\n }\n this.grid.selectionDirective = true;\n };\n /**\n * @hidden\n */\n SelectionDirective.prototype.ngOnDestroy = function () {\n _super.prototype.destroy.call(this);\n };\n SelectionDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoGridSelectBy]'\n },] },\n ];\n /** @nocollapse */\n SelectionDirective.ctorParameters = function () { return [\n { type: GridComponent },\n { type: ChangeDetectorRef }\n ]; };\n return SelectionDirective;\n}(Selection));\n\n/**\n * @hidden\n */\nvar Messages = /** @class */ (function (_super) {\n __extends(Messages, _super);\n function Messages() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Messages.propDecorators = {\n groupPanelEmpty: [{ type: Input }],\n noRecords: [{ type: Input }],\n pagerFirstPage: [{ type: Input }],\n pagerLastPage: [{ type: Input }],\n pagerPreviousPage: [{ type: Input }],\n pagerNextPage: [{ type: Input }],\n pagerPage: [{ type: Input }],\n pagerItemsPerPage: [{ type: Input }],\n pagerOf: [{ type: Input }],\n pagerItems: [{ type: Input }],\n filter: [{ type: Input }],\n filterEqOperator: [{ type: Input }],\n filterNotEqOperator: [{ type: Input }],\n filterIsNullOperator: [{ type: Input }],\n filterIsNotNullOperator: [{ type: Input }],\n filterIsEmptyOperator: [{ type: Input }],\n filterIsNotEmptyOperator: [{ type: Input }],\n filterStartsWithOperator: [{ type: Input }],\n filterContainsOperator: [{ type: Input }],\n filterNotContainsOperator: [{ type: Input }],\n filterEndsWithOperator: [{ type: Input }],\n filterGteOperator: [{ type: Input }],\n filterGtOperator: [{ type: Input }],\n filterLteOperator: [{ type: Input }],\n filterLtOperator: [{ type: Input }],\n filterIsTrue: [{ type: Input }],\n filterIsFalse: [{ type: Input }],\n filterBooleanAll: [{ type: Input }],\n filterAfterOrEqualOperator: [{ type: Input }],\n filterAfterOperator: [{ type: Input }],\n filterBeforeOperator: [{ type: Input }],\n filterBeforeOrEqualOperator: [{ type: Input }],\n filterFilterButton: [{ type: Input }],\n filterClearButton: [{ type: Input }],\n filterAndLogic: [{ type: Input }],\n filterOrLogic: [{ type: Input }],\n loading: [{ type: Input }],\n columnMenu: [{ type: Input }],\n columns: [{ type: Input }],\n lock: [{ type: Input }],\n unlock: [{ type: Input }],\n sortable: [{ type: Input }],\n sortAscending: [{ type: Input }],\n sortDescending: [{ type: Input }],\n sortedAscending: [{ type: Input }],\n sortedDescending: [{ type: Input }],\n sortedDefault: [{ type: Input }],\n columnsApply: [{ type: Input }],\n columnsReset: [{ type: Input }],\n detailExpand: [{ type: Input }],\n detailCollapse: [{ type: Input }]\n };\n return Messages;\n}(ComponentMessages));\n\n/**\n * @hidden\n */\nvar LocalizedMessagesDirective = /** @class */ (function (_super) {\n __extends(LocalizedMessagesDirective, _super);\n function LocalizedMessagesDirective(service) {\n var _this = _super.call(this) || this;\n _this.service = service;\n return _this;\n }\n LocalizedMessagesDirective.decorators = [\n { type: Directive, args: [{\n providers: [\n {\n provide: Messages,\n useExisting: forwardRef(function () { return LocalizedMessagesDirective; })\n }\n ],\n selector: '[kendoGridLocalizedMessages]'\n },] },\n ];\n /** @nocollapse */\n LocalizedMessagesDirective.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return LocalizedMessagesDirective;\n}(Messages));\n\n/**\n * Custom component messages override default component messages\n * ([see example]({% slug globalization_grid %}#toc-localization)).\n */\nvar CustomMessagesComponent = /** @class */ (function (_super) {\n __extends(CustomMessagesComponent, _super);\n function CustomMessagesComponent(service) {\n var _this = _super.call(this) || this;\n _this.service = service;\n return _this;\n }\n Object.defineProperty(CustomMessagesComponent.prototype, \"override\", {\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n CustomMessagesComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: Messages,\n useExisting: forwardRef(function () { return CustomMessagesComponent; })\n }\n ],\n selector: 'kendo-grid-messages',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n CustomMessagesComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return CustomMessagesComponent;\n}(Messages));\n\n/**\n * @hidden\n */\nvar FilterRowComponent = /** @class */ (function () {\n function FilterRowComponent(localization) {\n this.localization = localization;\n this.columns = [];\n this.groups = [];\n this.filterRowClass = true;\n this.filterLabel = this.localization.get('filter');\n }\n FilterRowComponent.decorators = [\n { type: Component, args: [{\n selector: '[kendoGridFilterRow]',\n template: \"\\n \\n | \\n \\n | \\n | \\n \"\n },] },\n ];\n /** @nocollapse */\n FilterRowComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n FilterRowComponent.propDecorators = {\n columns: [{ type: Input }],\n filter: [{ type: Input }],\n groups: [{ type: Input }],\n detailTemplate: [{ type: Input }],\n logicalRowIndex: [{ type: Input }],\n lockedColumnsCount: [{ type: Input }],\n filterRowClass: [{ type: HostBinding, args: ['class.k-filter-row',] }]\n };\n return FilterRowComponent;\n}());\n\nvar areDifferent = function (a, b) {\n return a.field !== b.field || a.operator !== b.operator || a.value !== b.value;\n};\nvar isChanged$1 = function (a, b) {\n if (a.length !== b.length) {\n return true;\n }\n for (var idx = 0, len = a.length; idx < len; idx++) {\n var prev = a[idx];\n var curr = b[idx];\n if (isCompositeFilterDescriptor(prev)) {\n // tslint:disable-next-line:no-use-before-declare\n if (diffFilters(prev, curr[idx])) {\n return true;\n }\n }\n else if (areDifferent(prev, curr)) {\n return true;\n }\n }\n return false;\n};\nvar copyObject = function (obj) {\n var result = {};\n Object.assign(result, obj);\n if (obj.constructor !== Object) {\n var proto_1 = obj.constructor.prototype;\n Object.getOwnPropertyNames(proto_1).forEach(function (property) {\n if (property !== 'constructor' && proto_1.hasOwnProperty(property)) {\n result[property] = obj[property];\n }\n });\n }\n return result;\n};\nvar cloneFilter = function (filter$$1) { return copyObject(filter$$1); };\n/**\n * @hidden\n */\nvar cloneFilters = function (filter$$1) {\n if (!filter$$1) {\n return;\n }\n if (isCompositeFilterDescriptor(filter$$1)) {\n return {\n filters: cloneFilters(filter$$1.filters),\n logic: filter$$1.logic\n };\n }\n else if (Array.isArray(filter$$1)) {\n return filter$$1.map(cloneFilters);\n }\n return cloneFilter(filter$$1);\n};\n/**\n * @hidden\n */\nvar diffFilters = function (a, b) {\n if (isPresent(a) && !isPresent(b)) {\n return true;\n }\n if (!isPresent(a) && isPresent(b)) {\n return true;\n }\n return isPresent(a) && isPresent(b) && isChanged$1(a.filters, b.filters);\n};\n\n/**\n * @hidden\n */\nvar FilterCellComponent = /** @class */ (function () {\n function FilterCellComponent() {\n this._templateContext = {};\n }\n Object.defineProperty(FilterCellComponent.prototype, \"filter\", {\n get: function () {\n return this._filter;\n },\n set: function (value) {\n this._filter = cloneFilters(value);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FilterCellComponent.prototype, \"templateContext\", {\n get: function () {\n this._templateContext.column = this.column;\n this._templateContext.filter = this.filter;\n // tslint:disable-next-line:no-string-literal\n this._templateContext[\"$implicit\"] = this.filter;\n return this._templateContext;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FilterCellComponent.prototype, \"hasTemplate\", {\n get: function () {\n return isPresent(this.column.filterCellTemplateRef);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FilterCellComponent.prototype, \"isFilterable\", {\n get: function () {\n return isPresent(this.column) && !isNullOrEmptyString(this.column.field) && this.column.filterable;\n },\n enumerable: true,\n configurable: true\n });\n FilterCellComponent.decorators = [\n { type: Component, args: [{\n selector: '[kendoGridFilterCell]',\n template: \"\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \"\n },] },\n ];\n FilterCellComponent.propDecorators = {\n column: [{ type: Input }],\n filter: [{ type: Input }]\n };\n return FilterCellComponent;\n}());\n\nvar localizeOperators = function (operators$$1) { return function (localization) {\n return Object.keys(operators$$1).reduce(function (acc, key) {\n acc[operators$$1[key]] = localization.get(key);\n return acc;\n }, {});\n}; }; // tslint:disable-line:align\nvar operatorTexts = localizeOperators({\n \"filterEqOperator\": \"eq\",\n \"filterNotEqOperator\": \"neq\",\n // tslint:disable-next-line:object-literal-sort-keys\n \"filterGteOperator\": \"gte\",\n \"filterGtOperator\": \"gt\",\n \"filterLteOperator\": \"lte\",\n \"filterLtOperator\": \"lt\",\n \"filterIsNullOperator\": \"isnull\",\n \"filterIsNotNullOperator\": \"isnotnull\",\n \"filterIsEmptyOperator\": \"isempty\",\n \"filterIsNotEmptyOperator\": \"isnotempty\",\n \"filterContainsOperator\": \"contains\",\n \"filterNotContainsOperator\": \"doesnotcontain\",\n \"filterStartsWithOperator\": \"startswith\",\n \"filterEndsWithOperator\": \"endswith\",\n \"filterAfterOrEqualOperator\": \"after-eq\",\n \"filterAfterOperator\": \"after\",\n \"filterBeforeOrEqualOperator\": \"before-eq\",\n \"filterBeforeOperator\": \"before\"\n});\n/**\n * @hidden\n */\nvar toJSON = function (xs) { return xs.map(function (x) { return x.toJSON(); }); };\n/**\n * @hidden\n */\nvar FilterOperatorBase = /** @class */ (function () {\n function FilterOperatorBase(operator, localization) {\n this.operator = operator;\n this.localization = localization;\n this.messages = operatorTexts(this.localization);\n this._text = this.messages[this.operator];\n this.localization.changes.subscribe(this.refreshText.bind(this));\n }\n Object.defineProperty(FilterOperatorBase.prototype, \"text\", {\n /**\n * The text that will be displayed in the drop-down list.\n * @readonly\n * @type {string}\n * @memberOf FilterOperatorBase\n */\n get: function () {\n return this._text;\n },\n /**\n *\n */\n set: function (value) {\n this._text = isNullOrEmptyString(value) ? this.messages[this.operator] : value;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n */\n FilterOperatorBase.prototype.toJSON = function () {\n return {\n text: this.text,\n value: this.operator\n };\n };\n FilterOperatorBase.prototype.refreshText = function () {\n var update = this._text === this.messages[this.operator];\n this.messages = operatorTexts(this.localization);\n if (update) {\n this._text = this.messages[this.operator];\n }\n };\n FilterOperatorBase.propDecorators = {\n text: [{ type: Input }]\n };\n return FilterOperatorBase;\n}());\n\nvar insertDefaultFilter = function (index, rootFilter, filter$$1) {\n rootFilter = (rootFilter || { filters: [], logic: \"and\" });\n rootFilter.filters[index] = filter$$1;\n return filter$$1;\n};\n/**\n * @hidden\n */\nvar setFilter = function (index, filter$$1, field, defaultOperator) {\n if (isPresent(filter$$1) && isPresent(filter$$1.filters) && filter$$1.filters.length > index) {\n return filter$$1.filters[index];\n }\n else {\n return insertDefaultFilter(index, filter$$1, {\n field: field,\n operator: defaultOperator\n });\n }\n};\n/**\n * @hidden\n */\nvar logicOperators = function (localization) { return [\n { text: localization.get(\"filterAndLogic\"), value: \"and\" },\n { text: localization.get(\"filterOrLogic\"), value: \"or\" }\n]; };\n/**\n * @hidden\n */\nvar flatten = function (filter$$1) {\n if (isPresent(filter$$1.filters)) {\n return filter$$1.filters.reduce(function (acc, curr) {\n return acc.concat(isCompositeFilterDescriptor(curr) ? flatten(curr) : [curr]);\n }, []);\n }\n return [];\n};\nvar trimFilterByField = function (filter$$1, field) {\n if (isPresent(filter$$1) && isPresent(filter$$1.filters)) {\n filter$$1.filters = filter$$1.filters.filter(function (x) {\n if (isCompositeFilterDescriptor(x)) {\n trimFilterByField(x, field);\n return x.filters.length;\n }\n else {\n return x.field !== field;\n }\n });\n }\n};\n/**\n * @hidden\n */\nvar filtersByField = function (filter$$1, field) {\n return flatten(filter$$1 || {}).filter(function (x) { return x.field === field; });\n};\n/**\n * @hidden\n */\nvar filterByField = function (filter$$1, field) {\n var currentFilter = filtersByField(filter$$1, field)[0];\n return currentFilter;\n};\n/**\n * @hidden\n */\nvar removeFilter = function (filter$$1, field) {\n trimFilterByField(filter$$1, field);\n return filter$$1;\n};\n/**\n * @hidden\n */\nvar localizeOperators$1 = function (operators$$1) { return function (localization) { return Object.keys(operators$$1).map(function (key) { return ({\n text: localization.get(key),\n value: operators$$1[key]\n}); }); }; };\n/**\n * An abstract base class for the filter-cell component ([see example]({% slug reusablecustomfilters_grid %}#toc-filter-row)).\n */\nvar BaseFilterCellComponent = /** @class */ (function () {\n function BaseFilterCellComponent(filterService) {\n this.filterService = filterService;\n this.operatorList = new QueryList();\n }\n Object.defineProperty(BaseFilterCellComponent.prototype, \"hostClasses\", {\n /**\n * @hidden\n */\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BaseFilterCellComponent.prototype, \"operators\", {\n get: function () {\n return this._operators.length ? this._operators : this.defaultOperators;\n },\n set: function (values) {\n this._operators = values;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n */\n BaseFilterCellComponent.prototype.ngAfterContentInit = function () {\n var _this = this;\n this.operationListSubscription = observe(this.operatorList)\n .pipe(map(function (q) { return q.toArray(); }), map(toJSON))\n .subscribe(function (x) {\n _this.operators = x;\n });\n };\n BaseFilterCellComponent.prototype.ngOnDestroy = function () {\n if (this.operationListSubscription) {\n this.operationListSubscription.unsubscribe();\n }\n };\n BaseFilterCellComponent.prototype.filterByField = function (field) {\n return filterByField(this.filter, field);\n };\n BaseFilterCellComponent.prototype.filtersByField = function (field) {\n return filtersByField(this.filter, field);\n };\n BaseFilterCellComponent.prototype.removeFilter = function (field) {\n return removeFilter(this.filter, field);\n };\n BaseFilterCellComponent.prototype.updateFilter = function (filter$$1) {\n var root = this.filter || {\n filters: [],\n logic: \"and\"\n };\n var currentFilter = flatten(root).filter(function (x) { return x.field === filter$$1.field; })[0];\n if (!isPresent(currentFilter)) {\n root.filters.push(filter$$1);\n }\n else {\n Object.assign(currentFilter, filter$$1);\n }\n return root;\n };\n BaseFilterCellComponent.prototype.applyFilter = function (filter$$1) {\n this.filterService.filter(filter$$1);\n };\n BaseFilterCellComponent.propDecorators = {\n hostClasses: [{ type: HostBinding, args: ['class.k-filtercell',] }],\n operatorList: [{ type: ContentChildren, args: [FilterOperatorBase,] }]\n };\n return BaseFilterCellComponent;\n}());\n\n// tslint:disable:no-access-missing-member\nvar numericOperators = localizeOperators$1({\n \"filterEqOperator\": \"eq\",\n \"filterNotEqOperator\": \"neq\",\n // tslint:disable-next-line:object-literal-sort-keys\n \"filterGteOperator\": \"gte\",\n \"filterGtOperator\": \"gt\",\n \"filterLteOperator\": \"lte\",\n \"filterLtOperator\": \"lt\",\n \"filterIsNullOperator\": \"isnull\",\n \"filterIsNotNullOperator\": \"isnotnull\"\n});\n/**\n * Represents a base numeric filter component.\n */\nvar NumericFilterComponent = /** @class */ (function (_super) {\n __extends(NumericFilterComponent, _super);\n function NumericFilterComponent(filterService, localization) {\n var _this = _super.call(this, filterService) || this;\n _this.localization = localization;\n /**\n * The default filter operator. Defaults to `eq`.\n * @type {string}\n */\n _this.operator = \"eq\";\n /**\n * Specifies the value that is used to increment or decrement the component value.\n * @type {numeric}\n */\n _this.step = 1;\n /**\n * Specifies whether the **Up** and **Down** spin buttons will be rendered.\n * @type {boolean}\n */\n _this.spinners = true;\n _this.defaultOperators = numericOperators(_this.localization);\n return _this;\n }\n Object.defineProperty(NumericFilterComponent.prototype, \"format\", {\n /**\n * Specifies the number format used when the component is not focused.\n * By default, the `column.format` value is used (if set).\n *\n * @readonly\n * @type {string}\n */\n get: function () {\n return !isNullOrEmptyString(this._format) ? this._format : this.columnFormat;\n },\n /**\n * Specifies the number format used when the component is not focused.\n * By default, the `column.format` value is used (if set).\n */\n set: function (value) {\n this._format = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NumericFilterComponent.prototype, \"currentFilter\", {\n /**\n * The current filter for the associated column field.\n * @readonly\n * @type {FilterDescriptor}\n */\n get: function () {\n return this.filterByField(this.column.field);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NumericFilterComponent.prototype, \"currentOperator\", {\n /**\n * The current filter operator for the associated column field.\n * @readonly\n * @type {string}\n */\n get: function () {\n return this.currentFilter ? this.currentFilter.operator : this.operator;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NumericFilterComponent.prototype, \"columnFormat\", {\n get: function () {\n return this.column && !isNullOrEmptyString(this.column.format) ?\n extractFormat(this.column.format) : \"n2\";\n },\n enumerable: true,\n configurable: true\n });\n NumericFilterComponent.prototype.ngOnInit = function () {\n this.subscription = this.localization.changes.subscribe(this.localizationChange.bind(this));\n };\n NumericFilterComponent.prototype.ngOnDestroy = function () {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n _super.prototype.ngOnDestroy.call(this);\n };\n NumericFilterComponent.prototype.localizationChange = function () {\n this.defaultOperators = numericOperators(this.localization);\n if (this.operatorList.length) {\n this.operators = toJSON(this.operatorList.toArray());\n }\n };\n NumericFilterComponent.propDecorators = {\n column: [{ type: Input }],\n filter: [{ type: Input }],\n operator: [{ type: Input }],\n step: [{ type: Input }],\n min: [{ type: Input }],\n max: [{ type: Input }],\n spinners: [{ type: Input }],\n decimals: [{ type: Input }],\n format: [{ type: Input }]\n };\n return NumericFilterComponent;\n}(BaseFilterCellComponent));\n\n/**\n * Represents a numeric filter cell.\n *\n * @example\n * ```html-no-run\n * \n * \n * \n * \n * \n * \n * ```\n */\nvar NumericFilterCellComponent = /** @class */ (function (_super) {\n __extends(NumericFilterCellComponent, _super);\n function NumericFilterCellComponent(filterService, localization) {\n var _this = _super.call(this, filterService, localization) || this;\n _this.localization = localization;\n /**\n * Determines the delay time (in milliseconds) before the filter value is submitted.\n * A value of `0` indicates no delay. The default value is `500`.\n * @type {boolean}\n */\n _this.filterDelay = 500;\n /**\n * Determines if the drop-down filter operators will be displayed.\n * The default value is `true`.\n * @type {boolean}\n */\n _this.showOperators = true;\n return _this;\n }\n NumericFilterCellComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-numeric-filter-cell',\n template: \"\\n \\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n NumericFilterCellComponent.ctorParameters = function () { return [\n { type: FilterService },\n { type: LocalizationService }\n ]; };\n NumericFilterCellComponent.propDecorators = {\n filterDelay: [{ type: Input }],\n showOperators: [{ type: Input }]\n };\n return NumericFilterCellComponent;\n}(NumericFilterComponent));\n\n/**\n * @hidden\n */\nvar FilterInputDirective = /** @class */ (function () {\n function FilterInputDirective(valueAccessors, ngZone, element, renderer) {\n var _this = this;\n this.change = new EventEmitter();\n this.composing = false;\n this.filterDelay = 500;\n this.changeRequests = new Subject();\n this.accessor = valueAccessors[0];\n ngZone.runOutsideAngular(function () {\n var unsubscribeStart = renderer.listen(element.nativeElement, 'compositionstart', function () { return _this.composing = true; });\n var unsubscribeEnd = renderer.listen(element.nativeElement, 'compositionend', function () { return _this.composing = false; });\n _this.unsubscribeEvents = function () {\n unsubscribeStart();\n unsubscribeEnd();\n };\n });\n }\n Object.defineProperty(FilterInputDirective.prototype, \"value\", {\n set: function (value) {\n this.accessor.writeValue(value);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FilterInputDirective.prototype, \"disabled\", {\n set: function (value) {\n this.accessor.setDisabledState(value);\n },\n enumerable: true,\n configurable: true\n });\n FilterInputDirective.prototype.ngAfterViewInit = function () {\n var _this = this;\n this.accessor.registerOnChange(function (x) {\n return _this.filterDelay > 0 ?\n _this.changeRequests.next(x) :\n _this.change.emit(x);\n });\n this.subscribeChanges();\n };\n FilterInputDirective.prototype.ngOnChanges = function (changes) {\n if (isChanged('filterDelay', changes)) {\n this.unsubscribeChanges();\n this.subscribeChanges();\n }\n };\n FilterInputDirective.prototype.ngOnDestroy = function () {\n this.unsubscribeChanges();\n this.unsubscribeEvents();\n };\n FilterInputDirective.prototype.subscribeChanges = function () {\n var _this = this;\n this.changeRequestsSubscription = this.changeRequests\n .pipe(debounceTime(this.filterDelay), filter(function () { return !_this.composing; }))\n .subscribe(function (x) { return _this.change.emit(x); });\n };\n FilterInputDirective.prototype.unsubscribeChanges = function () {\n if (this.changeRequestsSubscription) {\n this.changeRequestsSubscription.unsubscribe();\n }\n };\n FilterInputDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoFilterInput]'\n },] },\n ];\n /** @nocollapse */\n FilterInputDirective.ctorParameters = function () { return [\n { type: Array, decorators: [{ type: Self }, { type: Inject, args: [NG_VALUE_ACCESSOR,] }] },\n { type: NgZone },\n { type: ElementRef },\n { type: Renderer2 }\n ]; };\n FilterInputDirective.propDecorators = {\n filterDelay: [{ type: Input }],\n value: [{ type: Input }]\n };\n return FilterInputDirective;\n}());\n\nvar EMPTY_VALUE_OPERATORS = new Set(['isnull', 'isnotnull', 'isempty', 'isnotempty']);\nvar isEmptyValueOperator = function (operator) { return EMPTY_VALUE_OPERATORS.has(operator); };\n/**\n * @hidden\n */\nvar FilterInputWrapperComponent = /** @class */ (function (_super) {\n __extends(FilterInputWrapperComponent, _super);\n function FilterInputWrapperComponent(filterService) {\n var _this = _super.call(this, filterService) || this;\n _this.operators = [];\n return _this;\n }\n Object.defineProperty(FilterInputWrapperComponent.prototype, \"currentFilter\", {\n get: function () {\n return this.filterByField(this.column.field);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FilterInputWrapperComponent.prototype, \"currentOperator\", {\n get: function () {\n var filter$$1 = this.currentFilter;\n if (!this._operator) {\n this._operator = filter$$1 ? filter$$1.operator : this.defaultOperator;\n }\n return this._operator;\n },\n set: function (value) {\n this._operator = value;\n var emptyValueOperator = isEmptyValueOperator(value);\n this.filterInputDisabled = emptyValueOperator;\n if (emptyValueOperator) {\n this.applyNoValueFilter(value);\n }\n else if (!isBlank(value) && isPresent(this.currentFilter)) {\n this.onChange(this.currentFilter.value);\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FilterInputWrapperComponent.prototype, \"defaultOperator\", {\n get: function () {\n if (!isNullOrEmptyString(this._defaultOperator)) {\n return this._defaultOperator;\n }\n else if (this.operators && this.operators.length) {\n return this.operators[0].value;\n }\n return \"eq\";\n },\n set: function (value) {\n this._defaultOperator = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FilterInputWrapperComponent.prototype, \"filterInputDisabled\", {\n set: function (disabled) {\n if (!this.input) {\n return;\n }\n this.input.disabled = disabled;\n },\n enumerable: true,\n configurable: true\n });\n FilterInputWrapperComponent.prototype.ngAfterContentInit = function () {\n if (isPresent(this.input)) {\n this.changeSubscription = this.input.change.subscribe(this.onChange.bind(this));\n this.filterInputDisabled = isEmptyValueOperator(this.currentOperator);\n }\n };\n FilterInputWrapperComponent.prototype.ngOnDestroy = function () {\n _super.prototype.ngOnDestroy.call(this);\n if (this.changeSubscription) {\n this.changeSubscription.unsubscribe();\n }\n };\n FilterInputWrapperComponent.prototype.onChange = function (value) {\n if (!isNullOrEmptyString(value) || this.filterByField(this.column.field)) {\n this.filterChange(isNullOrEmptyString(value) ?\n this.removeFilter(this.column.field) :\n this.updateFilter({\n field: this.column.field,\n operator: this.currentOperator,\n value: value\n }));\n }\n };\n FilterInputWrapperComponent.prototype.onClear = function () {\n this.onChange(null);\n this.filterInputDisabled = isEmptyValueOperator(this.defaultOperator);\n };\n FilterInputWrapperComponent.prototype.applyNoValueFilter = function (operator) {\n this.filterChange(this.updateFilter({\n field: this.column.field,\n operator: operator,\n value: null\n }));\n };\n FilterInputWrapperComponent.prototype.ngOnChanges = function (changes) {\n if (isChanged(\"filter\", changes, false)) {\n this._operator = null;\n this.filterInputDisabled = isEmptyValueOperator(this.currentOperator);\n }\n };\n FilterInputWrapperComponent.propDecorators = {\n operators: [{ type: Input }],\n column: [{ type: Input }],\n filter: [{ type: Input }],\n input: [{ type: ContentChild, args: [FilterInputDirective,] }],\n defaultOperator: [{ type: Input }]\n };\n return FilterInputWrapperComponent;\n}(BaseFilterCellComponent));\n\nvar EMPTY_FILTER_OPERATORS = ['isnull', 'isnotnull', 'isempty', 'isnotempty'];\n/**\n * @hidden\n */\nvar FilterCellWrapperComponent = /** @class */ (function (_super) {\n __extends(FilterCellWrapperComponent, _super);\n function FilterCellWrapperComponent(filterService) {\n var _this = _super.call(this, filterService) || this;\n _this.showOperators = true;\n return _this;\n }\n Object.defineProperty(FilterCellWrapperComponent.prototype, \"hostClasses\", {\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FilterCellWrapperComponent.prototype, \"overrideBaseClasses\", {\n get: function () {\n return false;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FilterCellWrapperComponent.prototype, \"showButton\", {\n get: function () {\n var filter$$1 = this.currentFilter;\n return isPresent(filter$$1) && (!isNullOrEmptyString(filter$$1.value) ||\n EMPTY_FILTER_OPERATORS.indexOf(String(filter$$1.operator)) >= 0);\n },\n enumerable: true,\n configurable: true\n });\n FilterCellWrapperComponent.prototype.filterChange = function (filter$$1) {\n this.applyFilter(filter$$1);\n };\n FilterCellWrapperComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-filter-wrapper-cell',\n template: \"\\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n FilterCellWrapperComponent.ctorParameters = function () { return [\n { type: FilterService }\n ]; };\n FilterCellWrapperComponent.propDecorators = {\n hostClasses: [{ type: HostBinding, args: ['class.k-filtercell-wrapper',] }],\n overrideBaseClasses: [{ type: HostBinding, args: ['class.k-filtercell',] }],\n showOperators: [{ type: Input }]\n };\n return FilterCellWrapperComponent;\n}(FilterInputWrapperComponent));\n\n// tslint:disable:no-access-missing-member\nvar stringOperators = localizeOperators$1({\n \"filterEqOperator\": \"eq\",\n \"filterNotEqOperator\": \"neq\",\n // tslint:disable-next-line:object-literal-sort-keys\n \"filterContainsOperator\": \"contains\",\n \"filterNotContainsOperator\": \"doesnotcontain\",\n \"filterStartsWithOperator\": \"startswith\",\n \"filterEndsWithOperator\": \"endswith\",\n \"filterIsNullOperator\": \"isnull\",\n \"filterIsNotNullOperator\": \"isnotnull\",\n \"filterIsEmptyOperator\": \"isempty\",\n \"filterIsNotEmptyOperator\": \"isnotempty\"\n});\n/**\n * Represents a base string filter component.\n */\nvar StringFilterComponent = /** @class */ (function (_super) {\n __extends(StringFilterComponent, _super);\n function StringFilterComponent(filterService, localization) {\n var _this = _super.call(this, filterService) || this;\n _this.localization = localization;\n /**\n * The default filter operator. Defaults to `contains`.\n * @type {string}\n */\n _this.operator = \"contains\";\n return _this;\n }\n Object.defineProperty(StringFilterComponent.prototype, \"currentFilter\", {\n /**\n * The current filter for the associated column field.\n * @readonly\n * @type {FilterDescriptor}\n */\n get: function () {\n return this.filterByField((this.column || {}).field);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(StringFilterComponent.prototype, \"currentOperator\", {\n /**\n * The current filter operator for the associated column field.\n * @readonly\n * @type {string}\n */\n get: function () {\n return this.currentFilter ? this.currentFilter.operator : this.operator;\n },\n enumerable: true,\n configurable: true\n });\n StringFilterComponent.prototype.ngOnInit = function () {\n this.subscription = this.localization.changes.subscribe(this.localizationChange.bind(this));\n };\n StringFilterComponent.prototype.ngOnDestroy = function () {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n _super.prototype.ngOnDestroy.call(this);\n };\n StringFilterComponent.prototype.localizationChange = function () {\n this.defaultOperators = stringOperators(this.localization);\n if (this.operatorList.length) {\n this.operators = toJSON(this.operatorList.toArray());\n }\n };\n StringFilterComponent.propDecorators = {\n column: [{ type: Input }],\n filter: [{ type: Input }],\n operator: [{ type: Input }]\n };\n return StringFilterComponent;\n}(BaseFilterCellComponent));\n\n/**\n * Represents a string-filter cell component\n * ([see example]({% slug builtinfiltertemplate_grid %}#toc-configuration-components-for-filter-templates)).\n *\n * @example\n *\n * ```html-no-run\n * \n * \n * \n * \n * \n * \n * ```\n */\nvar StringFilterCellComponent = /** @class */ (function (_super) {\n __extends(StringFilterCellComponent, _super);\n function StringFilterCellComponent(filterService, localization) {\n var _this = _super.call(this, filterService, localization) || this;\n /**\n * Determines the delay time (in milliseconds) before the filter value is submitted.\n * A value of `0` indicates no delay. The default value is `500`.\n * @type {boolean}\n */\n _this.filterDelay = 500;\n /**\n * Determines if the drop-down filter operators will be displayed.\n * The default value is `true`.\n * @type {boolean}\n */\n _this.showOperators = true;\n return _this;\n }\n StringFilterCellComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-string-filter-cell',\n template: \"\\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n StringFilterCellComponent.ctorParameters = function () { return [\n { type: FilterService },\n { type: LocalizationService }\n ]; };\n StringFilterCellComponent.propDecorators = {\n filterDelay: [{ type: Input }],\n showOperators: [{ type: Input }]\n };\n return StringFilterCellComponent;\n}(StringFilterComponent));\n\n/**\n * Represents a component which accommodates the filter operators.\n */\nvar FilterCellOperatorsComponent = /** @class */ (function () {\n function FilterCellOperatorsComponent(localization) {\n this.localization = localization;\n this.clearText = 'Clear';\n /**\n * The filter operators that will be displayed.\n */\n this.operators = [];\n /**\n * Determines if the list of operators will be displayed.\n * @type {boolean}\n */\n this.showOperators = true;\n /**\n * Fires when the operator is selected.\n * @type {EventEmitter}\n */\n this.valueChange = new EventEmitter();\n /**\n * Fires when the **Clear** button is clicked.\n * @type {EventEmitter<{}>}\n */\n this.clear = new EventEmitter();\n }\n Object.defineProperty(FilterCellOperatorsComponent.prototype, \"hostClasses\", {\n /**\n * @hidden\n */\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n */\n FilterCellOperatorsComponent.prototype.onChange = function (dataItem) {\n this.valueChange.emit(dataItem);\n };\n /**\n * @hidden\n */\n FilterCellOperatorsComponent.prototype.clearClick = function () {\n this.clear.emit();\n return false;\n };\n /**\n * @hidden\n */\n FilterCellOperatorsComponent.prototype.clearKeydown = function (args) {\n if (args.keyCode === Keys.Enter || args.keyCode === Keys.Space) {\n this.clear.emit();\n }\n };\n /**\n * @hidden\n */\n FilterCellOperatorsComponent.prototype.dropdownKeydown = function (args) {\n if (args.defaultPrevented) {\n return;\n }\n if (args.keyCode === Keys.Enter && !this.dropdown.isOpen) {\n this.dropdown.toggle(true);\n args.preventDefault();\n }\n };\n FilterCellOperatorsComponent.prototype.ngOnInit = function () {\n var _this = this;\n this.localization.changes.subscribe(function () { return _this.clearText = _this.localization.get(\"filterClearButton\"); });\n };\n FilterCellOperatorsComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-filter-cell-operators',\n template: \"\\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n FilterCellOperatorsComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n FilterCellOperatorsComponent.propDecorators = {\n hostClasses: [{ type: HostBinding, args: ['class.k-filtercell-operator',] }],\n dropdown: [{ type: ViewChild, args: ['dropdown',] }],\n operators: [{ type: Input }],\n showButton: [{ type: Input }],\n showOperators: [{ type: Input }],\n value: [{ type: Input }],\n valueChange: [{ type: Output }],\n clear: [{ type: Output }]\n };\n return FilterCellOperatorsComponent;\n}());\n\n// tslint:disable:no-access-missing-member\nvar stringOperators$1 = localizeOperators$1({\n \"filterContainsOperator\": \"contains\",\n \"filterNotContainsOperator\": \"doesnotcontain\",\n // tslint:disable-next-line:object-literal-sort-keys\n \"filterEqOperator\": \"eq\",\n \"filterNotEqOperator\": \"neq\",\n \"filterStartsWithOperator\": \"startswith\",\n \"filterEndsWithOperator\": \"endswith\",\n \"filterIsNullOperator\": \"isnull\",\n \"filterIsNotNullOperator\": \"isnotnull\",\n \"filterIsEmptyOperator\": \"isempty\",\n \"filterIsNotEmptyOperator\": \"isnotempty\"\n});\n/**\n * @hidden\n */\nvar AutoCompleteFilterCellComponent = /** @class */ (function (_super) {\n __extends(AutoCompleteFilterCellComponent, _super);\n function AutoCompleteFilterCellComponent(filterService, column, localization) {\n var _this = _super.call(this, filterService) || this;\n _this.localization = localization;\n _this.showOperators = true;\n _this.defaultOperators = stringOperators$1(_this.localization);\n _this.column = column;\n return _this;\n }\n Object.defineProperty(AutoCompleteFilterCellComponent.prototype, \"valueField\", {\n get: function () {\n return this._valueField ? this._valueField : this.column.field;\n },\n set: function (value) {\n this._valueField = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AutoCompleteFilterCellComponent.prototype, \"currentFilter\", {\n get: function () {\n return this.filterByField(this.column.field);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AutoCompleteFilterCellComponent.prototype, \"currentOperator\", {\n get: function () {\n return this.currentFilter ? this.currentFilter.operator : \"contains\";\n },\n enumerable: true,\n configurable: true\n });\n AutoCompleteFilterCellComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-autocomplete-filter-cell',\n template: \"\\n \\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n AutoCompleteFilterCellComponent.ctorParameters = function () { return [\n { type: FilterService },\n { type: ColumnComponent },\n { type: LocalizationService }\n ]; };\n AutoCompleteFilterCellComponent.propDecorators = {\n showOperators: [{ type: Input }],\n column: [{ type: Input }],\n filter: [{ type: Input }],\n data: [{ type: Input }],\n valueField: [{ type: Input }]\n };\n return AutoCompleteFilterCellComponent;\n}(BaseFilterCellComponent));\n\n// tslint:disable:no-access-missing-member\n/**\n * @hidden\n */\nvar BooleanFilterComponent = /** @class */ (function (_super) {\n __extends(BooleanFilterComponent, _super);\n function BooleanFilterComponent(filterService, localization) {\n var _this = _super.call(this, filterService) || this;\n _this.localization = localization;\n /**\n * @hidden\n */\n _this.operator = \"eq\";\n /**\n * @hidden\n */\n _this.items = [\n { text: _this.localization.get(\"filterIsTrue\"), value: true },\n { text: _this.localization.get(\"filterIsFalse\"), value: false }\n ];\n /**\n * @hidden\n */\n _this.defaultItem = { text: _this.localization.get(\"filterBooleanAll\"), value: null };\n return _this;\n }\n Object.defineProperty(BooleanFilterComponent.prototype, \"hostClasses\", {\n /**\n * @hidden\n */\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BooleanFilterComponent.prototype, \"currentFilter\", {\n /**\n * The current filter for the associated column field.\n * @readonly\n * @type {FilterDescriptor}\n */\n get: function () {\n return this.filterByField(this.column.field);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(BooleanFilterComponent.prototype, \"currentOperator\", {\n /**\n * The current filter operator for the associated column field.\n * @readonly\n * @type {string}\n */\n get: function () {\n return this.currentFilter ? this.currentFilter.operator : this.operator;\n },\n enumerable: true,\n configurable: true\n });\n BooleanFilterComponent.prototype.ngOnInit = function () {\n this.subscription = this.localization.changes.subscribe(this.localizationChange.bind(this));\n };\n BooleanFilterComponent.prototype.ngOnDestroy = function () {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n _super.prototype.ngOnDestroy.call(this);\n };\n BooleanFilterComponent.prototype.localizationChange = function () {\n this.items = [\n { text: this.localization.get(\"filterIsTrue\"), value: true },\n { text: this.localization.get(\"filterIsFalse\"), value: false }\n ];\n this.defaultItem = { text: this.localization.get(\"filterBooleanAll\"), value: null };\n };\n BooleanFilterComponent.propDecorators = {\n hostClasses: [{ type: HostBinding, args: ['class.k-filtercell-boolean',] }],\n column: [{ type: Input }],\n filter: [{ type: Input }]\n };\n return BooleanFilterComponent;\n}(BaseFilterCellComponent));\n\n/**\n * Represents a Boolean filter-cell component.\n *\n * @example\n *\n * ```html-no-run\n * \n * \n * \n * \n * \n * \n * ```\n */\nvar BooleanFilterCellComponent = /** @class */ (function (_super) {\n __extends(BooleanFilterCellComponent, _super);\n function BooleanFilterCellComponent(filterService, localization, cd) {\n var _this = _super.call(this, filterService, localization) || this;\n _this.cd = cd;\n return _this;\n }\n BooleanFilterCellComponent.prototype.localizationChange = function () {\n _super.prototype.localizationChange.call(this);\n this.cd.markForCheck();\n };\n BooleanFilterCellComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-boolean-filter-cell',\n template: \"\\n \\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n BooleanFilterCellComponent.ctorParameters = function () { return [\n { type: FilterService },\n { type: LocalizationService },\n { type: ChangeDetectorRef }\n ]; };\n return BooleanFilterCellComponent;\n}(BooleanFilterComponent));\n\n// tslint:disable:no-access-missing-member\nvar dateOperators = localizeOperators$1({\n \"filterEqOperator\": \"eq\",\n \"filterNotEqOperator\": \"neq\",\n // tslint:disable-next-line:object-literal-sort-keys\n \"filterAfterOrEqualOperator\": \"gte\",\n \"filterAfterOperator\": \"gt\",\n \"filterBeforeOrEqualOperator\": \"lte\",\n \"filterBeforeOperator\": \"lt\",\n \"filterIsNullOperator\": \"isnull\",\n \"filterIsNotNullOperator\": \"isnotnull\"\n});\n/**\n * @hidden\n */\nvar DateFilterComponent = /** @class */ (function (_super) {\n __extends(DateFilterComponent, _super);\n function DateFilterComponent(filterService, localization) {\n var _this = _super.call(this, filterService) || this;\n _this.localization = localization;\n /**\n * The default filter operator. Defaults to `contains`.\n * @type {string}\n */\n _this.operator = \"gte\";\n /**\n * Defines the active view that the calendar initially renders.\n * By default, the active view is `month`.\n *\n * > You have to set `activeView` within the `topView`-`bottomView` range.\n */\n _this.activeView = \"month\";\n /**\n * Defines the bottommost calendar view, to which the user can navigate.\n */\n _this.bottomView = \"month\";\n /**\n * Defines the topmost calendar view, to which the user can navigate.\n */\n _this.topView = \"century\";\n /**\n * Determines whether to display a week number column in the `month` view of the Calendar.\n */\n _this.weekNumber = false;\n _this.defaultOperators = dateOperators(_this.localization);\n return _this;\n }\n Object.defineProperty(DateFilterComponent.prototype, \"currentFilter\", {\n /**\n * The current filter for the associated column field.\n * @readonly\n * @type {FilterDescriptor}\n */\n get: function () {\n return this.filterByField(this.column.field);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateFilterComponent.prototype, \"format\", {\n /**\n * Specifies the date format that is used when the component is not focused.\n * By default, the `column.format` value is used (if set).\n *\n * @readonly\n * @type {string}\n */\n get: function () {\n return !isNullOrEmptyString(this._format) ? this._format : this.columnFormat;\n },\n /**\n * Specifies the date format that is used when the component is not focused.\n * By default, the `column.format` value is used (if set).\n */\n set: function (value) {\n this._format = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateFilterComponent.prototype, \"columnFormat\", {\n get: function () {\n return this.column && !isNullOrEmptyString(this.column.format) ?\n extractFormat(this.column.format) : \"d\";\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateFilterComponent.prototype, \"currentOperator\", {\n /**\n * The current filter operator for the associated column field.\n * @readonly\n * @type {string}\n */\n get: function () {\n return this.currentFilter ? this.currentFilter.operator : this.operator;\n },\n enumerable: true,\n configurable: true\n });\n DateFilterComponent.prototype.ngOnInit = function () {\n this.subscription = this.localization.changes.subscribe(this.localizationChange.bind(this));\n };\n DateFilterComponent.prototype.ngOnDestroy = function () {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n _super.prototype.ngOnDestroy.call(this);\n };\n DateFilterComponent.prototype.localizationChange = function () {\n this.defaultOperators = dateOperators(this.localization);\n if (this.operatorList.length) {\n this.operators = toJSON(this.operatorList.toArray());\n }\n };\n DateFilterComponent.propDecorators = {\n column: [{ type: Input }],\n filter: [{ type: Input }],\n operator: [{ type: Input }],\n format: [{ type: Input }],\n min: [{ type: Input }],\n max: [{ type: Input }],\n formatPlaceholder: [{ type: Input }],\n placeholder: [{ type: Input }],\n activeView: [{ type: Input }],\n bottomView: [{ type: Input }],\n topView: [{ type: Input }],\n weekNumber: [{ type: Input }]\n };\n return DateFilterComponent;\n}(BaseFilterCellComponent));\n\n/**\n * Represents a date-filter cell component.\n *\n * @example\n *\n * ```html-no-run\n * \n * \n * \n * \n * \n * \n * ```\n */\nvar DateFilterCellComponent = /** @class */ (function (_super) {\n __extends(DateFilterCellComponent, _super);\n function DateFilterCellComponent(filterService, localization) {\n var _this = _super.call(this, filterService, localization) || this;\n _this.localization = localization;\n /**\n * Determines if the drop-down filter operators will be displayed. The default value is `true`.\n * @type {boolean}\n */\n _this.showOperators = true;\n return _this;\n }\n DateFilterCellComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-date-filter-cell',\n template: \"\\n \\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n DateFilterCellComponent.ctorParameters = function () { return [\n { type: FilterService },\n { type: LocalizationService }\n ]; };\n DateFilterCellComponent.propDecorators = {\n showOperators: [{ type: Input }]\n };\n return DateFilterCellComponent;\n}(DateFilterComponent));\n\n/**\n * @hidden\n */\nvar ColGroupComponent = /** @class */ (function () {\n function ColGroupComponent() {\n this.columns = [];\n this.groups = [];\n }\n Object.defineProperty(ColGroupComponent.prototype, \"columnsToRender\", {\n get: function () {\n return columnsToRender(this.columns);\n },\n enumerable: true,\n configurable: true\n });\n ColGroupComponent.prototype.trackBy = function (index, _item) {\n return index;\n };\n ColGroupComponent.decorators = [\n { type: Component, args: [{\n selector: '[kendoGridColGroup]',\n template: \"\\n \\n \\n \\n \\n \\n \"\n },] },\n ];\n ColGroupComponent.propDecorators = {\n columns: [{ type: Input }],\n groups: [{ type: Input }],\n detailTemplate: [{ type: Input }]\n };\n return ColGroupComponent;\n}());\n\n/**\n * @hidden\n */\nvar LoadingComponent = /** @class */ (function () {\n function LoadingComponent(localization) {\n this.localization = localization;\n this.hostClass = true;\n }\n Object.defineProperty(LoadingComponent.prototype, \"loadingText\", {\n get: function () {\n return this.localization.get('loading');\n },\n enumerable: true,\n configurable: true\n });\n LoadingComponent.decorators = [\n { type: Component, args: [{\n selector: '[kendoGridLoading]',\n template: \"\\n {{ loadingText }}\\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n LoadingComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n LoadingComponent.propDecorators = {\n hostClass: [{ type: HostBinding, args: ['class.k-loading-mask',] }]\n };\n return LoadingComponent;\n}());\n\n/**\n * @hidden\n */\nvar ResizableContainerDirective = /** @class */ (function () {\n function ResizableContainerDirective(el, renderer, resizeService, grid) {\n this.el = el;\n this.renderer = renderer;\n this.resizeService = resizeService;\n this.grid = grid;\n this.enabled = false;\n }\n Object.defineProperty(ResizableContainerDirective.prototype, \"lockedWidth\", {\n set: function (value) {\n this._lockedWidth = value;\n if (this.enabled) {\n this.attachResize();\n this.resize();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ResizableContainerDirective.prototype, \"kendoGridResizableContainer\", {\n set: function (enabled) {\n var refresh = enabled !== this.enabled;\n this.enabled = enabled;\n if (refresh) {\n this.attachResize();\n this.resize();\n }\n },\n enumerable: true,\n configurable: true\n });\n ResizableContainerDirective.prototype.ngOnDestroy = function () {\n if (this.resizeSubscription) {\n this.resizeSubscription.unsubscribe();\n }\n };\n ResizableContainerDirective.prototype.attachResize = function () {\n if (this.resizeSubscription && !this.enabled) {\n this.resizeSubscription.unsubscribe();\n this.resizeSubscription = null;\n }\n if (!this.resizeSubscription && this.enabled) {\n this.resizeSubscription = this.resizeService.changes.subscribe(this.resize.bind(this));\n }\n };\n ResizableContainerDirective.prototype.resize = function () {\n if (this.grid && this.grid.wrapper) {\n var containerElement = this.grid.wrapper.nativeElement;\n var width = Math.max(containerElement.clientWidth - this._lockedWidth, 0);\n if (this.enabled && width > 0) {\n this.renderer.setStyle(this.el.nativeElement, \"width\", width + \"px\");\n }\n else {\n this.renderer.setStyle(this.el.nativeElement, \"width\", \"\");\n }\n }\n };\n ResizableContainerDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoGridResizableContainer]'\n },] },\n ];\n /** @nocollapse */\n ResizableContainerDirective.ctorParameters = function () { return [\n { type: ElementRef },\n { type: Renderer2 },\n { type: ResizeService },\n { type: GridComponent, decorators: [{ type: Optional }] }\n ]; };\n ResizableContainerDirective.propDecorators = {\n lockedWidth: [{ type: Input, args: ['lockedWidth',] }],\n kendoGridResizableContainer: [{ type: Input }]\n };\n return ResizableContainerDirective;\n}());\n\n/**\n * @hidden\n */\nvar TemplateContextDirective = /** @class */ (function () {\n function TemplateContextDirective(viewContainerRef) {\n this.viewContainerRef = viewContainerRef;\n }\n Object.defineProperty(TemplateContextDirective.prototype, \"templateContext\", {\n set: function (context) {\n this.removeView();\n if (context.templateRef) {\n this.insertedViewRef = this.viewContainerRef.createEmbeddedView(context.templateRef, context);\n }\n },\n enumerable: true,\n configurable: true\n });\n TemplateContextDirective.prototype.ngOnDestroy = function () {\n this.removeView();\n };\n TemplateContextDirective.prototype.removeView = function () {\n if (this.insertedViewRef) {\n this.viewContainerRef.remove(this.viewContainerRef.indexOf(this.insertedViewRef));\n this.insertedViewRef = undefined;\n }\n };\n TemplateContextDirective.decorators = [\n { type: Directive, args: [{\n selector: '[templateContext]' // tslint:disable-line:directive-selector\n },] },\n ];\n /** @nocollapse */\n TemplateContextDirective.ctorParameters = function () { return [\n { type: ViewContainerRef }\n ]; };\n TemplateContextDirective.propDecorators = {\n templateContext: [{ type: Input }]\n };\n return TemplateContextDirective;\n}());\n\n/**\n * @hidden\n */\nvar FocusGroup = /** @class */ (function () {\n function FocusGroup(root) {\n this.root = root;\n this.active = true;\n this.children = [];\n this.root.registerGroup(this);\n }\n Object.defineProperty(FocusGroup.prototype, \"focusableChildren\", {\n get: function () {\n return this.children.filter(function (el) { return el.canFocus(); });\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FocusGroup.prototype, \"isActive\", {\n get: function () {\n return this.active;\n },\n enumerable: true,\n configurable: true\n });\n FocusGroup.prototype.ngOnDestroy = function () {\n this.root.unregisterGroup(this);\n };\n FocusGroup.prototype.registerElement = function (element) {\n this.unregisterElement(element);\n this.children.push(element);\n };\n FocusGroup.prototype.unregisterElement = function (element) {\n this.children = this.children.filter(function (f) { return f !== element; });\n };\n /**\n * Returns a Boolean value which indicates if the group will receive focus when the cell is focused.\n * Requires a single \"simple\" focusable element such as a button or a checkbox.\n */\n FocusGroup.prototype.isNavigable = function () {\n var focusable = this.focusableChildren;\n return focusable.length === 1 && focusable[0].isNavigable();\n };\n FocusGroup.prototype.canFocus = function () {\n return this.focusableChildren.length > 0;\n };\n FocusGroup.prototype.focus = function () {\n if (this.canFocus() && !this.hasFocus()) {\n this.focusableChildren[0].focus();\n }\n };\n FocusGroup.prototype.activate = function () {\n this.toggleState(true);\n };\n FocusGroup.prototype.deactivate = function () {\n this.toggleState(false);\n };\n FocusGroup.prototype.hasFocus = function () {\n return this.children.reduce(function (focused, element) { return focused || element.hasFocus(); }, false);\n };\n FocusGroup.prototype.toggleState = function (active) {\n if (this.active !== active) {\n this.active = active;\n this.children.forEach(function (f) { return f.toggle(active); });\n }\n };\n FocusGroup.decorators = [\n { type: Injectable },\n ];\n /** @nocollapse */\n FocusGroup.ctorParameters = function () { return [\n { type: FocusRoot }\n ]; };\n return FocusGroup;\n}());\n\nvar id = 0;\nfunction nextId() {\n return id++;\n}\n/**\n * @hidden\n */\nvar LogicalCellDirective = /** @class */ (function () {\n function LogicalCellDirective(focusGroup, element, columnInfoService, idService, navigationService, renderer, zone, cellContext) {\n this.focusGroup = focusGroup;\n this.element = element;\n this.columnInfoService = columnInfoService;\n this.idService = idService;\n this.navigationService = navigationService;\n this.renderer = renderer;\n this.zone = zone;\n this.cellContext = cellContext;\n this.logicalSlaveCell = false;\n this.colSpan = 1;\n this.rowSpan = 1;\n this.dataRowIndex = -1;\n this.detailExpandCell = false;\n this.uid = nextId();\n }\n Object.defineProperty(LogicalCellDirective.prototype, \"id\", {\n get: function () {\n if (!this.logicalSlaveCell && this.columnInfoService.isLocked) {\n return this.idService.cellId(this.logicalRowIndex, this.logicalColIndex);\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(LogicalCellDirective.prototype, \"ariaColIndex\", {\n get: function () {\n if (this.logicalSlaveCell || this.logicalColIndex === -1) {\n return undefined;\n }\n return this.logicalColIndex + 1;\n },\n enumerable: true,\n configurable: true\n });\n LogicalCellDirective.prototype.ngOnInit = function () {\n var _this = this;\n if (!this.navigationService.enabled) {\n return;\n }\n this.navigationChange = this.navigationService.changes.subscribe(function (e) { return _this.onNavigationChange(e); });\n };\n LogicalCellDirective.prototype.ngDoCheck = function () {\n if (!this.navigationService.enabled || this.logicalColIndex === -1) {\n return;\n }\n if (this.cellContext) {\n this.cellContext.focusGroup = this.focusGroup;\n }\n this.registerNoChanges();\n };\n LogicalCellDirective.prototype.ngOnChanges = function (changes) {\n if (!this.navigationService.enabled) {\n return;\n }\n var keys = Object.keys(changes);\n if ((keys.length === 1 && keys[0] === 'groupItem') || this.logicalColIndex === -1) {\n // Ignore groupItem changes as the reference is not stable\n return;\n }\n var indexChange = changes.logicalColIndex;\n var rowIndexChange = changes.logicalRowIndex;\n var index = indexChange && !indexChange.isFirstChange() ? indexChange.previousValue : this.logicalColIndex;\n var rowIndex = rowIndexChange && !rowIndexChange.isFirstChange() ? rowIndexChange.previousValue : this.logicalRowIndex;\n this.navigationService.unregisterCell(index, rowIndex, this);\n this.registerChanges();\n this.updateElement();\n };\n LogicalCellDirective.prototype.ngOnDestroy = function () {\n if (this.navigationChange) {\n this.navigationChange.unsubscribe();\n }\n this.navigationService.unregisterCell(this.logicalColIndex, this.logicalRowIndex, this);\n };\n LogicalCellDirective.prototype.onNavigationChange = function (e) {\n var active = this.logicalColIndex === e.colIndex && this.logicalRowIndex === e.rowIndex;\n var wasActive = this.logicalColIndex === e.prevColIndex && this.logicalRowIndex === e.prevRowIndex;\n if (active || wasActive) {\n this.updateElement();\n }\n };\n LogicalCellDirective.prototype.updateElement = function () {\n var _this = this;\n var el = this.element.nativeElement;\n this.renderer.setAttribute(el, 'tabIndex', this.isFocusable() && !this.logicalSlaveCell ? '0' : '-1');\n if (this.isFocused()) {\n if (this.focusGroup.isNavigable()) {\n this.focusGroup.focus();\n }\n else {\n if (!this.logicalSlaveCell && this.navigationService.autoFocusCell(this.logicalColIndex, this.logicalColIndex + this.colSpan - 1)) {\n this.microtask(function () {\n return _this.isFocused() && el.focus();\n });\n }\n this.renderer.addClass(el, 'k-state-focused');\n }\n }\n else {\n this.renderer.removeClass(el, 'k-state-focused');\n }\n };\n LogicalCellDirective.prototype.microtask = function (callback) {\n this.zone.runOutsideAngular(function () {\n return Promise.resolve(null).then(callback);\n });\n };\n LogicalCellDirective.prototype.registerChanges = function () {\n if (!this.logicalSlaveCell) {\n this.navigationService.registerCell(this);\n }\n };\n LogicalCellDirective.prototype.registerNoChanges = function () {\n if (!this.logicalSlaveCell) {\n this.navigationService.registerCellOnCurrentRow(this);\n }\n };\n LogicalCellDirective.prototype.isFocusable = function () {\n return this.navigationService.isCellFocusable(this);\n };\n LogicalCellDirective.prototype.isFocused = function () {\n return this.navigationService.isCellFocused(this);\n };\n LogicalCellDirective.decorators = [\n { type: Directive, args: [{\n providers: [{\n provide: FocusGroup,\n deps: [FocusRoot],\n useClass: FocusGroup\n }],\n selector: '[kendoGridLogicalCell]'\n },] },\n ];\n /** @nocollapse */\n LogicalCellDirective.ctorParameters = function () { return [\n { type: FocusGroup },\n { type: ElementRef },\n { type: ColumnInfoService },\n { type: IdService },\n { type: NavigationService },\n { type: Renderer2 },\n { type: NgZone },\n { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [CELL_CONTEXT,] }] }\n ]; };\n LogicalCellDirective.propDecorators = {\n logicalColIndex: [{ type: Input }],\n logicalRowIndex: [{ type: Input }],\n logicalSlaveCell: [{ type: Input }],\n colIndex: [{ type: Input }],\n colSpan: [{ type: Input }],\n rowSpan: [{ type: Input }],\n groupItem: [{ type: Input }],\n dataRowIndex: [{ type: Input }],\n dataItem: [{ type: Input }],\n detailExpandCell: [{ type: Input }],\n id: [{ type: HostBinding, args: ['attr.id',] }],\n ariaColIndex: [{ type: HostBinding, args: ['attr.aria-colindex',] }]\n };\n return LogicalCellDirective;\n}());\n\nvar id$1 = 0;\nfunction nextId$1() {\n return id$1++;\n}\n/**\n * @hidden\n */\nvar LogicalRowDirective = /** @class */ (function () {\n function LogicalRowDirective(idService, navigation) {\n this.idService = idService;\n this.navigation = navigation;\n this.logicalSlaveRow = false;\n this.logicalSlaveCellsCount = 0;\n this.dataRowIndex = -1;\n this.uid = nextId$1();\n }\n Object.defineProperty(LogicalRowDirective.prototype, \"hostRole\", {\n get: function () {\n return this.logicalSlaveRow ? 'presentation' : 'row';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(LogicalRowDirective.prototype, \"ariaRowIndex\", {\n get: function () {\n if (this.navigation.enabled) {\n return this.logicalRowIndex + 1;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(LogicalRowDirective.prototype, \"ariaOwns\", {\n get: function () {\n if (!this.navigation.enabled || this.logicalSlaveRow || this.logicalSlaveCellsCount === 0) {\n return undefined;\n }\n var ids = [];\n var total = this.logicalCellsCount + this.logicalSlaveCellsCount;\n for (var cellIndex = this.logicalCellsCount; cellIndex < total; cellIndex++) {\n ids.push(this.idService.cellId(this.logicalRowIndex, cellIndex));\n }\n return ids.join(' ');\n },\n enumerable: true,\n configurable: true\n });\n LogicalRowDirective.prototype.ngOnChanges = function (changes) {\n if (!this.navigation.enabled || this.logicalSlaveRow) {\n return;\n }\n var indexChange = changes.logicalRowIndex;\n var logicalSlaveRowChange = changes.logicalSlaveRow;\n if (indexChange || logicalSlaveRowChange) {\n var index = indexChange && !indexChange.isFirstChange() ? indexChange.previousValue : this.logicalRowIndex;\n this.navigation.unregisterRow(index, this);\n this.navigation.registerRow(this);\n }\n else if (anyChanged(['dataRowIndex', 'dataItem'], changes)) {\n this.navigation.updateRow(this);\n }\n };\n LogicalRowDirective.prototype.ngOnDestroy = function () {\n this.navigation.unregisterRow(this.logicalRowIndex, this);\n };\n LogicalRowDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoGridLogicalRow]'\n },] },\n ];\n /** @nocollapse */\n LogicalRowDirective.ctorParameters = function () { return [\n { type: IdService },\n { type: NavigationService }\n ]; };\n LogicalRowDirective.propDecorators = {\n logicalRowIndex: [{ type: Input }],\n logicalSlaveRow: [{ type: Input }],\n logicalCellsCount: [{ type: Input }],\n logicalSlaveCellsCount: [{ type: Input }],\n dataRowIndex: [{ type: Input }],\n dataItem: [{ type: Input }],\n hostRole: [{ type: HostBinding, args: ['attr.role',] }],\n ariaRowIndex: [{ type: HostBinding, args: ['attr.aria-rowindex',] }],\n ariaOwns: [{ type: HostBinding, args: ['attr.aria-owns',] }]\n };\n return LogicalRowDirective;\n}());\n\n/* tslint:disable:pipe-naming */\nvar FORMAT_REGEX = /\\{\\d+:?/;\n/**\n * @hidden\n */\nvar FieldAccessorPipe = /** @class */ (function () {\n function FieldAccessorPipe(intlService) {\n this.intlService = intlService;\n }\n FieldAccessorPipe.prototype.transform = function (dataItem, fieldName, format) {\n if (!isNullOrEmptyString(fieldName)) {\n var value = getter(fieldName)(dataItem);\n if (!isNullOrEmptyString(format)) {\n return this.formatValue(format, value);\n }\n return value;\n }\n return dataItem;\n };\n FieldAccessorPipe.prototype.formatValue = function (format, value) {\n var intl = this.intlService;\n if (isString(format) && format.match(FORMAT_REGEX)) {\n return intl.format(format, value);\n }\n return intl.toString(value, format);\n };\n FieldAccessorPipe.decorators = [\n { type: Pipe, args: [{\n name: 'valueOf',\n pure: false\n },] },\n ];\n /** @nocollapse */\n FieldAccessorPipe.ctorParameters = function () { return [\n { type: IntlService }\n ]; };\n return FieldAccessorPipe;\n}());\n\n/**\n * @hidden\n */\nvar columnsToResize = function (_a) {\n var columns = _a.columns;\n return Math.max(1, resizableColumns(columns).length);\n};\n/**\n * @hidden\n */\nvar row = function (selector) { return function (element) { return element.querySelector(selector); }; };\n/**\n * @hidden\n */\nvar headerRow = function (index) { return function (element) { return element.querySelectorAll('thead>tr')[index]; }; };\n/**\n * @hidden\n */\nvar cell = function (index, selector) {\n if (selector === void 0) { selector = 'td'; }\n return function (element) {\n return element.querySelectorAll(selector + \":not(.k-group-cell):not(.k-hierarchy-cell)\")[index];\n };\n};\n/**\n * @hidden\n */\nvar offsetWidth = function (element) { return element.offsetWidth; };\n/**\n * @hidden\n */\nvar pipe = function () {\n var fns = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n fns[_i] = arguments[_i];\n }\n return function (data) { return fns.reduce(function (state$$1, fn) { return state$$1 ? fn(state$$1) : 0; }, data); };\n};\n/**\n * @hidden\n */\nvar TableDirective = /** @class */ (function () {\n function TableDirective(element, renderer, service, zone, cdr) {\n this.element = element;\n this.renderer = renderer;\n this.service = service;\n this.zone = zone;\n this.cdr = cdr;\n this.locked = false;\n this.firstResize = false;\n }\n Object.defineProperty(TableDirective.prototype, \"minWidth\", {\n get: function () {\n return this.firstResize ? 0 : null;\n },\n enumerable: true,\n configurable: true\n });\n TableDirective.prototype.ngOnInit = function () {\n var _this = this;\n var obs = this.service\n .changes.pipe(filter(function (e) { return _this.locked === e.locked; }));\n this.subscription = obs.pipe(filter(function (e) { return e.type === 'start'; }), tap(this.initState.bind(this)), map(columnsToResize), switchMap(function (take$$1) {\n return obs.pipe(filter(function (e) { return e.type === 'resizeTable'; }), map(function (e) { return e.delta; }), bufferCount(take$$1));\n })).subscribe(this.resize.bind(this));\n this.autoFitSubscription = this.service\n .registerTable({\n autoFit: this.autoFitObservable.bind(this),\n locked: this.locked\n });\n };\n TableDirective.prototype.ngOnDestroy = function () {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n if (this.autoFitSubscription) {\n this.autoFitSubscription();\n this.autoFitSubscription = null;\n }\n };\n TableDirective.prototype.initState = function () {\n this.firstResize = true;\n if (!this.virtualColumns || this.locked) {\n this.originalWidth = offsetWidth(this.element.nativeElement);\n }\n };\n TableDirective.prototype.resize = function (deltas) {\n if (!this.virtualColumns || this.locked) {\n var delta = deltas.reduce(function (sum, item) { return sum + item; }, 0);\n var width = this.originalWidth + delta;\n this.renderer.setStyle(this.element.nativeElement, 'width', width + 'px');\n }\n this.cdr.detectChanges();\n };\n TableDirective.prototype.autoFitObservable = function (columnInfo) {\n var _this = this;\n return Observable.create(function (observer) {\n _this.zone.runOutsideAngular(function () {\n _this.renderer.addClass(_this.element.nativeElement, 'k-autofitting');\n _this.cdr.detectChanges();\n var widths = columnInfo.map(_this.measureColumn.bind(_this));\n _this.renderer.removeClass(_this.element.nativeElement, 'k-autofitting');\n observer.next(widths);\n });\n });\n };\n TableDirective.prototype.measureColumn = function (info) {\n var dom = this.element.nativeElement;\n var header = pipe(headerRow(info.level), cell(info.headerIndex, 'th'), offsetWidth)(dom);\n var data = 0;\n if (!info.isParentSpan || (info.isParentSpan && info.isLastInSpan)) {\n data = pipe(row('tbody>tr:not(.k-grouping-row):not(.k-grid-norecords)'), cell(info.index), offsetWidth)(dom);\n }\n var footer = pipe(row('tfoot>tr'), cell(info.index), offsetWidth)(dom);\n return Math.max(header, data, footer);\n };\n TableDirective.decorators = [\n { type: Directive, args: [{\n selector: 'table' // tslint:disable-line:directive-selector\n },] },\n ];\n /** @nocollapse */\n TableDirective.ctorParameters = function () { return [\n { type: ElementRef },\n { type: Renderer2 },\n { type: ColumnResizingService },\n { type: NgZone },\n { type: ChangeDetectorRef }\n ]; };\n TableDirective.propDecorators = {\n locked: [{ type: Input }],\n virtualColumns: [{ type: Input }],\n minWidth: [{ type: HostBinding, args: ['style.min-width',] }]\n };\n return TableDirective;\n}());\n\nvar exportedModules = [\n ColumnComponent,\n ColumnGroupComponent,\n LogicalCellDirective,\n LogicalRowDirective,\n FocusableDirective,\n FooterTemplateDirective,\n ColGroupComponent,\n ResizableContainerDirective,\n TemplateContextDirective,\n FieldAccessorPipe,\n DetailTemplateDirective,\n SpanColumnComponent,\n TableDirective,\n LoadingComponent\n];\n/**\n * @hidden\n */\nvar SharedModule = /** @class */ (function () {\n function SharedModule() {\n }\n SharedModule.exports = function () {\n return [\n ColumnComponent,\n SpanColumnComponent,\n ColumnGroupComponent,\n FooterTemplateDirective,\n DetailTemplateDirective,\n FocusableDirective\n ];\n };\n SharedModule.decorators = [\n { type: NgModule, args: [{\n declarations: [exportedModules],\n exports: [exportedModules, DraggableModule],\n imports: [CommonModule]\n },] },\n ];\n return SharedModule;\n}());\n\n/**\n * Represents the `Contains` (**Contains**) filter operator.\n *\n * For more information and examples, refer to:\n * * [Setting the default filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-default-filter-operator)\n * * [Setting the order of the filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-order-of-the-filter-operators)\n */\nvar ContainsFilterOperatorComponent = /** @class */ (function (_super) {\n __extends(ContainsFilterOperatorComponent, _super);\n function ContainsFilterOperatorComponent(localization) {\n return _super.call(this, \"contains\", localization) || this;\n }\n ContainsFilterOperatorComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: FilterOperatorBase,\n useExisting: forwardRef(function () { return ContainsFilterOperatorComponent; })\n }\n ],\n selector: 'kendo-filter-contains-operator',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n ContainsFilterOperatorComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return ContainsFilterOperatorComponent;\n}(FilterOperatorBase));\n\n/**\n * Represents the `DoesNotContain` (**Does not contain**) filter operator.\n *\n * For more information and examples, refer to:\n * * [Setting the default filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-default-filter-operator)\n * * [Setting the order of the filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-order-of-the-filter-operators)\n */\nvar DoesNotContainFilterOperatorComponent = /** @class */ (function (_super) {\n __extends(DoesNotContainFilterOperatorComponent, _super);\n function DoesNotContainFilterOperatorComponent(localization) {\n return _super.call(this, \"doesnotcontain\", localization) || this;\n }\n DoesNotContainFilterOperatorComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: FilterOperatorBase,\n useExisting: forwardRef(function () { return DoesNotContainFilterOperatorComponent; })\n }\n ],\n selector: 'kendo-filter-not-contains-operator',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n DoesNotContainFilterOperatorComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return DoesNotContainFilterOperatorComponent;\n}(FilterOperatorBase));\n\n/**\n * Represents the `EndsWith` (**Ends with**) string filter operator.\n *\n * For more information and examples, refer to:\n * * [Setting the default filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-default-filter-operator)\n * * [Setting the order of the filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-order-of-the-filter-operators)\n */\nvar EndsWithFilterOperatorComponent = /** @class */ (function (_super) {\n __extends(EndsWithFilterOperatorComponent, _super);\n function EndsWithFilterOperatorComponent(localization) {\n return _super.call(this, \"endswith\", localization) || this;\n }\n EndsWithFilterOperatorComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: FilterOperatorBase,\n useExisting: forwardRef(function () { return EndsWithFilterOperatorComponent; })\n }\n ],\n selector: 'kendo-filter-endswith-operator',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n EndsWithFilterOperatorComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return EndsWithFilterOperatorComponent;\n}(FilterOperatorBase));\n\n/**\n * Represents the `Equal` (**Is equal to**) filter operator.\n *\n * For more information and examples, refer to:\n * * [Setting the default filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-default-filter-operator)\n * * [Setting the order of the filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-order-of-the-filter-operators)\n */\nvar EqualFilterOperatorComponent = /** @class */ (function (_super) {\n __extends(EqualFilterOperatorComponent, _super);\n function EqualFilterOperatorComponent(localization) {\n return _super.call(this, \"eq\", localization) || this;\n }\n EqualFilterOperatorComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: FilterOperatorBase,\n useExisting: forwardRef(function () { return EqualFilterOperatorComponent; })\n }\n ],\n selector: 'kendo-filter-eq-operator',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n EqualFilterOperatorComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return EqualFilterOperatorComponent;\n}(FilterOperatorBase));\n\n/**\n * Represents the `IsEmpty` (**Is empty**) filter operator.\n *\n * For more information and examples, refer to:\n * * [Setting the default filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-default-filter-operator)\n * * [Setting the order of the filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-order-of-the-filter-operators)\n */\nvar IsEmptyFilterOperatorComponent = /** @class */ (function (_super) {\n __extends(IsEmptyFilterOperatorComponent, _super);\n function IsEmptyFilterOperatorComponent(localization) {\n return _super.call(this, \"isempty\", localization) || this;\n }\n IsEmptyFilterOperatorComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: FilterOperatorBase,\n useExisting: forwardRef(function () { return IsEmptyFilterOperatorComponent; })\n }\n ],\n selector: 'kendo-filter-isempty-operator',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n IsEmptyFilterOperatorComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return IsEmptyFilterOperatorComponent;\n}(FilterOperatorBase));\n\n/**\n * Represents the `IsNotEmpty` (**Is not empty**) filter operator.\n *\n * For more information and examples, refer to:\n * * [Setting the default filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-default-filter-operator)\n * * [Setting the order of the filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-order-of-the-filter-operators)\n */\nvar IsNotEmptyFilterOperatorComponent = /** @class */ (function (_super) {\n __extends(IsNotEmptyFilterOperatorComponent, _super);\n function IsNotEmptyFilterOperatorComponent(localization) {\n return _super.call(this, \"isnotempty\", localization) || this;\n }\n IsNotEmptyFilterOperatorComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: FilterOperatorBase,\n useExisting: forwardRef(function () { return IsNotEmptyFilterOperatorComponent; })\n }\n ],\n selector: 'kendo-filter-isnotempty-operator',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n IsNotEmptyFilterOperatorComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return IsNotEmptyFilterOperatorComponent;\n}(FilterOperatorBase));\n\n/**\n * Represents the `IsNotNull` (**Is not null**) filter operator.\n *\n * For more information and examples, refer to:\n * * [Setting the default filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-default-filter-operator)\n * * [Setting the order of the filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-order-of-the-filter-operators)\n */\nvar IsNotNullFilterOperatorComponent = /** @class */ (function (_super) {\n __extends(IsNotNullFilterOperatorComponent, _super);\n function IsNotNullFilterOperatorComponent(localization) {\n return _super.call(this, \"isnotnull\", localization) || this;\n }\n IsNotNullFilterOperatorComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: FilterOperatorBase,\n useExisting: forwardRef(function () { return IsNotNullFilterOperatorComponent; })\n }\n ],\n selector: 'kendo-filter-isnotnull-operator',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n IsNotNullFilterOperatorComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return IsNotNullFilterOperatorComponent;\n}(FilterOperatorBase));\n\n/**\n * Represents the `IsNull` (**Is null**) filter operator.\n *\n * For more information and examples, refer to:\n * * [Setting the default filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-default-filter-operator)\n * * [Setting the order of the filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-order-of-the-filter-operators)\n */\nvar IsNullFilterOperatorComponent = /** @class */ (function (_super) {\n __extends(IsNullFilterOperatorComponent, _super);\n function IsNullFilterOperatorComponent(localization) {\n return _super.call(this, \"isnull\", localization) || this;\n }\n IsNullFilterOperatorComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: FilterOperatorBase,\n useExisting: forwardRef(function () { return IsNullFilterOperatorComponent; })\n }\n ],\n selector: 'kendo-filter-isnull-operator',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n IsNullFilterOperatorComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return IsNullFilterOperatorComponent;\n}(FilterOperatorBase));\n\n/**\n * Represents the `NotEqual` (**Is not equal to**) filter operator.\n *\n * For more information and examples, refer to:\n * * [Setting the default filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-default-filter-operator)\n * * [Setting the order of the filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-order-of-the-filter-operators)\n */\nvar NotEqualFilterOperatorComponent = /** @class */ (function (_super) {\n __extends(NotEqualFilterOperatorComponent, _super);\n function NotEqualFilterOperatorComponent(localization) {\n return _super.call(this, \"neq\", localization) || this;\n }\n NotEqualFilterOperatorComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: FilterOperatorBase,\n useExisting: forwardRef(function () { return NotEqualFilterOperatorComponent; })\n }\n ],\n selector: 'kendo-filter-neq-operator',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n NotEqualFilterOperatorComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return NotEqualFilterOperatorComponent;\n}(FilterOperatorBase));\n\n/**\n * Represents the `StartsWith` (**Starts with**) filter operator.\n *\n * For more information and examples, refer to:\n * * [Setting the default filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-default-filter-operator)\n * * [Setting the order of the filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-order-of-the-filter-operators)\n */\nvar StartsWithFilterOperatorComponent = /** @class */ (function (_super) {\n __extends(StartsWithFilterOperatorComponent, _super);\n function StartsWithFilterOperatorComponent(localization) {\n return _super.call(this, \"startswith\", localization) || this;\n }\n StartsWithFilterOperatorComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: FilterOperatorBase,\n useExisting: forwardRef(function () { return StartsWithFilterOperatorComponent; })\n }\n ],\n selector: 'kendo-filter-startswith-operator',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n StartsWithFilterOperatorComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return StartsWithFilterOperatorComponent;\n}(FilterOperatorBase));\n\n/*\n * Represents the `Greater` (**Is greater than**) numeric filter operator.\n *\n * For more information and examples, refer to:\n * * [Setting the default filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-default-filter-operator)\n * * [Setting the order of the filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-order-of-the-filter-operators)\n */\nvar GreaterFilterOperatorComponent = /** @class */ (function (_super) {\n __extends(GreaterFilterOperatorComponent, _super);\n function GreaterFilterOperatorComponent(localization) {\n return _super.call(this, \"gt\", localization) || this;\n }\n GreaterFilterOperatorComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: FilterOperatorBase,\n useExisting: forwardRef(function () { return GreaterFilterOperatorComponent; })\n }\n ],\n selector: 'kendo-filter-gt-operator',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n GreaterFilterOperatorComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return GreaterFilterOperatorComponent;\n}(FilterOperatorBase));\n\n/**\n * Represents the `GreaterOrEqualTo` (**Is greater than or equal to**) numeric filter operator.\n *\n * For more information and examples, refer to:\n * * [Setting the default filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-default-filter-operator)\n * * [Setting the order of the filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-order-of-the-filter-operators)\n */\nvar GreaterOrEqualToFilterOperatorComponent = /** @class */ (function (_super) {\n __extends(GreaterOrEqualToFilterOperatorComponent, _super);\n function GreaterOrEqualToFilterOperatorComponent(localization) {\n return _super.call(this, \"gte\", localization) || this;\n }\n GreaterOrEqualToFilterOperatorComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: FilterOperatorBase,\n useExisting: forwardRef(function () { return GreaterOrEqualToFilterOperatorComponent; })\n }\n ],\n selector: 'kendo-filter-gte-operator',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n GreaterOrEqualToFilterOperatorComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return GreaterOrEqualToFilterOperatorComponent;\n}(FilterOperatorBase));\n\n/*\n * Represents the `Less` (**Is less than**) numeric filter operator.\n *\n * For more information and examples, refer to:\n * * [Setting the default filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-default-filter-operator)\n * * [Setting the order of the filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-order-of-the-filter-operators)\n */\nvar LessFilterOperatorComponent = /** @class */ (function (_super) {\n __extends(LessFilterOperatorComponent, _super);\n function LessFilterOperatorComponent(localization) {\n return _super.call(this, \"lt\", localization) || this;\n }\n LessFilterOperatorComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: FilterOperatorBase,\n useExisting: forwardRef(function () { return LessFilterOperatorComponent; })\n }\n ],\n selector: 'kendo-filter-lt-operator',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n LessFilterOperatorComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return LessFilterOperatorComponent;\n}(FilterOperatorBase));\n\n/*\n * Represents the `LessOrEqualTo` (**Is less than or equal to**) numeric filter operator.\n *\n * For more information and examples, refer to:\n * * [Setting the default filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-default-filter-operator)\n * * [Setting the order of the filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-order-of-the-filter-operators)\n */\nvar LessOrEqualToFilterOperatorComponent = /** @class */ (function (_super) {\n __extends(LessOrEqualToFilterOperatorComponent, _super);\n function LessOrEqualToFilterOperatorComponent(localization) {\n return _super.call(this, \"lte\", localization) || this;\n }\n LessOrEqualToFilterOperatorComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: FilterOperatorBase,\n useExisting: forwardRef(function () { return LessOrEqualToFilterOperatorComponent; })\n }\n ],\n selector: 'kendo-filter-lte-operator',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n LessOrEqualToFilterOperatorComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return LessOrEqualToFilterOperatorComponent;\n}(FilterOperatorBase));\n\n/*\n * Represents the `Greater` (**Is after**) date filter operator.\n *\n * For more information and examples, refer to:\n * * [Setting the default filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-default-filter-operator)\n * * [Setting the order of the filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-order-of-the-filter-operators)\n */\nvar AfterFilterOperatorComponent = /** @class */ (function (_super) {\n __extends(AfterFilterOperatorComponent, _super);\n function AfterFilterOperatorComponent(localization) {\n return _super.call(this, \"after\", localization) || this;\n }\n /**\n * @hidden\n */\n AfterFilterOperatorComponent.prototype.toJSON = function () {\n return {\n text: this.text,\n value: \"gt\"\n };\n };\n AfterFilterOperatorComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: FilterOperatorBase,\n useExisting: forwardRef(function () { return AfterFilterOperatorComponent; })\n }\n ],\n selector: 'kendo-filter-after-operator',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n AfterFilterOperatorComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return AfterFilterOperatorComponent;\n}(FilterOperatorBase));\n\n/*\n * Represents the `GreaterOrEqualTo` (**Is after or equal to**) date filter operator.\n *\n * For more information and examples, refer to:\n * * [Setting the default filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-default-filter-operator)\n * * [Setting the order of the filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-order-of-the-filter-operators)\n */\nvar AfterEqFilterOperatorComponent = /** @class */ (function (_super) {\n __extends(AfterEqFilterOperatorComponent, _super);\n function AfterEqFilterOperatorComponent(localization) {\n return _super.call(this, \"after-eq\", localization) || this;\n }\n /**\n * @hidden\n */\n AfterEqFilterOperatorComponent.prototype.toJSON = function () {\n return {\n text: this.text,\n value: \"gte\"\n };\n };\n AfterEqFilterOperatorComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: FilterOperatorBase,\n useExisting: forwardRef(function () { return AfterEqFilterOperatorComponent; })\n }\n ],\n selector: 'kendo-filter-after-eq-operator',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n AfterEqFilterOperatorComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return AfterEqFilterOperatorComponent;\n}(FilterOperatorBase));\n\n/*\n * Represents the `LessOrEqualTo` (**Is before or equal to**) date filter operator.\n *\n * For more information and examples, refer to:\n * * [Setting the default filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-default-filter-operator)\n * * [Setting the order of the filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-order-of-the-filter-operators)\n */\nvar BeforeEqFilterOperatorComponent = /** @class */ (function (_super) {\n __extends(BeforeEqFilterOperatorComponent, _super);\n function BeforeEqFilterOperatorComponent(localization) {\n return _super.call(this, \"before-eq\", localization) || this;\n }\n /**\n * @hidden\n */\n BeforeEqFilterOperatorComponent.prototype.toJSON = function () {\n return {\n text: this.text,\n value: \"lte\"\n };\n };\n BeforeEqFilterOperatorComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: FilterOperatorBase,\n useExisting: forwardRef(function () { return BeforeEqFilterOperatorComponent; })\n }\n ],\n selector: 'kendo-filter-before-eq-operator',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n BeforeEqFilterOperatorComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return BeforeEqFilterOperatorComponent;\n}(FilterOperatorBase));\n\n/*\n * Represents the `Less then` (**Is before**) date filter operator.\n *\n * For more information and examples, refer to:\n * * [Setting the default filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-default-filter-operator)\n * * [Setting the order of the filter operators]({% slug builtinfiltertemplate_grid %}#toc-setting-the-order-of-the-filter-operators)\n */\nvar BeforeFilterOperatorComponent = /** @class */ (function (_super) {\n __extends(BeforeFilterOperatorComponent, _super);\n function BeforeFilterOperatorComponent(localization) {\n return _super.call(this, \"before\", localization) || this;\n }\n /**\n * @hidden\n */\n BeforeFilterOperatorComponent.prototype.toJSON = function () {\n return {\n text: this.text,\n value: \"lt\"\n };\n };\n BeforeFilterOperatorComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: FilterOperatorBase,\n useExisting: forwardRef(function () { return BeforeFilterOperatorComponent; })\n }\n ],\n selector: 'kendo-filter-before-operator',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n BeforeFilterOperatorComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return BeforeFilterOperatorComponent;\n}(FilterOperatorBase));\n\nvar FILTER_OPERATORS = [\n FilterCellOperatorsComponent,\n ContainsFilterOperatorComponent,\n DoesNotContainFilterOperatorComponent,\n EndsWithFilterOperatorComponent,\n EqualFilterOperatorComponent,\n IsEmptyFilterOperatorComponent,\n IsNotEmptyFilterOperatorComponent,\n IsNotNullFilterOperatorComponent,\n IsNullFilterOperatorComponent,\n NotEqualFilterOperatorComponent,\n StartsWithFilterOperatorComponent,\n GreaterFilterOperatorComponent,\n GreaterOrEqualToFilterOperatorComponent,\n LessFilterOperatorComponent,\n LessOrEqualToFilterOperatorComponent,\n AfterFilterOperatorComponent,\n AfterEqFilterOperatorComponent,\n BeforeEqFilterOperatorComponent,\n BeforeFilterOperatorComponent\n];\nvar importedModules = [\n CommonModule,\n ReactiveFormsModule,\n FormsModule,\n DropDownListModule,\n AutoCompleteModule,\n InputsModule,\n DatePickerModule,\n PopupModule,\n SharedModule\n];\nvar COMPONENTS = [\n FilterInputDirective\n];\n/**\n * @hidden\n */\nvar SharedFilterModule = /** @class */ (function () {\n function SharedFilterModule() {\n }\n SharedFilterModule.exports = function () {\n return FILTER_OPERATORS.slice();\n };\n SharedFilterModule.decorators = [\n { type: NgModule, args: [{\n declarations: [FILTER_OPERATORS, COMPONENTS],\n exports: [FILTER_OPERATORS, importedModules, COMPONENTS],\n imports: importedModules.slice()\n },] },\n ];\n return SharedFilterModule;\n}());\n\n/**\n * @hidden\n */\nvar FilterHostDirective = /** @class */ (function () {\n function FilterHostDirective(host, resolver) {\n this.host = host;\n this.resolver = resolver;\n }\n FilterHostDirective.prototype.ngOnInit = function () {\n this.component = this.host.createComponent(this.resolver.resolveComponentFactory(this.componentType()));\n this.initComponent({\n column: this.column,\n filter: this.filter\n });\n };\n FilterHostDirective.prototype.ngOnDestroy = function () {\n if (this.component) {\n this.component.destroy();\n this.component = null;\n }\n };\n FilterHostDirective.prototype.ngOnChanges = function (changes) {\n if (anyChanged([\"column\", \"filter\"], changes)) {\n this.initComponent({\n column: this.column,\n filter: this.filter\n });\n }\n };\n FilterHostDirective.prototype.initComponent = function (_a) {\n var column = _a.column, filter$$1 = _a.filter;\n var instance = this.component.instance;\n instance.column = column;\n instance.filter = filter$$1;\n };\n FilterHostDirective.propDecorators = {\n column: [{ type: Input }],\n filter: [{ type: Input }]\n };\n return FilterHostDirective;\n}());\n\n/**\n * @hidden\n *\n * > List the following components in the GridModule as `entryComponents`.\n */\nvar filterComponentFactory = function (type) { return ({\n \"boolean\": BooleanFilterCellComponent,\n \"date\": DateFilterCellComponent,\n \"numeric\": NumericFilterCellComponent,\n \"text\": StringFilterCellComponent\n}[type]); };\n\n/**\n * @hidden\n */\nvar FilterCellHostDirective = /** @class */ (function (_super) {\n __extends(FilterCellHostDirective, _super);\n function FilterCellHostDirective(host, resolver) {\n return _super.call(this, host, resolver) || this;\n }\n FilterCellHostDirective.prototype.componentType = function () {\n if (!isNullOrEmptyString(this.column.filter)) {\n return filterComponentFactory(this.column.filter);\n }\n return StringFilterCellComponent;\n };\n FilterCellHostDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoFilterCellHost]'\n },] },\n ];\n /** @nocollapse */\n FilterCellHostDirective.ctorParameters = function () { return [\n { type: ViewContainerRef },\n { type: ComponentFactoryResolver }\n ]; };\n return FilterCellHostDirective;\n}(FilterHostDirective));\n\nvar INTERNAL_COMPONENTS = [\n FilterRowComponent,\n FilterCellComponent,\n FilterCellTemplateDirective,\n StringFilterCellComponent,\n NumericFilterCellComponent,\n AutoCompleteFilterCellComponent,\n BooleanFilterCellComponent,\n FilterCellHostDirective,\n FilterCellWrapperComponent,\n DateFilterCellComponent\n];\nvar ENTRY_COMPONENTS = [\n StringFilterCellComponent,\n NumericFilterCellComponent,\n BooleanFilterCellComponent,\n DateFilterCellComponent\n];\n/**\n * @hidden\n */\nvar RowFilterModule = /** @class */ (function () {\n function RowFilterModule() {\n }\n RowFilterModule.exports = function () {\n return [\n FilterRowComponent,\n FilterCellComponent,\n FilterCellTemplateDirective,\n FilterCellOperatorsComponent,\n StringFilterCellComponent,\n NumericFilterCellComponent,\n AutoCompleteFilterCellComponent,\n BooleanFilterCellComponent,\n DateFilterCellComponent,\n SharedFilterModule.exports()\n ];\n };\n RowFilterModule.decorators = [\n { type: NgModule, args: [{\n declarations: [INTERNAL_COMPONENTS],\n entryComponents: ENTRY_COMPONENTS,\n exports: [INTERNAL_COMPONENTS, SharedFilterModule],\n imports: [SharedFilterModule]\n },] },\n ];\n return RowFilterModule;\n}());\n\n/**\n * @hidden\n */\nvar normalizeSettings = function (_a) {\n var _b = _a.buttonCount, buttonCount = _b === void 0 ? 10 : _b, _c = _a.info, info = _c === void 0 ? true : _c, _d = _a.type, type = _d === void 0 ? 'numeric' : _d, _e = _a.pageSizes, pageSizes = _e === void 0 ? false : _e, _f = _a.previousNext, previousNext = _f === void 0 ? true : _f;\n return ({\n buttonCount: buttonCount,\n info: info,\n pageSizes: pageSizes === true ? [5, 10, 20] : pageSizes,\n previousNext: previousNext,\n type: type\n });\n};\n/**\n * @hidden\n */\nvar normalize = function (settings) {\n return normalizeSettings(settings === true ? {} : settings);\n};\n\n/**\n * @hidden\n */\nvar PagerComponent = /** @class */ (function () {\n function PagerComponent(pagerContext) {\n this.pagerContext = pagerContext;\n this.total = 0;\n this.skip = 1;\n this.pageChange = new EventEmitter();\n this.settings = normalize({});\n this._templateContext = {};\n }\n Object.defineProperty(PagerComponent.prototype, \"options\", {\n set: function (value) {\n this.settings = normalize(value);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PagerComponent.prototype, \"pagerWrapClass\", {\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PagerComponent.prototype, \"gridPagerClass\", {\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PagerComponent.prototype, \"widgetClass\", {\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PagerComponent.prototype, \"totalPages\", {\n get: function () {\n return Math.ceil((this.total || 0) / this.pageSize);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PagerComponent.prototype, \"currentPage\", {\n get: function () {\n return Math.floor((this.skip || 0) / this.pageSize) + 1;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PagerComponent.prototype, \"templateContext\", {\n get: function () {\n var context = this._templateContext;\n context.totalPages = this.totalPages;\n context.total = this.total;\n context.skip = this.skip;\n context.pageSize = this.pageSize;\n context.currentPage = this.currentPage;\n return context;\n },\n enumerable: true,\n configurable: true\n });\n PagerComponent.prototype.ngOnInit = function () {\n this.pageChangeSubscription = this.pagerContext.pageChange.subscribe(this.changePage.bind(this));\n };\n PagerComponent.prototype.ngOnChanges = function (changes) {\n if (anyChanged([\"pageSize\", \"skip\", \"total\"], changes, false)) {\n this.pagerContext.notifyChanges({\n pageSize: this.pageSize,\n skip: this.skip,\n total: this.total\n });\n }\n };\n PagerComponent.prototype.ngOnDestroy = function () {\n if (this.pageChangeSubscription) {\n this.pageChangeSubscription.unsubscribe();\n }\n };\n PagerComponent.prototype.changePage = function (event) {\n this.pageChange.emit(event);\n };\n PagerComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-pager',\n template: \"\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n PagerComponent.ctorParameters = function () { return [\n { type: PagerContextService }\n ]; };\n PagerComponent.propDecorators = {\n total: [{ type: Input }],\n skip: [{ type: Input }],\n pageSize: [{ type: Input }],\n options: [{ type: Input }],\n template: [{ type: Input }],\n pageChange: [{ type: Output }],\n pagerWrapClass: [{ type: HostBinding, args: ['class.k-pager-wrap',] }],\n gridPagerClass: [{ type: HostBinding, args: ['class.k-grid-pager',] }],\n widgetClass: [{ type: HostBinding, args: ['class.k-widget',] }]\n };\n return PagerComponent;\n}());\n\n/**\n * @hidden\n */\nvar PagerElementComponent = /** @class */ (function () {\n function PagerElementComponent(localization, pagerContext, cd) {\n this.localization = localization;\n this.pagerContext = pagerContext;\n this.cd = cd;\n this.total = this.pagerContext.total;\n this.skip = this.pagerContext.skip;\n this.pageSize = this.pagerContext.pageSize;\n }\n Object.defineProperty(PagerElementComponent.prototype, \"currentPage\", {\n /**\n * @hidden\n *\n * @readonly\n * @type {number}\n * @memberOf PagerElementComponent\n */\n get: function () {\n return Math.floor((this.skip || 0) / this.pageSize) + 1;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PagerElementComponent.prototype, \"totalPages\", {\n /**\n * @hidden\n *\n * @readonly\n * @type {number}\n * @memberOf PagerElementComponent\n */\n get: function () {\n return Math.ceil((this.total || 0) / this.pageSize);\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n *\n * @param {string} key\n * @returns {string}\n *\n * @memberOf PagerElementComponent\n */\n PagerElementComponent.prototype.textFor = function (key) {\n return this.localization.get(key);\n };\n /**\n * @hidden\n *\n * @param {number} page\n *\n * @memberOf PagerElementComponent\n */\n PagerElementComponent.prototype.changePage = function (page) {\n this.pagerContext.changePage(page);\n return false;\n };\n /**\n * @hidden\n *\n * @memberOf PagerElementComponent\n */\n PagerElementComponent.prototype.ngOnInit = function () {\n var _this = this;\n this.subscriptions = this.pagerContext.changes.subscribe(this.onChanges.bind(this));\n this.subscriptions.add(this.localization.changes.subscribe(function () { return _this.cd.markForCheck(); }));\n };\n PagerElementComponent.prototype.ngOnDestroy = function () {\n if (this.subscriptions) {\n this.subscriptions.unsubscribe();\n }\n };\n return PagerElementComponent;\n}());\n\n// tslint:disable:no-access-missing-member\n/**\n * Displays buttons for navigating to the first and to the previous page ([see example]({% slug paging_grid %}#toc-pager-templates)).\n */\nvar PagerPrevButtonsComponent = /** @class */ (function (_super) {\n __extends(PagerPrevButtonsComponent, _super);\n function PagerPrevButtonsComponent(localization, pagerContext, cd) {\n return _super.call(this, localization, pagerContext, cd) || this;\n }\n Object.defineProperty(PagerPrevButtonsComponent.prototype, \"disabled\", {\n /**\n * @hidden\n *\n * @readonly\n * @type {boolean}\n * @memberOf PagerPrevButtonsComponent\n */\n get: function () {\n return this.currentPage === 1 || !this.total;\n },\n enumerable: true,\n configurable: true\n });\n PagerPrevButtonsComponent.prototype.onChanges = function (_a) {\n var total = _a.total, skip = _a.skip, pageSize = _a.pageSize;\n this.total = total;\n this.skip = skip;\n this.pageSize = pageSize;\n this.cd.markForCheck();\n };\n PagerPrevButtonsComponent.decorators = [\n { type: Component, args: [{\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'kendo-pager-prev-buttons',\n template: \"\\n \\n \\n \\n \\n \\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n PagerPrevButtonsComponent.ctorParameters = function () { return [\n { type: LocalizationService },\n { type: PagerContextService },\n { type: ChangeDetectorRef }\n ]; };\n return PagerPrevButtonsComponent;\n}(PagerElementComponent));\n\n// tslint:disable: no-access-missing-member\n/**\n * Displays buttons for navigating to the next and to the last page ([see example]({% slug paging_grid %}#toc-pager-templates)).\n */\nvar PagerNextButtonsComponent = /** @class */ (function (_super) {\n __extends(PagerNextButtonsComponent, _super);\n function PagerNextButtonsComponent(localization, pagerContext, cd) {\n return _super.call(this, localization, pagerContext, cd) || this;\n }\n Object.defineProperty(PagerNextButtonsComponent.prototype, \"disabled\", {\n /**\n * @hidden\n *\n * @readonly\n * @type {boolean}\n * @memberOf PagerNextButtonsComponent\n */\n get: function () {\n return this.currentPage === this.totalPages || !this.total;\n },\n enumerable: true,\n configurable: true\n });\n PagerNextButtonsComponent.prototype.onChanges = function (_a) {\n var total = _a.total, skip = _a.skip, pageSize = _a.pageSize;\n this.total = total;\n this.skip = skip;\n this.pageSize = pageSize;\n this.cd.markForCheck();\n };\n PagerNextButtonsComponent.decorators = [\n { type: Component, args: [{\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'kendo-pager-next-buttons',\n template: \"\\n \\n \\n \\n \\n \\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n PagerNextButtonsComponent.ctorParameters = function () { return [\n { type: LocalizationService },\n { type: PagerContextService },\n { type: ChangeDetectorRef }\n ]; };\n return PagerNextButtonsComponent;\n}(PagerElementComponent));\n\n/**\n * Displays numeric buttons to enable navigation between the pages.\n */\nvar PagerNumericButtonsComponent = /** @class */ (function (_super) {\n __extends(PagerNumericButtonsComponent, _super);\n function PagerNumericButtonsComponent(localization, cd, pagerContext) {\n var _this = _super.call(this, localization, pagerContext, cd) || this;\n _this.pagerContext = pagerContext;\n return _this;\n }\n Object.defineProperty(PagerNumericButtonsComponent.prototype, \"buttons\", {\n /**\n * @hidden\n *\n * @readonly\n * @type {number[]}\n * @memberOf PagerNumericButtonsComponent\n */\n get: function () {\n var result = [];\n for (var idx = this.start; idx <= this.end; idx++) {\n result.push(idx);\n }\n return result;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PagerNumericButtonsComponent.prototype, \"end\", {\n /**\n * @hidden\n */\n get: function () {\n return Math.min((this.start + this.buttonCount) - 1, this.totalPages);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PagerNumericButtonsComponent.prototype, \"start\", {\n /**\n * @hidden\n */\n get: function () {\n var page = this.currentPage;\n var buttonCount = this.buttonCount;\n if (page > buttonCount) {\n var reminder = (page % buttonCount);\n return (reminder === 0) ? (page - buttonCount) + 1 : (page - reminder) + 1;\n }\n return 1;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n */\n PagerNumericButtonsComponent.prototype.pageLabel = function (num) {\n var pageText = this.textFor('pagerPage');\n if (pageText) {\n return pageText + ' ' + num;\n }\n return num.toString();\n };\n PagerNumericButtonsComponent.prototype.onChanges = function (_a) {\n var total = _a.total, skip = _a.skip, pageSize = _a.pageSize;\n this.total = total;\n this.skip = skip;\n this.pageSize = pageSize;\n this.cd.markForCheck();\n };\n PagerNumericButtonsComponent.decorators = [\n { type: Component, args: [{\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'kendo-pager-numeric-buttons',\n template: \"\\n \\n \"\n },] },\n ];\n /** @nocollapse */\n PagerNumericButtonsComponent.ctorParameters = function () { return [\n { type: LocalizationService },\n { type: ChangeDetectorRef },\n { type: PagerContextService }\n ]; };\n PagerNumericButtonsComponent.propDecorators = {\n buttonCount: [{ type: Input }]\n };\n return PagerNumericButtonsComponent;\n}(PagerElementComponent));\n\n// tslint:disable:no-access-missing-member\n/**\n * Displays an input element which allows the typing and rendering of page numbers.\n */\nvar PagerInputComponent = /** @class */ (function (_super) {\n __extends(PagerInputComponent, _super);\n function PagerInputComponent(localization, pagerContext, zone, cd) {\n var _this = _super.call(this, localization, pagerContext, cd) || this;\n _this.pagerContext = pagerContext;\n _this.zone = zone;\n /**\n * @hidden\n *\n * @param {string} value\n *\n * @memberOf PagerInputComponent\n */\n _this.handleKeyDown = function (event) {\n var incomingValue = _this.numericInput.value || _this.current;\n if (event.keyCode === Keys.Enter) {\n event.preventDefault();\n if (incomingValue !== _this.current) {\n _this.zone.run(function () {\n _this.changePage(incomingValue - 1);\n });\n }\n }\n };\n /**\n * @hidden\n *\n * @param {string} value\n *\n * @memberOf PagerInputComponent\n */\n _this.handleBlur = function () {\n var inputValue = _this.numericInput.value;\n if (!inputValue) {\n _this.numericInput.writeValue(_this.current);\n return;\n }\n if (inputValue !== _this.current) {\n _this.zone.run(function () {\n _this.changePage(inputValue - 1);\n });\n }\n };\n return _this;\n }\n Object.defineProperty(PagerInputComponent.prototype, \"current\", {\n /**\n * @hidden\n */\n get: function () {\n return this.hasPages ? this.currentPage : 0;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PagerInputComponent.prototype, \"hasPages\", {\n get: function () {\n return this.totalPages !== 0;\n },\n enumerable: true,\n configurable: true\n });\n PagerInputComponent.prototype.onChanges = function (_a) {\n var total = _a.total, skip = _a.skip, pageSize = _a.pageSize;\n this.total = total;\n this.skip = skip;\n this.pageSize = pageSize;\n this.cd.markForCheck();\n };\n PagerInputComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-pager-input',\n template: \"\\n \\n {{textFor('pagerPage')}}\\n \\n {{textFor('pagerOf')}} {{totalPages}}\\n \\n \"\n },] },\n ];\n /** @nocollapse */\n PagerInputComponent.ctorParameters = function () { return [\n { type: LocalizationService },\n { type: PagerContextService },\n { type: NgZone },\n { type: ChangeDetectorRef }\n ]; };\n PagerInputComponent.propDecorators = {\n numericInput: [{ type: ViewChild, args: [NumericTextBoxComponent,] }]\n };\n return PagerInputComponent;\n}(PagerElementComponent));\n\n// tslint:disable:no-access-missing-member\n/**\n * Displays information about the current page and the total number of records ([see example]({% slug paging_grid %}#toc-pager-templates)).\n */\nvar PagerInfoComponent = /** @class */ (function (_super) {\n __extends(PagerInfoComponent, _super);\n function PagerInfoComponent(localization, cd, pagerContext) {\n var _this = _super.call(this, localization, pagerContext, cd) || this;\n _this.pagerContext = pagerContext;\n return _this;\n }\n Object.defineProperty(PagerInfoComponent.prototype, \"maxItems\", {\n /**\n * @hidden\n *\n * @readonly\n * @type {number}\n * @memberOf PagerInfoComponent\n */\n get: function () {\n return Math.min(this.currentPage * this.pageSize, this.total);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PagerInfoComponent.prototype, \"currentPageText\", {\n /**\n * @hidden\n *\n * @readonly\n * @type {number}\n * @memberOf PagerInfoComponent\n */\n get: function () {\n return this.total ?\n (this.currentPage - 1) * this.pageSize + 1 :\n 0;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PagerInfoComponent.prototype, \"classes\", {\n /**\n * @hidden\n *\n * @readonly\n * @type {boolean}\n * @memberOf PagerInfoComponent\n */\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n PagerInfoComponent.prototype.onChanges = function (_a) {\n var total = _a.total, skip = _a.skip, pageSize = _a.pageSize;\n this.total = total;\n this.skip = skip;\n this.pageSize = pageSize;\n this.cd.markForCheck();\n };\n PagerInfoComponent.decorators = [\n { type: Component, args: [{\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'kendo-pager-info',\n template: \"{{currentPageText}} - {{maxItems}} {{textFor('pagerOf')}} {{total}} {{textFor('pagerItems')}}\"\n },] },\n ];\n /** @nocollapse */\n PagerInfoComponent.ctorParameters = function () { return [\n { type: LocalizationService },\n { type: ChangeDetectorRef },\n { type: PagerContextService }\n ]; };\n PagerInfoComponent.propDecorators = {\n classes: [{ type: HostBinding, args: [\"class.k-pager-info\",] }, { type: HostBinding, args: [\"class.k-label\",] }]\n };\n return PagerInfoComponent;\n}(PagerElementComponent));\n\n// tslint:disable:no-access-missing-member\n/**\n * Displays a drop-down list for the page size selection ([see example]({% slug paging_grid %}#toc-pager-templates)).\n */\nvar PagerPageSizesComponent = /** @class */ (function (_super) {\n __extends(PagerPageSizesComponent, _super);\n function PagerPageSizesComponent(localization, cd, pagerContext) {\n var _this = _super.call(this, localization, pagerContext, cd) || this;\n _this.pagerContext = pagerContext;\n _this._pageSizes = [];\n return _this;\n }\n Object.defineProperty(PagerPageSizesComponent.prototype, \"pageSizes\", {\n get: function () {\n return this._pageSizes;\n },\n /**\n * The page sizes collection. Can be an Array of numbers and/or PageSizeItem objects.\n *\n * @example\n * ```ts-preview\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * \n * \n * \n * `\n * })\n * class AppComponent {\n * public gridData: any[] = products;\n * public pageSize = 2;\n * public pagesizes = [{text: 'One', value: 1}, {text: 'Two', value: 2}, {text: 'All', value : 'all'}];\n * }\n *\n * const products = [{\n * 'ProductID' : 1,\n * 'ProductName' : \"Chai\",\n * 'SupplierID' : 1,\n * 'CategoryID' : 1,\n * 'QuantityPerUnit' : \"10 boxes x 20 bags\",\n * 'UnitPrice' : 18.0000,\n * 'UnitsInStock' : 39,\n * 'UnitsOnOrder' : 0,\n * 'ReorderLevel' : 10,\n * 'Discontinued' : false\n *\n * }, {\n * 'ProductID' : 2,\n * 'ProductName' : \"Chang\",\n * 'SupplierID' : 1,\n * 'CategoryID' : 1,\n * 'QuantityPerUnit' : \"24 - 12 oz bottles\",\n * 'UnitPrice' : 19.0000,\n * 'UnitsInStock' : 17,\n * 'UnitsOnOrder' : 40,\n * 'ReorderLevel' : 25,\n * 'Discontinued' : false\n * }, {\n * 'ProductID' : 3,\n * 'ProductName' : \"Aniseed Syrup\",\n * 'SupplierID' : 1,\n * 'CategoryID' : 2,\n * 'QuantityPerUnit' : \"12 - 550 ml bottles\",\n * 'UnitPrice' : 10.0000,\n * 'UnitsInStock' : 13,\n * 'UnitsOnOrder' : 70,\n * 'ReorderLevel' : 25,\n * 'Discontinued' : false\n * }, {\n * 'ProductID' : 4,\n * 'ProductName' : \"Chef Anton\\'s Cajun Seasoning\",\n * 'SupplierID' : 2,\n * 'CategoryID' : 2,\n * 'QuantityPerUnit' : \"48 - 6 oz jars\",\n * 'UnitPrice' : 22.0000,\n * 'UnitsInStock' : 53,\n * 'UnitsOnOrder' : 0,\n * 'ReorderLevel' : 0,\n * 'Discontinued' : false\n * }, {\n * 'ProductID' : 5,\n * 'ProductName' : \"Chef Anton\\'s Gumbo Mix\",\n * 'SupplierID' : 2,\n * 'CategoryID' : 2,\n * 'QuantityPerUnit' : \"36 boxes\",\n * 'UnitPrice' : 21.3500,\n * 'UnitsInStock' : 0,\n * 'UnitsOnOrder' : 0,\n * 'ReorderLevel' : 0,\n * 'Discontinued' : true\n * }, {\n * 'ProductID' : 6,\n * 'ProductName' : \"Grandma\\'s Boysenberry Spread\",\n * 'SupplierID' : 3,\n * 'CategoryID' : 2,\n * 'QuantityPerUnit' : \"12 - 8 oz jars\",\n * 'UnitPrice' : 25.0000,\n * 'UnitsInStock' : 120,\n * 'UnitsOnOrder' : 0,\n * 'ReorderLevel' : 25,\n * 'Discontinued' : false\n * }];\n * ```\n */\n set: function (pageSizes) {\n var normalizedItems = [];\n pageSizes.forEach(function (item) {\n if (typeof item === 'number') {\n normalizedItems.push({\n text: item.toString(),\n value: item\n });\n }\n else {\n normalizedItems.push(item);\n }\n });\n this._pageSizes = normalizedItems;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PagerPageSizesComponent.prototype, \"classes\", {\n /**\n * @hidden\n *\n * @readonly\n */\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(PagerPageSizesComponent.prototype, \"showInitialPageSize\", {\n /**\n * @hidden\n *\n * @readonly\n */\n get: function () {\n var _this = this;\n return this.pageSizes\n .filter(function (item) {\n if (typeof item.value === 'number') {\n return item.value === Number(_this.pageSize);\n }\n return _this.total === Number(_this.pageSize);\n })\n .length === 0;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n */\n PagerPageSizesComponent.prototype.pageSizeChange = function (value) {\n this.pageSize = parseInt(value, 10);\n this.pagerContext.changePageSize(this.pageSize);\n };\n /**\n * @hidden\n */\n PagerPageSizesComponent.prototype.getValue = function (page) {\n return typeof page.value === 'number' ? page.value : this.total;\n };\n /**\n * @hidden\n */\n PagerPageSizesComponent.prototype.getSelectedState = function (page) {\n if (typeof page.value === 'number') {\n return page.value === this.pageSize ? true : undefined;\n }\n return this.pageSize === this.total;\n };\n PagerPageSizesComponent.prototype.onChanges = function (_a) {\n var total = _a.total, skip = _a.skip, pageSize = _a.pageSize;\n this.total = total;\n this.skip = skip;\n this.pageSize = typeof pageSize === 'number' ? pageSize : this.total;\n this.cd.markForCheck();\n };\n PagerPageSizesComponent.decorators = [\n { type: Component, args: [{\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'kendo-pager-page-sizes',\n template: \"\\n \\n {{ textFor('pagerItemsPerPage') }}\\n \"\n },] },\n ];\n /** @nocollapse */\n PagerPageSizesComponent.ctorParameters = function () { return [\n { type: LocalizationService },\n { type: ChangeDetectorRef },\n { type: PagerContextService }\n ]; };\n PagerPageSizesComponent.propDecorators = {\n pageSizes: [{ type: Input }],\n classes: [{ type: HostBinding, args: [\"class.k-pager-sizes\",] }, { type: HostBinding, args: [\"class.k-label\",] }]\n };\n return PagerPageSizesComponent;\n}(PagerElementComponent));\n\nvar importedModules$1 = [\n CommonModule,\n InputsModule,\n SharedModule,\n EventsModule\n];\nvar INTERNAL_COMPONENTS$1 = [\n PagerComponent,\n PagerPrevButtonsComponent,\n PagerNextButtonsComponent,\n PagerNumericButtonsComponent,\n PagerInputComponent,\n PagerInfoComponent,\n PagerPageSizesComponent,\n PagerTemplateDirective\n];\n/**\n * @hidden\n */\nvar PagerModule = /** @class */ (function () {\n function PagerModule() {\n }\n PagerModule.exports = function () {\n return [\n PagerComponent,\n PagerPrevButtonsComponent,\n PagerNextButtonsComponent,\n PagerNumericButtonsComponent,\n PagerInputComponent,\n PagerInfoComponent,\n PagerPageSizesComponent,\n PagerTemplateDirective\n ];\n };\n PagerModule.decorators = [\n { type: NgModule, args: [{\n declarations: [INTERNAL_COMPONENTS$1],\n exports: [INTERNAL_COMPONENTS$1],\n imports: importedModules$1.slice()\n },] },\n ];\n return PagerModule;\n}());\n\n/**\n * @hidden\n */\nvar GroupHeaderComponent = /** @class */ (function () {\n function GroupHeaderComponent(groupsService, groupInfoService) {\n this.groupsService = groupsService;\n this.groupInfoService = groupInfoService;\n this.skipGroupDecoration = false;\n this.hasDetails = false;\n this.totalColumnsCount = 0;\n this.groups = [];\n this.isExpanded = false;\n }\n Object.defineProperty(GroupHeaderComponent.prototype, \"groupItemClass\", {\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n GroupHeaderComponent.prototype.ngDoCheck = function () {\n this.isExpanded = this.groupsService.isExpanded(this.item.index);\n };\n GroupHeaderComponent.prototype.prefixGroupCell = function (item) {\n return new Array(item.level);\n };\n GroupHeaderComponent.prototype.toggleGroup = function (item) {\n this.groupsService.toggleRow(item.index, item.data);\n return false;\n };\n GroupHeaderComponent.prototype.groupSpan = function (item) {\n var groupCount = (this.groups || []).length;\n if (this.hasGroupHeaderColumn) {\n return groupCount + (this.skipGroupDecoration ? 0 : 1) - item.level;\n }\n var columnCount = columnsSpan(this.columns);\n if (this.skipGroupDecoration) {\n return columnCount;\n }\n if (this.hasDetails) {\n columnCount++;\n }\n return groupCount + columnCount - item.level;\n };\n GroupHeaderComponent.prototype.logicalColSpan = function () {\n return this.skipGroupDecoration ? 1 : this.totalColumnsCount;\n };\n GroupHeaderComponent.prototype.ariaRole = function () {\n if (this.skipGroupDecoration) {\n return 'presentation';\n }\n return 'gridcell';\n };\n GroupHeaderComponent.prototype.formatForGroup = function (item) {\n return this.groupInfoService.formatForGroup(item);\n };\n GroupHeaderComponent.prototype.groupTitle = function (item) {\n return this.groupInfoService.groupTitle(item);\n };\n GroupHeaderComponent.prototype.groupHeaderTemplate = function (item) {\n return this.groupInfoService.groupHeaderTemplate(item);\n };\n GroupHeaderComponent.decorators = [\n { type: Component, args: [{\n selector: '[kendoGridGroupHeader]',\n template: \"\\n \\n | \\n \\n \\n \\n \\n \\n \\n \\n {{groupTitle(item)}}: {{item.data | valueOf:\\\"value\\\": formatForGroup(item)}}\\n \\n \\n \\n \\n \\n | \\n \\n \\n \\n \\n | \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n GroupHeaderComponent.ctorParameters = function () { return [\n { type: GroupsService },\n { type: GroupInfoService }\n ]; };\n GroupHeaderComponent.propDecorators = {\n rowIndex: [{ type: Input }],\n logicalRowIndex: [{ type: Input }],\n item: [{ type: Input }],\n skipGroupDecoration: [{ type: Input }],\n hasDetails: [{ type: Input }],\n totalColumnsCount: [{ type: Input }],\n hasGroupHeaderColumn: [{ type: Input }],\n groupHeaderColumns: [{ type: Input }],\n columns: [{ type: Input }],\n groups: [{ type: Input }],\n groupItemClass: [{ type: HostBinding, args: ['class.k-grouping-row',] }]\n };\n return GroupHeaderComponent;\n}());\n\n/**\n * @hidden\n */\nvar DropTargetDirective = /** @class */ (function () {\n function DropTargetDirective(element, service) {\n this.element = element;\n this.service = service;\n this.context = {};\n this.enter = new EventEmitter();\n this.leave = new EventEmitter();\n this.drop = new EventEmitter();\n this.subscriptions = new Subscription();\n }\n DropTargetDirective.prototype.ngOnInit = function () {\n var _this = this;\n this.service.add(this);\n var changes = this.service.changes.pipe(filter(function (_a) {\n var target = _a.target;\n return target === _this;\n }));\n this.subscriptions.add(changes.pipe(filter(function (_a) {\n var type = _a.type;\n return type === 'leave';\n }))\n .subscribe(function (e) {\n _this.leave.next(_this.eventArgs(e));\n }));\n this.subscriptions.add(changes.pipe(filter(function (_a) {\n var type = _a.type;\n return type === 'enter';\n }))\n .subscribe(function (e) {\n _this.enter.next(_this.eventArgs(e));\n }));\n this.subscriptions.add(changes.pipe(filter(function (_a) {\n var type = _a.type;\n return type === 'drop';\n }))\n .subscribe(function (e) {\n _this.drop.next(_this.eventArgs(e));\n }));\n };\n DropTargetDirective.prototype.ngOnDestroy = function () {\n if (this.subscriptions) {\n this.subscriptions.unsubscribe();\n }\n };\n DropTargetDirective.prototype.eventArgs = function (e) {\n return {\n target: this,\n mouseEvent: e.mouseEvent,\n draggable: e.draggable\n };\n };\n DropTargetDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoDropTarget]'\n },] },\n ];\n /** @nocollapse */\n DropTargetDirective.ctorParameters = function () { return [\n { type: ElementRef },\n { type: DragAndDropService }\n ]; };\n DropTargetDirective.propDecorators = {\n context: [{ type: Input }],\n enter: [{ type: Output }],\n leave: [{ type: Output }],\n drop: [{ type: Output }]\n };\n return DropTargetDirective;\n}());\n\nvar withoutField = function (_a) {\n var field = _a.field;\n return isNullOrEmptyString(field);\n};\nvar alreadyGrouped = function (_a) {\n var groups = _a.groups, field = _a.field;\n return groups.some(function (group) { return group.field === field; });\n};\nvar overSameTarget = function (_a) {\n var target = _a.target, field = _a.field;\n return target.field === field;\n};\nvar overLastTarget = function (_a) {\n var target = _a.target;\n return target.lastTarget;\n};\nvar isLastGroup = function (_a) {\n var groups = _a.groups, field = _a.field;\n return groups.map(function (group) { return group.field; }).indexOf(field) === groups.length - 1;\n};\nvar isNotGroupable = function (groupsService) { return function (_a) {\n var field = _a.field;\n return !groupsService.isGroupable(field);\n}; };\nvar columnRules = function (groupService) { return or(withoutField, alreadyGrouped, isNotGroupable(groupService)); };\nvar indicatorRules = or(overSameTarget, and(overLastTarget, isLastGroup));\n/**\n * @hidden\n */\nvar GroupPanelComponent = /** @class */ (function () {\n function GroupPanelComponent(hint, cue, groupInfoService, localization, cd) {\n this.hint = hint;\n this.cue = cue;\n this.groupInfoService = groupInfoService;\n this.localization = localization;\n this.cd = cd;\n this.change = new EventEmitter();\n this.groups = [];\n this.dropTargets = new QueryList();\n this.groupTitles = [];\n this.subscription = new Subscription();\n }\n Object.defineProperty(GroupPanelComponent.prototype, \"groupHeaderClass\", {\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GroupPanelComponent.prototype, \"text\", {\n get: function () {\n return this.emptyText ? this.emptyText : this.localization.get('groupPanelEmpty');\n },\n set: function (value) {\n this.emptyText = value;\n },\n enumerable: true,\n configurable: true\n });\n GroupPanelComponent.prototype.ngAfterViewInit = function () {\n this.subscription.add(observe(this.dropTargets)\n .subscribe(this.attachTargets.bind(this)));\n };\n GroupPanelComponent.prototype.ngOnInit = function () {\n var _this = this;\n this.subscription.add(this.localization.changes.subscribe(function () { return _this.cd.markForCheck(); }));\n };\n GroupPanelComponent.prototype.ngDoCheck = function () {\n var _this = this;\n var currentTitles = this.groups.map(function (group) { return _this.groupInfoService.groupTitle(group); });\n if (currentTitles.length !== this.groupTitles.length || currentTitles.some(function (current, idx) { return current !== _this.groupTitles[idx]; })) {\n this.groupTitles = currentTitles;\n this.cd.markForCheck();\n }\n };\n GroupPanelComponent.prototype.ngOnDestroy = function () {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n if (this.targetSubscription) {\n this.targetSubscription.unsubscribe();\n }\n };\n GroupPanelComponent.prototype.directionChange = function (group) {\n var index = this.groups.findIndex(function (x) { return x.field === group.field; });\n var groups = this.groups.slice(0, index).concat([group], this.groups.slice(index + 1));\n this.change.emit(groups);\n };\n GroupPanelComponent.prototype.insert = function (field, index) {\n var groups = this.groups.filter(function (x) { return x.field !== field; });\n if (groups.length || this.groups.length === 0) {\n this.change.emit(groups.slice(0, index).concat([{ field: field }], groups.slice(index)));\n }\n };\n GroupPanelComponent.prototype.remove = function (group) {\n this.change.emit(this.groups.filter(function (x) { return x.field !== group.field; }));\n };\n GroupPanelComponent.prototype.canDrop = function (draggable, target) {\n var isIndicator = draggable.type === 'groupIndicator';\n var rules = isIndicator\n ? indicatorRules\n : columnRules(this.groupInfoService);\n return !rules({\n field: draggable.field,\n groups: this.groups,\n target: target\n });\n };\n GroupPanelComponent.prototype.attachTargets = function () {\n var _this = this;\n if (this.targetSubscription) {\n this.targetSubscription.unsubscribe();\n }\n this.targetSubscription = new Subscription();\n var enterStream = this.dropTargets\n .reduce(function (acc, target) { return merge(acc, target.enter); }, from([]));\n var leaveStream = this.dropTargets\n .reduce(function (acc, target) { return merge(acc, target.leave); }, from([]));\n var dropStream = this.dropTargets\n .reduce(function (acc, target) { return merge(acc, target.drop); }, from([]));\n this.targetSubscription.add(enterStream.pipe(tap(function (_) { return _this.hint.removeLock(); }), filter(function (_a) {\n var draggable = _a.draggable, target = _a.target;\n return _this.canDrop(draggable.context, target.context);\n }), tap(this.enter.bind(this)), switchMapTo(dropStream.pipe(takeUntil(leaveStream.pipe(tap(this.leave.bind(this))))))).subscribe(this.drop.bind(this)));\n };\n GroupPanelComponent.prototype.enter = function (_a) {\n var draggable = _a.draggable, target = _a.target;\n this.hint.enable();\n var before = target.context.lastTarget || isTargetBefore(draggable.element.nativeElement, target.element.nativeElement);\n if (this.localization.rtl) {\n before = !before;\n }\n this.cue.position(position(target.element.nativeElement, before));\n };\n GroupPanelComponent.prototype.leave = function () {\n this.hint.disable();\n this.cue.hide();\n };\n GroupPanelComponent.prototype.drop = function (_a) {\n var target = _a.target, draggable = _a.draggable;\n var field = draggable.context.field;\n var index = this.dropTargets.toArray().indexOf(target);\n this.insert(field, index);\n };\n GroupPanelComponent.decorators = [\n { type: Component, args: [{\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'kendo-grid-group-panel',\n template: \"\\n \\n \\n {{ text }}\\n
\\n \\n \\n
\\n \"\n },] },\n ];\n /** @nocollapse */\n GroupPanelComponent.ctorParameters = function () { return [\n { type: DragHintService },\n { type: DropCueService },\n { type: GroupInfoService },\n { type: LocalizationService },\n { type: ChangeDetectorRef }\n ]; };\n GroupPanelComponent.propDecorators = {\n change: [{ type: Output }],\n groupHeaderClass: [{ type: HostBinding, args: [\"class.k-grouping-header\",] }, { type: HostBinding, args: [\"class.k-grouping-header-flex\",] }],\n text: [{ type: Input }],\n groups: [{ type: Input }],\n dropTargets: [{ type: ViewChildren, args: [DropTargetDirective,] }]\n };\n return GroupPanelComponent;\n}());\n\n/**\n * @hidden\n */\nvar GroupIndicatorComponent = /** @class */ (function () {\n function GroupIndicatorComponent() {\n this.directionChange = new EventEmitter();\n this.remove = new EventEmitter();\n }\n Object.defineProperty(GroupIndicatorComponent.prototype, \"groupIndicatorClass\", {\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GroupIndicatorComponent.prototype, \"dir\", {\n get: function () {\n return this.group.dir ? this.group.dir : \"asc\";\n },\n enumerable: true,\n configurable: true\n });\n GroupIndicatorComponent.prototype.toggleDirection = function () {\n this.directionChange.emit({\n dir: this.dir === \"asc\" ? \"desc\" : \"asc\",\n field: this.group.field\n });\n return false;\n };\n GroupIndicatorComponent.prototype.removeDescriptor = function () {\n this.remove.emit({\n dir: this.group.dir,\n field: this.group.field\n });\n return false;\n };\n GroupIndicatorComponent.decorators = [\n { type: Component, args: [{\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: '[kendoGroupIndicator]',\n template: \"\\n \\n \\n {{groupTitle}}\\n \\n \\n \\n \"\n },] },\n ];\n GroupIndicatorComponent.propDecorators = {\n directionChange: [{ type: Output }],\n remove: [{ type: Output }],\n group: [{ type: Input }],\n groupTitle: [{ type: Input }],\n groupIndicatorClass: [{ type: HostBinding, args: [\"class.k-group-indicator\",] }]\n };\n return GroupIndicatorComponent;\n}());\n\n// TODO\n// tslint:disable:rxjs-no-unsafe-takeuntil\n/**\n * @hidden\n */\nvar preventOnDblClick = function (release) { return function (mouseDown) {\n return of(mouseDown).pipe(delay(150), takeUntil(release));\n}; };\nvar hasClass = function (className) { return function (el) { return new RegExp(\"(^| )\" + className + \"( |$)\").test(el.className); }; };\nvar isDeleteButton = or(hasClass(\"k-i-group-delete\"), hasClass(\"k-button-icon\"));\nvar isSortIcon = or(hasClass(\"k-i-sort-asc-sm\"), hasClass(\"k-i-sort-desc-sm\"));\nvar skipButtons = and(not(isDeleteButton), not(isSortIcon), not(isFocusableWithTabKey), not(matchesNodeName(\"label\")));\nvar elementUnderCursor = function (_a) {\n var clientX = _a.clientX, clientY = _a.clientY;\n return document.elementFromPoint(clientX, clientY);\n};\nvar hideThenShow = function (element, cont) {\n element.style.display = 'none';\n var result = cont();\n element.style.display = 'block';\n return result;\n};\n/**\n * @hidden\n */\nvar DraggableColumnDirective = /** @class */ (function () {\n function DraggableColumnDirective(draggable, element, zone, service, hint, cue, nav, renderer) {\n this.draggable = draggable;\n this.element = element;\n this.zone = zone;\n this.service = service;\n this.hint = hint;\n this.cue = cue;\n this.nav = nav;\n this.renderer = renderer;\n this.context = {};\n this.drag = new EventEmitter();\n this.subscriptions = new Subscription();\n }\n Object.defineProperty(DraggableColumnDirective.prototype, \"enableDrag\", {\n set: function (enabled) {\n this.enabled = enabled;\n this.updateTouchAction();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DraggableColumnDirective.prototype, \"hostClass\", {\n get: function () {\n return this.enabled;\n },\n enumerable: true,\n configurable: true\n });\n DraggableColumnDirective.prototype.ngOnInit = function () {\n var _this = this;\n this.subscriptions.add(this.zone.runOutsideAngular(function () {\n return _this.draggable.kendoPress.pipe(filter(function (_) { return _this.enabled; }), filter(function (_a) {\n var target = _a.originalEvent.target;\n return target === _this.element.nativeElement || skipButtons(target);\n }), tap(function (e) {\n var originalEvent = e.originalEvent;\n if (!e.isTouch) {\n originalEvent.preventDefault();\n }\n _this.nav.navigateTo(originalEvent.target);\n }), switchMap(preventOnDblClick(_this.draggable.kendoRelease)), tap(function (down) {\n _this.hint.create(down, _this.element.nativeElement, _this.context.hint);\n _this.cue.create();\n }), switchMap(function (down) {\n return _this.draggable.kendoDrag.pipe(tap(function (e) {\n if (e.isTouch) {\n e.originalEvent.preventDefault();\n }\n }), tap(_this.hint.attach()), tap(_this.cue.attach()), takeUntil(_this.draggable.kendoRelease), map(function (move) { return ({ move: move, down: down }); }));\n }), tap(_this.performDrag.bind(_this)), switchMapTo(_this.draggable.kendoRelease)).subscribe(_this.drop.bind(_this));\n }));\n };\n DraggableColumnDirective.prototype.ngOnDestroy = function () {\n if (this.subscriptions) {\n this.subscriptions.unsubscribe();\n }\n };\n DraggableColumnDirective.prototype.drop = function (upEvent) {\n this.hint.remove();\n this.cue.remove();\n this.service.notifyDrop(this, upEvent);\n };\n DraggableColumnDirective.prototype.performDrag = function (_a) {\n var move = _a.move;\n this.hint.move(move);\n var cursorElement = this.elementUnderCursor(move);\n if (cursorElement) {\n this.service.notifyDrag(this, cursorElement, move);\n }\n this.drag.emit({\n draggable: this,\n mouseEvent: move\n });\n };\n DraggableColumnDirective.prototype.elementUnderCursor = function (mouseEvent) {\n this.hint.hide();\n var target = elementUnderCursor(mouseEvent);\n if (target && /k-grouping-dropclue/.test(target.className)) {\n target = hideThenShow(target, elementUnderCursor.bind(this, mouseEvent));\n }\n this.hint.show();\n return target;\n };\n DraggableColumnDirective.prototype.updateTouchAction = function () {\n if (!this.element) {\n return;\n }\n this.renderer.setStyle(this.element.nativeElement, 'touch-action', this.enabled ? 'none' : '');\n };\n DraggableColumnDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoDraggableColumn]'\n },] },\n ];\n /** @nocollapse */\n DraggableColumnDirective.ctorParameters = function () { return [\n { type: DraggableDirective, decorators: [{ type: Host }] },\n { type: ElementRef },\n { type: NgZone },\n { type: DragAndDropService },\n { type: DragHintService },\n { type: DropCueService },\n { type: NavigationService },\n { type: Renderer2 }\n ]; };\n DraggableColumnDirective.propDecorators = {\n context: [{ type: Input }],\n enableDrag: [{ type: Input }],\n drag: [{ type: Output }],\n hostClass: [{ type: HostBinding, args: ['class.k-grid-draggable-header',] }]\n };\n return DraggableColumnDirective;\n}());\n\nvar exported = [\n DraggableColumnDirective,\n DropTargetDirective\n];\n/**\n * @hidden\n */\nvar DragAndDropModule = /** @class */ (function () {\n function DragAndDropModule() {\n }\n DragAndDropModule.decorators = [\n { type: NgModule, args: [{\n declarations: [exported],\n exports: [exported]\n },] },\n ];\n return DragAndDropModule;\n}());\n\nvar exportedModules$1 = [\n GroupHeaderTemplateDirective,\n GroupHeaderColumnTemplateDirective,\n GroupFooterTemplateDirective,\n GroupHeaderComponent,\n GroupPanelComponent,\n GroupIndicatorComponent\n];\n/**\n * @hidden\n */\nvar GroupModule = /** @class */ (function () {\n function GroupModule() {\n }\n GroupModule.exports = function () {\n return [\n GroupHeaderTemplateDirective,\n GroupHeaderColumnTemplateDirective,\n GroupFooterTemplateDirective\n ];\n };\n GroupModule.decorators = [\n { type: NgModule, args: [{\n declarations: [exportedModules$1],\n exports: [exportedModules$1],\n imports: [CommonModule, SharedModule, DragAndDropModule]\n },] },\n ];\n return GroupModule;\n}());\n\n/**\n * @hidden\n */\nvar DEFAULTS = {\n allowUnsort: true,\n mode: 'single',\n showIndexes: true,\n initialDirection: 'asc'\n};\n/**\n * @hidden\n */\nvar normalize$1 = function () {\n var settings = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n settings[_i] = arguments[_i];\n }\n return Object.assign.apply(Object, [{}, DEFAULTS].concat(settings));\n};\n\n/**\n * @hidden\n */\nvar hasFilter = function (settings, column) { return settings.filter !== false && column.field && column.filterable; };\n/**\n * @hidden\n */\nvar hasSort = function (settings, column) { return settings.sort !== false && column.field && column.sortable; };\n/**\n * @hidden\n */\nvar hasLock = function (settings, column) {\n return settings.lock && column.lockable && !(column.parent && !column.parent.isSpanColumn);\n};\n/**\n * @hidden\n */\nvar hasColumnChooser = function (settings) { return settings.columnChooser !== false; };\n/**\n * @hidden\n */\nvar hasItems = function (settings, column) {\n return hasColumnChooser(settings) || hasLock(settings, column) || hasSort(settings, column) || hasFilter(settings, column);\n};\n\nvar mergeObjects = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return Object.assign.apply(null, [{}].concat(args));\n};\nvar directions = function (initialDirection) { return initialDirection === \"asc\" ? [\"asc\", \"desc\"] : [\"desc\", \"asc\"]; };\n/**\n * @hidden\n */\nvar isRootLevel = function (_a) {\n var parent = _a.parent;\n return !isTruthy(parent);\n};\nvar ofColumnType = function (_a) {\n var draggable = _a.draggable;\n return ['column', 'columnGroup']\n .indexOf(draggable.context.type) >= 0;\n};\nvar notSameElement = function (_a) {\n var draggable = _a.draggable, target = _a.target;\n return draggable.element.nativeElement !== target.element.nativeElement;\n};\nvar inSameParent = function (x, y) { return x.parent === y.parent ||\n (isInSpanColumn(y) && inSameParent(x, y.parent)); };\nvar sameParent = function (_a) {\n var draggable = _a.draggable, target = _a.target;\n return inSameParent(draggable.context.column, target.context.column);\n};\nvar lastNonLocked = function (_a) {\n var draggable = _a.draggable;\n return !isTruthy(draggable.context.column.locked) &&\n isRootLevel(draggable.context.column) &&\n draggable.context.lastColumn;\n};\nvar notInSpanColumn = function (_a) {\n var draggable = _a.draggable;\n return !isInSpanColumn(draggable.context.column);\n};\nvar reorderable = function (_a) {\n var draggable = _a.draggable;\n return draggable.context.column.reorderable;\n};\nvar lockable = function (_a) {\n var draggable = _a.draggable, target = _a.target;\n return draggable.context.column.lockable !== false ||\n draggable.context.column.isLocked === target.context.column.isLocked;\n};\nvar rules = and(ofColumnType, reorderable, notInSpanColumn, notSameElement, sameParent, not(lastNonLocked), lockable);\n/**\n * @hidden\n */\nvar HeaderComponent = /** @class */ (function () {\n function HeaderComponent(popupService, hint, cue, reorderService, idService, sortService, localization, cd) {\n this.popupService = popupService;\n this.hint = hint;\n this.cue = cue;\n this.reorderService = reorderService;\n this.idService = idService;\n this.sortService = sortService;\n this.localization = localization;\n this.cd = cd;\n this.columns = [];\n this.groups = [];\n this.sort = new Array();\n this.sortable = false;\n this.groupable = false;\n this.lockedColumnsCount = 0;\n this.resizable = false;\n this.reorderable = false;\n this.columnMenu = false;\n this.totalColumnsCount = 0;\n this.sortedFields = {};\n this.dropTargets = new QueryList();\n this.subscription = new Subscription();\n }\n Object.defineProperty(HeaderComponent.prototype, \"headerClass\", {\n get: function () {\n return !this.scrollable;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(HeaderComponent.prototype, \"sortableLabel\", {\n get: function () {\n return this.localization.get('sortable');\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(HeaderComponent.prototype, \"unlockedColumnsCount\", {\n // Number of unlocked columns in the next table, if any\n get: function () {\n return this.totalColumnsCount - this.lockedColumnsCount - this.columns.length;\n },\n enumerable: true,\n configurable: true\n });\n HeaderComponent.prototype.sortColumn = function (column, event, link) {\n var target = event ? event.target : null;\n if (column.headerTemplateRef && target !== link) {\n var hasFocusableParent = Boolean(closestInScope(target, isFocusable, link));\n if (hasFocusableParent) {\n return target.type === 'checkbox'; // prevent navigation only if the element is not checkbox\n }\n }\n this.sortService.sort(this.toggleSort(column));\n // Prevent navigation\n return false;\n };\n HeaderComponent.prototype.onHeaderKeydown = function (column, args) {\n if (!this.sortable || args.defaultPrevented || column.sortable === false) {\n return;\n }\n if (args.keyCode === Keys.Enter) {\n this.sortService.sort(this.toggleSort(column));\n }\n };\n HeaderComponent.prototype.showSortNumbering = function (column) {\n var showIndexes = normalize$1(this.sortable).showIndexes;\n return showIndexes\n && this.sort\n && this.sort.filter(function (_a) {\n var dir = _a.dir;\n return isPresent(dir);\n }).length > 1\n && this.sortOrder(column.field) > 0;\n };\n HeaderComponent.prototype.sortOrder = function (field) {\n return this.sort\n .filter(function (_a) {\n var dir = _a.dir;\n return isPresent(dir);\n })\n .findIndex(function (x) { return x.field === field; })\n + 1;\n };\n HeaderComponent.prototype.sortIcon = function (field) {\n var state$$1 = this.sortDescriptor(field);\n return {\n 'k-icon': isPresent(state$$1.dir),\n 'k-i-sort-desc-sm': state$$1.dir === \"desc\",\n 'k-i-sort-asc-sm': state$$1.dir === \"asc\"\n };\n };\n HeaderComponent.prototype.sortState = function (column) {\n if (!this.isSortable(column)) {\n return;\n }\n var state$$1 = this.sortDescriptor(column.field);\n if (state$$1.dir === 'asc') {\n return 'ascending';\n }\n if (state$$1.dir === 'desc') {\n return 'descending';\n }\n };\n HeaderComponent.prototype.sortStatus = function (column) {\n if (!this.sortedFields[column.field] || !this.isSortable(column)) {\n return;\n }\n var msg = 'sortedDefault';\n var state$$1 = this.sortDescriptor(column.field);\n if (state$$1.dir === 'asc') {\n msg = 'sortedAscending';\n }\n else if (state$$1.dir === 'desc') {\n msg = 'sortedDescending';\n }\n return this.localization.get(msg);\n };\n HeaderComponent.prototype.toggleSort = function (column) {\n var _a = normalize$1(this.sortable, column.sortable), allowUnsort = _a.allowUnsort, mode = _a.mode, initialDirection = _a.initialDirection;\n var descriptor = this.toggleDirection(column.field, allowUnsort, initialDirection);\n if (mode === 'single') {\n return [descriptor];\n }\n return this.sort.filter(function (desc) { return desc.field !== column.field; }).concat([descriptor]);\n };\n HeaderComponent.prototype.ngAfterViewInit = function () {\n this.subscription.add(observe(this.dropTargets)\n .subscribe(this.attachTargets.bind(this)));\n };\n HeaderComponent.prototype.ngDoCheck = function () {\n this._leafColumns = columnsToRender(this.columns || []).filter(function (x) { return !isColumnGroupComponent(x); });\n };\n HeaderComponent.prototype.ngOnChanges = function (changes) {\n var _this = this;\n var sortChange = changes.sort;\n if (sortChange && !sortChange.isFirstChange()) {\n sortChange.currentValue.forEach(function (change) {\n _this.sortedFields[change.field] = true;\n });\n }\n };\n HeaderComponent.prototype.ngOnInit = function () {\n var _this = this;\n this.subscription.add(this.localization.changes\n .subscribe(function () { return _this.cd.markForCheck(); }));\n };\n HeaderComponent.prototype.ngOnDestroy = function () {\n if (this.targetSubscription) {\n this.targetSubscription.unsubscribe();\n }\n if (this.popupService) {\n this.popupService.destroy();\n }\n this.subscription.unsubscribe();\n };\n HeaderComponent.prototype.selectAllCheckboxId = function () {\n return this.idService.selectAllCheckboxId();\n };\n HeaderComponent.prototype.isFirstOnRow = function (column, index) {\n var _this = this;\n var isTailing = function (c) { return c &&\n (_this.columnsForLevel(c.level).indexOf(c) > 0 || isTailing(c.parent)); };\n return index === 0 && !this.groups.length && !this.detailTemplate && isTailing(column.parent);\n };\n HeaderComponent.prototype.logicalColumnIndex = function (column) {\n var index = column.leafIndex;\n if (isPresent(index)) {\n return index + (isPresent(this.detailTemplate) ? 1 : 0);\n }\n return -1;\n };\n Object.defineProperty(HeaderComponent.prototype, \"showFilterMenu\", {\n get: function () {\n return !this.columnMenu && hasFilterMenu(this.filterable);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(HeaderComponent.prototype, \"showFilterRow\", {\n get: function () {\n return hasFilterRow(this.filterable);\n },\n enumerable: true,\n configurable: true\n });\n HeaderComponent.prototype.showColumnMenu = function (column) {\n return this.columnMenu && column.columnMenu &&\n (this.columnMenuTemplate || column.columnMenuTemplates.length || hasItems(this.columnMenu, column));\n };\n HeaderComponent.prototype.isFilterable = function (column) {\n return !isNullOrEmptyString(column.field) && column.filterable === true;\n };\n HeaderComponent.prototype.canDrop = function (draggable, target) {\n return this.reorderable && rules({ draggable: draggable, target: target });\n };\n HeaderComponent.prototype.shouldActivate = function (column) {\n var canReorder = this.reorderable && column.reorderable;\n if (!canReorder && !isColumnComponent(column)) {\n return false;\n }\n var groupable = this.groupable && isColumnComponent(column) && column.groupable !== false;\n return groupable || canReorder;\n };\n HeaderComponent.prototype.isSortable = function (column) {\n return !isNullOrEmptyString(column.field)\n && isTruthy(this.sortable) && isTruthy(column.sortable);\n };\n HeaderComponent.prototype.isCheckboxColumn = function (column) {\n return isCheckboxColumn(column) && !column.templateRef;\n };\n HeaderComponent.prototype.trackByIndex = function (index, _item) {\n return index;\n };\n HeaderComponent.prototype.toggleDirection = function (field, allowUnsort, initialDirection) {\n var descriptor = this.sortDescriptor(field);\n var _a = directions(initialDirection), first = _a[0], second = _a[1];\n var dir = first;\n if (descriptor.dir === first) {\n dir = second;\n }\n else if (descriptor.dir === second && allowUnsort) {\n dir = undefined;\n }\n return { dir: dir, field: field };\n };\n HeaderComponent.prototype.columnsForLevel = function (level) {\n var columns = this.columns ? this.columns.filter(function (column) { return column.level === level; }) : [];\n return sortColumns(columnsToRender(columns));\n };\n HeaderComponent.prototype.isColumnGroupComponent = function (column) {\n return isColumnGroupComponent(column);\n };\n Object.defineProperty(HeaderComponent.prototype, \"columnLevels\", {\n get: function () {\n return new Array((this.totalColumnLevels || 0) + 1);\n },\n enumerable: true,\n configurable: true\n });\n HeaderComponent.prototype.sortDescriptor = function (field) {\n return this.sort.find(function (item) { return item.field === field; }) || { field: field };\n };\n Object.defineProperty(HeaderComponent.prototype, \"leafColumns\", {\n get: function () {\n return this._leafColumns;\n },\n enumerable: true,\n configurable: true\n });\n HeaderComponent.prototype.attachTargets = function () {\n var _this = this;\n if (this.targetSubscription) {\n this.targetSubscription.unsubscribe();\n }\n this.targetSubscription = new Subscription();\n var enterStream = merge.apply(void 0, this.dropTargets.map(function (target) { return target.enter; }));\n var leaveStream = merge.apply(void 0, this.dropTargets.map(function (target) { return target.leave; }));\n var dropStream = merge.apply(void 0, this.dropTargets.map(function (target) { return target.drop; }));\n this.targetSubscription.add(enterStream.pipe(tap(function (_a) {\n var target = _a.target, draggable = _a.draggable;\n if (draggable.context.type === 'groupIndicator') {\n return;\n }\n var targetLocked = isTruthy(target.context.column.isLocked);\n var draggableLocked = isTruthy(draggable.context.column.isLocked);\n if (_this.lockedColumnsCount > 0 || targetLocked || draggableLocked) {\n _this.hint.toggleLock(targetLocked);\n }\n }), filter(function (_a) {\n var draggable = _a.draggable, target = _a.target;\n return _this.canDrop(draggable, target);\n }), switchMap(this.trackMove.bind(this, leaveStream, dropStream)), map(function (e) { return mergeObjects(e, { before: _this.calculateBefore(e), changeContainer: e.changeContainer }); }), map(this.normalizeTarget.bind(this)), tap(this.enter.bind(this)), switchMap(function (args) {\n return dropStream.pipe(map(function () { return args; }), takeUntil(leaveStream.pipe(tap(_this.leave.bind(_this)))));\n }))\n .subscribe(this.drop.bind(this)));\n };\n HeaderComponent.prototype.normalizeTarget = function (e) {\n var target = e.target;\n var parent = target.context.column.parent;\n if (parent && parent.isSpanColumn) {\n var arr = this.dropTargets.toArray();\n var firstSpan = arr.find(function (t) { return t.context.column.parent === parent; });\n var index = arr.indexOf(firstSpan);\n var adjust = e.before ? 0 : parent.childColumns.length - 1;\n target = arr[index + adjust];\n }\n return mergeObjects(e, { target: target });\n };\n HeaderComponent.prototype.trackMove = function (leaveStream, dropStream, e) {\n var column = e.target.context.column;\n var levelColumns = this.columnsForLevel(column.level);\n var index = levelColumns.indexOf(column);\n var isFirst = (column.locked ? index === levelColumns.length - 1 : index === 0);\n var changed = e.draggable.context.column.isLocked !== column.isLocked;\n if (changed && isFirst) {\n return e.draggable.drag\n .pipe(takeUntil(leaveStream), takeUntil(dropStream), map(function (_a) {\n var mouseEvent = _a.mouseEvent;\n return mergeObjects({ changeContainer: true }, e, { mouseEvent: mouseEvent });\n }));\n }\n return of(mergeObjects({ changeContainer: changed }, e));\n };\n HeaderComponent.prototype.calculateBefore = function (_a) {\n var draggable = _a.draggable, target = _a.target, mouseEvent = _a.mouseEvent, _b = _a.changeContainer, changeContainer = _b === void 0 ? false : _b;\n var targetElement = target.element.nativeElement;\n var before = false;\n if (changeContainer) {\n var left = offset(targetElement).left;\n var halfWidth = targetElement.offsetWidth / 2;\n var middle = left + halfWidth;\n before = middle > mouseEvent.pageX;\n if (this.localization.rtl) {\n before = !before;\n }\n }\n else {\n before = isTargetBefore(draggable.element.nativeElement, targetElement);\n }\n return before;\n };\n HeaderComponent.prototype.enter = function (_a) {\n var target = _a.target, before = _a.before;\n this.hint.enable();\n if (this.localization.rtl) {\n before = !before;\n }\n this.cue.position(position(target.element.nativeElement, before));\n };\n HeaderComponent.prototype.leave = function () {\n this.hint.disable();\n this.cue.hide();\n };\n HeaderComponent.prototype.drop = function (_a) {\n var draggable = _a.draggable, target = _a.target, before = _a.before, changeContainer = _a.changeContainer;\n this.reorderService.reorder({\n before: before,\n changeContainer: changeContainer,\n source: draggable.context.column,\n target: target.context.column\n });\n };\n HeaderComponent.decorators = [\n { type: Component, args: [{\n selector: '[kendoGridHeader]',\n styles: [\"\\n .k-column-resizer {\\n cursor: col-resize;\\n display: block;\\n height: 1000%;\\n position: absolute;\\n top: 0;\\n width: .5em;\\n }\\n \"],\n template: \"\\n \\n 0\\\"\\n [logicalCellsCount]=\\\"columns.length\\\"\\n [logicalSlaveCellsCount]=\\\"unlockedColumnsCount\\\">\\n \\n | \\n \\n | \\n \\n \\n \\n \\n
\\n 0\\\"\\n [logicalCellsCount]=\\\"columns.length\\\"\\n [logicalSlaveCellsCount]=\\\"unlockedColumnsCount\\\"\\n >
\\n \\n \"\n },] },\n ];\n /** @nocollapse */\n HeaderComponent.ctorParameters = function () { return [\n { type: SinglePopupService },\n { type: DragHintService },\n { type: DropCueService },\n { type: ColumnReorderService },\n { type: IdService },\n { type: SortService },\n { type: LocalizationService },\n { type: ChangeDetectorRef }\n ]; };\n HeaderComponent.propDecorators = {\n totalColumnLevels: [{ type: Input }],\n columns: [{ type: Input }],\n groups: [{ type: Input }],\n detailTemplate: [{ type: Input }],\n scrollable: [{ type: Input }],\n filterable: [{ type: Input }],\n sort: [{ type: Input }],\n filter: [{ type: Input }],\n sortable: [{ type: Input }],\n groupable: [{ type: Input }],\n lockedColumnsCount: [{ type: Input }],\n resizable: [{ type: Input }],\n reorderable: [{ type: Input }],\n columnMenu: [{ type: Input }],\n columnMenuTemplate: [{ type: Input }],\n totalColumnsCount: [{ type: Input }],\n headerClass: [{ type: HostBinding, args: ['class.k-grid-header',] }],\n dropTargets: [{ type: ViewChildren, args: [DropTargetDirective,] }]\n };\n return HeaderComponent;\n}());\n\n// TODO\n// tslint:disable:rxjs-no-unsafe-takeuntil\n/**\n * @hidden\n */\nvar fromPercentage = function (value, percent) {\n var sign = percent < 0 ? -1 : 1;\n return Math.ceil((Math.abs(percent) / 100) * value) * sign;\n};\n/**\n * @hidden\n */\nvar toPercentage = function (value, whole) { return (value / whole) * 100; };\n/**\n * @hidden\n */\nvar headerWidth = function (handle) { return handle.nativeElement.parentElement.offsetWidth; };\n/**\n * @hidden\n */\nvar allLeafColumns = function (columns) { return expandColumns(columns)\n .filter(function (c) { return !c.isColumnGroup; }); };\n/**\n * @hidden\n */\nvar stopPropagation = function (_a) {\n var event = _a.originalEvent;\n event.stopPropagation();\n event.preventDefault();\n};\n/**\n * @hidden\n */\nvar createMoveStream = function (service, draggable) { return function (mouseDown) {\n return draggable.kendoDrag.pipe(takeUntil(draggable.kendoRelease.pipe(tap(function () { return service.end(); }))), map(function (_a) {\n var pageX = _a.pageX;\n return ({\n originalX: mouseDown.pageX,\n pageX: pageX\n });\n }));\n}; };\n/**\n * @hidden\n */\nvar preventOnDblClick$1 = function (release) { return function (mouseDown) {\n return of(mouseDown).pipe(delay(150), takeUntil(release));\n}; };\n/**\n * @hidden\n */\nvar isInSpanColumn$1 = function (column) { return !!(column.parent && column.parent.isSpanColumn); };\n/**\n * @hidden\n *\n * Calculates the column index. If the column is stated in `SpanColumn`,\n * the index for all child columns equals the index of the first child.\n */\nvar indexOf = function (target, list) {\n var index = 0;\n var ignore = 0;\n var skip = 0;\n while (index < list.length) {\n var current = list[index];\n var isParentSpanColumn = isInSpanColumn$1(current);\n if (current === target) {\n break;\n }\n if ((ignore-- <= 0) && isParentSpanColumn) {\n ignore = current.parent.childColumns.length - 1;\n skip += ignore;\n }\n index++;\n }\n return index - skip;\n};\n/**\n * @hidden\n */\nvar ColumnHandleDirective = /** @class */ (function () {\n function ColumnHandleDirective(draggable, element, service, zone, cdr, localization) {\n this.draggable = draggable;\n this.element = element;\n this.service = service;\n this.zone = zone;\n this.cdr = cdr;\n this.localization = localization;\n this.columns = [];\n this.subscriptions = new Subscription();\n this.rtl = false;\n }\n Object.defineProperty(ColumnHandleDirective.prototype, \"visible\", {\n get: function () {\n return this.column.resizable ? 'block' : 'none';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ColumnHandleDirective.prototype, \"leftStyle\", {\n get: function () {\n return isTruthy(this.rtl) ? 0 : null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ColumnHandleDirective.prototype, \"rightStyle\", {\n get: function () {\n return isTruthy(this.rtl) ? null : 0;\n },\n enumerable: true,\n configurable: true\n });\n ColumnHandleDirective.prototype.autoFit = function () {\n var _this = this;\n var allLeafs = allLeafColumns(this.columns);\n var currentLeafs = leafColumns([this.column]).filter(function (column) { return isTruthy(column.resizable); });\n var columnInfo = currentLeafs.map(function (column) {\n var isParentSpan = isInSpanColumn$1(column);\n var isLastInSpan = isParentSpan ? column.parent.childColumns.last === column : false;\n var index = indexOf(column, allLeafs);\n return {\n column: column,\n headerIndex: _this.columnsForLevel(column.level).indexOf(column),\n index: index,\n isLastInSpan: isLastInSpan,\n isParentSpan: isParentSpan,\n level: column.level\n };\n });\n currentLeafs.forEach(function (column) { return column.width = 0; });\n this.service.measureColumns(columnInfo);\n };\n ColumnHandleDirective.prototype.ngOnInit = function () {\n var _this = this;\n var service = this.service.changes.pipe(filter(function () { return _this.column.resizable; }), filter(function (e) { return isPresent(e.columns.find(function (column) { return column === _this.column; })); }));\n this.subscriptions.add(service.pipe(filter(function (e) { return e.type === 'start'; }))\n .subscribe(this.initState.bind(this)));\n this.subscriptions.add(service.pipe(filter(function (e) { return e.type === 'resizeColumn'; }))\n .subscribe(this.resize.bind(this)));\n this.subscriptions.add(this.service.changes.pipe(filter(function (e) { return e.type === 'start'; }), filter(this.shouldUpdate.bind(this)), take(1) //on first resize only\n ).subscribe(this.initColumnWidth.bind(this)));\n this.subscriptions.add(this.zone.runOutsideAngular(function () {\n return _this.draggable.kendoPress.pipe(tap(stopPropagation), tap(function () { return _this.service.start(_this.column); }), switchMap(preventOnDblClick$1(_this.draggable.kendoRelease)), switchMap(createMoveStream(_this.service, _this.draggable)))\n .subscribe(function (_a) {\n var pageX = _a.pageX, originalX = _a.originalX;\n var delta = pageX - originalX;\n var percent = toPercentage(delta, _this.column.resizeStartWidth || _this.column.width);\n _this.service.resizeColumns(percent);\n });\n }));\n this.subscriptions.add(service.pipe(filter(function (e) { return e.type === 'autoFitComplete'; }))\n .subscribe(this.sizeToFit.bind(this)));\n this.subscriptions.add(service.pipe(filter(function (e) { return e.type === 'triggerAutoFit'; }))\n .subscribe(this.autoFit.bind(this)));\n this.subscriptions.add(this.localization.changes.subscribe(function (_a) {\n var rtl = _a.rtl;\n return _this.rtl = rtl;\n }));\n };\n ColumnHandleDirective.prototype.ngOnDestroy = function () {\n if (this.subscriptions) {\n this.subscriptions.unsubscribe();\n }\n };\n ColumnHandleDirective.prototype.shouldUpdate = function () {\n return !allLeafColumns(this.columns)\n .map(function (column) { return column.width; })\n .some(isBlank);\n };\n ColumnHandleDirective.prototype.initColumnWidth = function () {\n this.column.width = headerWidth(this.element);\n };\n ColumnHandleDirective.prototype.initState = function () {\n this.column.resizeStartWidth = headerWidth(this.element);\n this.service.resizedColumn({\n column: this.column,\n oldWidth: this.column.resizeStartWidth\n });\n };\n ColumnHandleDirective.prototype.resize = function (_a) {\n var deltaPercent = _a.deltaPercent;\n var delta = fromPercentage(this.column.resizeStartWidth, deltaPercent);\n if (isTruthy(this.rtl)) {\n delta *= -1;\n }\n var newWidth = Math.max(this.column.resizeStartWidth + delta, this.column.minResizableWidth);\n var tableDelta = newWidth > this.column.minResizableWidth ?\n delta : this.column.minResizableWidth - this.column.resizeStartWidth;\n this.updateWidth(this.column, newWidth);\n this.service.resizeTable(this.column, tableDelta);\n };\n ColumnHandleDirective.prototype.sizeToFit = function (_a) {\n var columns = _a.columns, widths = _a.widths;\n var index = columns.indexOf(this.column);\n var width = Math.max.apply(Math, widths.map(function (w) { return w[index]; })) + 1; //add 1px for IE\n var tableDelta = width - this.column.resizeStartWidth;\n this.updateWidth(this.column, width);\n this.service.resizeTable(this.column, tableDelta);\n };\n ColumnHandleDirective.prototype.updateWidth = function (column, width) {\n column.width = width;\n this.cdr.markForCheck(); //force CD cycle\n };\n ColumnHandleDirective.prototype.columnsForLevel = function (level) {\n return columnsToRender(this.columns ? this.columns.filter(function (column) { return column.level === level; }) : []);\n };\n ColumnHandleDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoGridColumnHandle]'\n },] },\n ];\n /** @nocollapse */\n ColumnHandleDirective.ctorParameters = function () { return [\n { type: DraggableDirective, decorators: [{ type: Host }] },\n { type: ElementRef },\n { type: ColumnResizingService },\n { type: NgZone },\n { type: ChangeDetectorRef },\n { type: LocalizationService }\n ]; };\n ColumnHandleDirective.propDecorators = {\n columns: [{ type: Input }],\n column: [{ type: Input }],\n visible: [{ type: HostBinding, args: ['style.display',] }],\n leftStyle: [{ type: HostBinding, args: ['style.left',] }],\n rightStyle: [{ type: HostBinding, args: ['style.right',] }],\n autoFit: [{ type: HostListener, args: ['dblclick',] }]\n };\n return ColumnHandleDirective;\n}());\n\n/**\n * Represents the select-all checkbox feature of the Grid ([see example]({% slug selection_grid %}#toc-select-all-feature)).\n */\nvar SelectAllCheckboxDirective = /** @class */ (function () {\n function SelectAllCheckboxDirective(selectionService, el, renderer, ngZone) {\n var _this = this;\n this.selectionService = selectionService;\n this.el = el;\n this.renderer = renderer;\n this.ngZone = ngZone;\n /**\n * Fires when the user clicks the `kendoGridSelectAllCheckbox` select-all checkbox\n * ([see example]({% slug selection_grid %}#toc-select-all-feature)).\n */\n this.selectAllChange = new EventEmitter();\n this.type = \"checkbox\";\n this.stateSet = false;\n this.ngZone.runOutsideAngular(function () {\n _this.destroyClick = _this.renderer.listen(_this.el.nativeElement, \"click\", _this.onClick.bind(_this));\n });\n }\n SelectAllCheckboxDirective.prototype.ngAfterContentChecked = function () {\n this.setState();\n };\n SelectAllCheckboxDirective.prototype.ngOnChanges = function () {\n this.stateSet = true;\n };\n SelectAllCheckboxDirective.prototype.ngOnDestroy = function () {\n if (this.destroyClick) {\n this.destroyClick();\n }\n };\n /**\n * @hidden\n */\n SelectAllCheckboxDirective.prototype.onClick = function () {\n var _this = this;\n var isChecked = this.el.nativeElement.checked;\n var options = this.selectionService.options;\n this.selectAllChange.emit(isChecked ? \"checked\" : \"unchecked\");\n if (options.enabled && options.mode === \"multiple\") {\n this.ngZone.run(function () {\n _this.selectionService.updateAll(isChecked);\n });\n }\n };\n /**\n * @hidden\n */\n SelectAllCheckboxDirective.prototype.setState = function () {\n var state$$1 = this.stateSet ? this.stateToBool() : this.selectionService.selectAllState;\n var elem = this.el.nativeElement;\n this.renderer.setProperty(elem, \"indeterminate\", !isPresent(state$$1));\n this.renderer.setProperty(elem, \"checked\", isPresent(state$$1) ? state$$1 : false);\n };\n /**\n * @hidden\n */\n SelectAllCheckboxDirective.prototype.stateToBool = function () {\n switch (this.state) {\n case \"checked\":\n return true;\n case \"unchecked\":\n return false;\n default:\n return undefined;\n }\n };\n SelectAllCheckboxDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoGridSelectAllCheckbox]'\n },] },\n ];\n /** @nocollapse */\n SelectAllCheckboxDirective.ctorParameters = function () { return [\n { type: SelectionService },\n { type: ElementRef },\n { type: Renderer2 },\n { type: NgZone }\n ]; };\n SelectAllCheckboxDirective.propDecorators = {\n state: [{ type: Input }],\n selectAllChange: [{ type: Output }],\n type: [{ type: HostBinding, args: ['attr.type',] }]\n };\n return SelectAllCheckboxDirective;\n}());\n\n/**\n * @hidden\n */\nvar FilterMenuComponent = /** @class */ (function () {\n function FilterMenuComponent(filterService, popupService, localization) {\n this.filterService = filterService;\n this.popupService = popupService;\n this.localization = localization;\n /**\n * @hidden\n */\n this.filterLabel = this.localization.get('filter');\n }\n Object.defineProperty(FilterMenuComponent.prototype, \"hasFilters\", {\n get: function () {\n return filtersByField(this.filter, (this.column || {}).field).length > 0;\n },\n enumerable: true,\n configurable: true\n });\n FilterMenuComponent.prototype.toggle = function (anchor, template) {\n this.popupRef = this.popupService.open(anchor, template, this.popupRef);\n return false;\n };\n FilterMenuComponent.prototype.close = function () {\n this.popupService.destroy();\n };\n FilterMenuComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-filter-menu',\n template: \"\\n \\n \\n \\n \\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n FilterMenuComponent.ctorParameters = function () { return [\n { type: FilterService },\n { type: SinglePopupService },\n { type: LocalizationService }\n ]; };\n FilterMenuComponent.propDecorators = {\n column: [{ type: Input }],\n filter: [{ type: Input }]\n };\n return FilterMenuComponent;\n}());\n\nvar isNoValueOperator = function (operator) { return (operator === \"isnull\"\n || operator === \"isnotnull\"\n || operator === \"isempty\"\n || operator === \"isnotempty\"); };\nvar validFilters = function (_a) {\n var value = _a.value, operator = _a.operator;\n return !isNullOrEmptyString(value) || isNoValueOperator(operator);\n};\nvar trimFilters = function (filter$$1) {\n filter$$1.filters = filter$$1.filters.filter(validFilters);\n return filter$$1;\n};\nvar findParent = function (filters, field, parent) {\n return filters.reduce(function (acc, filter$$1) {\n if (acc) {\n return acc;\n }\n if (filter$$1.filters) {\n return findParent(filter$$1.filters, field, filter$$1);\n }\n else if (filter$$1.field === field) {\n return parent;\n }\n return acc;\n }, undefined); // tslint:disable-line:align\n};\nvar parentLogicOfDefault = function (filter$$1, field, def) {\n if (def === void 0) { def = \"and\"; }\n var parent = findParent(((filter$$1 || {}).filters || []), field);\n return isPresent(parent) ? parent.logic : def;\n};\n/**\n * @hidden\n */\nvar FilterMenuContainerComponent = /** @class */ (function () {\n function FilterMenuContainerComponent(parentService, childService, localization, cd) {\n this.parentService = parentService;\n this.childService = childService;\n this.localization = localization;\n this.cd = cd;\n this.close = new EventEmitter();\n /**\n * @hidden\n */\n this.actionsClass = 'k-action-buttons k-button-group';\n this._templateContext = {};\n }\n Object.defineProperty(FilterMenuContainerComponent.prototype, \"filter\", {\n get: function () {\n return this._filter;\n },\n /**\n * The current root filter.\n * @type {CompositeFilterDescriptor}\n */\n set: function (value) {\n this._filter = cloneFilters(value);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FilterMenuContainerComponent.prototype, \"childFilter\", {\n get: function () {\n if (!isPresent(this._childFilter)) {\n this._childFilter = {\n filters: filtersByField(this.filter, (this.column || {}).field),\n logic: parentLogicOfDefault(this.filter, (this.column || {}).field)\n };\n }\n return this._childFilter;\n },\n enumerable: true,\n configurable: true\n });\n FilterMenuContainerComponent.prototype.ngOnInit = function () {\n var _this = this;\n this.subscription = this.childService.changes.subscribe(function (filter$$1) { return _this._childFilter = filter$$1; });\n this.subscription.add(this.localization.changes.subscribe(function () { return _this.cd.markForCheck(); }));\n };\n FilterMenuContainerComponent.prototype.ngOnDestroy = function () {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n };\n Object.defineProperty(FilterMenuContainerComponent.prototype, \"disabled\", {\n get: function () {\n return !this.childFilter.filters.some(validFilters);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FilterMenuContainerComponent.prototype, \"templateContext\", {\n get: function () {\n this._templateContext.column = this.column;\n this._templateContext.filter = this.childFilter;\n this._templateContext.filterService = this.childService;\n // tslint:disable-next-line:no-string-literal\n this._templateContext[\"$implicit\"] = this.childFilter;\n return this._templateContext;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FilterMenuContainerComponent.prototype, \"hasTemplate\", {\n get: function () {\n return isPresent(this.column) && isPresent(this.column.filterMenuTemplateRef);\n },\n enumerable: true,\n configurable: true\n });\n FilterMenuContainerComponent.prototype.submit = function () {\n var filter$$1 = trimFilters(this.childFilter);\n if (filter$$1.filters.length) {\n var root = this.filter || {\n filters: [],\n logic: \"and\"\n };\n removeFilter(root, this.column.field);\n root.filters.push(filter$$1);\n this.parentService.filter(root);\n }\n this.close.emit();\n return false;\n };\n FilterMenuContainerComponent.prototype.reset = function () {\n var root = this.filter || {\n filters: [],\n logic: \"and\"\n };\n removeFilter(root, this.column.field);\n this.parentService.filter(root);\n this.close.emit();\n };\n Object.defineProperty(FilterMenuContainerComponent.prototype, \"clearText\", {\n get: function () {\n return this.localization.get(\"filterClearButton\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FilterMenuContainerComponent.prototype, \"filterText\", {\n get: function () {\n return this.localization.get(\"filterFilterButton\");\n },\n enumerable: true,\n configurable: true\n });\n FilterMenuContainerComponent.decorators = [\n { type: Component, args: [{\n providers: [FilterService],\n selector: 'kendo-grid-filter-menu-container',\n template: \"\\n \\n \"\n },] },\n ];\n /** @nocollapse */\n FilterMenuContainerComponent.ctorParameters = function () { return [\n { type: FilterService, decorators: [{ type: SkipSelf }] },\n { type: FilterService },\n { type: LocalizationService },\n { type: ChangeDetectorRef }\n ]; };\n FilterMenuContainerComponent.propDecorators = {\n close: [{ type: Output }],\n column: [{ type: Input }],\n filter: [{ type: Input }],\n actionsClass: [{ type: Input }]\n };\n return FilterMenuContainerComponent;\n}());\n\n/**\n * @hidden\n */\nvar FilterMenuInputWrapperComponent = /** @class */ (function (_super) {\n __extends(FilterMenuInputWrapperComponent, _super);\n function FilterMenuInputWrapperComponent() {\n return _super.call(this, null) || this;\n }\n Object.defineProperty(FilterMenuInputWrapperComponent.prototype, \"hostClasses\", {\n /**\n * @hidden\n */\n get: function () {\n return false;\n },\n enumerable: true,\n configurable: true\n });\n FilterMenuInputWrapperComponent.prototype.operatorChange = function (dataItem) {\n this.currentOperator = dataItem;\n };\n FilterMenuInputWrapperComponent.prototype.filterChange = function (filter$$1) {\n this.applyFilter(filter$$1);\n };\n Object.defineProperty(FilterMenuInputWrapperComponent.prototype, \"currentFilter\", {\n /**\n * The current filter for the associated column field.\n * @readonly\n * @type {FilterDescriptor}\n */\n get: function () {\n return this._currentFilter;\n },\n /**\n * The current filter for the associated column field.\n * @readonly\n * @type {FilterDescriptor}\n */\n set: function (value) {\n this._currentFilter = value;\n },\n enumerable: true,\n configurable: true\n });\n FilterMenuInputWrapperComponent.prototype.updateFilter = function (filter$$1) {\n Object.assign(this.currentFilter, filter$$1);\n return this.filter;\n };\n FilterMenuInputWrapperComponent.prototype.onChange = function (value) {\n this.filterChange(this.updateFilter({\n field: this.column.field,\n operator: this.currentOperator,\n value: value\n }));\n };\n FilterMenuInputWrapperComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-filter-menu-input-wrapper',\n template: \"\\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n FilterMenuInputWrapperComponent.ctorParameters = function () { return []; };\n FilterMenuInputWrapperComponent.propDecorators = {\n filterService: [{ type: Input }],\n currentFilter: [{ type: Input }]\n };\n return FilterMenuInputWrapperComponent;\n}(FilterInputWrapperComponent));\n\n/**\n * @hidden\n */\nvar StringFilterMenuInputComponent = /** @class */ (function () {\n function StringFilterMenuInputComponent() {\n this.operators = [];\n }\n StringFilterMenuInputComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-string-filter-menu-input',\n template: \"\\n \\n \\n \\n \"\n },] },\n ];\n StringFilterMenuInputComponent.propDecorators = {\n operators: [{ type: Input }],\n column: [{ type: Input }],\n filter: [{ type: Input }],\n operator: [{ type: Input }],\n currentFilter: [{ type: Input }],\n filterService: [{ type: Input }]\n };\n return StringFilterMenuInputComponent;\n}());\n\n/**\n * Represents a string-filter menu component.\n * ([see example]({% slug builtinfiltertemplate_grid %}#toc-configuration-components-for-filter-templates)).\n */\nvar StringFilterMenuComponent = /** @class */ (function (_super) {\n __extends(StringFilterMenuComponent, _super);\n function StringFilterMenuComponent(localization) {\n var _this = _super.call(this, null, localization) || this;\n _this.logicOperators = logicOperators(_this.localization);\n /**\n * The current menu filter.\n * @type {CompositeFilterDescriptor}\n */\n _this.filter = { filters: [], logic: \"and\" };\n /**\n * Determines if the inputs of second criteria will displayed.\n */\n _this.extra = true;\n return _this;\n }\n Object.defineProperty(StringFilterMenuComponent.prototype, \"hostClasses\", {\n /**\n * @hidden\n */\n get: function () {\n return false;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(StringFilterMenuComponent.prototype, \"firstFilter\", {\n get: function () {\n return setFilter(0, this.filter, (this.column || {}).field, this.operator);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(StringFilterMenuComponent.prototype, \"secondFilter\", {\n get: function () {\n return setFilter(1, this.filter, (this.column || {}).field, this.operator);\n },\n enumerable: true,\n configurable: true\n });\n StringFilterMenuComponent.prototype.logicChange = function (value) {\n this.filter.logic = value;\n };\n StringFilterMenuComponent.prototype.localizationChange = function () {\n this.logicOperators = logicOperators(this.localization);\n _super.prototype.localizationChange.call(this);\n };\n StringFilterMenuComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-string-filter-menu',\n template: \"\\n \\n \\n \\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n StringFilterMenuComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n StringFilterMenuComponent.propDecorators = {\n hostClasses: [{ type: HostBinding, args: ['class.k-filtercell',] }],\n column: [{ type: Input }],\n filter: [{ type: Input }],\n extra: [{ type: Input }],\n filterService: [{ type: Input }]\n };\n return StringFilterMenuComponent;\n}(StringFilterComponent));\n\n/**\n * Represents a numeric-filter menu component.\n *\n * @example\n * ```html-no-run\n * \n * \n * \n * \n * \n * \n * ```\n */\nvar NumericFilterMenuComponent = /** @class */ (function (_super) {\n __extends(NumericFilterMenuComponent, _super);\n function NumericFilterMenuComponent(localization) {\n var _this = _super.call(this, null, localization) || this;\n _this.logicOperators = logicOperators(_this.localization);\n /**\n * The current menu filter.\n * @type {CompositeFilterDescriptor}\n */\n _this.filter = { filters: [], logic: \"and\" };\n /**\n * Determines if the inputs of second criteria will displayed.\n */\n _this.extra = true;\n return _this;\n }\n Object.defineProperty(NumericFilterMenuComponent.prototype, \"hostClasses\", {\n /**\n * @hidden\n */\n get: function () {\n return false;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NumericFilterMenuComponent.prototype, \"firstFilter\", {\n get: function () {\n return setFilter(0, this.filter, (this.column || {}).field, this.operator);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(NumericFilterMenuComponent.prototype, \"secondFilter\", {\n get: function () {\n return setFilter(1, this.filter, (this.column || {}).field, this.operator);\n },\n enumerable: true,\n configurable: true\n });\n NumericFilterMenuComponent.prototype.logicChange = function (value) {\n this.filter.logic = value;\n };\n NumericFilterMenuComponent.prototype.localizationChange = function () {\n this.logicOperators = logicOperators(this.localization);\n _super.prototype.localizationChange.call(this);\n };\n NumericFilterMenuComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-numeric-filter-menu',\n template: \"\\n \\n \\n \\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n NumericFilterMenuComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n NumericFilterMenuComponent.propDecorators = {\n hostClasses: [{ type: HostBinding, args: ['class.k-filtercell',] }],\n column: [{ type: Input }],\n filter: [{ type: Input }],\n extra: [{ type: Input }],\n filterService: [{ type: Input }]\n };\n return NumericFilterMenuComponent;\n}(NumericFilterComponent));\n\n/**\n * @hidden\n */\nvar NumericFilterMenuInputComponent = /** @class */ (function () {\n function NumericFilterMenuInputComponent() {\n this.operators = [];\n /**\n * Specifies the value which is used to increment or decrement the component value.\n * @type {numeric}\n */\n this.step = 1;\n /**\n * Specifies whether the **Up** and **Down** spin buttons will be rendered.\n * @type {boolean}\n */\n this.spinners = true;\n }\n NumericFilterMenuInputComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-numeric-filter-menu-input',\n template: \"\\n \\n \\n \\n \\n \"\n },] },\n ];\n NumericFilterMenuInputComponent.propDecorators = {\n operators: [{ type: Input }],\n column: [{ type: Input }],\n filter: [{ type: Input }],\n operator: [{ type: Input }],\n currentFilter: [{ type: Input }],\n filterService: [{ type: Input }],\n step: [{ type: Input }],\n min: [{ type: Input }],\n max: [{ type: Input }],\n spinners: [{ type: Input }],\n decimals: [{ type: Input }],\n format: [{ type: Input }]\n };\n return NumericFilterMenuInputComponent;\n}());\n\n/**\n * Represents a date-filter menu component.\n *\n * @example\n * ```html-no-run\n * \n * \n * \n * \n * \n * \n * ```\n */\nvar DateFilterMenuComponent = /** @class */ (function (_super) {\n __extends(DateFilterMenuComponent, _super);\n function DateFilterMenuComponent(localization) {\n var _this = _super.call(this, null, localization) || this;\n _this.logicOperators = logicOperators(_this.localization);\n /**\n * The current menu filter.\n * @type {CompositeFilterDescriptor}\n */\n _this.filter = { filters: [], logic: \"and\" };\n /**\n * Determines if the inputs of second criteria will be displayed.\n */\n _this.extra = true;\n return _this;\n }\n Object.defineProperty(DateFilterMenuComponent.prototype, \"hostClasses\", {\n /**\n * @hidden\n */\n get: function () {\n return false;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateFilterMenuComponent.prototype, \"firstFilter\", {\n get: function () {\n return setFilter(0, this.filter, (this.column || {}).field, this.operator);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateFilterMenuComponent.prototype, \"secondFilter\", {\n get: function () {\n return setFilter(1, this.filter, (this.column || {}).field, this.operator);\n },\n enumerable: true,\n configurable: true\n });\n DateFilterMenuComponent.prototype.logicChange = function (value) {\n this.filter.logic = value;\n };\n DateFilterMenuComponent.prototype.localizationChange = function () {\n this.logicOperators = logicOperators(this.localization);\n _super.prototype.localizationChange.call(this);\n };\n DateFilterMenuComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-date-filter-menu',\n template: \"\\n \\n \\n \\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n DateFilterMenuComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n DateFilterMenuComponent.propDecorators = {\n hostClasses: [{ type: HostBinding, args: ['class.k-filtercell',] }],\n column: [{ type: Input }],\n filter: [{ type: Input }],\n extra: [{ type: Input }],\n filterService: [{ type: Input }]\n };\n return DateFilterMenuComponent;\n}(DateFilterComponent));\n\n/**\n * Represents a Boolean-filter menu component.\n *\n * @example\n * ```html-no-run\n * \n * \n * \n * \n * \n * \n * ```\n */\nvar BooleanFilterMenuComponent = /** @class */ (function (_super) {\n __extends(BooleanFilterMenuComponent, _super);\n function BooleanFilterMenuComponent(localization) {\n var _this = _super.call(this, null, localization) || this;\n /**\n * The current menu filter.\n * @type {CompositeFilterDescriptor}\n */\n _this.filter = { filters: [], logic: \"and\" };\n _this.idPrefix = guid();\n return _this;\n }\n Object.defineProperty(BooleanFilterMenuComponent.prototype, \"hostClasses\", {\n /**\n * @hidden\n */\n get: function () {\n return false;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n */\n BooleanFilterMenuComponent.prototype.radioId = function (value) {\n return this.idPrefix + \"_\" + value;\n };\n /**\n * @hidden\n */\n BooleanFilterMenuComponent.prototype.onChange = function (value) {\n this.applyFilter(this.updateFilter({\n field: this.column.field,\n operator: \"eq\",\n value: value\n }));\n };\n /**\n * @hidden\n */\n BooleanFilterMenuComponent.prototype.isSelected = function (radioValue) {\n return this.filtersByField(this.column.field).some(function (_a) {\n var value = _a.value;\n return value === radioValue;\n });\n };\n BooleanFilterMenuComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-boolean-filter-menu',\n template: \"\\n \\n \"\n },] },\n ];\n /** @nocollapse */\n BooleanFilterMenuComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n BooleanFilterMenuComponent.propDecorators = {\n hostClasses: [{ type: HostBinding, args: ['class.k-filtercell',] }],\n filter: [{ type: Input }],\n filterService: [{ type: Input }]\n };\n return BooleanFilterMenuComponent;\n}(BooleanFilterComponent));\n\n/**\n * @hidden\n *\n * > List the following components as `entryComponents` in the GridModule.\n */\nvar filterMenuComponentFactory = function (type) { return ({\n \"boolean\": BooleanFilterMenuComponent,\n \"date\": DateFilterMenuComponent,\n \"numeric\": NumericFilterMenuComponent,\n \"text\": StringFilterMenuComponent\n}[type]); };\n\n/**\n * @hidden\n */\nvar FilterMenuHostDirective = /** @class */ (function (_super) {\n __extends(FilterMenuHostDirective, _super);\n function FilterMenuHostDirective(host, resolver) {\n return _super.call(this, host, resolver) || this;\n }\n FilterMenuHostDirective.prototype.componentType = function () {\n if (isPresent(this.column) && !isNullOrEmptyString(this.column.filter)) {\n return filterMenuComponentFactory(this.column.filter);\n }\n return StringFilterMenuComponent;\n };\n FilterMenuHostDirective.prototype.initComponent = function (ctx) {\n _super.prototype.initComponent.call(this, ctx);\n this.component.instance.filterService = this.filterService;\n };\n FilterMenuHostDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoFilterMenuHost]'\n },] },\n ];\n /** @nocollapse */\n FilterMenuHostDirective.ctorParameters = function () { return [\n { type: ViewContainerRef },\n { type: ComponentFactoryResolver }\n ]; };\n FilterMenuHostDirective.propDecorators = {\n filterService: [{ type: Input }]\n };\n return FilterMenuHostDirective;\n}(FilterHostDirective));\n\n/**\n * @hidden\n */\nvar DateFilterMenuInputComponent = /** @class */ (function () {\n function DateFilterMenuInputComponent(popupService) {\n this.popupService = popupService;\n this.operators = [];\n }\n DateFilterMenuInputComponent.prototype.open = function (picker) {\n this.subscription = this.popupService.onClose\n .pipe(filter(function () { return picker.isActive; }))\n .subscribe(function (e) { return e.preventDefault(); });\n };\n DateFilterMenuInputComponent.prototype.ngOnDestroy = function () {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n };\n DateFilterMenuInputComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-date-filter-menu-input',\n template: \"\\n \\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n DateFilterMenuInputComponent.ctorParameters = function () { return [\n { type: SinglePopupService }\n ]; };\n DateFilterMenuInputComponent.propDecorators = {\n operators: [{ type: Input }],\n column: [{ type: Input }],\n filter: [{ type: Input }],\n operator: [{ type: Input }],\n currentFilter: [{ type: Input }],\n filterService: [{ type: Input }],\n format: [{ type: Input }],\n formatPlaceholder: [{ type: Input }],\n placeholder: [{ type: Input }],\n min: [{ type: Input }],\n max: [{ type: Input }],\n activeView: [{ type: Input }],\n bottomView: [{ type: Input }],\n topView: [{ type: Input }],\n weekNumber: [{ type: Input }]\n };\n return DateFilterMenuInputComponent;\n}());\n\nvar INTERNAL_COMPONENTS$2 = [\n FilterMenuComponent,\n FilterMenuContainerComponent,\n FilterMenuInputWrapperComponent,\n StringFilterMenuInputComponent,\n StringFilterMenuComponent,\n FilterMenuTemplateDirective,\n NumericFilterMenuComponent,\n NumericFilterMenuInputComponent,\n DateFilterMenuInputComponent,\n DateFilterMenuComponent,\n FilterMenuHostDirective,\n BooleanFilterMenuComponent\n];\nvar ENTRY_COMPONENTS$1 = [\n StringFilterMenuComponent,\n NumericFilterMenuComponent,\n DateFilterMenuComponent,\n BooleanFilterMenuComponent\n];\n/**\n * @hidden\n */\nvar FilterMenuModule = /** @class */ (function () {\n function FilterMenuModule() {\n }\n FilterMenuModule.exports = function () {\n return [\n StringFilterMenuComponent,\n FilterMenuTemplateDirective,\n NumericFilterMenuComponent,\n DateFilterMenuComponent,\n BooleanFilterMenuComponent,\n SharedFilterModule.exports()\n ];\n };\n FilterMenuModule.decorators = [\n { type: NgModule, args: [{\n declarations: [INTERNAL_COMPONENTS$2],\n entryComponents: ENTRY_COMPONENTS$1,\n exports: [INTERNAL_COMPONENTS$2, SharedFilterModule],\n imports: [SharedFilterModule]\n },] },\n ];\n return FilterMenuModule;\n}());\n\n/**\n * @hidden\n */\nvar ColumnListComponent = /** @class */ (function () {\n function ColumnListComponent(element, ngZone, renderer) {\n this.element = element;\n this.ngZone = ngZone;\n this.renderer = renderer;\n this.reset = new EventEmitter();\n this.apply = new EventEmitter();\n this.columnChange = new EventEmitter();\n this.autoSync = true;\n this.allowHideAll = false;\n this.actionsClass = 'k-action-buttons';\n this.unlockedCount = 0;\n }\n Object.defineProperty(ColumnListComponent.prototype, \"className\", {\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ColumnListComponent.prototype, \"columns\", {\n get: function () {\n return this._columns;\n },\n set: function (value) {\n this._columns = value.filter(function (column) { return column.includeInChooser !== false; });\n this.allColumns = value;\n this.updateColumnState();\n },\n enumerable: true,\n configurable: true\n });\n ColumnListComponent.prototype.isDisabled = function (column) {\n return !(this.allowHideAll || this.hasFiltered || column.hidden || this.columns.find(function (current) { return current !== column && !current.hidden; })) ||\n (this.hasVisibleLocked && !this.hasUnlockedFiltered && this.unlockedCount === 1 && !column.locked && !column.hidden);\n };\n ColumnListComponent.prototype.ngOnInit = function () {\n var _this = this;\n if (!this.element) {\n return;\n }\n this.ngZone.runOutsideAngular(function () {\n _this.domSubscriptions = _this.renderer.listen(_this.element.nativeElement, 'click', function (e) {\n if (hasClasses(e.target, 'k-checkbox')) {\n if (_this.autoSync) {\n var index = parseInt(e.target.getAttribute('data-index'), 10);\n var column_1 = _this.columns[index];\n var hidden_1 = !e.target.checked;\n if (Boolean(column_1.hidden) !== hidden_1) {\n _this.ngZone.run(function () {\n column_1.hidden = hidden_1;\n _this.columnChange.emit([column_1]);\n });\n }\n }\n else {\n _this.updateDisabled();\n }\n }\n });\n });\n };\n ColumnListComponent.prototype.ngOnDestroy = function () {\n if (this.domSubscriptions) {\n this.domSubscriptions();\n }\n };\n ColumnListComponent.prototype.cancelChanges = function () {\n var _this = this;\n this.forEachCheckBox(function (element, index) {\n element.checked = !_this.columns[index].hidden;\n });\n this.updateDisabled();\n this.reset.emit();\n };\n ColumnListComponent.prototype.applyChanges = function () {\n var _this = this;\n var changed = [];\n this.forEachCheckBox(function (element, index) {\n var column = _this.columns[index];\n var hidden = !element.checked;\n if (Boolean(column.hidden) !== hidden) {\n column.hidden = hidden;\n changed.push(column);\n }\n });\n this.updateDisabled();\n this.apply.emit(changed);\n };\n ColumnListComponent.prototype.forEachCheckBox = function (callback) {\n var checkboxes = this.element.nativeElement.getElementsByClassName('k-checkbox');\n var length = checkboxes.length;\n for (var idx = 0; idx < length; idx++) {\n callback(checkboxes[idx], idx);\n }\n };\n ColumnListComponent.prototype.updateDisabled = function () {\n if (this.allowHideAll && !this.hasLocked) {\n return;\n }\n var checkedItems = [];\n this.forEachCheckBox(function (checkbox, index) {\n if (checkbox.checked) {\n checkedItems.push({ checkbox: checkbox, index: index });\n }\n checkbox.disabled = false;\n });\n if (!this.allowHideAll && checkedItems.length === 1 && !this.hasFiltered) {\n checkedItems[0].checkbox.disabled = true;\n }\n else if (this.hasLocked && !this.hasUnlockedFiltered) {\n var columns_1 = this.columns;\n var checkedUnlocked = checkedItems.filter(function (item) { return !columns_1[item.index].locked; });\n if (checkedUnlocked.length === 1) {\n checkedUnlocked[0].checkbox.disabled = true;\n }\n }\n };\n ColumnListComponent.prototype.updateColumnState = function () {\n this.hasLocked = this.allColumns.filter(function (column) { return column.locked && (!column.hidden || column.includeInChooser !== false); }).length > 0;\n this.hasVisibleLocked = this.allColumns.filter(function (column) { return column.locked && !column.hidden; }).length > 0;\n this.unlockedCount = this.columns.filter(function (column) { return !column.locked && !column.hidden; }).length;\n var filteredColumns = this.allColumns.filter(function (column) { return column.includeInChooser === false && !column.hidden; });\n if (filteredColumns.length) {\n this.hasFiltered = filteredColumns.length > 0;\n this.hasUnlockedFiltered = filteredColumns.filter(function (column) { return !column.locked; }).length > 0;\n }\n else {\n this.hasFiltered = false;\n this.hasUnlockedFiltered = false;\n }\n };\n ColumnListComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-columnlist',\n template: \"\\n \\n \\n
\\n \\n \\n \\n
\\n \"\n },] },\n ];\n /** @nocollapse */\n ColumnListComponent.ctorParameters = function () { return [\n { type: ElementRef },\n { type: NgZone },\n { type: Renderer2 }\n ]; };\n ColumnListComponent.propDecorators = {\n className: [{ type: HostBinding, args: [\"class.k-column-list-wrapper\",] }],\n reset: [{ type: Output }],\n apply: [{ type: Output }],\n columnChange: [{ type: Output }],\n columns: [{ type: Input }],\n autoSync: [{ type: Input }],\n allowHideAll: [{ type: Input }],\n applyText: [{ type: Input }],\n resetText: [{ type: Input }],\n actionsClass: [{ type: Input }]\n };\n return ColumnListComponent;\n}());\n\n/**\n * Represents the component for selecting columns in the Grid. To enable the user to show or hide columns,\n * add the component inside a [`ToolbarTemplate`]({% slug api_grid_toolbartemplatedirective %}) directive.\n *\n * @example\n * {% meta height:300 %}\n * ```ts-preview\n *\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * \n * \n * \n * \n * \n * `\n * })\n *\n * class AppComponent {\n * public data: any[] = [{ Field1: 'Foo', Field2: 'Bar' }];\n * }\n *\n * ```\n * {% endmeta %}\n */\nvar ColumnChooserComponent = /** @class */ (function () {\n function ColumnChooserComponent(localization, columnInfoService, popupService, ngZone, renderer, changeDetector) {\n this.localization = localization;\n this.columnInfoService = columnInfoService;\n this.popupService = popupService;\n this.ngZone = ngZone;\n this.renderer = renderer;\n this.changeDetector = changeDetector;\n /**\n * Specifies if the changes in the visibility of the column will be immediately applied.\n */\n this.autoSync = false;\n /**\n * Specifies if all columns can be hidden.\n */\n this.allowHideAll = true;\n }\n Object.defineProperty(ColumnChooserComponent.prototype, \"columns\", {\n get: function () {\n return this.columnInfoService.leafNamedColumns;\n },\n enumerable: true,\n configurable: true\n });\n ColumnChooserComponent.prototype.ngOnDestroy = function () {\n this.close();\n };\n /**\n * @hidden\n */\n ColumnChooserComponent.prototype.toggle = function (anchor, template) {\n var _this = this;\n if (!this.popupRef) {\n var direction = this.localization.rtl ? 'right' : 'left';\n this.popupRef = this.popupService.open({\n anchor: anchor,\n content: template,\n positionMode: 'absolute',\n anchorAlign: { vertical: 'bottom', horizontal: direction },\n popupAlign: { vertical: 'top', horizontal: direction }\n });\n this.renderer.setAttribute(this.popupRef.popupElement, 'dir', this.localization.rtl ? 'rtl' : 'ltr');\n this.ngZone.runOutsideAngular(function () {\n return _this.closeClick = _this.renderer.listen(\"document\", \"click\", function (_a) {\n var target = _a.target;\n if (!closest(target, function (node) { return node === _this.popupRef.popupElement || node === anchor; })) {\n _this.close();\n }\n });\n });\n }\n else {\n this.close();\n }\n };\n /**\n * @hidden\n */\n ColumnChooserComponent.prototype.onApply = function (changed) {\n this.close();\n if (changed.length) {\n this.changeDetector.markForCheck();\n this.columnInfoService.changeVisibility(changed);\n }\n };\n /**\n * @hidden\n */\n ColumnChooserComponent.prototype.onChange = function (changed) {\n this.changeDetector.markForCheck();\n this.columnInfoService.changeVisibility(changed);\n };\n ColumnChooserComponent.prototype.close = function () {\n if (this.popupRef) {\n this.popupRef.close();\n this.popupRef = null;\n }\n this.detachClose();\n };\n ColumnChooserComponent.prototype.detachClose = function () {\n if (this.closeClick) {\n this.closeClick();\n this.closeClick = null;\n }\n };\n ColumnChooserComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-column-chooser',\n template: \"\\n \\n \\n {{ localization.get('columns') }}\\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n ColumnChooserComponent.ctorParameters = function () { return [\n { type: LocalizationService },\n { type: ColumnInfoService },\n { type: PopupService },\n { type: NgZone },\n { type: Renderer2 },\n { type: ChangeDetectorRef }\n ]; };\n ColumnChooserComponent.propDecorators = {\n autoSync: [{ type: Input }],\n allowHideAll: [{ type: Input }]\n };\n return ColumnChooserComponent;\n}());\n\n/**\n * Represents the service that is passed to the\n * [`ColumnMenuTemplate`]({% slug api_grid_columnmenutemplatedirective %}) directive.\n *\n * @example\n * ```ts-preview\n *\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * \n * \n * \n * \n * \n * \n * \n * `\n * })\n *\n * class AppComponent {\n * public data: any[] = [{ Field1: 'Foo', Field2: 'Bar' }];\n * }\n *\n * ```\n */\nvar ColumnMenuService = /** @class */ (function () {\n function ColumnMenuService() {\n /**\n * @hidden\n */\n this.closeMenu = new EventEmitter();\n }\n /**\n * Closes the column menu.\n */\n ColumnMenuService.prototype.close = function () {\n this.closeMenu.emit();\n };\n ColumnMenuService.decorators = [\n { type: Injectable },\n ];\n return ColumnMenuService;\n}());\n\n/**\n * @hidden\n */\nvar ColumnMenuItemBase = /** @class */ (function () {\n function ColumnMenuItemBase() {\n this.hostClass = true;\n }\n ColumnMenuItemBase.prototype.ngOnInit = function () {\n if (isDevMode() && !this.service) {\n throw new Error('The service input of the predefined column menu components is mandatory.');\n }\n };\n /**\n * @hidden\n */\n ColumnMenuItemBase.prototype.close = function () {\n this.service.close();\n };\n ColumnMenuItemBase.propDecorators = {\n service: [{ type: Input }],\n hostClass: [{ type: HostBinding, args: ['class.k-columnmenu-item-wrapper',] }]\n };\n return ColumnMenuItemBase;\n}());\n\n/* tslint:disable:max-line-length */\n/**\n * Represents the component for selecting columns in the Grid that can be placed\n * inside a [`ColumnMenuTemplate`]({% slug api_grid_columnmenutemplatedirective %}) directive.\n *\n * > You have to set the [ColumnMenuService]({% slug api_grid_columnmenuservice %}) that is passed by\n * > the template to the service input of the `kendo-grid-columnmenu-chooser` component.\n *\n * @example\n * {% meta height:300 %}\n * ```ts-preview\n *\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * \n * \n * \n * \n * \n * \n * `\n * })\n *\n * class AppComponent {\n * public data: any[] = [{ Field1: 'Foo', Field2: 'Bar' }];\n * }\n *\n * ```\n * {% endmeta %}\n */\nvar ColumnMenuChooserComponent = /** @class */ (function (_super) {\n __extends(ColumnMenuChooserComponent, _super);\n function ColumnMenuChooserComponent(localization, columnInfoService, changeDetector) {\n var _this = _super.call(this) || this;\n _this.localization = localization;\n _this.columnInfoService = columnInfoService;\n _this.changeDetector = changeDetector;\n /**\n * Fires when the content is expanded.\n */\n _this.expand = new EventEmitter();\n /**\n * Fires when the content is collapsed.\n */\n _this.collapse = new EventEmitter();\n /**\n * Specifies if the content is expanded.\n */\n _this.expanded = false;\n /**\n * @hidden\n */\n _this.actionsClass = 'k-columnmenu-actions';\n return _this;\n }\n Object.defineProperty(ColumnMenuChooserComponent.prototype, \"columns\", {\n get: function () {\n return this.columnInfoService.leafNamedColumns;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n */\n ColumnMenuChooserComponent.prototype.onApply = function (changed) {\n this.close();\n if (changed.length) {\n this.changeDetector.markForCheck();\n this.columnInfoService.changeVisibility(changed);\n }\n };\n ColumnMenuChooserComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-columnmenu-chooser',\n template: \"\\n \\n \\n \\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n ColumnMenuChooserComponent.ctorParameters = function () { return [\n { type: LocalizationService },\n { type: ColumnInfoService },\n { type: ChangeDetectorRef }\n ]; };\n ColumnMenuChooserComponent.propDecorators = {\n expand: [{ type: Output }],\n collapse: [{ type: Output }],\n expanded: [{ type: Input }]\n };\n return ColumnMenuChooserComponent;\n}(ColumnMenuItemBase));\n\n/* tslint:disable:max-line-length */\n/**\n * Represents the component for editing column filters in the Grid that can be placed\n * inside a [`ColumnMenuTemplate`]({% slug api_grid_columnmenutemplatedirective %}) directive.\n *\n * > You have to set the [ColumnMenuService]({% slug api_grid_columnmenuservice %}) that is passed by\n * > the template to the service input of the `kendo-grid-columnmenu-filter` component.\n *\n * @example\n * {% meta height:400 %}\n * ```ts-preview\n *\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * \n * \n * \n * \n * \n * \n * `\n * })\n *\n * class AppComponent {\n * public data: any[] = [{ Field1: 'Foo', Field2: 'Bar' }];\n * }\n *\n * ```\n * {% endmeta %}\n */\nvar ColumnMenuFilterComponent = /** @class */ (function (_super) {\n __extends(ColumnMenuFilterComponent, _super);\n function ColumnMenuFilterComponent(localization) {\n var _this = _super.call(this) || this;\n _this.localization = localization;\n /**\n * Fires when the content is expanded.\n */\n _this.expand = new EventEmitter();\n /**\n * Fires when the content is collapsed.\n */\n _this.collapse = new EventEmitter();\n /**\n * Specifies if the content is expanded.\n */\n _this.expanded = false;\n /**\n * @hidden\n */\n _this.actionsClass = 'k-columnmenu-actions';\n return _this;\n }\n ColumnMenuFilterComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-columnmenu-filter',\n template: \"\\n \\n \\n \\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n ColumnMenuFilterComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n ColumnMenuFilterComponent.propDecorators = {\n expand: [{ type: Output }],\n collapse: [{ type: Output }],\n expanded: [{ type: Input }]\n };\n return ColumnMenuFilterComponent;\n}(ColumnMenuItemBase));\n\n/* tslint:disable:max-line-length */\n/**\n * Represents the content template of the\n * [`kendo-grid-columnmenu-item`]({% slug api_grid_columnmenuitemcomponent %}) component.\n * Provides an option for specifying the content of a column item.\n * To define the content template, nest an `` tag with the\n * `kendoGridColumnMenuItemContentTemplate` directive inside a ``.\n *\n * @example\n * ```ts-preview\n *\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * \n * \n * Item Content\n * \n * \n * \n * \n * \n * \n * `\n * })\n *\n * class AppComponent {\n * public data: any[] = [{ Field1: 'Foo', Field2: 'Bar' }];\n * }\n *\n * ```\n */\nvar ColumnMenuItemContentTemplateDirective = /** @class */ (function () {\n function ColumnMenuItemContentTemplateDirective(templateRef) {\n this.templateRef = templateRef;\n }\n ColumnMenuItemContentTemplateDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoGridColumnMenuItemContentTemplate]'\n },] },\n ];\n /** @nocollapse */\n ColumnMenuItemContentTemplateDirective.ctorParameters = function () { return [\n { type: TemplateRef, decorators: [{ type: Optional }] }\n ]; };\n return ColumnMenuItemContentTemplateDirective;\n}());\n\n/**\n * Represents an item that can be placed inside a\n * [`ColumnMenuTemplate`]({% slug api_grid_columnmenutemplatedirective %}) directive.\n *\n * @example\n * ```ts-preview\n *\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * \n * \n * \n * \n * \n * \n * `\n * })\n *\n * class AppComponent {\n * public data: any[] = [{ Field1: 'Foo', Field2: 'Bar' }];\n * }\n *\n * ```\n */\nvar ColumnMenuItemComponent = /** @class */ (function () {\n function ColumnMenuItemComponent() {\n /**\n * Fires when the item is clicked.\n */\n this.itemClick = new EventEmitter();\n /**\n * Fires when the content is expanded.\n */\n this.expand = new EventEmitter();\n /**\n * Fires when the content is collapsed.\n */\n this.collapse = new EventEmitter();\n this.contentState = 'collapsed';\n }\n Object.defineProperty(ColumnMenuItemComponent.prototype, \"iconClass\", {\n get: function () {\n return \"k-i-\" + this.icon;\n },\n enumerable: true,\n configurable: true\n });\n ColumnMenuItemComponent.prototype.ngOnChanges = function (changes) {\n if (changes.expanded) {\n this.updateContentState();\n }\n };\n /**\n * @hidden\n */\n ColumnMenuItemComponent.prototype.onClick = function (e) {\n this.itemClick.emit(e);\n if (this.contentTemplate) {\n this.expanded = !this.expanded;\n this.updateContentState();\n if (this.expanded) {\n this.expand.emit();\n }\n else {\n this.collapse.emit();\n }\n }\n };\n ColumnMenuItemComponent.prototype.updateContentState = function () {\n this.contentState = this.expanded ? 'expanded' : 'collapsed';\n };\n ColumnMenuItemComponent.decorators = [\n { type: Component, args: [{\n animations: [\n trigger('state', [\n state('collapsed', style({ display: 'none' })),\n state('expanded', style({ display: 'block' })),\n transition('collapsed => expanded', [\n style({\n height: '0px',\n display: 'block'\n }),\n animate('100ms ease-in', style({\n height: '*'\n }))\n ]),\n transition('expanded => collapsed', [\n style({\n height: '*'\n }),\n animate('100ms ease-in', style({\n height: '0px'\n }))\n ])\n ])\n ],\n selector: 'kendo-grid-columnmenu-item',\n template: \"\\n \\n \\n \\n {{ text }}\\n
\\n \\n
\\n \\n
\\n \"\n },] },\n ];\n ColumnMenuItemComponent.propDecorators = {\n itemClick: [{ type: Output }],\n expand: [{ type: Output }],\n collapse: [{ type: Output }],\n icon: [{ type: Input }],\n text: [{ type: Input }],\n selected: [{ type: Input }],\n disabled: [{ type: Input }],\n expanded: [{ type: Input }],\n contentTemplate: [{ type: ContentChild, args: [ColumnMenuItemContentTemplateDirective,] }]\n };\n return ColumnMenuItemComponent;\n}());\n\n/* tslint:disable:max-line-length */\n/**\n * Represents a column-menu item for sorting Grid columns that can be placed inside a\n * [`ColumnMenuTemplate`]({% slug api_grid_columnmenutemplatedirective %}) directive.\n * Allows the user to sort the column.\n *\n * > You have to set the [ColumnMenuService]({% slug api_grid_columnmenuservice %}) that is passed by\n * > the template to the service input of the `kendo-grid-columnmenu-sort` component.\n *\n * @example\n * ```ts-preview\n *\n * _@Component({\n * selector: 'my-app',\n * template: `\n *
\n * \n * \n * \n * \n * \n * \n * \n * `\n * })\n *\n * class AppComponent {\n * public data: any[] = [{ Field1: 'Foo', Field2: 'Bar' }, { Field1: 'Foo1', Field2: 'Bar1' }];\n * }\n *\n * ```\n */\nvar ColumnMenuSortComponent = /** @class */ (function (_super) {\n __extends(ColumnMenuSortComponent, _super);\n function ColumnMenuSortComponent(localization, sortService) {\n var _this = _super.call(this) || this;\n _this.localization = localization;\n _this.sortService = sortService;\n return _this;\n }\n Object.defineProperty(ColumnMenuSortComponent.prototype, \"sortedAsc\", {\n get: function () {\n var descriptor = this.descriptor;\n return descriptor && (!descriptor.dir || descriptor.dir === 'asc');\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ColumnMenuSortComponent.prototype, \"sortedDesc\", {\n get: function () {\n var descriptor = this.descriptor;\n return descriptor && descriptor.dir === 'desc';\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n */\n ColumnMenuSortComponent.prototype.toggleSort = function (dir) {\n var field = this.service.column.field;\n var _a = normalize$1(this.service.sortable), mode = _a.mode, allowUnsort = _a.allowUnsort;\n var descriptor = this.descriptor;\n var sort = mode === 'multiple' ? this.service.sort.filter(function (s) { return s.field !== field; }) : [];\n if (descriptor && descriptor.dir === dir) {\n if (!allowUnsort) {\n return;\n }\n }\n else {\n sort.push({ field: field, dir: dir });\n }\n this.sortService.sort(sort);\n this.close();\n };\n Object.defineProperty(ColumnMenuSortComponent.prototype, \"descriptor\", {\n get: function () {\n var _this = this;\n return [].concat(this.service.sort || []).find(function (s) { return s.field === _this.service.column.field; });\n },\n enumerable: true,\n configurable: true\n });\n ColumnMenuSortComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-columnmenu-sort',\n template: \"\\n
\\n \\n
\\n \\n \"\n },] },\n ];\n /** @nocollapse */\n ColumnMenuSortComponent.ctorParameters = function () { return [\n { type: LocalizationService },\n { type: SortService }\n ]; };\n return ColumnMenuSortComponent;\n}(ColumnMenuItemBase));\n\nvar POPUP_CLASS = 'k-grid-columnmenu-popup';\n/**\n * Represents the [column menu]({% slug columnmenu_grid %}) component.\n */\nvar ColumnMenuComponent = /** @class */ (function () {\n function ColumnMenuComponent(popupService, localization, service) {\n this.popupService = popupService;\n this.localization = localization;\n this.service = service;\n /**\n * @hidden\n */\n this.standalone = true;\n /**\n * The settings for the Column Menu.\n */\n this.settings = {};\n /**\n * @hidden\n */\n this.sortable = true;\n /**\n * @hidden\n */\n this.expandedFilter = false;\n /**\n * @hidden\n */\n this.expandedColumns = false;\n this.closeSubscription = service.closeMenu.subscribe(this.close.bind(this));\n }\n Object.defineProperty(ColumnMenuComponent.prototype, \"isActive\", {\n /**\n * @hidden\n */\n get: function () {\n var _this = this;\n return (this.hasFilter && filtersByField(this.filter, this.column.field).length > 0) ||\n (!this.sortable && this.hasSort && this.sort.find(function (descriptor) { return descriptor.field === _this.column.field; }));\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ColumnMenuComponent.prototype, \"hasFilter\", {\n /**\n * @hidden\n */\n get: function () {\n return hasFilter(this.settings, this.column);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ColumnMenuComponent.prototype, \"hasSort\", {\n /**\n * @hidden\n */\n get: function () {\n return hasSort(this.settings, this.column);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ColumnMenuComponent.prototype, \"hasColumnChooser\", {\n /**\n * @hidden\n */\n get: function () {\n return hasColumnChooser(this.settings);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ColumnMenuComponent.prototype, \"hasLock\", {\n /**\n * @hidden\n */\n get: function () {\n return hasLock(this.settings, this.column);\n },\n enumerable: true,\n configurable: true\n });\n ColumnMenuComponent.prototype.ngOnChanges = function () {\n this.service.column = this.column;\n this.service.sort = this.sort;\n this.service.filter = this.filter;\n this.service.sortable = this.sortable;\n };\n ColumnMenuComponent.prototype.ngOnDestroy = function () {\n this.close();\n this.closeSubscription.unsubscribe();\n };\n /**\n * @hidden\n */\n ColumnMenuComponent.prototype.toggle = function (e, anchor, template) {\n e.preventDefault();\n this.expandedFilter = !this.hasColumnChooser;\n this.expandedColumns = !this.hasFilter;\n this.popupRef = this.popupService.open(anchor, template, this.popupRef, POPUP_CLASS);\n };\n /**\n * @hidden\n */\n ColumnMenuComponent.prototype.close = function () {\n this.popupService.destroy();\n this.popupRef = null;\n };\n /**\n * @hidden\n */\n ColumnMenuComponent.prototype.onColumnsExpand = function () {\n this.expandedColumns = true;\n this.expandedFilter = false;\n };\n /**\n * @hidden\n */\n ColumnMenuComponent.prototype.onFilterExpand = function () {\n this.expandedFilter = true;\n this.expandedColumns = false;\n };\n ColumnMenuComponent.decorators = [\n { type: Component, args: [{\n providers: [ColumnMenuService],\n selector: 'kendo-grid-column-menu',\n template: \"\\n
\\n \\n \\n
\\n \\n \\n \\n
\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n ColumnMenuComponent.ctorParameters = function () { return [\n { type: SinglePopupService },\n { type: LocalizationService },\n { type: ColumnMenuService }\n ]; };\n ColumnMenuComponent.propDecorators = {\n standalone: [{ type: HostBinding, args: ['class.k-grid-column-menu-standalone',] }, { type: Input }],\n column: [{ type: Input }],\n settings: [{ type: Input }],\n sort: [{ type: Input }],\n filter: [{ type: Input }],\n sortable: [{ type: Input }],\n columnMenuTemplate: [{ type: Input }]\n };\n return ColumnMenuComponent;\n}());\n\n/* tslint:disable:max-line-length */\n/**\n * Represents a column-menu item that can be placed inside a\n * [`ColumnMenuTemplate`]({% slug api_grid_columnmenutemplatedirective %}) directive.\n * Allows the user to lock or unlock the columns.\n *\n * > You have to set the [ColumnMenuService]({% slug api_grid_columnmenuservice %}) that is passed by\n * > the template to the service input of the `kendo-grid-columnmenu-lock` component.\n *\n * @example\n * ```ts-preview\n *\n * _@Component({\n * selector: 'my-app',\n * template: `\n *
\n * \n * \n * \n * \n * \n * \n * \n * `\n * })\n *\n * class AppComponent {\n * public data: any[] = [{ Field1: 'Foo', Field2: 'Bar' }];\n * }\n *\n * ```\n */\nvar ColumnMenuLockComponent = /** @class */ (function (_super) {\n __extends(ColumnMenuLockComponent, _super);\n function ColumnMenuLockComponent(localization, columnInfoService, changeDetector) {\n var _this = _super.call(this) || this;\n _this.localization = localization;\n _this.columnInfoService = columnInfoService;\n _this.changeDetector = changeDetector;\n return _this;\n }\n Object.defineProperty(ColumnMenuLockComponent.prototype, \"text\", {\n get: function () {\n return this.localization.get(this.locked ? 'unlock' : 'lock');\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ColumnMenuLockComponent.prototype, \"icon\", {\n get: function () {\n return this.locked ? 'unlock' : 'lock';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ColumnMenuLockComponent.prototype, \"disabled\", {\n get: function () {\n return !this.locked && this.columnInfoService.unlockedRootCount < 2;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n */\n ColumnMenuLockComponent.prototype.toggleColumn = function () {\n this.toggleHierarchy(!this.locked);\n this.close();\n this.changeDetector.markForCheck();\n };\n ColumnMenuLockComponent.prototype.toggleHierarchy = function (locked) {\n var root = this.service.column;\n while (root.parent) {\n root = root.parent;\n }\n var columns = [root];\n var allChanged = [];\n while (columns.length) {\n var column = columns.shift();\n column.locked = locked;\n allChanged.push(column);\n if (column.hasChildren) {\n columns.push.apply(columns, column.childrenArray);\n }\n }\n this.columnInfoService.changeLocked(allChanged);\n };\n Object.defineProperty(ColumnMenuLockComponent.prototype, \"locked\", {\n get: function () {\n return this.service.column.locked;\n },\n enumerable: true,\n configurable: true\n });\n ColumnMenuLockComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-columnmenu-lock',\n template: \"\\n
\\n \\n \"\n },] },\n ];\n /** @nocollapse */\n ColumnMenuLockComponent.ctorParameters = function () { return [\n { type: LocalizationService },\n { type: ColumnInfoService },\n { type: ChangeDetectorRef }\n ]; };\n return ColumnMenuLockComponent;\n}(ColumnMenuItemBase));\n\nvar COMPONENTS$1 = [\n ColumnListComponent,\n ColumnChooserComponent,\n ColumnMenuChooserComponent,\n ColumnMenuFilterComponent,\n ColumnMenuItemComponent,\n ColumnMenuItemContentTemplateDirective,\n ColumnMenuSortComponent,\n ColumnMenuComponent,\n ColumnMenuLockComponent,\n ColumnMenuTemplateDirective\n];\n/**\n * @hidden\n */\nvar ColumnMenuModule = /** @class */ (function () {\n function ColumnMenuModule() {\n }\n ColumnMenuModule.exports = function () {\n return [\n ColumnChooserComponent,\n ColumnMenuFilterComponent,\n ColumnMenuItemComponent,\n ColumnMenuItemContentTemplateDirective,\n ColumnMenuSortComponent,\n ColumnMenuLockComponent,\n ColumnMenuChooserComponent,\n ColumnMenuTemplateDirective,\n ColumnMenuComponent\n ];\n };\n ColumnMenuModule.decorators = [\n { type: NgModule, args: [{\n declarations: [COMPONENTS$1],\n imports: [CommonModule, FilterMenuModule],\n exports: [COMPONENTS$1]\n },] },\n ];\n return ColumnMenuModule;\n}());\n\nvar exportedModules$2 = [\n HeaderComponent,\n HeaderTemplateDirective,\n ColumnHandleDirective,\n SelectAllCheckboxDirective\n];\nvar importedModules$2 = [\n CommonModule,\n GroupModule,\n RowFilterModule,\n FilterMenuModule,\n SharedModule,\n DragAndDropModule,\n ColumnMenuModule\n];\n/**\n * @hidden\n */\nvar HeaderModule = /** @class */ (function () {\n function HeaderModule() {\n }\n HeaderModule.exports = function () {\n return [\n HeaderTemplateDirective,\n SelectAllCheckboxDirective\n ];\n };\n HeaderModule.decorators = [\n { type: NgModule, args: [{\n declarations: [exportedModules$2],\n exports: [exportedModules$2],\n imports: importedModules$2.slice()\n },] },\n ];\n return HeaderModule;\n}());\n\n/**\n * Represents the command columns of the Grid. You have to define the content of the\n * column inside an `
` tag. The template context is set to the current\n * data item. For more information and examples on using the passed fields\n * and the command directives, refer to the article on\n * [editing the Grid in Angular Reactive Forms]({% slug editing_reactive_forms_grid %}).\n *\n * The following additional fields are passed:\n * - `columnIndex`—The current column index.\n * - `rowIndex`—The current data row index. If inside a new item row, `rowIndex`is `-1`.\n * - `dataItem`—The current data item.\n * - `column`—The current column instance.\n * - `isNew`—The state of the current item.\n *\n * Usually, the template contains CRUD command directives such as:\n * - [`EditCommandDirective`]({% slug api_grid_editcommanddirective %})\n * - [`RemoveCommandDirective`]({% slug api_grid_removecommanddirective %})\n * - [`CancelCommandDirective`]({% slug api_grid_cancelcommanddirective %})\n * - [`SaveCommandDirective`]({% slug api_grid_savecommanddirective %})\n *\n * @example\n * ```ts-preview\n *\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * `\n * })\n *\n * class AppComponent {\n * public gridData: any[];\n *\n * constructor() {\n * this.gridData = products;\n * }\n * }\n *\n * const products = [{\n * \"ProductID\": 1,\n * \"ProductName\": \"Chai\",\n * \"UnitPrice\": 18.0000,\n * \"Discontinued\": true\n * }, {\n * \"ProductID\": 2,\n * \"ProductName\": \"Chang\",\n * \"UnitPrice\": 19.0000,\n * \"Discontinued\": false\n * }\n * ];\n *\n * ```\n */\nvar CommandColumnComponent = /** @class */ (function (_super) {\n __extends(CommandColumnComponent, _super);\n function CommandColumnComponent(parent) {\n var _this = _super.call(this, parent) || this;\n _this.parent = parent;\n return _this;\n }\n Object.defineProperty(CommandColumnComponent.prototype, \"templateRef\", {\n get: function () {\n return this.template ? this.template.templateRef : undefined;\n },\n enumerable: true,\n configurable: true\n });\n CommandColumnComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: ColumnBase$1,\n useExisting: forwardRef(function () { return CommandColumnComponent; })\n }\n ],\n selector: 'kendo-grid-command-column',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n CommandColumnComponent.ctorParameters = function () { return [\n { type: ColumnBase$1, decorators: [{ type: SkipSelf }, { type: Host }, { type: Optional }] }\n ]; };\n CommandColumnComponent.propDecorators = {\n template: [{ type: ContentChild, args: [CellTemplateDirective,] }]\n };\n return CommandColumnComponent;\n}(ColumnBase$1));\n\n/**\n * Represents the checkbox for selecting columns in the Grid. If the column is\n * defined as empty, it renders a default checkbox for row selection.\n * You can also define the content of the column inside an `` tag.\n * The input requires you to include the `SelectionCheckbox` option.\n *\n * The template context is set to the current data item and the following additional fields are passed:\n * - `columnIndex`—The current column index.\n * - `rowIndex`—The current data row index. If inside a new item row, it will be `-1`.\n * - `dataItem`—The current data item.\n * - `column`—The current column instance.\n * - `isNew`—The state of the current item.\n *\n * For more examples, refer to:\n * - [Selecting or deselecting all items on a page]({% slug selection_grid %}#toc-select-all-feature)\n * - [Persisting the selection]({% slug selection_grid %}#toc-in-combination-with-the-select-all-feature)\n *\n * @example\n * ```ts-preview\n *\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * \n * \n * \n * \n * \n * \n * \n * Select row \n * \n * \n * \n * `\n * })\n *\n * class AppComponent {\n * public gridData: any[];\n *\n * constructor() {\n * this.gridData = products;\n * }\n * }\n *\n * const products = [{\n * \"ProductID\": 1,\n * \"ProductName\": \"Chai\",\n * \"UnitPrice\": 18.0000,\n * \"Discontinued\": true\n * }, {\n * \"ProductID\": 2,\n * \"ProductName\": \"Chang\",\n * \"UnitPrice\": 19.0000,\n * \"Discontinued\": false\n * }\n * ];\n *\n * ```\n */\nvar CheckboxColumnComponent = /** @class */ (function (_super) {\n __extends(CheckboxColumnComponent, _super);\n function CheckboxColumnComponent(parent) {\n var _this = _super.call(this, parent) || this;\n _this.parent = parent;\n /*\n * @hidden\n */\n _this.isCheckboxColumn = true;\n return _this;\n }\n Object.defineProperty(CheckboxColumnComponent.prototype, \"templateRef\", {\n get: function () {\n return this.template ? this.template.templateRef : undefined;\n },\n enumerable: true,\n configurable: true\n });\n CheckboxColumnComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: ColumnBase$1,\n useExisting: forwardRef(function () { return CheckboxColumnComponent; })\n }\n ],\n selector: 'kendo-grid-checkbox-column',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n CheckboxColumnComponent.ctorParameters = function () { return [\n { type: ColumnBase$1, decorators: [{ type: SkipSelf }, { type: Host }, { type: Optional }] }\n ]; };\n CheckboxColumnComponent.propDecorators = {\n showSelectAll: [{ type: Input }],\n template: [{ type: ContentChild, args: [CellTemplateDirective,] }]\n };\n return CheckboxColumnComponent;\n}(ColumnBase$1));\n\n/* tslint:disable:no-input-rename */\n/**\n * Represents the row-selection checkbox of the Grid. The directive expects the\n * index of the current row as an input parameter. Inside the\n * [`CheckboxColumnComponent`]({% slug api_grid_checkboxcolumncomponent %}), apply the\n * directive to an `input` element. When the user clicks the checkbox that is associated\n * with the directive, a [`selectionChange`]({% slug api_grid_gridcomponent %}#toc-selectionChange)\n * event is triggered.\n *\n * @example\n * ```html-no-run\n * \n * \n * \n * \n * \n * \n * \n * ```\n */\nvar SelectionCheckboxDirective = /** @class */ (function () {\n function SelectionCheckboxDirective(selectionService, el, renderer, ngZone) {\n var _this = this;\n this.selectionService = selectionService;\n this.el = el;\n this.renderer = renderer;\n this.ngZone = ngZone;\n this.type = \"checkbox\";\n this.ngZone.runOutsideAngular(function () {\n _this.destroyClick = _this.renderer.listen(_this.el.nativeElement, \"click\", _this.onClick.bind(_this));\n _this.destroyKeyDown = _this.renderer.listen(_this.el.nativeElement, \"keydown\", _this.onKeyDown.bind(_this));\n });\n }\n SelectionCheckboxDirective.prototype.ngAfterContentChecked = function () {\n this.setCheckedState();\n };\n SelectionCheckboxDirective.prototype.ngOnDestroy = function () {\n if (this.destroyClick) {\n this.destroyClick();\n }\n if (this.destroyKeyDown) {\n this.destroyKeyDown();\n }\n };\n SelectionCheckboxDirective.prototype.onClick = function () {\n var _this = this;\n if (this.selectionService.options.enabled) {\n this.ngZone.run(function () {\n var ev = _this.selectionService.toggleByIndex(_this.itemIndex);\n ev.ctrlKey = true;\n ev.shiftKey = false;\n _this.selectionService.changes.emit(ev);\n });\n }\n };\n SelectionCheckboxDirective.prototype.onKeyDown = function (e) {\n if (e.keyCode === Keys.Enter) {\n this.onClick();\n }\n };\n /*\n * @hidden\n */\n SelectionCheckboxDirective.prototype.setCheckedState = function () {\n this.renderer.setProperty(this.el.nativeElement, \"checked\", this.selectionService.isSelected(this.itemIndex));\n };\n SelectionCheckboxDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoGridSelectionCheckbox]'\n },] },\n ];\n /** @nocollapse */\n SelectionCheckboxDirective.ctorParameters = function () { return [\n { type: SelectionService },\n { type: ElementRef },\n { type: Renderer2 },\n { type: NgZone }\n ]; };\n SelectionCheckboxDirective.propDecorators = {\n itemIndex: [{ type: Input, args: [\"kendoGridSelectionCheckbox\",] }],\n type: [{ type: HostBinding, args: ['attr.type',] }]\n };\n return SelectionCheckboxDirective;\n}());\n\nvar columnCellIndex = function (cell, cells) {\n var cellIndex = 0;\n for (var idx = 0; idx < cells.length; idx++) {\n if (cells[idx] === cell) {\n return cellIndex;\n }\n if (!hasClasses(cells[idx], 'k-hierarchy-cell k-group-cell')) {\n cellIndex++;\n }\n }\n};\n/**\n * @hidden\n */\nvar TableBodyComponent = /** @class */ (function () {\n function TableBodyComponent(detailsService, groupsService, changeNotification, editService, localization, ngZone, renderer, element, domEvents, selectionService, columnInfoService, navigationService) {\n var _this = this;\n this.detailsService = detailsService;\n this.groupsService = groupsService;\n this.changeNotification = changeNotification;\n this.editService = editService;\n this.localization = localization;\n this.ngZone = ngZone;\n this.renderer = renderer;\n this.element = element;\n this.domEvents = domEvents;\n this.selectionService = selectionService;\n this.columnInfoService = columnInfoService;\n this.navigationService = navigationService;\n this.columns = [];\n this.groups = [];\n this.skip = 0;\n this.noRecordsText = this.localization.get('noRecords');\n this.isLocked = false;\n this.skipGroupDecoration = false;\n this.showGroupFooters = false;\n this.lockedColumnsCount = 0;\n this.totalColumnsCount = 0;\n this.trackBy = defaultTrackBy;\n this.rowClass = function () { return null; };\n this.cellKeydownSubscription = this.navigationService.cellKeydown.subscribe(function (args) { return _this.cellKeydownHandler(args); });\n this.trackByWrapper = this.trackByWrapper.bind(this);\n this.trackByColumns = this.trackByColumns.bind(this);\n }\n Object.defineProperty(TableBodyComponent.prototype, \"newDataItem\", {\n get: function () {\n return this.editService.newDataItem;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TableBodyComponent.prototype, \"unlockedColumnsCount\", {\n // Number of unlocked columns in the next table, if any\n get: function () {\n return this.totalColumnsCount - this.lockedColumnsCount - (this.allColumns || this.columns).length;\n },\n enumerable: true,\n configurable: true\n });\n TableBodyComponent.prototype.toggleRow = function (index, dataItem) {\n this.detailsService.toggleRow(index, dataItem);\n return false;\n };\n TableBodyComponent.prototype.isExpanded = function (index) {\n return this.detailsService.isExpanded(index);\n };\n TableBodyComponent.prototype.detailButtonStyles = function (index) {\n return this.isExpanded(index) ? 'k-minus' : 'k-plus';\n };\n TableBodyComponent.prototype.detailButtonTitle = function (index) {\n var messageKey = this.isExpanded(index) ? 'detailCollapse' : 'detailExpand';\n return this.localization.get(messageKey);\n };\n TableBodyComponent.prototype.isGroup = function (item) {\n return item.type === 'group';\n };\n TableBodyComponent.prototype.isDataItem = function (item) {\n return !this.isGroup(item) && !this.isFooter(item);\n };\n TableBodyComponent.prototype.isFooter = function (item) {\n return item.type === 'footer';\n };\n TableBodyComponent.prototype.isInExpandedGroup = function (item) {\n return this.groupsService.isInExpandedGroup(item.groupIndex, false);\n };\n TableBodyComponent.prototype.isParentGroupExpanded = function (item) {\n return this.groupsService.isInExpandedGroup(item.index || item.groupIndex);\n };\n TableBodyComponent.prototype.isOdd = function (item) {\n return item.index % 2 !== 0;\n };\n TableBodyComponent.prototype.isSelectable = function () {\n return this.selectable && this.selectable.enabled !== false;\n };\n TableBodyComponent.prototype.isRowSelected = function (item) {\n return this.selectionService.isSelected(item.index);\n };\n TableBodyComponent.prototype.trackByWrapper = function (index, item) {\n if (item.type === 'data') {\n item.isEditing = this.editService.hasEdited(item.index);\n }\n return this.trackBy(index, item);\n };\n TableBodyComponent.prototype.trackByColumns = function (index, item) {\n return this.virtualColumns ? index : item;\n };\n TableBodyComponent.prototype.ngDoCheck = function () {\n if (this.hasGroupHeaderColumn) {\n this.groupHeaderColumns = columnsToRender(this.skipGroupDecoration ? this.columns : this.columns.toArray().slice(1));\n }\n else {\n this.groupHeaderColumns = [];\n }\n if (this.isLocked) {\n this.groupHeaderSlaveCellsCount =\n this.hasGroupHeaderColumn ? this.columnsContainer.nonLockedColumnsToRender.length : 1;\n }\n else {\n this.groupHeaderSlaveCellsCount = 0;\n }\n };\n TableBodyComponent.prototype.ngOnChanges = function (changes) {\n if (isChanged(\"columns\", changes, false)) {\n this.changeNotification.notify();\n }\n };\n TableBodyComponent.prototype.logicalRowIndex = function (rowIndex) {\n var pos = this.skip + rowIndex;\n if (this.hasDetailTemplate) {\n pos *= 2;\n }\n var absoluteRowIndex = 1 + pos;\n var addRowOffset = this.editService.hasNewItem ? 1 : 0;\n var filterRowOffset = hasFilterRow(this.filterable) ? 1 : 0;\n var headerRowCount = this.columnInfoService.totalLevels + filterRowOffset + addRowOffset;\n return absoluteRowIndex + headerRowCount;\n };\n TableBodyComponent.prototype.addRowLogicalIndex = function () {\n return this.columnInfoService.totalLevels + 1;\n };\n TableBodyComponent.prototype.logicalColIndex = function (column) {\n if (!isPresent(column.leafIndex)) {\n return -1;\n }\n return column.leafIndex + (this.hasDetailTemplate ? 1 : 0);\n };\n TableBodyComponent.prototype.ngOnInit = function () {\n var _this = this;\n this.ngZone.runOutsideAngular(function () {\n var clickHandler = _this.clickHandler.bind(_this);\n var mousedownSubscription = _this.renderer.listen(_this.element.nativeElement, 'mousedown', clickHandler);\n var clickSubscription = _this.renderer.listen(_this.element.nativeElement, 'click', clickHandler);\n var contextmenuSubscription = _this.renderer.listen(_this.element.nativeElement, 'contextmenu', clickHandler);\n _this.clickSubscription = function () {\n mousedownSubscription();\n clickSubscription();\n contextmenuSubscription();\n };\n });\n var originalNoRecordText = this.localization.get('noRecords');\n this.localization.changes.subscribe(function () {\n if (_this.noRecordsText === originalNoRecordText) {\n _this.noRecordsText = _this.localization.get('noRecords');\n originalNoRecordText = _this.noRecordsText;\n }\n });\n };\n TableBodyComponent.prototype.ngOnDestroy = function () {\n if (this.clickSubscription) {\n this.clickSubscription();\n }\n this.cellKeydownSubscription.unsubscribe();\n clearTimeout(this.clickTimeout);\n };\n TableBodyComponent.prototype.isEditingCell = function (index, column) {\n return this.editService.isEditing() && this.editService.isEditedColumn(index, column);\n };\n TableBodyComponent.prototype.isEditingRow = function (index) {\n return this.editService.isEditing() && this.editService.hasEdited(index);\n };\n Object.defineProperty(TableBodyComponent.prototype, \"hasGroupHeaderColumn\", {\n get: function () {\n return this.columnsContainer.hasGroupHeaderColumn;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TableBodyComponent.prototype, \"columnsContainer\", {\n get: function () {\n return this.columnInfoService.columnsContainer;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TableBodyComponent.prototype, \"columnsSpan\", {\n get: function () {\n return columnsSpan(this.columns);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TableBodyComponent.prototype, \"allColumnsSpan\", {\n get: function () {\n return columnsSpan(this.allColumns || this.columns);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TableBodyComponent.prototype, \"colSpan\", {\n get: function () {\n return this.columnsSpan + this.groups.length + (this.hasDetailTemplate ? 1 : 0);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TableBodyComponent.prototype, \"footerColumns\", {\n get: function () {\n return this.isLocked ? this.columnsContainer.lockedColumnsToRender : this.columnsContainer.nonLockedColumnsToRender;\n },\n enumerable: true,\n configurable: true\n });\n TableBodyComponent.prototype.showGroupHeader = function (item) {\n return !item.data.skipHeader;\n };\n Object.defineProperty(TableBodyComponent.prototype, \"hasDetailTemplate\", {\n get: function () {\n return isPresent(this.detailTemplate);\n },\n enumerable: true,\n configurable: true\n });\n TableBodyComponent.prototype.clickHandler = function (eventArg) {\n var _this = this;\n var element = this.element.nativeElement;\n var target = eventArg.target;\n var cell, row, body, gridElement;\n var currentTarget = target;\n do {\n cell = closest(currentTarget, matchesNodeName('td'));\n row = closest(cell, matchesNodeName('tr'));\n body = closest(row, matchesNodeName('tbody'));\n currentTarget = body;\n gridElement = closestInScope(currentTarget, matchesClasses('k-grid'), element);\n } while (body && body !== element && !gridElement);\n if (cell && !hasClasses(cell, NON_DATA_CELL_CLASSES) &&\n !hasClasses(row, NON_DATA_ROW_CLASSES) &&\n body === element && !gridElement) {\n this.editService.preventCellClose();\n var focusable = target !== cell && isFocusableWithTabKey(target, false);\n if (!focusable && !matchesNodeName('label')(target) && !hasClasses(target, IGNORE_TARGET_CLASSSES) &&\n !closestInScope(target, matchesClasses(IGNORE_CONTAINER_CLASSES), cell)) {\n var args_1 = this.cellClickArgs(cell, row, eventArg);\n if (eventArg.type === 'mousedown') {\n this.domEvents.cellMousedown.emit(args_1);\n }\n else {\n if (args_1.isEditedColumn || !this.editService.closeCell(eventArg)) {\n if (eventArg.type === 'click') {\n this.clickTimeout = setTimeout(function () {\n _this.emitCellClick(args_1);\n }, 0);\n }\n else {\n this.emitCellClick(args_1);\n }\n }\n }\n }\n }\n };\n TableBodyComponent.prototype.emitCellClick = function (args) {\n this.domEvents.cellClick.emit(Object.assign(args, {\n isEdited: args.isEditedRow || args.isEditedColumn\n }));\n };\n TableBodyComponent.prototype.cellKeydownHandler = function (args) {\n if (args.keyCode === Keys.Enter) {\n this.clickHandler(args);\n }\n };\n TableBodyComponent.prototype.cellClickArgs = function (cell, row, eventArg) {\n var index = columnCellIndex(cell, row.cells);\n var column = this.columns.toArray()[index];\n var columnIndex = this.lockedColumnsCount + index;\n var rowIndex = row.getAttribute('data-kendo-grid-item-index');\n rowIndex = rowIndex ? parseInt(rowIndex, 10) : -1;\n var dataItem = rowIndex === -1 ? this.editService.newDataItem : this.data.at(rowIndex - this.skip);\n var isEditedColumn = this.editService.isEditedColumn(rowIndex, column);\n var isEditedRow = this.editService.isEdited(rowIndex);\n var type = eventArg.type === 'keydown' ? 'click' : eventArg.type;\n return {\n column: column,\n columnIndex: columnIndex,\n dataItem: dataItem,\n isEditedColumn: isEditedColumn,\n isEditedRow: isEditedRow,\n originalEvent: eventArg,\n rowIndex: rowIndex,\n type: type\n };\n };\n TableBodyComponent.decorators = [\n { type: Component, args: [{\n selector: '[kendoGridTableBody]',\n template: \"\\n \\n 0\\\"\\n [logicalCellsCount]=\\\"columns.length\\\"\\n [logicalSlaveCellsCount]=\\\"unlockedColumnsCount\\\">\\n \\n | \\n \\n \\n | \\n \\n | \\n
\\n \\n \\n \\n \\n \\n \\n {{noRecordsText}}\\n \\n | \\n
\\n \\n 0\\\"\\n [logicalCellsCount]=\\\"columns.length\\\"\\n [logicalSlaveCellsCount]=\\\"groupHeaderSlaveCellsCount\\\">\\n
\\n 0\\\"\\n [logicalCellsCount]=\\\"columns.length\\\"\\n [logicalSlaveCellsCount]=\\\"unlockedColumnsCount\\\"\\n [ngClass]=\\\"rowClass({ dataItem: item.data, index: item.index })\\\"\\n [class.k-alt]=\\\"isOdd(item)\\\"\\n [class.k-master-row]=\\\"detailTemplate?.templateRef\\\"\\n [class.k-grid-edit-row]=\\\"isEditingRow(item.index)\\\"\\n [attr.data-kendo-grid-item-index]=\\\"item.index\\\"\\n [class.k-state-selected]=\\\"isSelectable() && isRowSelected(item)\\\">\\n \\n | \\n \\n \\n \\n | \\n \\n | \\n
\\n \\n | \\n | \\n \\n \\n \\n | \\n
\\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n TableBodyComponent.ctorParameters = function () { return [\n { type: DetailsService },\n { type: GroupsService },\n { type: ChangeNotificationService },\n { type: EditService },\n { type: LocalizationService },\n { type: NgZone },\n { type: Renderer2 },\n { type: ElementRef },\n { type: DomEventsService },\n { type: SelectionService },\n { type: ColumnInfoService },\n { type: NavigationService }\n ]; };\n TableBodyComponent.propDecorators = {\n columns: [{ type: Input }],\n allColumns: [{ type: Input }],\n groups: [{ type: Input }],\n detailTemplate: [{ type: Input }],\n noRecordsTemplate: [{ type: Input }],\n data: [{ type: Input }],\n skip: [{ type: Input }],\n selectable: [{ type: Input }],\n filterable: [{ type: Input }],\n noRecordsText: [{ type: Input }],\n isLocked: [{ type: Input }],\n skipGroupDecoration: [{ type: Input }],\n showGroupFooters: [{ type: Input }],\n lockedColumnsCount: [{ type: Input }],\n totalColumnsCount: [{ type: Input }],\n virtualColumns: [{ type: Input }],\n trackBy: [{ type: Input }],\n rowClass: [{ type: Input }]\n };\n return TableBodyComponent;\n}());\n\n/**\n * @hidden\n */\nvar CellComponent = /** @class */ (function () {\n function CellComponent(editService, idService, cellContext) {\n this.editService = editService;\n this.idService = idService;\n this.cellContext = cellContext;\n this.isNew = false;\n this._templateContext = {};\n this._editTemplateContext = {};\n }\n Object.defineProperty(CellComponent.prototype, \"commandCellClass\", {\n get: function () {\n return this.isCommand(this.column);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CellComponent.prototype, \"rowIndex\", {\n get: function () {\n return this._rowIndex;\n },\n set: function (index) {\n this._rowIndex = index;\n this.updateCellContext();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CellComponent.prototype, \"isEdited\", {\n get: function () {\n if (!(this.editService.isEditing() || this.isNew) || !this.isColumnEditable) {\n return false;\n }\n var editContext = this.editService.columnContext(this.rowIndex, this.column);\n return this.isFieldEditable(editContext, this.column);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CellComponent.prototype, \"formGroup\", {\n get: function () {\n return this.editService.context(this.rowIndex).group;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CellComponent.prototype, \"templateContext\", {\n get: function () {\n return this._templateContext;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CellComponent.prototype, \"editTemplateContext\", {\n get: function () {\n this._editTemplateContext.$implicit = this.formGroup;\n this._editTemplateContext.isNew = this.isNew;\n this._editTemplateContext.column = this.column;\n this._editTemplateContext.dataItem = this.dataItem;\n this._editTemplateContext.formGroup = this.formGroup;\n this._editTemplateContext.rowIndex = this.rowIndex;\n return this._editTemplateContext;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CellComponent.prototype, \"format\", {\n get: function () {\n if (isColumnComponent(this.column) && !isNullOrEmptyString(this.column.format)) {\n return extractFormat(this.column.format);\n }\n return undefined;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CellComponent.prototype, \"isBoundColumn\", {\n get: function () {\n return this.column.field && !this.column.templateRef;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CellComponent.prototype, \"isCheckboxColumn\", {\n get: function () {\n return isCheckboxColumn(this.column) && !this.column.templateRef;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CellComponent.prototype, \"selectionCheckboxId\", {\n get: function () {\n return this.idService.selectionCheckboxId(this.rowIndex);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CellComponent.prototype, \"isSpanColumn\", {\n get: function () {\n return isSpanColumn(this.column) && !this.column.templateRef;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CellComponent.prototype, \"childColumns\", {\n get: function () {\n return columnsToRender([this.column]);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CellComponent.prototype, \"isColumnEditable\", {\n get: function () {\n if (!this.column || this.isCommand(this.column)) {\n return false;\n }\n return this.column.editable !== false;\n },\n enumerable: true,\n configurable: true\n });\n CellComponent.prototype.ngDoCheck = function () {\n this.updateCellContext();\n };\n CellComponent.prototype.ngOnChanges = function (_changes) {\n this.updateTemplateContext();\n };\n CellComponent.prototype.isCommand = function (column) {\n return column instanceof CommandColumnComponent;\n };\n CellComponent.prototype.isFieldEditable = function (editContext, column) {\n if (!isPresent(editContext)) {\n return false;\n }\n if (isPresent(column.editTemplate)) {\n return true;\n }\n return isPresent(editContext.group) && isPresent(editContext.group.get(column.field));\n };\n CellComponent.prototype.updateCellContext = function () {\n if (this.cellContext) {\n this.cellContext.rowIndex = this._rowIndex;\n }\n };\n CellComponent.prototype.updateTemplateContext = function () {\n if (!this.column.templateRef) {\n return;\n }\n var context = this._templateContext;\n context.isNew = this.isNew;\n context.column = this.column;\n context.dataItem = this.dataItem;\n context.rowIndex = this.rowIndex;\n context.columnIndex = this.columnIndex;\n context.$implicit = this.dataItem;\n };\n CellComponent.decorators = [\n { type: Component, args: [{\n selector: '[kendoGridCell]',\n template: \"\\n \\n \\n \\n \\n \\n \\n {{ dataItem | valueOf: childColumn.field: childColumn.format}}\\n \\n \\n {{ dataItem | valueOf: column.field: column.format}}\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n\\n \\n\\n \\n\\n \\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n CellComponent.ctorParameters = function () { return [\n { type: EditService },\n { type: IdService },\n { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [CELL_CONTEXT,] }] }\n ]; };\n CellComponent.propDecorators = {\n commandCellClass: [{ type: HostBinding, args: ['class.k-command-cell',] }],\n column: [{ type: Input }],\n columnIndex: [{ type: Input }],\n isNew: [{ type: Input }],\n rowIndex: [{ type: Input }],\n dataItem: [{ type: Input }]\n };\n return CellComponent;\n}());\n\n/**\n * Represents the `edit` command of the Grid. You can apply this directive to any `button`\n * element inside a [`CommandColumnComponent`]({% slug api_grid_commandcolumncomponent %}).\n * When an associated button with the directive is clicked, the\n * [`edit`]({% slug api_grid_gridcomponent %}#toc-edit) event\n * is triggered ([see example]({% slug editing_grid %})).\n *\n * > When the row is in the edit mode, the button with `kendoGridEditCommand` is automatically hidden.\n *\n * @example\n * ```html-no-run\n * \n * \n * \n * \n * \n * \n * \n * ```\n *\n */\nvar EditCommandDirective = /** @class */ (function (_super) {\n __extends(EditCommandDirective, _super);\n function EditCommandDirective(editService, cellContext, element, renderer, localization, ngZone) {\n var _this = _super.call(this, element, renderer, null, localization, ngZone) || this;\n _this.editService = editService;\n _this.cellContext = cellContext;\n /**\n * @hidden\n */\n _this.commandClass = true;\n return _this;\n }\n Object.defineProperty(EditCommandDirective.prototype, \"visible\", {\n /**\n * @hidden\n */\n get: function () {\n return this.isEdited ? 'none' : '';\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n */\n EditCommandDirective.prototype.onClick = function (e) {\n e.preventDefault();\n this.editService.beginEdit(this.rowIndex);\n };\n EditCommandDirective.prototype.ngDoCheck = function () {\n if (this.cellContext) {\n this.rowIndex = this.cellContext.rowIndex;\n this.isEdited = this.editService.isEdited(this.rowIndex);\n }\n };\n EditCommandDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoGridEditCommand]'\n },] },\n ];\n /** @nocollapse */\n EditCommandDirective.ctorParameters = function () { return [\n { type: EditService },\n { type: undefined, decorators: [{ type: Inject, args: [CELL_CONTEXT,] }] },\n { type: ElementRef },\n { type: Renderer2 },\n { type: LocalizationService },\n { type: NgZone }\n ]; };\n EditCommandDirective.propDecorators = {\n visible: [{ type: HostBinding, args: ['style.display',] }],\n commandClass: [{ type: HostBinding, args: ['class.k-grid-edit-command',] }],\n onClick: [{ type: HostListener, args: ['click', ['$event'],] }]\n };\n return EditCommandDirective;\n}(Button));\n\n/**\n * Represents the `cancel` command of the Grid. You can apply this directive to any `button`\n * element inside a [`CommandColumnComponent`]({% slug api_grid_commandcolumncomponent %}).\n * When an associated button with the directive is clicked, the\n * [`cancel`]({% slug api_grid_gridcomponent %}#toc-cancel) event\n * is triggered ([see example]({% slug editing_grid %})).\n *\n * > When the row is not in the edit mode, the button with the `kendoGridCancelCommand` is automatically hidden.\n *\n * @example\n * ```html-no-run\n * \n * \n * \n * \n * \n * \n * \n * ```\n *\n * You can control the content of the button based on the state of the row.\n *\n * @example\n * ```html-no-run\n * \n * \n * \n * \n * \n * \n * \n * ```\n */\nvar CancelCommandDirective = /** @class */ (function (_super) {\n __extends(CancelCommandDirective, _super);\n function CancelCommandDirective(editService, cellContext, element, renderer, localization, ngZone) {\n var _this = _super.call(this, element, renderer, null, localization, ngZone) || this;\n _this.editService = editService;\n _this.cellContext = cellContext;\n /**\n * @hidden\n */\n _this.commandClass = true;\n return _this;\n }\n Object.defineProperty(CancelCommandDirective.prototype, \"visible\", {\n /**\n * @hidden\n */\n get: function () {\n return !this.isEdited ? 'none' : '';\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n */\n CancelCommandDirective.prototype.onClick = function (e) {\n e.preventDefault();\n if (this.isEdited) {\n this.editService.endEdit(this.rowIndex);\n }\n };\n CancelCommandDirective.prototype.ngDoCheck = function () {\n if (this.cellContext) {\n this.rowIndex = this.cellContext.rowIndex;\n this.isEdited = this.editService.isEdited(this.rowIndex);\n }\n };\n CancelCommandDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoGridCancelCommand]'\n },] },\n ];\n /** @nocollapse */\n CancelCommandDirective.ctorParameters = function () { return [\n { type: EditService },\n { type: undefined, decorators: [{ type: Inject, args: [CELL_CONTEXT,] }] },\n { type: ElementRef },\n { type: Renderer2 },\n { type: LocalizationService },\n { type: NgZone }\n ]; };\n CancelCommandDirective.propDecorators = {\n visible: [{ type: HostBinding, args: ['style.display',] }],\n commandClass: [{ type: HostBinding, args: ['class.k-grid-cancel-command',] }],\n onClick: [{ type: HostListener, args: ['click', ['$event'],] }]\n };\n return CancelCommandDirective;\n}(Button));\n\n/**\n * Represents the `save` command of the Grid. You can apply this directive to any `button`\n * element inside a [`CommandColumnComponent`]({% slug api_grid_commandcolumncomponent %}).\n * When an associated button with the directive is clicked, the\n * [`save`]({% slug api_grid_gridcomponent %}#toc-save) event\n * is triggered ([see example]({% slug editing_grid %})).\n *\n * > When the row is not in the edit mode, the button with `kendoGridSaveCommand` is automatically hidden.\n *\n * @example\n * ```html-no-run\n * \n * \n * \n * \n * \n * \n * \n * ```\n *\n * You can control the content of the button based on the state of the row.\n *\n * @example\n * ```html-no-run\n * \n * \n * \n * \n * \n * \n * \n * ```\n */\nvar SaveCommandDirective = /** @class */ (function (_super) {\n __extends(SaveCommandDirective, _super);\n function SaveCommandDirective(editService, cellContext, element, renderer, localization, ngZone) {\n var _this = _super.call(this, element, renderer, null, localization, ngZone) || this;\n _this.editService = editService;\n _this.cellContext = cellContext;\n /**\n * @hidden\n */\n _this.commandClass = true;\n return _this;\n }\n Object.defineProperty(SaveCommandDirective.prototype, \"visible\", {\n /**\n * @hidden\n */\n get: function () {\n return !this.isEdited ? 'none' : '';\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n */\n SaveCommandDirective.prototype.onClick = function (e) {\n e.preventDefault();\n if (this.isEdited) {\n this.editService.save(this.rowIndex);\n }\n };\n SaveCommandDirective.prototype.ngDoCheck = function () {\n if (this.cellContext) {\n this.rowIndex = this.cellContext.rowIndex;\n this.isEdited = this.editService.isEdited(this.rowIndex);\n }\n };\n SaveCommandDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoGridSaveCommand]'\n },] },\n ];\n /** @nocollapse */\n SaveCommandDirective.ctorParameters = function () { return [\n { type: EditService },\n { type: undefined, decorators: [{ type: Inject, args: [CELL_CONTEXT,] }] },\n { type: ElementRef },\n { type: Renderer2 },\n { type: LocalizationService },\n { type: NgZone }\n ]; };\n SaveCommandDirective.propDecorators = {\n visible: [{ type: HostBinding, args: ['style.display',] }],\n commandClass: [{ type: HostBinding, args: ['class.k-grid-save-command',] }],\n onClick: [{ type: HostListener, args: ['click', ['$event'],] }]\n };\n return SaveCommandDirective;\n}(Button));\n\n/**\n * Represents the `remove` command of the Grid. You can apply this directive to any `button` element\n * inside a [`CommandColumnComponent`]({% slug api_grid_commandcolumncomponent %}).\n * When an associated button with the directive is clicked, the\n * [`remove` event]({% slug api_grid_gridcomponent %}#toc-remove)\n * is triggered ([see example]({% slug editing_reactive_forms_grid %})).\n *\n * > When the row is in the edit mode, the button with the `kendoGridRemoveCommand` is automatically hidden.\n *\n * @example\n * ```html-no-run\n * \n * \n * \n * \n * \n * \n * \n * ```\n */\nvar RemoveCommandDirective = /** @class */ (function (_super) {\n __extends(RemoveCommandDirective, _super);\n function RemoveCommandDirective(editService, cellContext, element, renderer, localization, ngZone) {\n var _this = _super.call(this, element, renderer, null, localization, ngZone) || this;\n _this.editService = editService;\n _this.cellContext = cellContext;\n /**\n * @hidden\n */\n _this.commandClass = true;\n return _this;\n }\n Object.defineProperty(RemoveCommandDirective.prototype, \"visible\", {\n /**\n * @hidden\n */\n get: function () {\n return this.isEdited ? 'none' : '';\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n */\n RemoveCommandDirective.prototype.onClick = function (e) {\n e.preventDefault();\n this.editService.remove(this.rowIndex);\n };\n RemoveCommandDirective.prototype.ngDoCheck = function () {\n if (this.cellContext) {\n this.rowIndex = this.cellContext.rowIndex;\n this.isEdited = this.editService.isEdited(this.rowIndex);\n }\n };\n RemoveCommandDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoGridRemoveCommand]'\n },] },\n ];\n /** @nocollapse */\n RemoveCommandDirective.ctorParameters = function () { return [\n { type: EditService },\n { type: undefined, decorators: [{ type: Inject, args: [CELL_CONTEXT,] }] },\n { type: ElementRef },\n { type: Renderer2 },\n { type: LocalizationService },\n { type: NgZone }\n ]; };\n RemoveCommandDirective.propDecorators = {\n visible: [{ type: HostBinding, args: ['style.display',] }],\n commandClass: [{ type: HostBinding, args: ['class.k-grid-remove-command',] }],\n onClick: [{ type: HostListener, args: ['click', ['$event'],] }]\n };\n return RemoveCommandDirective;\n}(Button));\n\n/**\n * Represents the command for adding a new item to the Grid. You can apply this directive to any\n * `button` element inside a [`ToolbarTemplate`]({% slug api_grid_commandcolumncomponent %}).\n * When an associated button with the directive is clicked, the\n * [`add`]({% slug api_grid_gridcomponent %}#toc-add) event is triggered\n * ([see example]({% slug editing_grid %})).\n *\n * @example\n * ```html-no-run\n * \n * \n * \n * \n * \n * ```\n */\nvar AddCommandDirective = /** @class */ (function (_super) {\n __extends(AddCommandDirective, _super);\n function AddCommandDirective(editService, element, renderer, localization, ngZone) {\n var _this = _super.call(this, element, renderer, null, localization, ngZone) || this;\n _this.editService = editService;\n return _this;\n }\n /**\n * @hidden\n */\n AddCommandDirective.prototype.onClick = function (e) {\n e.preventDefault();\n this.editService.beginAdd();\n };\n Object.defineProperty(AddCommandDirective.prototype, \"commandClass\", {\n /**\n * @hidden\n */\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n AddCommandDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoGridAddCommand]'\n },] },\n ];\n /** @nocollapse */\n AddCommandDirective.ctorParameters = function () { return [\n { type: EditService },\n { type: ElementRef },\n { type: Renderer2 },\n { type: LocalizationService },\n { type: NgZone }\n ]; };\n AddCommandDirective.propDecorators = {\n onClick: [{ type: HostListener, args: ['click', ['$event'],] }],\n commandClass: [{ type: HostBinding, args: ['class.k-grid-add-command',] }]\n };\n return AddCommandDirective;\n}(Button));\n\nvar exported$1 = [\n CommandColumnComponent,\n CheckboxColumnComponent,\n SelectionCheckboxDirective,\n CellTemplateDirective,\n EditTemplateDirective,\n TableBodyComponent,\n NoRecordsTemplateDirective,\n CellComponent,\n EditCommandDirective,\n CancelCommandDirective,\n SaveCommandDirective,\n RemoveCommandDirective,\n AddCommandDirective\n];\nvar importedModules$3 = [\n CommonModule,\n ReactiveFormsModule,\n FormsModule,\n SharedModule,\n GroupModule,\n NumericTextBoxModule,\n DatePickerModule\n];\n/**\n * @hidden\n */\nvar BodyModule = /** @class */ (function () {\n function BodyModule() {\n }\n BodyModule.exports = function () {\n return [\n CommandColumnComponent,\n CheckboxColumnComponent,\n SelectionCheckboxDirective,\n CellTemplateDirective,\n NoRecordsTemplateDirective,\n EditTemplateDirective,\n EditCommandDirective,\n CancelCommandDirective,\n SaveCommandDirective,\n RemoveCommandDirective,\n AddCommandDirective\n ];\n };\n BodyModule.decorators = [\n { type: NgModule, args: [{\n declarations: [exported$1],\n exports: [exported$1],\n imports: importedModules$3.slice()\n },] },\n ];\n return BodyModule;\n}());\n\n/**\n * @hidden\n */\nvar FooterComponent = /** @class */ (function () {\n function FooterComponent() {\n this.columns = [];\n this.groups = [];\n this.lockedColumnsCount = 0;\n }\n Object.defineProperty(FooterComponent.prototype, \"footerClass\", {\n get: function () {\n return !this.scrollable;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(FooterComponent.prototype, \"columnsToRender\", {\n get: function () {\n return columnsToRender(this.columns || []);\n },\n enumerable: true,\n configurable: true\n });\n FooterComponent.decorators = [\n { type: Component, args: [{\n selector: '[kendoGridFooter]',\n template: \"\\n \\n \\n \\n | \\n \\n | \\n \\n \\n \\n | \\n
\\n \\n \"\n },] },\n ];\n FooterComponent.propDecorators = {\n columns: [{ type: Input }],\n groups: [{ type: Input }],\n detailTemplate: [{ type: Input }],\n scrollable: [{ type: Input }],\n lockedColumnsCount: [{ type: Input }],\n footerClass: [{ type: HostBinding, args: ['class.k-grid-footer',] }]\n };\n return FooterComponent;\n}());\n\nvar exportedModules$3 = [\n FooterComponent\n];\nvar importedModules$4 = [\n CommonModule,\n SharedModule\n];\n/**\n * @hidden\n */\nvar FooterModule = /** @class */ (function () {\n function FooterModule() {\n }\n FooterModule.exports = function () {\n return [];\n };\n FooterModule.decorators = [\n { type: NgModule, args: [{\n declarations: [exportedModules$3],\n exports: [exportedModules$3],\n imports: importedModules$4.slice()\n },] },\n ];\n return FooterModule;\n}());\n\n/**\n * @hidden\n */\nvar ToolbarComponent = /** @class */ (function () {\n function ToolbarComponent(grid) {\n this.grid = grid;\n this.context = {};\n }\n Object.defineProperty(ToolbarComponent.prototype, \"classNames\", {\n get: function () {\n return 'k-header k-grid-toolbar';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ToolbarComponent.prototype, \"position\", {\n set: function (value) {\n this.context.position = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ToolbarComponent.prototype, \"toolbarTemplateRef\", {\n get: function () {\n return this.grid.toolbarTemplate ? this.grid.toolbarTemplate.templateRef : undefined;\n },\n enumerable: true,\n configurable: true\n });\n ToolbarComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-toolbar',\n template: \"\\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n ToolbarComponent.ctorParameters = function () { return [\n { type: GridComponent }\n ]; };\n ToolbarComponent.propDecorators = {\n classNames: [{ type: HostBinding, args: ['class',] }],\n position: [{ type: Input }]\n };\n return ToolbarComponent;\n}());\n\n/**\n * @hidden\n */\nvar LocalEditService = /** @class */ (function () {\n function LocalEditService(grid, localDataChangesService) {\n this.grid = grid;\n this.localDataChangesService = localDataChangesService;\n }\n LocalEditService.prototype.create = function (item) {\n if (this.hasLocalData && this.grid.skip) {\n this.localDataChangesService.data.splice(this.grid.skip, 0, item);\n }\n else {\n this.data.unshift(item);\n }\n this.dataChanged();\n };\n LocalEditService.prototype.update = function (_item) { }; // tslint:disable-line:no-empty\n LocalEditService.prototype.remove = function (item) {\n var data = this.data;\n for (var idx = 0; idx < data.length; idx++) {\n if (item === data[idx]) {\n data.splice(idx, 1);\n this.dataChanged({ action: 'remove', item: item });\n break;\n }\n }\n };\n LocalEditService.prototype.assignValues = function (target, source) {\n Object.assign(target, source);\n };\n LocalEditService.prototype.dataChanged = function (args) {\n if (args === void 0) { args = {}; }\n if (this.hasLocalData) {\n this.localDataChangesService.changes.emit(args);\n }\n };\n Object.defineProperty(LocalEditService.prototype, \"hasLocalData\", {\n get: function () {\n return Array.isArray(this.localDataChangesService.data);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(LocalEditService.prototype, \"data\", {\n get: function () {\n if (this.hasLocalData) {\n return this.localDataChangesService.data;\n }\n var data = this.grid.data;\n if (Array.isArray(data)) {\n return data;\n }\n if (isDevMode()) {\n throw new Error('The default edit service of the editing directives works only when binding to plain array.' +\n 'Please provide an editService.');\n }\n return [];\n },\n enumerable: true,\n configurable: true\n });\n return LocalEditService;\n}());\n\n/**\n * @hidden\n */\nvar EditingDirectiveBase = /** @class */ (function () {\n function EditingDirectiveBase(grid, localDataChangesService) {\n this.grid = grid;\n this.localDataChangesService = localDataChangesService;\n this.defaultEditService = this.createDefaultService();\n }\n Object.defineProperty(EditingDirectiveBase.prototype, \"editService\", {\n get: function () {\n return this.userEditService || this.defaultEditService;\n },\n // Consider adding support for the dependency injection of the service to allow for specifying a generic service without code.\n // The Input should still be kept.\n /**\n * The edit service that will handle the operations.\n */\n set: function (value) {\n this.userEditService = value;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n */\n EditingDirectiveBase.prototype.ngOnInit = function () {\n this.subscriptions = this.grid.add.subscribe(this.addHandler.bind(this));\n this.subscriptions.add(this.grid.remove.subscribe(this.removeHandler.bind(this)));\n this.subscriptions.add(this.grid.cancel.subscribe(this.cancelHandler.bind(this)));\n this.subscriptions.add(this.grid.save.subscribe(this.saveHandler.bind(this)));\n this.subscriptions.add(this.grid.dataStateChange.subscribe(this.onStateChange.bind(this)));\n };\n /**\n * @hidden\n */\n EditingDirectiveBase.prototype.ngOnDestroy = function () {\n this.subscriptions.unsubscribe();\n };\n EditingDirectiveBase.prototype.createDefaultService = function () {\n return new LocalEditService(this.grid, this.localDataChangesService);\n };\n EditingDirectiveBase.prototype.addHandler = function () {\n this.grid.addRow(this.createModel({ isNew: true }));\n };\n EditingDirectiveBase.prototype.saveHandler = function (args) {\n var item = this.saveModel(args);\n if (item) {\n if (args.isNew) {\n this.editService.create(item);\n }\n else {\n this.editService.update(item);\n }\n }\n this.grid.closeRow(args.rowIndex);\n };\n EditingDirectiveBase.prototype.cancelHandler = function (_a) {\n var rowIndex = _a.rowIndex;\n this.closeEditor(rowIndex);\n };\n EditingDirectiveBase.prototype.removeHandler = function (_a) {\n var _this = this;\n var dataItem = _a.dataItem;\n var removeItem = function (shouldRemove) {\n if (shouldRemove) {\n _this.editService.remove(dataItem);\n }\n };\n if (this.removeConfirmation) {\n var result = this.removeConfirmation(dataItem);\n if (result instanceof Promise) {\n result.then(removeItem);\n }\n else if (result instanceof Observable) {\n result.pipe(take(1)).subscribe(removeItem);\n }\n else {\n removeItem(result);\n }\n }\n else {\n removeItem(true);\n }\n };\n EditingDirectiveBase.prototype.onStateChange = function () {\n this.closeEditor();\n };\n EditingDirectiveBase.prototype.closeEditor = function (rowIndex) {\n this.grid.closeRow(rowIndex);\n };\n EditingDirectiveBase.propDecorators = {\n editService: [{ type: Input }],\n removeConfirmation: [{ type: Input }]\n };\n return EditingDirectiveBase;\n}());\n\n/**\n * @hidden\n */\nvar LocalRowEditService = /** @class */ (function (_super) {\n __extends(LocalRowEditService, _super);\n function LocalRowEditService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n LocalRowEditService.prototype.update = function (_item) {\n this.dataChanged();\n };\n return LocalRowEditService;\n}(LocalEditService));\n\n/**\n * @hidden\n */\nvar RowEditingDirectiveBase = /** @class */ (function (_super) {\n __extends(RowEditingDirectiveBase, _super);\n function RowEditingDirectiveBase() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @hidden\n */\n RowEditingDirectiveBase.prototype.ngOnInit = function () {\n _super.prototype.ngOnInit.call(this);\n this.subscriptions\n .add(this.grid.edit.subscribe(this.editHandler.bind(this)));\n };\n RowEditingDirectiveBase.prototype.createDefaultService = function () {\n return new LocalRowEditService(this.grid, this.localDataChangesService);\n };\n RowEditingDirectiveBase.prototype.addHandler = function () {\n this.closeEditor();\n _super.prototype.addHandler.call(this);\n };\n RowEditingDirectiveBase.prototype.editHandler = function (args) {\n this.closeEditor();\n this.rowIndex = args.rowIndex;\n this.grid.editRow(args.rowIndex, this.createModel(args));\n };\n RowEditingDirectiveBase.prototype.saveHandler = function (args) {\n _super.prototype.saveHandler.call(this, args);\n this.clean();\n };\n RowEditingDirectiveBase.prototype.closeEditor = function (rowIndex) {\n if (rowIndex === void 0) { rowIndex = this.rowIndex; }\n _super.prototype.closeEditor.call(this, rowIndex);\n this.clean();\n };\n RowEditingDirectiveBase.prototype.clean = function () {\n delete this.rowIndex;\n };\n return RowEditingDirectiveBase;\n}(EditingDirectiveBase));\n\n/**\n * A directive which encapsulates the editing operations of the Grid when using\n * the Template-Driven Angular Forms ([see example]({% slug editing_directives_grid %}#toc-the-template-directive)).\n */\nvar TemplateEditingDirective = /** @class */ (function (_super) {\n __extends(TemplateEditingDirective, _super);\n function TemplateEditingDirective(grid, localDataChangesService) {\n var _this = _super.call(this, grid, localDataChangesService) || this;\n _this.grid = grid;\n _this.localDataChangesService = localDataChangesService;\n return _this;\n }\n TemplateEditingDirective.prototype.editHandler = function (args) {\n _super.prototype.editHandler.call(this, args);\n this.dataItem = args.dataItem;\n this.originalValues = {};\n this.editService.assignValues(this.originalValues, this.dataItem);\n };\n TemplateEditingDirective.prototype.closeEditor = function (rowIndex) {\n if (this.dataItem) {\n this.editService.assignValues(this.dataItem, this.originalValues);\n }\n _super.prototype.closeEditor.call(this, rowIndex);\n };\n TemplateEditingDirective.prototype.createModel = function (args) {\n if (args.isNew) {\n return this.createNewItem();\n }\n };\n TemplateEditingDirective.prototype.saveModel = function (args) {\n return args.dataItem;\n };\n TemplateEditingDirective.prototype.clean = function () {\n _super.prototype.clean.call(this);\n delete this.dataItem;\n };\n TemplateEditingDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoGridTemplateEditing]'\n },] },\n ];\n /** @nocollapse */\n TemplateEditingDirective.ctorParameters = function () { return [\n { type: GridComponent },\n { type: LocalDataChangesService }\n ]; };\n TemplateEditingDirective.propDecorators = {\n createNewItem: [{ type: Input, args: ['kendoGridTemplateEditing',] }]\n };\n return TemplateEditingDirective;\n}(RowEditingDirectiveBase));\n\n/**\n * @hidden\n */\nvar markAllAsTouched = function (control) {\n control.markAsTouched();\n if (control.hasOwnProperty('controls')) {\n var controls = control.controls;\n for (var inner in controls) {\n if (controls.hasOwnProperty(inner)) {\n markAllAsTouched(controls[inner]);\n }\n }\n }\n};\n\n/**\n * A directive which encapsulates the editing operations of the Grid when using the\n * Reactive Forms ([see example]({% slug editing_directives_grid %}#toc-the-reactive-directive)).\n */\nvar ReactiveEditingDirective = /** @class */ (function (_super) {\n __extends(ReactiveEditingDirective, _super);\n function ReactiveEditingDirective(grid, localDataChangesService) {\n var _this = _super.call(this, grid, localDataChangesService) || this;\n _this.grid = grid;\n _this.localDataChangesService = localDataChangesService;\n return _this;\n }\n ReactiveEditingDirective.prototype.createModel = function (args) {\n return this.createFormGroup(args);\n };\n ReactiveEditingDirective.prototype.saveModel = function (_a) {\n var dataItem = _a.dataItem, formGroup = _a.formGroup, isNew = _a.isNew;\n if (!formGroup.dirty && !isNew) {\n return;\n }\n if (formGroup.valid) {\n this.editService.assignValues(dataItem, formGroup.value);\n return dataItem;\n }\n markAllAsTouched(formGroup);\n };\n ReactiveEditingDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoGridReactiveEditing]'\n },] },\n ];\n /** @nocollapse */\n ReactiveEditingDirective.ctorParameters = function () { return [\n { type: GridComponent },\n { type: LocalDataChangesService }\n ]; };\n ReactiveEditingDirective.propDecorators = {\n createFormGroup: [{ type: Input, args: ['kendoGridReactiveEditing',] }]\n };\n return ReactiveEditingDirective;\n}(RowEditingDirectiveBase));\n\n/**\n * A directive which encapsulates the editing operations of the Grid when using the in-cell\n * editing with Reactive Forms ([see example]({% slug editing_directives_grid %}#toc-the-incell-directive)).\n */\nvar InCellEditingDirective = /** @class */ (function (_super) {\n __extends(InCellEditingDirective, _super);\n function InCellEditingDirective(grid, localDataChangesService) {\n var _this = _super.call(this, grid, localDataChangesService) || this;\n _this.grid = grid;\n _this.localDataChangesService = localDataChangesService;\n return _this;\n }\n // Need mixin\n InCellEditingDirective.prototype.createModel = function (args) {\n return this.createFormGroup(args);\n };\n InCellEditingDirective.prototype.saveModel = function (_a) {\n var dataItem = _a.dataItem, formGroup = _a.formGroup, isNew = _a.isNew;\n if (!formGroup.dirty && !isNew) {\n return;\n }\n if (formGroup.valid) {\n this.editService.assignValues(dataItem, formGroup.value);\n return dataItem;\n }\n markAllAsTouched(formGroup);\n };\n /**\n * @hidden\n */\n InCellEditingDirective.prototype.ngOnInit = function () {\n _super.prototype.ngOnInit.call(this);\n this.subscriptions.add(this.grid.cellClick.subscribe(this.cellClickHandler.bind(this)));\n this.subscriptions.add(this.grid.cellClose.subscribe(this.cellCloseHandler.bind(this)));\n };\n InCellEditingDirective.prototype.removeHandler = function (args) {\n _super.prototype.removeHandler.call(this, args);\n this.grid.cancelCell();\n };\n InCellEditingDirective.prototype.cellClickHandler = function (args) {\n if (!args.isEdited && args.type !== 'contextmenu') {\n this.grid.editCell(args.rowIndex, args.columnIndex, this.createFormGroup(args));\n }\n };\n InCellEditingDirective.prototype.cellCloseHandler = function (args) {\n var formGroup = args.formGroup, dataItem = args.dataItem;\n if (!formGroup.valid) {\n args.preventDefault();\n }\n else if (formGroup.dirty) {\n this.editService.assignValues(dataItem, formGroup.value);\n this.editService.update(dataItem);\n }\n };\n InCellEditingDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoGridInCellEditing]'\n },] },\n ];\n /** @nocollapse */\n InCellEditingDirective.ctorParameters = function () { return [\n { type: GridComponent },\n { type: LocalDataChangesService }\n ]; };\n InCellEditingDirective.propDecorators = {\n createFormGroup: [{ type: Input, args: ['kendoGridInCellEditing',] }]\n };\n return InCellEditingDirective;\n}(EditingDirectiveBase));\n\nvar hasGroups = function (items) { return items && items.length && items[0].field && items[0].items; };\nvar processGroups = function (data, state$$1) { return process(data, state$$1).data; };\nvar removeParentDescriptors = function (parents, owner) { return function (g) { return g.field !== owner.field && !parents.some(function (y) { return y.field === g.field; }); }; };\nvar findGroup = function (groupIndex, groups) {\n var parents = [];\n return {\n group: groupIndex.split(\"_\").reduce(function (acc, x) {\n var idx = parseInt(x, 10);\n if (acc.items) {\n parents.push(acc);\n return acc.items[idx];\n }\n return isArray(acc) ? acc[idx] : acc;\n }, groups),\n parents: parents\n };\n};\nvar findChildren = function (data, parents) {\n var filters = parents.map(function (p) { return ({ field: p.field, operator: \"eq\", value: p.value }); });\n return filterBy(data, {\n filters: filters,\n logic: \"and\"\n });\n};\n/**\n * @hidden\n */\nvar count = function (groups, includeFooters) {\n if (includeFooters === void 0) { includeFooters = false; }\n return (groups.reduce(function (acc, group) {\n if (!group.skipHeader) {\n acc++;\n }\n if (group.items) {\n var children = count(group.items, includeFooters);\n if (includeFooters && children && !group.hideFooter) {\n acc++;\n }\n acc += children;\n }\n return acc;\n }, 0) // tslint:disable-line:align\n );\n};\n/**\n * @hidden\n */\nvar slice = function (groups, skip, take$$1, includeFooters) {\n if (includeFooters === void 0) { includeFooters = false; }\n if (!isPresent(take$$1)) {\n return groups;\n }\n var result = [];\n for (var idx = 0, length_1 = groups.length; idx < length_1; idx++) {\n if (take$$1 <= 0) {\n break;\n }\n var group = groups[idx];\n var groupItems = group.items;\n var itemCount = count(groupItems, includeFooters);\n if (includeFooters && groupItems.length) {\n itemCount++;\n }\n var skipHeader = skip > 0;\n if (skip) {\n skip--;\n if (itemCount && skip >= itemCount) {\n skip -= itemCount;\n continue;\n }\n }\n if (!skipHeader || itemCount) {\n var items = [];\n var hideFooter = true;\n if (!skipHeader) {\n take$$1--;\n }\n if (take$$1) {\n if (hasGroups(groupItems)) {\n var children = slice(groupItems, skip, take$$1, includeFooters);\n items.push.apply(items, children);\n take$$1 -= count(children, includeFooters);\n }\n else {\n items.push.apply(items, groupItems.slice(skip, Math.min(skip + take$$1, groupItems.length)));\n take$$1 -= items.length;\n }\n if (take$$1 && includeFooters) {\n hideFooter = false;\n take$$1--;\n }\n skip = 0;\n }\n result.push({\n aggregates: group.aggregates,\n field: group.field,\n hideFooter: hideFooter,\n items: items,\n offset: idx,\n skipHeader: skipHeader,\n value: group.value\n });\n }\n }\n return result;\n};\nvar skippedHeaders = function (groupItem) {\n var total = 0;\n while (groupItem) {\n if (groupItem.skipHeader) {\n total++;\n }\n groupItem = groupItem.items && groupItem.items[0] || null;\n }\n return total;\n};\n/**\n * A directive which encapsulates the in-memory handling of grouping with virtual scrolling.\n */\nvar GroupBindingDirective = /** @class */ (function (_super) {\n __extends(GroupBindingDirective, _super);\n function GroupBindingDirective(grid, changeDetector, localDataChangesService) {\n return _super.call(this, grid, changeDetector, localDataChangesService) || this;\n }\n Object.defineProperty(GroupBindingDirective.prototype, \"kendoGridGroupBinding\", {\n /**\n * The array of data which will be used to populate the Grid.\n */\n set: function (value) {\n this.groups = null;\n this.grid.resetGroupsState();\n this.data = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GroupBindingDirective.prototype, \"data\", {\n /**\n * @hidden\n */\n set: function (value) {\n this.originalData = value || [];\n this.dataChanged = true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GroupBindingDirective.prototype, \"sort\", {\n /**\n * Defines the descriptors by which the data will be sorted.\n */\n set: function (value) {\n var clear = this.state.sort !== value;\n this.grid.sort = this.state.sort = value;\n if (clear) {\n this.groups = null;\n this.grid.resetGroupsState();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GroupBindingDirective.prototype, \"filter\", {\n /**\n * Defines the descriptor by which the data will be filtered.\n */\n set: function (value) {\n var clear = diffFilters(this.state.filter, value);\n if (clear) {\n this.state.filter = value;\n this.grid.filter = cloneFilters(value);\n this.groups = null;\n this.grid.resetGroupsState();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(GroupBindingDirective.prototype, \"group\", {\n /**\n * Defines the descriptors by which the data will be grouped.\n */\n set: function (value) {\n var clear = this.state.group !== value;\n this.grid.group = this.state.group = value;\n if (clear) {\n this.groups = null;\n this.grid.resetGroupsState();\n this.skip = 0;\n }\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n */\n GroupBindingDirective.prototype.ngOnInit = function () {\n _super.prototype.ngOnInit.call(this);\n this.grid.groupExpand.subscribe(this.groupExpand.bind(this));\n this.grid.groupCollapse.subscribe(this.groupCollapse.bind(this));\n };\n GroupBindingDirective.prototype.groupExpand = function (_a) {\n var groupIndex = _a.groupIndex;\n this.grid.expandGroupChildren(groupIndex);\n var _b = findGroup(groupIndex, this.groups), group = _b.group, parents = _b.parents;\n if (!group.items.length) {\n var descriptors = this.state.group.filter(removeParentDescriptors(parents, group));\n var children = findChildren(this.originalData, parents.concat(group));\n group.items = processGroups(children, {\n filter: this.state.filter,\n group: descriptors,\n sort: this.state.sort\n });\n }\n this.grid.data = this.dataResult(this.state.skip, this.state.take);\n };\n GroupBindingDirective.prototype.groupCollapse = function (_a) {\n var groupIndex = _a.groupIndex;\n var group = findGroup(groupIndex, this.groups).group;\n if (group) {\n group.items = [];\n }\n this.grid.data = this.dataResult(this.state.skip, this.state.take);\n };\n GroupBindingDirective.prototype.process = function (state$$1) {\n if (state$$1.group && state$$1.group.length) {\n var groups = this.processGroups(state$$1);\n this.grid.skip -= skippedHeaders(groups.data[0]);\n return groups;\n }\n else {\n this.groups = null;\n }\n return _super.prototype.process.call(this, state$$1);\n };\n GroupBindingDirective.prototype.processGroups = function (state$$1) {\n if (!this.groups || !this.groups.length) {\n this.groups = processGroups(this.originalData, {\n filter: state$$1.filter,\n group: state$$1.group,\n sort: state$$1.sort\n });\n }\n return this.dataResult(state$$1.skip, state$$1.take);\n };\n GroupBindingDirective.prototype.dataResult = function (skip, take$$1) {\n var includeFooters = this.grid.showGroupFooters;\n return {\n data: slice(this.groups, skip, take$$1, includeFooters),\n total: count(this.groups, includeFooters)\n };\n };\n GroupBindingDirective.prototype.applyState = function (_a) {\n var skip = _a.skip, take$$1 = _a.take, sort = _a.sort, group = _a.group, filter$$1 = _a.filter;\n this.skip = skip;\n this.state.take = take$$1;\n // this.pageSize = take; // do need to update take as the process with slice correctly\n this.sort = sort;\n this.group = group;\n this.filter = filter$$1;\n };\n GroupBindingDirective.decorators = [\n { type: Directive, args: [{ selector: '[kendoGridGroupBinding]' },] },\n ];\n /** @nocollapse */\n GroupBindingDirective.ctorParameters = function () { return [\n { type: GridComponent },\n { type: ChangeDetectorRef },\n { type: LocalDataChangesService }\n ]; };\n GroupBindingDirective.propDecorators = {\n kendoGridGroupBinding: [{ type: Input, args: [\"kendoGridGroupBinding\",] }],\n sort: [{ type: Input }],\n filter: [{ type: Input }],\n group: [{ type: Input }]\n };\n return GroupBindingDirective;\n}(DataBindingDirective));\n\nvar exportedModules$4 = [\n GridComponent,\n ToolbarTemplateDirective,\n ToolbarComponent,\n DataBindingDirective,\n SelectionDirective,\n CustomMessagesComponent,\n GroupBindingDirective,\n TemplateEditingDirective,\n ReactiveEditingDirective,\n InCellEditingDirective\n].concat(GroupModule.exports(), SharedModule.exports(), BodyModule.exports(), HeaderModule.exports(), FooterModule.exports(), PagerModule.exports(), RowFilterModule.exports(), FilterMenuModule.exports(), ColumnMenuModule.exports());\nvar declarations = [\n GridComponent,\n ListComponent,\n ToolbarComponent,\n LocalizedMessagesDirective,\n CustomMessagesComponent,\n DataBindingDirective,\n ToolbarTemplateDirective,\n SelectionDirective,\n TemplateEditingDirective,\n ReactiveEditingDirective,\n InCellEditingDirective,\n GroupBindingDirective\n];\n/**\n * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})\n * definition for the Grid component.\n *\n * @example\n *\n * ```ts-no-run\n * // Import the Grid module\n * import { GridModule } from '@progress/kendo-angular-grid';\n *\n * // The browser platform with a compiler\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n *\n * import { NgModule } from '@angular/core';\n *\n * // Import the app component\n * import { AppComponent } from './app.component';\n *\n * // Define the app module\n * _@NgModule({\n * declarations: [AppComponent], // declare app component\n * imports: [BrowserModule, GridModule], // import Grid module\n * bootstrap: [AppComponent]\n * })\n * export class AppModule {}\n *\n * // Compile and launch the module\n * platformBrowserDynamic().bootstrapModule(AppModule);\n *\n * ```\n */\nvar GridModule = /** @class */ (function () {\n function GridModule() {\n }\n GridModule.decorators = [\n { type: NgModule, args: [{\n declarations: [declarations],\n exports: [exportedModules$4],\n imports: [\n CommonModule,\n GroupModule,\n SharedModule,\n BodyModule,\n HeaderModule,\n FooterModule,\n PagerModule,\n RowFilterModule,\n FilterMenuModule,\n ResizeSensorModule,\n ColumnMenuModule\n ]\n },] },\n ];\n return GridModule;\n}());\n\nvar PDFMarginComponent$1 = /** @class */ (function (_super) {\n __extends(PDFMarginComponent$$1, _super);\n function PDFMarginComponent$$1() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFMarginComponent$$1.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-pdf-margin',\n template: ''\n },] },\n ];\n return PDFMarginComponent$$1;\n}(PDFMarginComponent));\n\n/**\n * Represents the PDF page template of the Grid that helps to customize the PDF pages. To define a page template,\n * nest an `` tag with the `kendoGridPDFTemplate` directive inside ``.\n *\n * The template context provides the following fields:\n * - `pageNumber`—Defines PDF page number.\n * - `totalPages`—Defines the total number of PDF pages.\n *\n * @example\n * ```ts-preview\n *\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * Page {{ pageNum }} of {{ totalPages }}\n *
\n * \n * \n * \n * `\n * })\n *\n * class AppComponent {\n * public gridData = [{\n * \"ProductID\": 1,\n * \"ProductName\": \"Chai\",\n * \"UnitPrice\": 18.0000\n * }, {\n * \"ProductID\": 2,\n * \"ProductName\": \"Chang\",\n * \"UnitPrice\": 19.0000\n * }\n * ];\n * }\n *\n * ```\n */\nvar PDFTemplateDirective$1 = /** @class */ (function (_super) {\n __extends(PDFTemplateDirective$$1, _super);\n function PDFTemplateDirective$$1(templateRef) {\n return _super.call(this, templateRef) || this;\n }\n PDFTemplateDirective$$1.decorators = [\n { type: Directive, args: [{\n selector: '[kendoGridPDFTemplate]'\n },] },\n ];\n /** @nocollapse */\n PDFTemplateDirective$$1.ctorParameters = function () { return [\n { type: TemplateRef, decorators: [{ type: Optional }] }\n ]; };\n return PDFTemplateDirective$$1;\n}(PDFTemplateDirective));\n\n/**\n * @hidden\n */\nvar HEADER_CLASS = 'k-grid-header';\n/**\n * @hidden\n */\nvar FOOTER_CLASS = 'k-grid-footer';\nvar GRID_LIST = 'KENDO-GRID-LIST';\nvar TABLE = 'TABLE';\nvar matchesList = matchesNodeName(GRID_LIST);\nvar matchesTable = matchesNodeName(TABLE);\nvar suffix = function (locked) { return locked ? 'locked' : 'wrap'; };\n/**\n * @hidden\n */\nvar GridQuery = /** @class */ (function () {\n function GridQuery(element) {\n this.element = element;\n this.list = findElement(element, matchesList);\n }\n GridQuery.prototype.content = function (locked) {\n return findElement(this.list, matchesClasses(\"k-grid-content\" + (locked ? '-locked' : '')));\n };\n GridQuery.prototype.header = function (locked) {\n this.headerWrap = this.headerWrap || findElement(this.element, matchesClasses(HEADER_CLASS));\n return findElement(this.headerWrap, matchesClasses(HEADER_CLASS + \"-\" + suffix(locked)));\n };\n GridQuery.prototype.footer = function (locked) {\n this.footerWrap = this.footerWrap || findElement(this.element, matchesClasses(FOOTER_CLASS));\n return findElement(this.footerWrap, matchesClasses(FOOTER_CLASS + \"-\" + suffix(locked)));\n };\n GridQuery.prototype.table = function () {\n return findElement(this.element, matchesTable);\n };\n return GridQuery;\n}());\n\nvar FIRST_CLASS = 'k-first';\nvar INPUTS = ['input', 'select', 'textarea', 'option'];\n/** @hidden */\nvar cloneNode = function (node) {\n var clone = node.cloneNode(false);\n if (node._kendoExportVisual) {\n clone._kendoExportVisual = node._kendoExportVisual;\n }\n if (INPUTS.indexOf(String(node.nodeName).toLowerCase()) >= 0) {\n clone.removeAttribute(\"id\");\n clone.removeAttribute(\"name\");\n clone.value = node.value;\n clone.checked = node.checked;\n clone.selected = node.selected;\n }\n var child = node.firstChild;\n while (child) {\n clone.appendChild(cloneNode(child));\n child = child.nextSibling;\n }\n return clone;\n};\nvar appendNodes = function (element, nodes) {\n var length = nodes.length;\n for (var idx = 0; idx < length; idx++) {\n element.appendChild(cloneNode(nodes[idx]));\n }\n};\nvar wrapTable = function (table) {\n var wrapper = document.createElement('div');\n wrapper.className = 'k-widget k-grid';\n wrapper.appendChild(table);\n return wrapper;\n};\nvar createTableElement = function (sources) {\n var sourceCount = sources.length;\n var element = cloneNode(sources[0]);\n var rowsCount = element.rows.length;\n if (sourceCount > 1) {\n for (var rowIdx = 0; rowIdx < rowsCount; rowIdx++) {\n for (var sourceIdx = 1; sourceIdx < sourceCount; sourceIdx++) {\n appendNodes(element.rows[rowIdx], sources[sourceIdx].rows[rowIdx].cells);\n }\n }\n }\n return element;\n};\nvar setFirstCellClass = function (header, headers) {\n if (headers.length > 1 && header.rows.length > 1) {\n for (var idx = 1; idx < header.rows.length; idx++) {\n var firstCellIndex = headers[0].rows[idx].cells.length;\n var cell = header.rows[idx].cells[firstCellIndex];\n if (String(cell.className).indexOf(FIRST_CLASS) === -1) {\n cell.className += \" \" + FIRST_CLASS;\n }\n }\n }\n};\nvar createTable = function (colGroups, headers, bodies, footers) {\n var table = document.createElement('table');\n var colGroup = colGroups[0].cloneNode(true);\n for (var idx = 1; idx < colGroups.length; idx++) {\n appendNodes(colGroup, colGroups[idx].querySelectorAll('col'));\n }\n var header = createTableElement(headers);\n var body = createTableElement(bodies);\n header.className = HEADER_CLASS;\n setFirstCellClass(header, headers);\n table.appendChild(colGroup);\n table.appendChild(header);\n table.appendChild(body);\n if (footers.length) {\n var footer = createTableElement(footers);\n footer.className = FOOTER_CLASS;\n table.appendChild(footer);\n }\n return wrapTable(table);\n};\n/**\n * @hidden\n */\nvar exportElement = function (wrapper) {\n var query = new GridQuery(wrapper);\n var content = query.content();\n var result;\n if (content) {\n var colGroups = [content.querySelector('colgroup')];\n var headers = [query.header().querySelector('thead')];\n var bodies = [content.querySelector('tbody')];\n var footer = query.footer();\n var footers = [];\n if (footer) {\n footers.push(footer.querySelector('tfoot'));\n }\n var lockedContent = query.content(true);\n if (lockedContent) {\n colGroups.unshift(lockedContent.querySelector('colgroup'));\n headers.unshift(query.header(true).querySelector('thead'));\n bodies.unshift(lockedContent.querySelector('tbody'));\n if (footer) {\n footers.unshift(query.footer(true).querySelector('tfoot'));\n }\n }\n result = createTable(colGroups, headers, bodies, footers);\n }\n else {\n result = wrapTable(query.table().cloneNode(true));\n }\n return result;\n};\n\nvar createElement = function (tagName, className) {\n var element = document.createElement(tagName);\n if (className) {\n element.className = className;\n }\n return element;\n};\nvar createDiv = function (className) {\n return createElement('div', className);\n};\n/**\n * Configures the settings for the export of Grid in PDF ([see example]({% slug pdfexport_grid %})).\n */\nvar PDFComponent = /** @class */ (function (_super) {\n __extends(PDFComponent, _super);\n function PDFComponent(pdfService, suspendService, ngZone, element) {\n var _this = _super.call(this, element) || this;\n _this.pdfService = pdfService;\n _this.suspendService = suspendService;\n _this.ngZone = ngZone;\n _this.columns = new QueryList();\n _this.saveSubscription = pdfService.savePDF.subscribe(_this.savePDF.bind(_this));\n _this.drawSubscription = pdfService.drawPDF.subscribe(_this.drawPDF.bind(_this));\n _this.reset = _this.reset.bind(_this);\n _this.draw = _this.draw.bind(_this);\n return _this;\n }\n PDFComponent.prototype.ngOnDestroy = function () {\n this.saveSubscription.unsubscribe();\n this.drawSubscription.unsubscribe();\n this.reset();\n };\n PDFComponent.prototype.savePDF = function (component) {\n this.createPDF(component, this.draw);\n };\n PDFComponent.prototype.drawPDF = function (_a) {\n var _this = this;\n var component = _a.component, promise = _a.promise;\n this.createPDF(component, function () {\n _this.createExportGroup(promise);\n });\n };\n PDFComponent.prototype.createPDF = function (component, callback) {\n var pageSize = component.pageSize;\n var total = component.view.total;\n var columns = this.columns.toArray();\n if (columns.length) {\n this.originalColumns = component.columns.toArray();\n }\n this.component = component;\n this.suspendService.scroll = true;\n this.pdfService.exporting = true;\n this.initProgress();\n this.renderAllPages = this.allPages && pageSize < total;\n if (this.renderAllPages) {\n this.skip = component.skip;\n this.pageSize = pageSize;\n this.changePage(0, total, callback, columns);\n }\n else if (columns.length || component.virtualColumns) {\n this.changeColumns(columns, callback);\n }\n else {\n callback();\n }\n };\n PDFComponent.prototype.initProgress = function () {\n var wrapperElement = this.component.wrapper.nativeElement;\n var progress = this.progress = createDiv('k-loading-pdf-mask');\n var overlay = cloneNode(wrapperElement);\n progress.appendChild(overlay);\n progress.appendChild(createDiv('k-loading-color'));\n progress.appendChild(createElement('span', 'k-i-loading k-icon'));\n this.originalHeight = wrapperElement.style.height;\n this.originalOverflow = wrapperElement.style.overflow;\n wrapperElement.style.height = wrapperElement.offsetHeight + 'px';\n wrapperElement.style.overflow = 'hidden';\n wrapperElement.appendChild(progress);\n this.applyScroll(overlay);\n };\n PDFComponent.prototype.applyScroll = function (overlay) {\n var query = new GridQuery(this.component.wrapper.nativeElement);\n var content = query.content();\n if (content) {\n var overlayQuery = new GridQuery(overlay);\n var overlayContent = overlayQuery.content();\n overlayContent.scrollTop = content.scrollTop;\n overlayContent.scrollLeft = content.scrollLeft;\n overlayQuery.header().scrollLeft = query.header().scrollLeft;\n var footer = query.footer();\n if (footer) {\n overlayQuery.footer().scrollLeft = footer.scrollLeft;\n }\n var lockedContent = query.content(true);\n if (lockedContent) {\n var overlayLockedContent = overlayQuery.content(true);\n overlayLockedContent.scrollTop = lockedContent.scrollTop;\n overlayLockedContent.scrollLeft = lockedContent.scrollLeft;\n }\n }\n };\n PDFComponent.prototype.draw = function () {\n var _this = this;\n this.createExportElement(function (element) {\n _this.save(element, _this.fileName);\n });\n };\n PDFComponent.prototype.createExportGroup = function (promise) {\n var _this = this;\n this.createExportElement(function (element) {\n _this.exportElement(element).then(function (group) { return promise.resolve(group); });\n });\n };\n PDFComponent.prototype.createExportElement = function (callback) {\n var _this = this;\n this.ngZone.runOutsideAngular(function () {\n var container = _this.container = createDiv('k-grid-pdf-export-element');\n var element = exportElement(_this.component.wrapper.nativeElement);\n container.appendChild(element);\n document.body.appendChild(container);\n callback(element);\n });\n };\n PDFComponent.prototype.drawOptions = function () {\n var options = _super.prototype.drawOptions.call(this);\n options._destructive = true;\n return options;\n };\n PDFComponent.prototype.cleanup = function () {\n _super.prototype.cleanup.call(this);\n this.pdfService.exporting = false;\n if (this.component) {\n var originalColumns = this.originalColumns;\n delete this.originalColumns;\n if (this.renderAllPages) {\n this.changePage(this.skip, this.pageSize, this.reset, originalColumns);\n }\n else if (originalColumns || this.component.virtualColumns) {\n this.changeColumns(originalColumns, this.reset);\n }\n else {\n this.reset();\n }\n }\n else {\n this.reset();\n }\n this.removeContainer();\n };\n PDFComponent.prototype.removeContainer = function () {\n if (this.container) {\n document.body.removeChild(this.container);\n delete this.container;\n }\n };\n PDFComponent.prototype.changePage = function (skip, _take, callback, columns) {\n var _this = this;\n this.ngZone.run(function () {\n _this.pdfService.dataChanged.pipe(take(1)).subscribe(function () {\n if ((columns && columns.length) || _this.component.virtualColumns) {\n _this.changeColumns(columns, callback);\n }\n else {\n _this.onStable(callback);\n }\n });\n _this.component.notifyPageChange('pdf', { skip: skip, take: _take });\n });\n };\n PDFComponent.prototype.changeColumns = function (columns, callback) {\n var _this = this;\n this.ngZone.run(function () {\n _this.onStable(callback);\n if (columns && columns.length) {\n _this.component.columns.reset(columns);\n }\n });\n };\n PDFComponent.prototype.reset = function () {\n this.suspendService.scroll = false;\n this.renderAllPages = false;\n if (!this.component) {\n return;\n }\n var wrapperElement = this.component.wrapper.nativeElement;\n wrapperElement.removeChild(this.progress);\n wrapperElement.style.height = this.originalHeight;\n wrapperElement.style.overflow = this.originalOverflow;\n delete this.progress;\n delete this.component;\n };\n PDFComponent.prototype.onStable = function (callback) {\n var _this = this;\n // not sure if it is an actual scenario. occurs in the tests.\n // onStable is triggered in the same pass without the change detection.\n // thus, the callback is called before the changes are applied without the timeout.\n setTimeout(function () {\n _this.ngZone.onStable.asObservable().pipe(take(1)).subscribe(callback);\n }, 0); // tslint:disable-line: align\n };\n PDFComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-pdf',\n template: ''\n },] },\n ];\n /** @nocollapse */\n PDFComponent.ctorParameters = function () { return [\n { type: PDFService },\n { type: SuspendService },\n { type: NgZone },\n { type: ElementRef }\n ]; };\n PDFComponent.propDecorators = {\n allPages: [{ type: Input }],\n columns: [{ type: ContentChildren, args: [ColumnBase$1,] }],\n marginComponent: [{ type: ContentChild, args: [PDFMarginComponent$1,] }],\n pageTemplateDirective: [{ type: ContentChild, args: [PDFTemplateDirective$1,] }]\n };\n return PDFComponent;\n}(PDFExportComponent));\n\n/**\n * Represents the `export-to-PDF` command of the Grid.\n * You can apply this directive to any `button` element inside a\n * [`ToolbarTemplate`]({% slug api_grid_commandcolumncomponent %}).\n * When the user clicks a button that is associated with the directive, the\n * [`pdfExport`]({% slug api_grid_gridcomponent %}#toc-pdfexport) event\n * fires ([see example]({% slug pdfexport_grid %})).\n *\n * @example\n * ```html-no-run\n * \n * \n * \n * \n * \n * \n * \n * ```\n */\nvar PDFCommandDirective = /** @class */ (function (_super) {\n __extends(PDFCommandDirective, _super);\n function PDFCommandDirective(pdfService, element, renderer, localization, ngZone) {\n var _this = _super.call(this, element, renderer, null, localization, ngZone) || this;\n _this.pdfService = pdfService;\n _this.ngZone = ngZone;\n return _this;\n }\n /**\n * @hidden\n */\n PDFCommandDirective.prototype.onClick = function (e) {\n e.preventDefault();\n this.pdfService.exportClick.emit();\n };\n Object.defineProperty(PDFCommandDirective.prototype, \"pdfClass\", {\n /**\n * @hidden\n */\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n PDFCommandDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoGridPDFCommand]'\n },] },\n ];\n /** @nocollapse */\n PDFCommandDirective.ctorParameters = function () { return [\n { type: PDFService },\n { type: ElementRef },\n { type: Renderer2 },\n { type: LocalizationService },\n { type: NgZone }\n ]; };\n PDFCommandDirective.propDecorators = {\n onClick: [{ type: HostListener, args: ['click', ['$event'],] }],\n pdfClass: [{ type: HostBinding, args: ['class.k-grid-pdf',] }]\n };\n return PDFCommandDirective;\n}(Button));\n\nvar exportedModules$5 = [\n PDFComponent,\n PDFMarginComponent$1,\n PDFCommandDirective,\n PDFTemplateDirective$1\n];\nvar declarations$1 = [\n PDFComponent,\n PDFMarginComponent$1,\n PDFCommandDirective,\n PDFTemplateDirective$1\n];\n/**\n * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})\n * definition for the Grid PDF component.\n *\n * @example\n *\n * ```ts-no-run\n * // Import the Grid and PDF modules\n * import { GridModule, PDFModule } from '@progress/kendo-angular-grid';\n *\n * // The browser platform with a compiler\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n *\n * import { NgModule } from '@angular/core';\n *\n * // Import the app component\n * import { AppComponent } from './app.component';\n *\n * // Define the app module\n * _@NgModule({\n * declarations: [AppComponent], // declare app component\n * imports: [BrowserModule, GridModule, PDFModule], // import Grid and PDF modules\n * bootstrap: [AppComponent]\n * })\n * export class AppModule {}\n *\n * // Compile and launch the module\n * platformBrowserDynamic().bootstrapModule(AppModule);\n *\n * ```\n */\nvar PDFModule = /** @class */ (function () {\n function PDFModule() {\n }\n PDFModule.decorators = [\n { type: NgModule, args: [{\n declarations: [declarations$1],\n exports: [exportedModules$5]\n },] },\n ];\n return PDFModule;\n}());\n\n/**\n * Arguments for the `excelExport` event.\n */\nvar ExcelExportEvent = /** @class */ (function (_super) {\n __extends(ExcelExportEvent, _super);\n function ExcelExportEvent(workbook) {\n var _this = _super.call(this) || this;\n _this.workbook = workbook;\n return _this;\n }\n return ExcelExportEvent;\n}(PreventableEvent));\n\n/* tslint:disable object-literal-sort-keys */\nvar fetchComponentData = function (component) {\n return {\n data: component.view.map(function (item) { return item; }),\n group: component.group\n };\n};\nvar toExcelColumn = function (column) {\n return {\n title: column.title,\n field: column.field,\n locked: Boolean(column.locked),\n width: column.width,\n level: column.level,\n hidden: !column.isVisible,\n groupHeaderTemplate: column.groupHeaderTemplate,\n groupHeaderColumnTemplate: column.groupHeaderColumnTemplate,\n groupFooterTemplate: column.groupFooterTemplate,\n footerTemplate: column.footerTemplate\n };\n};\nvar toExcelColumns = function (columns) {\n var result = [];\n sortColumns(columns)\n .forEach(function (column) {\n if (column.isSpanColumn) {\n result.push.apply(result, toExcelColumns(column.childrenArray));\n }\n else {\n var excelColumn = toExcelColumn(column);\n if (column.isColumnGroup) {\n excelColumn.children = [excelColumn].concat(toExcelColumns(column.childrenArray));\n }\n result.push(excelColumn);\n }\n });\n return result;\n};\nvar componentColumns = function (component) {\n var columns = toExcelColumns(component.columns.toArray());\n return orderBy(columns, [{ field: 'locked', dir: 'desc' }]);\n};\n/**\n * Configures the settings for the export of Grid in Excel ([see example]({% slug excelexport_grid %})).\n */\nvar ExcelComponent = /** @class */ (function () {\n function ExcelComponent(excelService, localization, zone) {\n this.localization = localization;\n this.zone = zone;\n /**\n * Specifies the file name of the exported Excel file.\n * @default \"Export.xlsx\"\n */\n this.fileName = 'Export.xlsx';\n /**\n * @hidden\n */\n this.columns = new QueryList();\n this.saveSubscription = excelService.saveToExcel.subscribe(this.save.bind(this));\n }\n ExcelComponent.prototype.ngOnDestroy = function () {\n this.saveSubscription.unsubscribe();\n if (this.dataSubscription) {\n this.dataSubscription.unsubscribe();\n }\n };\n ExcelComponent.prototype.save = function (component) {\n var _this = this;\n var data = (this.fetchData || fetchComponentData)(component);\n var exportData = function (result) {\n delete _this.dataSubscription;\n _this.exportData(component, result);\n };\n if (data instanceof Promise) {\n data.then(exportData);\n }\n else if (data instanceof Observable) {\n this.dataSubscription = data.pipe(take(1)).subscribe(exportData);\n }\n else {\n exportData(data);\n }\n };\n ExcelComponent.prototype.exportData = function (component, result) {\n var _this = this;\n var options = workbookOptions({\n columns: this.columns.length ? this.columns : componentColumns(component),\n data: result.data,\n group: result.group,\n filterable: this.filterable,\n creator: this.creator,\n date: this.date,\n paddingCellOptions: this.paddingCellOptions,\n headerPaddingCellOptions: this.headerPaddingCellOptions,\n rtl: this.localization.rtl,\n collapsible: this.collapsible\n });\n var args = new ExcelExportEvent(options);\n component.excelExport.emit(args);\n if (!args.isDefaultPrevented()) {\n this.zone.runOutsideAngular(function () { return _this.saveFile(options); });\n }\n };\n ExcelComponent.prototype.saveFile = function (options) {\n var _this = this;\n toDataURL(options).then(function (dataURL) {\n saveAs(dataURL, _this.fileName, {\n forceProxy: _this.forceProxy,\n proxyURL: _this.proxyURL\n });\n });\n };\n ExcelComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-grid-excel',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n ExcelComponent.ctorParameters = function () { return [\n { type: ExcelService },\n { type: LocalizationService },\n { type: NgZone }\n ]; };\n ExcelComponent.propDecorators = {\n fileName: [{ type: Input }],\n filterable: [{ type: Input }],\n creator: [{ type: Input }],\n date: [{ type: Input }],\n forceProxy: [{ type: Input }],\n proxyURL: [{ type: Input }],\n fetchData: [{ type: Input }],\n paddingCellOptions: [{ type: Input }],\n headerPaddingCellOptions: [{ type: Input }],\n collapsible: [{ type: Input }],\n columns: [{ type: ContentChildren, args: [ColumnBase, { descendants: true },] }]\n };\n return ExcelComponent;\n}());\n\n/**\n * Represents the `export-to-Excel` command of the Grid. You can apply this\n * directive to any `button` element inside a\n * [`ToolbarTemplate`]({% slug api_grid_commandcolumncomponent %}).\n * When the user clicks a button associated with the directive, the\n * [`excelExport`]({% slug api_grid_gridcomponent %}#toc-excelexport) event\n * fires ([see example]({% slug excelexport_grid %})).\n *\n * @example\n * ```html-no-run\n * \n * \n * \n * \n * \n * \n * \n * ```\n */\nvar ExcelCommandDirective = /** @class */ (function (_super) {\n __extends(ExcelCommandDirective, _super);\n function ExcelCommandDirective(excelService, element, renderer, localization, ngZone) {\n var _this = _super.call(this, element, renderer, null, localization, ngZone) || this;\n _this.excelService = excelService;\n _this.ngZone = ngZone;\n return _this;\n }\n /**\n * @hidden\n */\n ExcelCommandDirective.prototype.onClick = function (e) {\n e.preventDefault();\n this.excelService.exportClick.emit();\n };\n Object.defineProperty(ExcelCommandDirective.prototype, \"excelClass\", {\n /**\n * @hidden\n */\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n ExcelCommandDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoGridExcelCommand]'\n },] },\n ];\n /** @nocollapse */\n ExcelCommandDirective.ctorParameters = function () { return [\n { type: ExcelService },\n { type: ElementRef },\n { type: Renderer2 },\n { type: LocalizationService },\n { type: NgZone }\n ]; };\n ExcelCommandDirective.propDecorators = {\n onClick: [{ type: HostListener, args: ['click', ['$event'],] }],\n excelClass: [{ type: HostBinding, args: ['class.k-grid-excel',] }]\n };\n return ExcelCommandDirective;\n}(Button));\n\nvar declarations$2 = [ExcelComponent, ExcelCommandDirective];\n/**\n * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})\n * definition for the Excel component of the Grid.\n *\n * @example\n *\n * ```ts-no-run\n * // Import the Grid and Excel modules\n * import { GridModule, ExcelModule } from '@progress/kendo-angular-grid';\n *\n * // The browser platform with a compiler\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n *\n * import { NgModule } from '@angular/core';\n *\n * // Import the app component\n * import { AppComponent } from './app.component';\n *\n * // Define the app module\n * _@NgModule({\n * declarations: [AppComponent], // declare app component\n * imports: [BrowserModule, GridModule, ExcelModule], // import Grid and Excel modules\n * bootstrap: [AppComponent]\n * })\n * export class AppModule {}\n *\n * // Compile and launch the module\n * platformBrowserDynamic().bootstrapModule(AppModule);\n *\n * ```\n */\nvar ExcelModule = /** @class */ (function () {\n function ExcelModule() {\n }\n ExcelModule.decorators = [\n { type: NgModule, args: [{\n declarations: [declarations$2],\n exports: [declarations$2, ExcelExportModule]\n },] },\n ];\n return ExcelModule;\n}());\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { ColumnChooserComponent, ColumnListComponent, ColumnMenuChooserComponent, ColumnMenuFilterComponent, ColumnMenuItemBase, ColumnMenuItemContentTemplateDirective, ColumnMenuItemComponent, ColumnMenuLockComponent, ColumnMenuSortComponent, ColumnMenuTemplateDirective, ColumnMenuModule, ColumnMenuService, ColumnHandleDirective, ColumnResizingService, TableDirective, ColumnInfoService, DomEventsService, ExpandStateService, IdService, PreventableEvent, SortService, ChangeNotificationService, ColumnReorderService, DragAndDropModule, DragAndDropService, DragHintService, DraggableColumnDirective, DropCueService, DropTargetDirective, EditingDirectiveBase, RowEditingDirectiveBase, AddCommandDirective, CancelCommandDirective, EditCommandDirective, EditService as EditService$1, LocalDataChangesService, RemoveCommandDirective, SaveCommandDirective, ExcelCommandDirective, BooleanFilterComponent, BooleanFilterCellComponent, FilterCellHostDirective, FilterCellOperatorsComponent, FilterCellWrapperComponent, DateFilterComponent, FilterHostDirective, FilterInputWrapperComponent, FilterInputDirective, FilterRowComponent, DateFilterMenuInputComponent, FilterMenuContainerComponent, FilterMenuHostDirective, FilterMenuInputWrapperComponent, FilterMenuComponent, NumericFilterMenuInputComponent, StringFilterMenuInputComponent, NumericFilterComponent, FilterOperatorBase, SharedFilterModule, StringFilterComponent, GroupHeaderComponent, GroupIndicatorComponent, GroupInfoService, GroupPanelComponent, GroupsService, BrowserSupportService, ResizeService, ResponsiveService, LocalizedMessagesDirective, Messages, FocusGroup, FocusRoot, LogicalCellDirective, LogicalRowDirective, NavigationService, PagerContextService, PagerElementComponent, PDFCommandDirective, PDFTemplateDirective$1 as PDFTemplateDirective, CellComponent, CELL_CONTEXT, EMPTY_CELL_CONTEXT, FieldAccessorPipe, DetailsService, DEFAULT_SCROLLER_FACTORY, SCROLLER_FACTORY_TOKEN, ScrollRequestService, ScrollSyncService, ScrollerService, SelectAllCheckboxDirective, SelectionCheckboxDirective, Selection, SelectionService, GridModule, SharedModule, GridComponent, ColumnBase$1 as ColumnBase, ColumnComponent, CommandColumnComponent, SpanColumnComponent, ColumnGroupComponent, CheckboxColumnComponent, ToolbarComponent, ToolbarTemplateDirective, CellTemplateDirective, HeaderTemplateDirective, FooterTemplateDirective, PagerTemplateDirective, DetailTemplateDirective, DetailExpandEvent, DetailCollapseEvent, GroupHeaderTemplateDirective, GroupHeaderColumnTemplateDirective, GroupFooterTemplateDirective, ResizableContainerDirective, TemplateContextDirective, NoRecordsTemplateDirective, DataBindingDirective, SelectionDirective, FilterService, FilterCellTemplateDirective, FilterCellComponent, StringFilterCellComponent, DateFilterCellComponent, BaseFilterCellComponent, FilterMenuTemplateDirective, NumericFilterMenuComponent, StringFilterMenuComponent, DateFilterMenuComponent, BooleanFilterMenuComponent, BeforeEqFilterOperatorComponent, BeforeFilterOperatorComponent, AfterEqFilterOperatorComponent, AfterFilterOperatorComponent, ContainsFilterOperatorComponent, DoesNotContainFilterOperatorComponent, EndsWithFilterOperatorComponent, EqualFilterOperatorComponent, IsEmptyFilterOperatorComponent, IsNotEmptyFilterOperatorComponent, IsNotNullFilterOperatorComponent, IsNullFilterOperatorComponent, NotEqualFilterOperatorComponent, StartsWithFilterOperatorComponent, NumericFilterCellComponent, AutoCompleteFilterCellComponent, GreaterFilterOperatorComponent, GreaterOrEqualToFilterOperatorComponent, LessOrEqualToFilterOperatorComponent, LessFilterOperatorComponent, PagerPrevButtonsComponent, PagerNextButtonsComponent, PagerNumericButtonsComponent, PagerInputComponent, PagerInfoComponent, PagerPageSizesComponent, RowFilterModule, FilterMenuModule, BodyModule, GroupModule, HeaderModule, FooterModule, PagerModule, TemplateEditingDirective, ReactiveEditingDirective, InCellEditingDirective, EditTemplateDirective, ColGroupComponent, HeaderComponent, ListComponent, FooterComponent, TableBodyComponent, PagerComponent, CustomMessagesComponent, LoadingComponent, PDFModule, PDFComponent, PDFMarginComponent$1 as PDFMarginComponent, PDFService, ExcelModule, ExcelComponent, ExcelService, CellCloseEvent, SuspendService, GroupBindingDirective, slice, count, Skip, ColumnReorderEvent, FocusableDirective, ColumnVisibilityChangeEvent, ColumnMenuComponent, SinglePopupService, PopupCloseEvent };\n","var base = {\n 8: \"Backspace\",\n 9: \"Tab\",\n 10: \"Enter\",\n 12: \"NumLock\",\n 13: \"Enter\",\n 16: \"Shift\",\n 17: \"Control\",\n 18: \"Alt\",\n 20: \"CapsLock\",\n 27: \"Escape\",\n 32: \" \",\n 33: \"PageUp\",\n 34: \"PageDown\",\n 35: \"End\",\n 36: \"Home\",\n 37: \"ArrowLeft\",\n 38: \"ArrowUp\",\n 39: \"ArrowRight\",\n 40: \"ArrowDown\",\n 44: \"PrintScreen\",\n 45: \"Insert\",\n 46: \"Delete\",\n 59: \";\",\n 61: \"=\",\n 91: \"Meta\",\n 92: \"Meta\",\n 106: \"*\",\n 107: \"+\",\n 108: \",\",\n 109: \"-\",\n 110: \".\",\n 111: \"/\",\n 144: \"NumLock\",\n 145: \"ScrollLock\",\n 160: \"Shift\",\n 161: \"Shift\",\n 162: \"Control\",\n 163: \"Control\",\n 164: \"Alt\",\n 165: \"Alt\",\n 173: \"-\",\n 186: \";\",\n 187: \"=\",\n 188: \",\",\n 189: \"-\",\n 190: \".\",\n 191: \"/\",\n 192: \"`\",\n 219: \"[\",\n 220: \"\\\\\",\n 221: \"]\",\n 222: \"'\",\n 229: \"q\"\n};\nvar base_1 = base;\n\nvar shift = {\n 48: \")\",\n 49: \"!\",\n 50: \"@\",\n 51: \"#\",\n 52: \"$\",\n 53: \"%\",\n 54: \"^\",\n 55: \"&\",\n 56: \"*\",\n 57: \"(\",\n 59: \";\",\n 61: \"+\",\n 173: \"_\",\n 186: \":\",\n 187: \"+\",\n 188: \"<\",\n 189: \"_\",\n 190: \">\",\n 191: \"?\",\n 192: \"~\",\n 219: \"{\",\n 220: \"|\",\n 221: \"}\",\n 222: \"\\\"\",\n 229: \"Q\"\n};\nvar shift_1 = shift;\n\nvar chrome = typeof navigator != \"undefined\" && /Chrome\\/(\\d+)/.exec(navigator.userAgent);\nvar safari = typeof navigator != \"undefined\" && /Apple Computer/.test(navigator.vendor);\nvar gecko = typeof navigator != \"undefined\" && /Gecko\\/\\d+/.test(navigator.userAgent);\nvar mac = typeof navigator != \"undefined\" && /Mac/.test(navigator.platform);\nvar ie = typeof navigator != \"undefined\" && /MSIE \\d|Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(navigator.userAgent);\nvar brokenModifierNames = chrome && (mac || +chrome[1] < 57) || gecko && mac;\n\n// Fill in the digit keys\nfor (var i = 0; i < 10; i++) base[48 + i] = base[96 + i] = String(i);\n\n// The function keys\nfor (var i = 1; i <= 24; i++) base[i + 111] = \"F\" + i;\n\n// And the alphabetic keys\nfor (var i = 65; i <= 90; i++) {\n base[i] = String.fromCharCode(i + 32);\n shift[i] = String.fromCharCode(i);\n}\n\n// For each code that doesn't have a shift-equivalent, copy the base name\nfor (var code in base) if (!shift.hasOwnProperty(code)) shift[code] = base[code];\n\nvar keyName = function(event) {\n // Don't trust event.key in Chrome when there are modifiers until\n // they fix https://bugs.chromium.org/p/chromium/issues/detail?id=633838\n var ignoreKey = brokenModifierNames && (event.ctrlKey || event.altKey || event.metaKey) ||\n (safari || ie) && event.shiftKey && event.key && event.key.length == 1;\n var name = (!ignoreKey && event.key) ||\n (event.shiftKey ? shift : base)[event.keyCode] ||\n event.key || \"Unidentified\";\n // Edge sometimes produces wrong names (Issue #3)\n if (name == \"Esc\") name = \"Escape\";\n if (name == \"Del\") name = \"Delete\";\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8860571/\n if (name == \"Left\") name = \"ArrowLeft\";\n if (name == \"Up\") name = \"ArrowUp\";\n if (name == \"Right\") name = \"ArrowRight\";\n if (name == \"Down\") name = \"ArrowDown\";\n return name\n};\n\nvar w3cKeyname = {\n\tbase: base_1,\n\tshift: shift_1,\n\tkeyName: keyName\n};\n\nexport default w3cKeyname;\nexport { base_1 as base, keyName, shift_1 as shift };\n","import { keyName, base } from 'w3c-keyname';\nimport { Plugin } from 'prosemirror-state';\n\n// declare global: navigator\n\nvar mac = typeof navigator != \"undefined\" ? /Mac/.test(navigator.platform) : false;\n\nfunction normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/), result = parts[parts.length - 1];\n if (result == \"Space\") { result = \" \"; }\n var alt, ctrl, shift, meta;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) { meta = true; }\n else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n else if (/^mod$/i.test(mod)) { if (mac) { meta = true; } else { ctrl = true; } }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { result = \"Alt-\" + result; }\n if (ctrl) { result = \"Ctrl-\" + result; }\n if (meta) { result = \"Meta-\" + result; }\n if (shift) { result = \"Shift-\" + result; }\n return result\n}\n\nfunction normalize(map) {\n var copy = Object.create(null);\n for (var prop in map) { copy[normalizeKeyName(prop)] = map[prop]; }\n return copy\n}\n\nfunction modifiers(name, event, shift) {\n if (event.altKey) { name = \"Alt-\" + name; }\n if (event.ctrlKey) { name = \"Ctrl-\" + name; }\n if (event.metaKey) { name = \"Meta-\" + name; }\n if (shift !== false && event.shiftKey) { name = \"Shift-\" + name; }\n return name\n}\n\n// :: (Object) → Plugin\n// Create a keymap plugin for the given set of bindings.\n//\n// Bindings should map key names to [command](#commands)-style\n// functions, which will be called with `(EditorState, dispatch,\n// EditorView)` arguments, and should return true when they've handled\n// the key. Note that the view argument isn't part of the command\n// protocol, but can be used as an escape hatch if a binding needs to\n// directly interact with the UI.\n//\n// Key names may be strings like `\"Shift-Ctrl-Enter\"`—a key\n// identifier prefixed with zero or more modifiers. Key identifiers\n// are based on the strings that can appear in\n// [`KeyEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key).\n// Use lowercase letters to refer to letter keys (or uppercase letters\n// if you want shift to be held). You may use `\"Space\"` as an alias\n// for the `\" \"` name.\n//\n// Modifiers can be given in any order. `Shift-` (or `s-`), `Alt-` (or\n// `a-`), `Ctrl-` (or `c-` or `Control-`) and `Cmd-` (or `m-` or\n// `Meta-`) are recognized. For characters that are created by holding\n// shift, the `Shift-` prefix is implied, and should not be added\n// explicitly.\n//\n// You can use `Mod-` as a shorthand for `Cmd-` on Mac and `Ctrl-` on\n// other platforms.\n//\n// You can add multiple keymap plugins to an editor. The order in\n// which they appear determines their precedence (the ones early in\n// the array get to dispatch first).\nfunction keymap(bindings) {\n return new Plugin({props: {handleKeyDown: keydownHandler(bindings)}})\n}\n\n// :: (Object) → (view: EditorView, event: dom.Event) → bool\n// Given a set of bindings (using the same format as\n// [`keymap`](#keymap.keymap), return a [keydown\n// handler](#view.EditorProps.handleKeyDown) that handles them.\nfunction keydownHandler(bindings) {\n var map = normalize(bindings);\n return function(view, event) {\n var name = keyName(event), isChar = name.length == 1 && name != \" \", baseName;\n var direct = map[modifiers(name, event, !isChar)];\n if (direct && direct(view.state, view.dispatch, view)) { return true }\n if (isChar && (event.shiftKey || event.altKey || event.metaKey) &&\n (baseName = base[event.keyCode]) && baseName != name) {\n var fromCode = map[modifiers(baseName, event, true)];\n if (fromCode && fromCode(view.state, view.dispatch, view)) { return true }\n } else if (isChar && event.shiftKey) {\n var withShift = map[modifiers(name, event, true)];\n if (withShift && withShift(view.state, view.dispatch, view)) { return true }\n }\n return false\n }\n}\n\nexport { keydownHandler, keymap };\n//# sourceMappingURL=index.es.js.map\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nexport default nodeUtil;\n","/** PURE_IMPORTS_START tslib,_OuterSubscriber,_InnerSubscriber,_util_subscribeToResult,_map,_observable_from PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { InnerSubscriber } from '../InnerSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { map } from './map';\nimport { from } from '../observable/from';\nexport function switchMap(project, resultSelector) {\n if (typeof resultSelector === 'function') {\n return function (source) { return source.pipe(switchMap(function (a, i) { return from(project(a, i)).pipe(map(function (b, ii) { return resultSelector(a, b, i, ii); })); })); };\n }\n return function (source) { return source.lift(new SwitchMapOperator(project)); };\n}\nvar SwitchMapOperator = /*@__PURE__*/ (function () {\n function SwitchMapOperator(project) {\n this.project = project;\n }\n SwitchMapOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new SwitchMapSubscriber(subscriber, this.project));\n };\n return SwitchMapOperator;\n}());\nvar SwitchMapSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(SwitchMapSubscriber, _super);\n function SwitchMapSubscriber(destination, project) {\n var _this = _super.call(this, destination) || this;\n _this.project = project;\n _this.index = 0;\n return _this;\n }\n SwitchMapSubscriber.prototype._next = function (value) {\n var result;\n var index = this.index++;\n try {\n result = this.project(value, index);\n }\n catch (error) {\n this.destination.error(error);\n return;\n }\n this._innerSub(result, value, index);\n };\n SwitchMapSubscriber.prototype._innerSub = function (result, value, index) {\n var innerSubscription = this.innerSubscription;\n if (innerSubscription) {\n innerSubscription.unsubscribe();\n }\n var innerSubscriber = new InnerSubscriber(this, value, index);\n var destination = this.destination;\n destination.add(innerSubscriber);\n this.innerSubscription = subscribeToResult(this, result, undefined, undefined, innerSubscriber);\n if (this.innerSubscription !== innerSubscriber) {\n destination.add(this.innerSubscription);\n }\n };\n SwitchMapSubscriber.prototype._complete = function () {\n var innerSubscription = this.innerSubscription;\n if (!innerSubscription || innerSubscription.closed) {\n _super.prototype._complete.call(this);\n }\n this.unsubscribe();\n };\n SwitchMapSubscriber.prototype._unsubscribe = function () {\n this.innerSubscription = null;\n };\n SwitchMapSubscriber.prototype.notifyComplete = function (innerSub) {\n var destination = this.destination;\n destination.remove(innerSub);\n this.innerSubscription = null;\n if (this.isStopped) {\n _super.prototype._complete.call(this);\n }\n };\n SwitchMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n this.destination.next(innerValue);\n };\n return SwitchMapSubscriber;\n}(OuterSubscriber));\n//# sourceMappingURL=switchMap.js.map\n","/** PURE_IMPORTS_START _ReplaySubject PURE_IMPORTS_END */\nimport { ReplaySubject } from '../ReplaySubject';\nexport function shareReplay(configOrBufferSize, windowTime, scheduler) {\n var config;\n if (configOrBufferSize && typeof configOrBufferSize === 'object') {\n config = configOrBufferSize;\n }\n else {\n config = {\n bufferSize: configOrBufferSize,\n windowTime: windowTime,\n refCount: false,\n scheduler: scheduler\n };\n }\n return function (source) { return source.lift(shareReplayOperator(config)); };\n}\nfunction shareReplayOperator(_a) {\n var _b = _a.bufferSize, bufferSize = _b === void 0 ? Number.POSITIVE_INFINITY : _b, _c = _a.windowTime, windowTime = _c === void 0 ? Number.POSITIVE_INFINITY : _c, useRefCount = _a.refCount, scheduler = _a.scheduler;\n var subject;\n var refCount = 0;\n var subscription;\n var hasError = false;\n var isComplete = false;\n return function shareReplayOperation(source) {\n refCount++;\n if (!subject || hasError) {\n hasError = false;\n subject = new ReplaySubject(bufferSize, windowTime, scheduler);\n subscription = source.subscribe({\n next: function (value) { subject.next(value); },\n error: function (err) {\n hasError = true;\n subject.error(err);\n },\n complete: function () {\n isComplete = true;\n subscription = undefined;\n subject.complete();\n },\n });\n }\n var innerSub = subject.subscribe(this);\n this.add(function () {\n refCount--;\n innerSub.unsubscribe();\n if (subscription && !isComplete && useRefCount && refCount === 0) {\n subscription.unsubscribe();\n subscription = undefined;\n subject = undefined;\n }\n });\n };\n}\n//# sourceMappingURL=shareReplay.js.map\n","/**\n * A function that clones the passed date. The parameter could be `null`.\n *\n * @param date - The initial date value.\n * @returns - A new `Date` instance.\n *\n * @example\n * ```ts-no-run\n * cloneDate(new Date(2016, 0, 1)); // returns new Date(2016, 0, 1);\n * cloneDate(null); // returns null\n * ```\n */\nexport var cloneDate = function (date) { return date ? new Date(date.getTime()) : null; };\n","import { cloneDate } from './clone-date';\n/**\n * @hidden\n */\nexport var adjustDST = function (date, hour) {\n var newDate = cloneDate(date);\n if (hour === 0 && newDate.getHours() === 23) {\n newDate.setHours(newDate.getHours() + 2);\n }\n return newDate;\n};\n","import { adjustDST } from './adjust-dst';\nimport { cloneDate } from './clone-date';\n/**\n * A function that adds and subtracts days from a `Date` object.\n *\n * @param date - The initial date value.\n * @param offset - The number of days to add and subtract from the date.\n * @returns - A new `Date` instance.\n *\n * @example\n * ```ts-no-run\n * addDays(new Date(2016, 0, 1), 5); // 2016-1-6\n * addDays(new Date(2016, 0, 1), -5); // 2015-12-26\n * ```\n */\nexport var addDays = function (date, offset) {\n var newDate = cloneDate(date);\n newDate.setDate(newDate.getDate() + offset);\n return adjustDST(newDate, date.getHours());\n};\n","import { adjustDST } from './adjust-dst';\n/**\n * A function which returns a new `Date` instance.\n *\n * @param year - The year value.\n * @param month - The month value.\n * @param day - The day value.\n * @param hours - The hours value.\n * @param minutes - The minutes value.\n * @param seconds - The seconds value.\n * @param milliseconds - milliseconds value.\n * @returns The date instance.\n *\n * @example\n * ```ts-no-run\n * createDate(2016, 0, 15); // 2016-01-15 00:00:00\n * createDate(2016, 0, 15, 22, 22, 20); // 2016-01-15 22:22:20\n * ```\n */\nexport var createDate = function (year, month, day, hours, minutes, seconds, milliseconds) {\n if (hours === void 0) { hours = 0; }\n if (minutes === void 0) { minutes = 0; }\n if (seconds === void 0) { seconds = 0; }\n if (milliseconds === void 0) { milliseconds = 0; }\n var date = new Date(year, month, day, hours, minutes, seconds, milliseconds);\n if (year > -1 && year < 100) {\n date.setFullYear(date.getFullYear() - 1900);\n }\n return adjustDST(date, hours);\n};\n","import { createDate } from './create-date';\n/**\n * A function which returns the passed date with a midnight time portion.\n *\n * @param date - The initial date.\n * @returns - The date with a midnight time portion.\n *\n * @example\n * ```ts-no-run\n * getDate(new Date(2016, 0, 15, 14, 30, 30)); // 2016-01-15 00:00:00\n * ```\n */\nexport var getDate = function (date) {\n return createDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);\n};\n","/**\n * A function that compares two dates. The comparison also includes the time portion.\n *\n * @param candidate - The candidate date.\n * @param expected - The expected date.\n * @returns - A Boolean value indicating whether the values are equal.\n *\n * @example\n * ```ts-no-run\n * isEqual(new Date(2016, 0, 1), new Date(2016, 0, 1)); // true\n * isEqual(new Date(2016, 0, 1), new Date(2016, 0, 2)); // false\n * isEqual(new Date(2016, 0, 1, 10), new Date(2016, 0, 1, 20)); // false\n * ```\n */\nexport var isEqual = function (candidate, expected) {\n if (!candidate && !expected) {\n return true;\n }\n return candidate && expected && candidate.getTime() === expected.getTime();\n};\n","import { addDays } from './add-days';\nimport { createDate } from './create-date';\n/**\n * A function which returns the last date of the month.\n *\n * @param date - The initial date.\n * @returns - The last date of the initial date month.\n *\n * @example\n * ```ts-no-run\n * lastDayOfMonth(new Date(2016, 0, 15)); // 2016-01-31\n * ```\n */\nexport var lastDayOfMonth = function (date) {\n var newDate = createDate(date.getFullYear(), date.getMonth() + 1, 1, date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return addDays(newDate, -1);\n};\n","import { adjustDST } from './adjust-dst';\nimport { cloneDate } from './clone-date';\nimport { lastDayOfMonth } from './last-day-of-month';\nvar MONTHS_LENGTH = 12;\nvar normalize = function (date, expectedMonth) { return (date.getMonth() !== expectedMonth ? lastDayOfMonth(addMonths(date, -1)) : date //tslint:disable-line:no-use-before-declare\n); };\n/**\n * A function that adds and subtracts months from a `Date` object.\n *\n * @param date - The initial date value.\n * @param offset - The number of months to add or subtract from the date.\n * @returns - A new `Date` instance.\n *\n * @example\n * ```ts-no-run\n * addMonths(new Date(2016, 5, 1), 5); // 2016-11-1\n * addMonths(new Date(2016, 5, 1), -5); // 2015-1-1\n * ```\n */\nexport var addMonths = function (date, offset) {\n var newDate = cloneDate(date);\n var diff = (newDate.getMonth() + offset) % MONTHS_LENGTH;\n var expectedMonth = (MONTHS_LENGTH + diff) % MONTHS_LENGTH;\n newDate.setMonth(newDate.getMonth() + offset);\n return normalize(adjustDST(newDate, date.getHours()), expectedMonth);\n};\n","import { addMonths } from './add-months';\nimport { createDate } from './create-date';\nimport { lastDayOfMonth } from './last-day-of-month';\n/**\n * @hidden\n */\nexport var setYear = function (value, year) {\n var month = value.getMonth();\n var candidate = createDate(year, month, value.getDate(), value.getHours(), value.getMinutes(), value.getSeconds(), value.getMilliseconds());\n return candidate.getMonth() === month ? candidate : lastDayOfMonth(addMonths(candidate, -1));\n};\n","import { adjustDST } from './adjust-dst';\nimport { setYear } from './set-year';\n/**\n * A function that adds and subtracts years from a `Date` object.\n *\n * @param date - The initial date value.\n * @param offset - The number of years to add or subtract from the date.\n * @returns - A new `Date` instance.\n *\n * @example\n * ```ts-no-run\n * addYears(new Date(2016, 5, 1), 5); // 2011-6-1\n * addYears(new Date(2016, 5, 1), -5); // 2021-6-1\n * ```\n */\nexport var addYears = function (value, offset) {\n return adjustDST(setYear(value, value.getFullYear() + offset), value.getHours());\n};\n","import { addYears } from './add-years';\n/**\n * A function that adds and subtracts decades from a `Date` object.\n *\n * @param date - The initial date value.\n * @param offset - The number of decades to add or subtract from the date.\n * @returns - A new `Date` instance.\n *\n * @example\n * ```ts-no-run\n * addDecades(new Date(2016, 5, 1), 5); // 2066-6-1\n * addDecades(new Date(2016, 5, 1), -5); // 1966-6-1\n * ```\n */\nexport var addDecades = function (value, offset) {\n return addYears(value, 10 * offset);\n};\n","import { addYears } from './add-years';\n/**\n * A function that adds and subtracts centuries from a `Date` object.\n *\n * @param date - The initial date value.\n * @param offset - The number of centuries to add or subtract from the date.\n * @returns - A new `Date` instance.\n *\n * @example\n * ```ts-no-run\n * addCenturies(new Date(2016, 5, 1), 5); // 2516-6-1\n * addCenturies(new Date(2016, 5, 1), -5); // 1516-6-1\n * ```\n */\nexport var addCenturies = function (value, offset) {\n return addYears(value, 100 * offset);\n};\n","import { setYear } from './set-year';\n/**\n * @hidden\n */\nexport var normalizeYear = function (value, year) { return (setYear(value, year(value.getFullYear()))); };\n","import { normalizeYear } from './normalize-year';\n/**\n * A function that returns a `Date` object of the first decade in a century.\n *\n * @param date - The start date value.\n * @returns - The first year in a century.\n *\n * @example\n * ```ts-no-run\n * firstDecadeOfCentury(new Date(2017, 0, 1)); // 2000-1-1\n * firstDecadeOfCentury(new Date(2007, 10, 22)); // 2000-11-22\n * firstDecadeOfCentury(new Date(2126, 0, 1)); // 2100-1-1\n * ```\n */\nexport var firstDecadeOfCentury = function (value) { return (normalizeYear(value, function (y) { return y - (y % 100); })); };\n","import { normalizeYear } from './normalize-year';\n/**\n * A function that returns a `Date` object of the last decade in a century.\n *\n * @param date - The start date value.\n * @returns - The last year in a decade.\n *\n * @example\n * ```ts-no-run\n * lastDecadeOfCentury(new Date(2017, 0, 1)); // 2090-1-1\n * lastDecadeOfCentury(new Date(2007, 10, 22)); // 2090-11-22\n * lastDecadeOfCentury(new Date(2126, 0, 1)); // 2190-1-1\n * ```\n */\nexport var lastDecadeOfCentury = function (value) { return (normalizeYear(value, function (y) { return y - (y % 100) + 90; })); };\n","import { normalizeYear } from './normalize-year';\n/**\n * A function that returns a `Date` object of the first year in a decade.\n *\n * @param date - The start date value.\n * @returns - The first year in a decade.\n *\n * @example\n * ```ts-no-run\n * firstYearOfDecade(new Date(2017, 0, 1)); // 2010-1-1\n * firstYearOfDecade(new Date(2007, 10, 22)); // 2000-11-22\n * firstYearOfDecade(new Date(2026, 0, 1)); // 2020-1-1\n * ```\n */\nexport var firstYearOfDecade = function (value) { return (normalizeYear(value, function (y) { return y - (y % 10); })); };\n","import { firstDecadeOfCentury } from './first-decade-of-century';\n/**\n * A function that calculates duration in centuries between two `Date` objects.\n *\n * @param start - The start date value.\n * @param end - The end date value.\n * @returns - The duration in months.\n *\n * @example\n * ```ts-no-run\n * durationInCenturies(new Date(2016, 0, 1), new Date(3216, 0, 1)); // 12\n * durationInCenturies(new Date(2016, 6, 1), new Date(2617, 0, 1)); // 6\n * durationInCenturies(new Date(2016, 0, 1), new Date(2016, 0, 1)); // 0\n * ```\n */\nexport var durationInCenturies = function (start, end) { return ((firstDecadeOfCentury(end).getFullYear() - firstDecadeOfCentury(start).getFullYear()) / 100); };\n","import { normalizeYear } from './normalize-year';\n/**\n * A function that returns a `Date` object of the last year in a decade.\n *\n * @param date - The start date value.\n * @returns - The last year in a decade.\n *\n * @example\n * ```ts-no-run\n * lastYearOfDecade(new Date(2017, 0, 1)); // 2019-1-1\n * lastYearOfDecade(new Date(2007, 10, 22)); // 2009-11-22\n * lastYearOfDecade(new Date(2026, 0, 1)); // 2029-1-1\n * ```\n */\nexport var lastYearOfDecade = function (value) { return (normalizeYear(value, function (y) { return y - (y % 10) + 9; })); };\n","import { firstYearOfDecade } from './first-year-of-decade';\n/**\n * A function that calculates duration in decades between two `Date` objects.\n *\n * @param start - The start date value.\n * @param end - The end date value.\n * @returns - The duration in months.\n *\n * @example\n * ```ts-no-run\n * durationInDecades(new Date(2016, 0, 1), new Date(2136, 0, 1)); // 12\n * durationInDecades(new Date(2016, 0, 1), new Date(2016, 0, 1)); // 0\n * ```\n */\nexport var durationInDecades = function (start, end) { return ((firstYearOfDecade(end).getFullYear() - firstYearOfDecade(start).getFullYear()) / 10); };\n","import { addDays } from './add-days';\n/**\n * A function that adds and subtracts weeks from a Date object.\n *\n * @param date - The initial date value.\n * @param offset - The number of weeks to add/subtract from the date.\n * @returns - A new `Date` instance.\n *\n * @example\n * ```ts-no-run\n * addWeeks(new Date(2016, 5, 1), 3); // 2016-6-22\n * addWeeks(new Date(2016, 5, 1), -3); // 2015-5-11\n * ```\n */\nexport var addWeeks = function (date, offset) {\n return addDays(date, offset * 7);\n};\n","import { createDate } from './create-date';\n/**\n * A function which returns the first date of the month.\n *\n * @param date - The initial date.\n * @returns - The first date of the initial date month.\n *\n * @example\n * ```ts-no-run\n * firstDayOfMonth(new Date(2016, 0, 15)); // 2016-01-01\n * ```\n */\nexport var firstDayOfMonth = function (date) {\n return createDate(date.getFullYear(), date.getMonth(), 1, date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n};\n","// tslint:disable:max-line-length\n/**\n * An enumeration which represents the horizontal direction. The `Forward` option moves forward. The `Backward` option moves backward.\n */\nexport var Direction;\n(function (Direction) {\n /**\n * The `Forward` value with an underlying `1` number value.\n */\n Direction[Direction[\"Forward\"] = 1] = \"Forward\";\n /**\n * The `Backward` value with an underlying `-1` (minus one) number value.\n */\n Direction[Direction[\"Backward\"] = -1] = \"Backward\";\n})(Direction || (Direction = {}));\n// tslint:enable:max-line-length\n","import { Direction } from \"./direction.enum\";\nimport { adjustDST } from \"./adjust-dst\";\nimport { cloneDate } from './clone-date';\n/**\n * @hidden\n *\n * A function which returns the next or previous date for a specific week day. For example, `Day.Monday`.\n *\n * @param date - The date to calculate from.\n * @param weekDay - The `Day` enum specifying the desired week day.\n * @param direction - The `Direction` enum specifying the calculation direction.\n * @returns - A `Date` instance.\n *\n * @example\n * ```ts-no-run\n * dayOfWeek(new Date(2016, 0, 1), Day.Wednesday, Direction.Forward); // 2016-01-06, Wednesday\n * dayOfWeek(new Date(2016, 0, 1), Day.Wednesday, Direction.Backward); // 2015-12-30, Wednesday\n * ```\n */\nexport var dayOfWeek = function (date, weekDay, direction) {\n if (direction === void 0) { direction = Direction.Forward; }\n var newDate = cloneDate(date);\n var newDay = ((weekDay - newDate.getDay()) + (7 * direction)) % 7;\n newDate.setDate(newDate.getDate() + newDay);\n return adjustDST(newDate, date.getHours());\n};\n","/**\n * A function that calculates duration in months between two `Date` objects.\n *\n * @param start - The start date value.\n * @param end - The end date value.\n * @returns - The duration in months.\n *\n * @example\n * ```ts-no-run\n * durationInMonths(new Date(2016, 0, 1), new Date(2017, 0, 1)); // 12\n * durationInMonths(new Date(2016, 6, 1), new Date(2017, 0, 1)); // 6\n * durationInMonths(new Date(2016, 0, 1), new Date(2016, 0, 1)); // 0\n * ```\n */\nexport var durationInMonths = function (start, end) { return (((end.getFullYear() - start.getFullYear())) * 12 + (end.getMonth() - start.getMonth())); };\n","import { addMonths } from './add-months';\nimport { createDate } from './create-date';\nimport { lastDayOfMonth } from './last-day-of-month';\n/**\n * @hidden\n */\nexport var setMonth = function (value, month) {\n var day = value.getDate();\n var candidate = createDate(value.getFullYear(), month, day, value.getHours(), value.getMinutes(), value.getSeconds(), value.getMilliseconds());\n return candidate.getDate() === day ? candidate : lastDayOfMonth(addMonths(candidate, -1));\n};\n","import { setMonth } from './set-month';\n/**\n * A function that returns a `Date` object of the first month in a year.\n *\n * @param date - The start date value.\n * @returns - The first month in a year.\n *\n * @example\n * ```ts-no-run\n * firstMonthOfYear(new Date(2017, 11, 1)); // 2017-1-1\n * firstMonthOfYear(new Date(2017, 0, 1)); // 2017-1-1\n * ```\n */\nexport var firstMonthOfYear = function (value) { return setMonth(value, 0); };\n","import { setMonth } from './set-month';\n/**\n * A function that returns a `Date` object of the last month in a year.\n *\n * @param date - The start date value.\n * @returns - The last month in a year.\n *\n * @example\n * ```ts-no-run\n * lastMonthOfYear(new Date(2017, 5, 3)); // 2017-12-3\n * lastMonthOfYear(new Date(2017, 11, 3)); // 2017-12-3\n * ```\n */\nexport var lastMonthOfYear = function (value) { return setMonth(value, 11); };\n","/**\n * A function that calculates duration in years between two `Date` objects.\n *\n * @param start - The start date value.\n * @param end - The end date value.\n * @returns - The duration in years.\n *\n * @example\n * ```ts-no-run\n * durationInYears(new Date(2016, 0, 1), new Date(2028, 0, 1)); // 12\n * durationInYears(new Date(2016, 0, 1), new Date(2022, 0, 1)); // 6\n * durationInYears(new Date(2016, 0, 1), new Date(2016, 0, 1)); // 0\n * ```\n */\nexport var durationInYears = function (start, end) { return (end.getFullYear() - start.getFullYear()); };\n","/**\n * Enumeration which represents the week days.\n */\nexport var Day;\n(function (Day) {\n /**\n * The Sunday value with an underlying `0` number value.\n */\n Day[Day[\"Sunday\"] = 0] = \"Sunday\";\n /**\n * The Monday value with an underlying `1` number value.\n */\n Day[Day[\"Monday\"] = 1] = \"Monday\";\n /**\n * The Tuesday value with an underlying `2` number value.\n */\n Day[Day[\"Tuesday\"] = 2] = \"Tuesday\";\n /**\n * The Wednesday value with an underlying `3` number value.\n */\n Day[Day[\"Wednesday\"] = 3] = \"Wednesday\";\n /**\n * The Thursday value with an underlying `4` number value.\n */\n Day[Day[\"Thursday\"] = 4] = \"Thursday\";\n /**\n * The Friday value with an underlying `5` number value.\n */\n Day[Day[\"Friday\"] = 5] = \"Friday\";\n /**\n * The Saturday value with an underlying `6` number value.\n */\n Day[Day[\"Saturday\"] = 6] = \"Saturday\";\n})(Day || (Day = {}));\n","import { Day } from './day.enum';\nimport { addDays } from './add-days';\nimport { createDate } from './create-date';\nimport { prevDayOfWeek } from './prev-day-of-week';\nimport { MS_PER_DAY } from './constants';\nvar moveDateToWeekStart = function (date, weekStartDay) {\n if (weekStartDay !== Day.Monday) {\n return addDays(prevDayOfWeek(date, weekStartDay), 4);\n }\n return addDays(date, (4 - (date.getDay() || 7)));\n};\nvar calcWeekInYear = function (date, weekStartDay) {\n var firstWeekInYear = createDate(date.getFullYear(), 0, 1, -6);\n var newDate = moveDateToWeekStart(date, weekStartDay);\n var diffInMS = newDate.getTime() - firstWeekInYear.getTime();\n var days = Math.floor(diffInMS / MS_PER_DAY);\n return 1 + Math.floor(days / 7);\n};\n/**\n * A function that returns the number of the week within a year, which is calculated in relation to the date.\n *\n * For more information, refer to the [**ISO week date**](https://en.wikipedia.org/wiki/ISO_week_date) article.\n *\n * @param date - The date used for the week number calculation.\n * @param weekStartDay - The first day of the week. By default, the first week day is Monday.\n * @returns - The number of the week within the year.\n *\n * @example\n * ```ts-no-run\n * weekInYear(new Date(2016, 0, 1)); // Week 53, 2015\n * weekInYear(new Date(2016, 0, 5)); // Week 1, 2016\n * weekInYear(new Date(2017, 0, 1)); // Week 52, 2016\n * weekInYear(new Date(2017, 0, 2)); // Week 1, 2017\n * ```\n */\nexport var weekInYear = function (date, weekStartDay) {\n if (weekStartDay === void 0) { weekStartDay = Day.Monday; }\n var prevWeekDate = addDays(date, -7);\n var nextWeekDate = addDays(date, 7);\n var weekNumber = calcWeekInYear(date, weekStartDay);\n if (weekNumber === 0) {\n return calcWeekInYear(prevWeekDate, weekStartDay) + 1;\n }\n if (weekNumber === 53 && calcWeekInYear(nextWeekDate, weekStartDay) > 1) {\n return 1;\n }\n return weekNumber;\n};\n","import { Direction } from \"./direction.enum\";\nimport { dayOfWeek } from './day-of-week';\n/**\n * A function which returns a date by a specific week name. For example, `Day.Monday`.\n *\n * @param date - The date to calculate from.\n * @param weekDay - The `Day` enum specifying the desired week day.\n * @returns - A `Date` instance.\n *\n * @example\n * ```ts-no-run\n * prevDayOfWeek(new Date(2016, 0, 1), Day.Wednesday); // 2015-12-30, Wednesday\n * ```\n */\nexport var prevDayOfWeek = function (date, weekDay) {\n return dayOfWeek(date, weekDay, Direction.Backward);\n};\n","/**\n * The number of milliseconds in one minute.\n */\nexport var MS_PER_MINUTE = 60000;\n/**\n * The number of milliseconds in one hour.\n */\nexport var MS_PER_HOUR = 3600000;\n/**\n * The number of milliseconds in one standard day.\n */\nexport var MS_PER_DAY = 86400000;\n","/**-----------------------------------------------------------------------------------------\n* Copyright © 2020 Progress Software Corporation. All rights reserved.\n* Licensed under commercial license. See LICENSE.md in the project root for more information\n*-------------------------------------------------------------------------------------------*/\nimport { Injectable, Injector, EventEmitter, InjectionToken, Component, Inject, ElementRef, Renderer2, NgZone, Input, Output, HostBinding, ChangeDetectionStrategy, ChangeDetectorRef, ViewChild, Directive, TemplateRef, isDevMode, forwardRef, Optional, ContentChild, ViewContainerRef, HostListener, ViewChildren, ContentChildren, IterableDiffers, NgModule } from '@angular/core';\nimport { NG_VALUE_ACCESSOR, NG_VALIDATORS, NgControl } from '@angular/forms';\nimport { LocalizationService, L10N_PREFIX, RTL, ComponentMessages } from '@progress/kendo-angular-l10n';\nimport { getDate, isEqual, cloneDate, addDays, addDecades, addCenturies, firstDecadeOfCentury, lastDecadeOfCentury, firstYearOfDecade, createDate, durationInCenturies, addYears, lastYearOfDecade, durationInDecades, addWeeks, addMonths, firstDayOfMonth, lastDayOfMonth, dayOfWeek, durationInMonths, firstMonthOfYear, lastMonthOfYear, durationInYears, weekInYear } from '@progress/kendo-date-math';\nimport { isDocumentAvailable, KendoInput, hasObservers, Keys, guid, EventsModule } from '@progress/kendo-angular-common';\nimport { IntlService, IntlModule } from '@progress/kendo-angular-intl';\nimport { ReplaySubject, Observable, combineLatest, of, interval, animationFrameScheduler, fromEvent, EMPTY, Subject, from, Subscription, BehaviorSubject, merge } from 'rxjs';\nimport { map, scan, takeWhile, tap, filter, debounceTime } from 'rxjs/operators';\nimport { PopupService, PopupModule } from '@progress/kendo-angular-popup';\nimport { __extends } from 'tslib';\nimport { CommonModule } from '@angular/common';\nimport { touchEnabled } from '@progress/kendo-common';\n\n/**\n * @hidden\n */\nvar Action;\n(function (Action) {\n Action[Action[\"Left\"] = 0] = \"Left\";\n Action[Action[\"Right\"] = 1] = \"Right\";\n Action[Action[\"Up\"] = 2] = \"Up\";\n Action[Action[\"Down\"] = 3] = \"Down\";\n Action[Action[\"PrevView\"] = 4] = \"PrevView\";\n Action[Action[\"NextView\"] = 5] = \"NextView\";\n Action[Action[\"FirstInView\"] = 6] = \"FirstInView\";\n Action[Action[\"LastInView\"] = 7] = \"LastInView\";\n Action[Action[\"LowerView\"] = 8] = \"LowerView\";\n Action[Action[\"UpperView\"] = 9] = \"UpperView\";\n})(Action || (Action = {}));\n\n/**\n * @hidden\n */\nvar EMPTY_SELECTIONRANGE = { start: null, end: null };\n\n/**\n * @hidden\n */\nvar MIDNIGHT_DATE = new Date(1980, 0, 1);\n/**\n * @hidden\n */\nvar MIN_DATE = new Date(1900, 0, 1);\n/**\n * @hidden\n */\nvar MAX_DATE = new Date(2099, 11, 31);\n/**\n * @hidden\n */\nvar MIN_TIME = new Date(1980, 0, 1);\n/**\n * @hidden\n */\nvar MAX_TIME = new Date(1980, 0, 1, 23, 59, 59);\n\n/* tslint:disable:no-bitwise max-line-length */\nvar isSet = function (value) { return value !== null && value !== undefined; };\nvar setter = function (method) { return function (date, value) {\n var clone = cloneDate(date);\n clone[method](value);\n return clone;\n}; };\n/**\n * @hidden\n */\nvar setTime = function (origin, candidate) {\n var date = cloneDate(origin);\n date.setHours(candidate.getHours(), candidate.getMinutes(), candidate.getSeconds(), candidate.getMilliseconds());\n return date;\n};\nvar normalizeTimes = function (candidate, min, max) { return ({\n candidateValue: setTime(MIDNIGHT_DATE, candidate),\n maxValue: addDays(setTime(MIDNIGHT_DATE, max), min.getHours() < max.getHours() ||\n (min.getHours() === max.getHours() && min.getMinutes() < max.getMinutes()) ? 0 : 1),\n minValue: setTime(MIDNIGHT_DATE, min)\n}); };\n/**\n * @hidden\n */\nvar setHours = setter('setHours');\n/**\n * @hidden\n */\nvar setMinutes = setter('setMinutes');\n/**\n * @hidden\n */\nvar setSeconds = setter('setSeconds');\n/**\n * @hidden\n */\nvar range = function (start, end, step) {\n if (step === void 0) { step = 1; }\n var result = [];\n for (var i = start; i < end; i = i + step) {\n result.push(i);\n }\n return result;\n};\n/**\n * @hidden\n */\nvar isInRange = function (candidate, min, max) { return (!candidate || !((min && min > candidate) || (max && max < candidate))); };\n/**\n * @hidden\n */\nvar isInTimeRange = function (candidate, min, max) {\n if (!candidate || !min || !max) {\n return true;\n }\n var _a = normalizeTimes(candidate, min, max), candidateValue = _a.candidateValue, minValue = _a.minValue, maxValue = _a.maxValue;\n return minValue <= candidateValue && candidateValue <= maxValue;\n};\n/**\n * @hidden\n */\nvar isValidRange = function (min, max) { return (!isSet(min) || !isSet(max) || min <= max); };\n/**\n * @hidden\n */\nvar dateInRange = function (candidate, min, max) {\n if (!candidate) {\n return candidate;\n }\n if (min && candidate < min) {\n return cloneDate(min);\n }\n if (max && candidate > max) {\n return cloneDate(max);\n }\n return candidate;\n};\n/**\n * @hidden\n */\nvar timeInRange = function (candidate, min, max) {\n if (!candidate || !min || !max) {\n return candidate;\n }\n var _a = normalizeTimes(candidate, min, max), candidateValue = _a.candidateValue, minValue = _a.minValue, maxValue = _a.maxValue;\n if (candidateValue < minValue) {\n return setTime(candidate, min);\n }\n if (candidateValue > maxValue) {\n return setTime(candidate, max);\n }\n return candidate;\n};\n/**\n * @hidden\n */\nvar getNow = function () { return new Date(); };\n/**\n * @hidden\n */\nvar getToday = function () { return getDate(new Date()); };\n/**\n * @hidden\n */\nvar noop = function (_) { }; // tslint:disable-line:no-empty\n/**\n * @hidden\n */\nvar isWindowAvailable = function () {\n return typeof window !== 'undefined';\n};\n/**\n * @hidden\n */\nvar stringifyClassObject = function (classes) {\n var pushToAcc = function (acc, cls) { return classes[cls] ? acc.concat(cls) : acc; };\n return Object.keys(classes).reduce(pushToAcc, []).join(' ');\n};\n/**\n * @hidden\n */\nvar shiftWeekNames = function (names, offset) { return (names.slice(offset).concat(names.slice(0, offset))); };\n/**\n * @hidden\n */\nvar approximateStringMatching = function (oldTextOrigin, oldFormat, newTextOrigin, caret) {\n // Remove the right part of the cursor.\n //oldFormat = oldFormat.substring(0, caret + oldText.length - newText.length);\n var oldIndex = caret + oldTextOrigin.length - newTextOrigin.length;\n var oldTextSeparator = oldTextOrigin[oldIndex];\n var oldText = oldTextOrigin.substring(0, caret + oldTextOrigin.length - newTextOrigin.length);\n var newText = newTextOrigin.substring(0, caret);\n var diff = [];\n // Handle typing a single character over the same selection.\n if (oldText === newText && caret > 0) {\n diff.push([oldFormat[caret - 1], newText[caret - 1]]);\n return diff;\n }\n if (oldText.indexOf(newText) === 0 && (newText.length === 0 || oldFormat[newText.length - 1] !== oldFormat[newText.length])) {\n // Handle Delete/Backspace.\n var deletedSymbol = \"\";\n //XXX:\n // Whole text is replaced with a same char\n // Nasty patch required to keep the selection in the first segment\n if (newText.length === 1) {\n diff.push([oldFormat[0], newText[0]]);\n }\n for (var i = newText.length; i < oldText.length; i++) {\n if (oldFormat[i] !== deletedSymbol && oldFormat[i] !== \"_\") {\n deletedSymbol = oldFormat[i];\n diff.push([deletedSymbol, \"\"]);\n }\n }\n return diff;\n }\n // Handle inserting text (the new text is longer than the previous one).\n // Handle typing over a literal as well.\n if (newText.indexOf(oldText) === 0 || oldFormat[caret - 1] === \"_\") {\n var symbol = oldFormat[0];\n for (var i = Math.max(0, oldText.length - 1); i < oldFormat.length; i++) {\n if (oldFormat[i] !== \"_\") {\n symbol = oldFormat[i];\n break;\n }\n }\n return [[symbol, newText[caret - 1]]];\n }\n // Handle entering a space or a separator, for navigation to the next item.\n if (newText[newText.length - 1] === \" \" || (newText[newText.length - 1] === oldTextSeparator && oldFormat[oldIndex] === '_')) {\n return [[oldFormat[caret - 1], \"_\"]];\n }\n // Handle typing over a correctly selected part.\n return [[oldFormat[caret - 1], newText[caret - 1]]];\n};\n/**\n * @hidden\n */\nvar domContainerFactory = function (type) { return function (children, classes, styles) {\n if (classes === void 0) { classes = \"\"; }\n if (styles === void 0) { styles = {}; }\n var container = document.createElement(type);\n container.className = classes;\n Object.keys(styles).map(function (key) { return container.style[key] = styles[key]; });\n if (typeof children === 'string') {\n container.innerHTML = children || '';\n }\n else {\n (children || []).forEach(function (child) { return child && container.appendChild(child); });\n }\n return container;\n}; };\n/**\n * @hidden\n */\nvar hasChange = function (changes, field) { return changes[field] !== undefined; };\n/**\n * @hidden\n */\nvar hasExistingValue = function (changes, field) { return changes[field] && changes[field].currentValue !== undefined && changes[field].currentValue !== null; };\n/**\n * @hidden\n */\nvar isInSelectionRange = function (value, selectionRange) {\n var _a = selectionRange || EMPTY_SELECTIONRANGE, start = _a.start, end = _a.end;\n if (!start || !end) {\n return false;\n }\n return start < value && value < end;\n};\n/**\n * @hidden\n */\nvar either = function (value1, value2) { return value1 || value2; };\n/**\n * @hidden\n */\nvar clampRange = function (value) { return ({ start: value, end: value }); };\n/**\n * @hidden\n */\nvar isEqualRange = function (initial, updated) {\n var _a = initial || EMPTY_SELECTIONRANGE, initialStart = _a.start, initialEnd = _a.end;\n var _b = updated || EMPTY_SELECTIONRANGE, updatedStart = _b.start, updatedEnd = _b.end;\n return isEqual(initialStart, updatedStart) && isEqual(initialEnd, updatedEnd);\n};\n/**\n * @hidden\n *\n * Creates a new date based on the date information from the specified date portion\n * and the time information from the time portion.\n * If a parameter is not provided, returns `null`.\n */\nvar mergeDateAndTime = function (date, time) {\n if (!(date && time)) {\n return null;\n }\n return new Date(date.getFullYear(), date.getMonth(), date.getDate(), time.getHours(), time.getMinutes(), time.getSeconds(), time.getMilliseconds());\n};\n/**\n * @hidden\n */\nvar lastMillisecondOfDate = function (date) {\n if (!date) {\n return null;\n }\n return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59, 999);\n};\n/**\n * @hidden\n *\n * Returns an array with dates ranging between and including the specified start and\n * end dates that are evaluated as disabled.\n */\nvar disabledDatesInRange = function (start, end, isDateDisabled) {\n if (!(start && end && isDateDisabled) || (start > end)) {\n return [];\n }\n var dates = [];\n var current = start;\n while (current <= end) {\n if (isDateDisabled(current)) {\n dates.push(current);\n }\n current = addDays(current, 1);\n }\n return dates;\n};\n\nvar _a;\nvar EMPTY_DATA = [[]];\nvar CELLS_LENGTH = 5;\nvar ROWS_LENGTH = 2;\nvar ACTIONS = (_a = {},\n _a[Action.Left] = function (date) { return addDecades(date, -1); },\n _a[Action.Up] = function (date) { return addDecades(date, -5); },\n _a[Action.Right] = function (date) { return addDecades(date, 1); },\n _a[Action.Down] = function (date) { return addDecades(date, 5); },\n _a[Action.PrevView] = function (date) { return addCenturies(date, -1); },\n _a[Action.NextView] = function (date) { return addCenturies(date, 1); },\n _a[Action.FirstInView] = function (date) { return firstDecadeOfCentury(date); },\n _a[Action.LastInView] = function (date) { return lastDecadeOfCentury(date); },\n _a);\n/**\n * @hidden\n */\nvar CenturyViewService = /** @class */ (function () {\n function CenturyViewService() {\n }\n CenturyViewService.prototype.addToDate = function (min, skip) {\n return addCenturies(min, skip);\n };\n CenturyViewService.prototype.datesList = function (start, count) {\n return range(0, count).map(function (i) { return addCenturies(start, i); });\n };\n CenturyViewService.prototype.data = function (options) {\n var _this = this;\n var cellUID = options.cellUID, focusedDate = options.focusedDate, isActiveView = options.isActiveView, max = options.max, min = options.min, selectedDate = options.selectedDate, _a = options.selectionRange, selectionRange = _a === void 0 ? EMPTY_SELECTIONRANGE : _a, viewDate = options.viewDate;\n if (!viewDate) {\n return EMPTY_DATA;\n }\n var cells = range(0, CELLS_LENGTH);\n var firstDate = firstDecadeOfCentury(viewDate);\n var lastDate = lastDecadeOfCentury(viewDate);\n var isSelectedDateInRange = isInRange(selectedDate, min, max);\n var today = getToday();\n return range(0, ROWS_LENGTH).map(function (rowOffset) {\n var baseDate = addDecades(firstDate, rowOffset * CELLS_LENGTH);\n return cells.map(function (cellOffset) {\n var cellDate = _this.normalize(addDecades(baseDate, cellOffset), min, max);\n if (!_this.isInRange(cellDate, min, max)) {\n return null;\n }\n var isRangeStart = _this.isEqual(cellDate, selectionRange.start);\n var isRangeEnd = _this.isEqual(cellDate, selectionRange.end);\n var isInMiddle = !isRangeStart && !isRangeEnd;\n var isRangeMid = isInMiddle && isInSelectionRange(cellDate, selectionRange);\n return {\n formattedValue: _this.value(cellDate),\n id: \"\" + cellUID + cellDate.getTime(),\n isFocused: _this.isEqual(cellDate, focusedDate),\n isSelected: isActiveView && isSelectedDateInRange && _this.isEqual(cellDate, selectedDate),\n isWeekend: false,\n isRangeStart: isRangeStart,\n isRangeMid: isRangeMid,\n isRangeEnd: isRangeEnd,\n isRangeSplitEnd: isRangeMid && _this.isEqual(cellDate, lastDate),\n isRangeSplitStart: isRangeMid && _this.isEqual(cellDate, firstDate),\n isToday: _this.isEqual(cellDate, today),\n title: _this.cellTitle(cellDate),\n value: cellDate\n };\n });\n });\n };\n CenturyViewService.prototype.isEqual = function (candidate, expected) {\n if (!candidate || !expected) {\n return false;\n }\n return firstYearOfDecade(candidate).getFullYear() === firstYearOfDecade(expected).getFullYear();\n };\n CenturyViewService.prototype.isInArray = function (date, dates) {\n if (!dates.length) {\n return false;\n }\n var year = date.getFullYear();\n return dates[0].getFullYear() <= year && year <= (dates[dates.length - 1].getFullYear() + 99);\n };\n CenturyViewService.prototype.isInRange = function (candidate, min, max) {\n var year = firstYearOfDecade(candidate).getFullYear();\n var aboveMin = !min || firstYearOfDecade(min).getFullYear() <= year;\n var belowMax = !max || year <= firstYearOfDecade(max).getFullYear();\n return aboveMin && belowMax;\n };\n CenturyViewService.prototype.beginningOfPeriod = function (date) {\n if (!date) {\n return date;\n }\n var firstYear = firstYearOfDecade(firstDecadeOfCentury(date));\n return createDate(firstYear.getFullYear(), 0, 1);\n };\n CenturyViewService.prototype.isRangeStart = function (value) {\n return value.getFullYear() % 1000 === 0;\n };\n CenturyViewService.prototype.move = function (value, action) {\n var modifier = ACTIONS[action];\n if (!modifier) {\n return value;\n }\n return modifier(value);\n };\n CenturyViewService.prototype.cellTitle = function (value) {\n return firstYearOfDecade(value).getFullYear().toString();\n };\n CenturyViewService.prototype.navigationTitle = function (value) {\n return value ? firstDecadeOfCentury(value).getFullYear().toString() : '';\n };\n CenturyViewService.prototype.title = function (value) {\n if (!value) {\n return '';\n }\n return firstDecadeOfCentury(value).getFullYear() + \" - \" + lastDecadeOfCentury(value).getFullYear();\n };\n CenturyViewService.prototype.rowLength = function (_) {\n return CELLS_LENGTH;\n };\n CenturyViewService.prototype.skip = function (value, min) {\n return durationInCenturies(min, value);\n };\n CenturyViewService.prototype.total = function (min, max) {\n return durationInCenturies(min, max) + 1;\n };\n CenturyViewService.prototype.value = function (current) {\n return current ? firstYearOfDecade(current).getFullYear().toString() : '';\n };\n CenturyViewService.prototype.viewDate = function (date, max, viewsCount) {\n if (viewsCount === void 0) { viewsCount = 1; }\n var viewsInRange = this.total(date, max);\n if (viewsInRange < viewsCount) {\n var centuriesToSubtract = viewsCount - viewsInRange;\n return addCenturies(date, -1 * centuriesToSubtract);\n }\n return date;\n };\n CenturyViewService.prototype.normalize = function (cellDate, min, max) {\n if (cellDate < min && this.isEqual(cellDate, min)) {\n return cloneDate(min);\n }\n if (cellDate > max && this.isEqual(cellDate, max)) {\n return cloneDate(max);\n }\n return cellDate;\n };\n CenturyViewService.decorators = [\n { type: Injectable },\n ];\n return CenturyViewService;\n}());\n\nvar _a$1;\nvar EMPTY_DATA$1 = [[]];\nvar CELLS_LENGTH$1 = 5;\nvar ROWS_LENGTH$1 = 2;\nvar ACTIONS$1 = (_a$1 = {},\n _a$1[Action.Left] = function (date) { return addYears(date, -1); },\n _a$1[Action.Up] = function (date) { return addYears(date, -5); },\n _a$1[Action.Right] = function (date) { return addYears(date, 1); },\n _a$1[Action.Down] = function (date) { return addYears(date, 5); },\n _a$1[Action.PrevView] = function (date) { return addDecades(date, -1); },\n _a$1[Action.NextView] = function (date) { return addDecades(date, 1); },\n _a$1[Action.FirstInView] = function (date) { return firstYearOfDecade(date); },\n _a$1[Action.LastInView] = function (date) { return lastYearOfDecade(date); },\n _a$1);\n/**\n * @hidden\n */\nvar DecadeViewService = /** @class */ (function () {\n function DecadeViewService() {\n }\n DecadeViewService.prototype.addToDate = function (min, skip) {\n return addDecades(min, skip);\n };\n DecadeViewService.prototype.datesList = function (start, count) {\n return range(0, count).map(function (i) { return addDecades(start, i); });\n };\n DecadeViewService.prototype.data = function (options) {\n var _this = this;\n var cellUID = options.cellUID, focusedDate = options.focusedDate, isActiveView = options.isActiveView, max = options.max, min = options.min, selectedDate = options.selectedDate, _a = options.selectionRange, selectionRange = _a === void 0 ? EMPTY_SELECTIONRANGE : _a, viewDate = options.viewDate;\n if (!viewDate) {\n return EMPTY_DATA$1;\n }\n var cells = range(0, CELLS_LENGTH$1);\n var firstDate = firstYearOfDecade(viewDate);\n var lastDate = lastYearOfDecade(viewDate);\n var isSelectedDateInRange = isInRange(selectedDate, min, max);\n var today = getToday();\n return range(0, ROWS_LENGTH$1).map(function (rowOffset) {\n var baseDate = addYears(firstDate, rowOffset * CELLS_LENGTH$1);\n return cells.map(function (cellOffset) {\n var cellDate = _this.normalize(addYears(baseDate, cellOffset), min, max);\n if (!_this.isInRange(cellDate, min, max)) {\n return null;\n }\n var isRangeStart = _this.isEqual(cellDate, selectionRange.start);\n var isRangeEnd = _this.isEqual(cellDate, selectionRange.end);\n var isInMiddle = !isRangeStart && !isRangeEnd;\n var isRangeMid = isInMiddle && isInSelectionRange(cellDate, selectionRange);\n return {\n formattedValue: _this.value(cellDate),\n id: \"\" + cellUID + cellDate.getTime(),\n isFocused: _this.isEqual(cellDate, focusedDate),\n isSelected: isActiveView && isSelectedDateInRange && _this.isEqual(cellDate, selectedDate),\n isWeekend: false,\n isRangeStart: isRangeStart,\n isRangeMid: isRangeMid,\n isRangeEnd: isRangeEnd,\n isRangeSplitEnd: isRangeMid && _this.isEqual(cellDate, lastDate),\n isRangeSplitStart: isRangeMid && _this.isEqual(cellDate, firstDate),\n isToday: _this.isEqual(cellDate, today),\n title: _this.cellTitle(cellDate),\n value: cellDate\n };\n });\n });\n };\n DecadeViewService.prototype.isEqual = function (candidate, expected) {\n if (!candidate || !expected) {\n return false;\n }\n return candidate.getFullYear() === expected.getFullYear();\n };\n DecadeViewService.prototype.isInArray = function (date, dates) {\n if (!dates.length) {\n return false;\n }\n var year = date.getFullYear();\n return dates[0].getFullYear() <= year && year <= (dates[dates.length - 1].getFullYear() + 9);\n };\n DecadeViewService.prototype.isInRange = function (candidate, min, max) {\n var year = candidate.getFullYear();\n var aboveMin = !min || min.getFullYear() <= year;\n var belowMax = !max || year <= max.getFullYear();\n return aboveMin && belowMax;\n };\n DecadeViewService.prototype.beginningOfPeriod = function (date) {\n if (!date) {\n return date;\n }\n var firstYear = firstYearOfDecade(date);\n return createDate(firstYear.getFullYear(), 0, 1);\n };\n DecadeViewService.prototype.isRangeStart = function (value) {\n return value.getFullYear() % 100 === 0;\n };\n DecadeViewService.prototype.move = function (value, action) {\n var modifier = ACTIONS$1[action];\n if (!modifier) {\n return value;\n }\n return modifier(value);\n };\n DecadeViewService.prototype.cellTitle = function (value) {\n return value.getFullYear().toString();\n };\n DecadeViewService.prototype.navigationTitle = function (value) {\n return value ? firstYearOfDecade(value).getFullYear().toString() : '';\n };\n DecadeViewService.prototype.title = function (value) {\n if (!value) {\n return '';\n }\n return firstYearOfDecade(value).getFullYear() + \" - \" + lastYearOfDecade(value).getFullYear();\n };\n DecadeViewService.prototype.rowLength = function (_) {\n return CELLS_LENGTH$1;\n };\n DecadeViewService.prototype.skip = function (value, min) {\n return durationInDecades(min, value);\n };\n DecadeViewService.prototype.total = function (min, max) {\n return durationInDecades(min, max) + 1;\n };\n DecadeViewService.prototype.value = function (current) {\n return current ? current.getFullYear().toString() : '';\n };\n DecadeViewService.prototype.viewDate = function (date, max, viewsCount) {\n if (viewsCount === void 0) { viewsCount = 1; }\n var viewsInRange = this.total(date, max);\n if (viewsInRange < viewsCount) {\n var decadesToSubtract = viewsCount - viewsInRange;\n return addDecades(date, -1 * decadesToSubtract);\n }\n return date;\n };\n DecadeViewService.prototype.normalize = function (cellDate, min, max) {\n if (cellDate < min && this.isEqual(cellDate, min)) {\n return cloneDate(min);\n }\n if (cellDate > max && this.isEqual(cellDate, max)) {\n return cloneDate(max);\n }\n return cellDate;\n };\n DecadeViewService.decorators = [\n { type: Injectable },\n ];\n return DecadeViewService;\n}());\n\nvar _a$2;\nvar EMPTY_DATA$2 = [[]];\nvar CELLS_LENGTH$2 = 7;\nvar ROWS_LENGTH$2 = 6;\nvar ACTIONS$2 = (_a$2 = {},\n _a$2[Action.Left] = function (date) { return addDays(date, -1); },\n _a$2[Action.Up] = function (date) { return addWeeks(date, -1); },\n _a$2[Action.Right] = function (date) { return addDays(date, 1); },\n _a$2[Action.Down] = function (date) { return addWeeks(date, 1); },\n _a$2[Action.PrevView] = function (date) { return addMonths(date, -1); },\n _a$2[Action.NextView] = function (date) { return addMonths(date, 1); },\n _a$2[Action.FirstInView] = function (date) { return firstDayOfMonth(date); },\n _a$2[Action.LastInView] = function (date) { return lastDayOfMonth(date); },\n _a$2);\n/**\n * @hidden\n */\nvar MonthViewService = /** @class */ (function () {\n function MonthViewService(_intlService) {\n this._intlService = _intlService;\n }\n MonthViewService.prototype.addToDate = function (min, skip) {\n return addMonths(min, skip);\n };\n MonthViewService.prototype.datesList = function (start, count) {\n return range(0, count).map(function (i) { return addMonths(start, i); });\n };\n MonthViewService.prototype.data = function (options) {\n var _this = this;\n var cellUID = options.cellUID, focusedDate = options.focusedDate, isActiveView = options.isActiveView, max = options.max, min = options.min, selectedDate = options.selectedDate, _a = options.selectionRange, selectionRange = _a === void 0 ? EMPTY_SELECTIONRANGE : _a, viewDate = options.viewDate, _b = options.isDateDisabled, isDateDisabled = _b === void 0 ? function () { return false; } : _b;\n if (!viewDate) {\n return EMPTY_DATA$2;\n }\n var firstMonthDate = firstDayOfMonth(viewDate);\n var firstMonthDay = getDate(firstMonthDate);\n var lastMonthDate = lastDayOfMonth(viewDate);\n var lastMonthDay = getDate(lastMonthDate);\n var backward = -1;\n var isSelectedDateInRange = isInRange(selectedDate, min, max);\n var date = dayOfWeek(firstMonthDate, this._intlService.firstDay(), backward);\n var cells = range(0, CELLS_LENGTH$2);\n var today = getToday();\n return range(0, ROWS_LENGTH$2).map(function (rowOffset) {\n var baseDate = addDays(date, rowOffset * CELLS_LENGTH$2);\n return cells.map(function (cellOffset) {\n var cellDate = _this.normalize(addDays(baseDate, cellOffset), min, max);\n var cellDay = getDate(cellDate);\n var otherMonth = cellDay < firstMonthDay || cellDay > lastMonthDay;\n var outOfRange = cellDate < min || cellDate > max;\n if (otherMonth || outOfRange) {\n return null;\n }\n var isRangeStart = _this.isEqual(cellDate, selectionRange.start);\n var isRangeEnd = _this.isEqual(cellDate, selectionRange.end);\n var isInMiddle = !isRangeStart && !isRangeEnd;\n var isRangeMid = isInMiddle && isInSelectionRange(cellDate, selectionRange);\n return {\n formattedValue: _this.value(cellDate),\n id: \"\" + cellUID + cellDate.getTime(),\n isFocused: _this.isEqual(cellDate, focusedDate),\n isSelected: isActiveView && isSelectedDateInRange && _this.isEqual(cellDate, selectedDate),\n isWeekend: _this.isWeekend(cellDate),\n isRangeStart: isRangeStart,\n isRangeMid: isRangeMid,\n isRangeEnd: isRangeEnd,\n isRangeSplitStart: isRangeMid && _this.isEqual(cellDate, firstMonthDate),\n isRangeSplitEnd: isRangeMid && _this.isEqual(cellDate, lastMonthDate),\n isToday: _this.isEqual(cellDate, today),\n title: _this.cellTitle(cellDate),\n value: cellDate,\n isDisabled: isDateDisabled(cellDate)\n };\n });\n });\n };\n MonthViewService.prototype.isEqual = function (candidate, expected) {\n if (!candidate || !expected) {\n return false;\n }\n return getDate(candidate).getTime() === getDate(expected).getTime();\n };\n MonthViewService.prototype.isInArray = function (date, dates) {\n if (dates.length === 0) {\n return false;\n }\n var lowerBound = this.beginningOfPeriod(dates[0]);\n var upperBound = this.beginningOfPeriod(addMonths(dates[dates.length - 1], 1));\n return lowerBound <= date && date < upperBound;\n };\n MonthViewService.prototype.isInRange = function (candidate, min, max) {\n var value = getDate(candidate);\n var aboveMin = !min || getDate(min) <= value;\n var belowMax = !max || value <= getDate(max);\n return aboveMin && belowMax;\n };\n MonthViewService.prototype.beginningOfPeriod = function (date) {\n if (!date) {\n return date;\n }\n return createDate(date.getFullYear(), date.getMonth(), 1);\n };\n MonthViewService.prototype.isRangeStart = function (value) {\n return !value.getMonth();\n };\n MonthViewService.prototype.move = function (value, action) {\n var modifier = ACTIONS$2[action];\n if (!modifier) {\n return value;\n }\n return modifier(value);\n };\n MonthViewService.prototype.cellTitle = function (value) {\n return this._intlService.formatDate(value, 'D');\n };\n MonthViewService.prototype.navigationTitle = function (value) {\n if (!value) {\n return '';\n }\n return this.isRangeStart(value) ? value.getFullYear().toString() : this.abbrMonthNames()[value.getMonth()];\n };\n MonthViewService.prototype.title = function (current) {\n return this.wideMonthNames()[current.getMonth()] + \" \" + current.getFullYear();\n };\n MonthViewService.prototype.rowLength = function (prependCell) {\n return CELLS_LENGTH$2 + (prependCell ? 1 : 0);\n };\n MonthViewService.prototype.skip = function (value, min) {\n return durationInMonths(min, value);\n };\n MonthViewService.prototype.total = function (min, max) {\n return durationInMonths(min, max) + 1;\n };\n MonthViewService.prototype.value = function (current) {\n return current ? current.getDate().toString() : \"\";\n };\n MonthViewService.prototype.viewDate = function (date, max, viewsCount) {\n if (viewsCount === void 0) { viewsCount = 1; }\n var viewsInRange = this.total(date, max);\n if (viewsInRange < viewsCount) {\n var monthsToSubtract = viewsCount - viewsInRange;\n return addMonths(date, -1 * monthsToSubtract);\n }\n return date;\n };\n MonthViewService.prototype.isWeekend = function (date) {\n var _a = this._intlService.weekendRange(), start = _a.start, end = _a.end;\n var day = date.getDay();\n if (end < start) {\n return day <= end || start <= day;\n }\n return start <= day && day <= end;\n };\n MonthViewService.prototype.abbrMonthNames = function () {\n return this._intlService.dateFormatNames({ nameType: 'abbreviated', type: 'months' });\n };\n MonthViewService.prototype.normalize = function (cellDate, min, max) {\n if (cellDate < min && this.isEqual(cellDate, min)) {\n return cloneDate(min);\n }\n if (cellDate > max && this.isEqual(cellDate, max)) {\n return cloneDate(max);\n }\n return cellDate;\n };\n MonthViewService.prototype.wideMonthNames = function () {\n return this._intlService.dateFormatNames({ nameType: 'wide', type: 'months' });\n };\n MonthViewService.decorators = [\n { type: Injectable },\n ];\n /** @nocollapse */\n MonthViewService.ctorParameters = function () { return [\n { type: IntlService }\n ]; };\n return MonthViewService;\n}());\n\nvar _a$3;\nvar EMPTY_DATA$3 = [[]];\nvar CELLS_LENGTH$3 = 5;\nvar ROWS_LENGTH$3 = 3;\nvar upStep = function (month) {\n if (month > 4) {\n return -5;\n }\n if (month < 2) {\n return -2;\n }\n return -7;\n};\nvar downStep = function (month) {\n if (month < 7) {\n return 5;\n }\n if (month < 10) {\n return 7;\n }\n return 2;\n};\nvar ACTIONS$3 = (_a$3 = {},\n _a$3[Action.Left] = function (date) { return addMonths(date, -1); },\n _a$3[Action.Up] = function (date) { return addMonths(date, upStep(date.getMonth())); },\n _a$3[Action.Right] = function (date) { return addMonths(date, 1); },\n _a$3[Action.Down] = function (date) { return addMonths(date, downStep(date.getMonth())); },\n _a$3[Action.PrevView] = function (date) { return addYears(date, -1); },\n _a$3[Action.NextView] = function (date) { return addYears(date, 1); },\n _a$3[Action.FirstInView] = function (date) { return firstMonthOfYear(date); },\n _a$3[Action.LastInView] = function (date) { return lastMonthOfYear(date); },\n _a$3);\n/**\n * @hidden\n */\nvar YearViewService = /** @class */ (function () {\n function YearViewService(_intlService) {\n this._intlService = _intlService;\n }\n YearViewService.prototype.addToDate = function (min, skip) {\n return addYears(min, skip);\n };\n YearViewService.prototype.datesList = function (start, count) {\n return range(0, count).map(function (i) { return addYears(start, i); });\n };\n YearViewService.prototype.data = function (options) {\n var _this = this;\n var cellUID = options.cellUID, focusedDate = options.focusedDate, isActiveView = options.isActiveView, max = options.max, min = options.min, selectedDate = options.selectedDate, _a = options.selectionRange, selectionRange = _a === void 0 ? EMPTY_SELECTIONRANGE : _a, viewDate = options.viewDate;\n if (!viewDate) {\n return EMPTY_DATA$3;\n }\n var months = this.abbrMonthNames();\n var isSelectedDateInRange = isInRange(selectedDate, min, max);\n var firstDate = firstMonthOfYear(viewDate);\n var lastDate = lastMonthOfYear(viewDate);\n var currentYear = firstDate.getFullYear();\n var cells = range(0, CELLS_LENGTH$3);\n var today = getToday();\n return range(0, ROWS_LENGTH$3).map(function (rowOffset) {\n var baseDate = addMonths(firstDate, rowOffset * CELLS_LENGTH$3);\n return cells.map(function (cellOffset) {\n var cellDate = _this.normalize(addMonths(baseDate, cellOffset), min, max);\n var changedYear = currentYear < cellDate.getFullYear();\n if (!_this.isInRange(cellDate, min, max) || changedYear) {\n return null;\n }\n var isRangeStart = _this.isEqual(cellDate, selectionRange.start);\n var isRangeEnd = _this.isEqual(cellDate, selectionRange.end);\n var isInMiddle = !isRangeStart && !isRangeEnd;\n var isRangeMid = isInMiddle && isInSelectionRange(cellDate, selectionRange);\n return {\n formattedValue: months[cellDate.getMonth()],\n id: \"\" + cellUID + cellDate.getTime(),\n isFocused: _this.isEqual(cellDate, focusedDate),\n isSelected: isActiveView && isSelectedDateInRange && _this.isEqual(cellDate, selectedDate),\n isWeekend: false,\n isRangeStart: isRangeStart,\n isRangeMid: isRangeMid,\n isRangeEnd: isRangeEnd,\n isRangeSplitEnd: isRangeMid && _this.isEqual(cellDate, lastDate),\n isRangeSplitStart: isRangeMid && _this.isEqual(cellDate, firstDate),\n isToday: _this.isEqual(cellDate, today),\n title: _this.cellTitle(cellDate),\n value: cellDate\n };\n });\n });\n };\n YearViewService.prototype.isEqual = function (candidate, expected) {\n if (!candidate || !expected) {\n return false;\n }\n return candidate.getFullYear() === expected.getFullYear() &&\n candidate.getMonth() === expected.getMonth();\n };\n YearViewService.prototype.isInArray = function (date, dates) {\n if (!dates.length) {\n return false;\n }\n var year = date.getFullYear();\n return dates[0].getFullYear() <= year && year <= dates[dates.length - 1].getFullYear();\n };\n YearViewService.prototype.isInRange = function (candidate, min, max) {\n var candidateValue = createDate(candidate.getFullYear(), candidate.getMonth(), 1);\n var aboveMin = !min || createDate(min.getFullYear(), min.getMonth(), 1) <= candidateValue;\n var belowMax = !max || candidateValue <= createDate(max.getFullYear(), max.getMonth(), 1);\n return aboveMin && belowMax;\n };\n YearViewService.prototype.beginningOfPeriod = function (date) {\n if (!date) {\n return date;\n }\n return createDate(date.getFullYear(), 0, 1);\n };\n YearViewService.prototype.isRangeStart = function (value) {\n return value.getFullYear() % 10 === 0;\n };\n YearViewService.prototype.move = function (value, action) {\n var modifier = ACTIONS$3[action];\n if (!modifier) {\n return value;\n }\n return modifier(value);\n };\n YearViewService.prototype.cellTitle = function (value) {\n return value.getFullYear() + \" \" + this.value(value);\n };\n YearViewService.prototype.navigationTitle = function (value) {\n return this.title(value);\n };\n YearViewService.prototype.title = function (current) {\n return current ? current.getFullYear().toString() : '';\n };\n YearViewService.prototype.rowLength = function (_) {\n return CELLS_LENGTH$3;\n };\n YearViewService.prototype.skip = function (value, min) {\n return durationInYears(min, value);\n };\n YearViewService.prototype.total = function (min, max) {\n return durationInYears(min, max) + 1;\n };\n YearViewService.prototype.value = function (current) {\n return current ? this.abbrMonthNames()[current.getMonth()] : '';\n };\n YearViewService.prototype.viewDate = function (date, max, viewsCount) {\n if (viewsCount === void 0) { viewsCount = 1; }\n var viewsInRange = this.total(date, max);\n if (viewsInRange < viewsCount) {\n var yearsToSubtract = viewsCount - viewsInRange;\n return addYears(date, -1 * yearsToSubtract);\n }\n return date;\n };\n YearViewService.prototype.abbrMonthNames = function () {\n return this._intlService.dateFormatNames({ nameType: 'abbreviated', type: 'months' });\n };\n YearViewService.prototype.normalize = function (cellDate, min, max) {\n if (cellDate < min && this.isEqual(cellDate, min)) {\n return cloneDate(min);\n }\n if (cellDate > max && this.isEqual(cellDate, max)) {\n return cloneDate(max);\n }\n return cellDate;\n };\n YearViewService.decorators = [\n { type: Injectable },\n ];\n /** @nocollapse */\n YearViewService.ctorParameters = function () { return [\n { type: IntlService }\n ]; };\n return YearViewService;\n}());\n\n/**\n * @hidden\n *\n * The Enum which defines all possible Calendar view types.\n */\nvar CalendarViewEnum;\n(function (CalendarViewEnum) {\n CalendarViewEnum[CalendarViewEnum[\"month\"] = 0] = \"month\";\n CalendarViewEnum[CalendarViewEnum[\"year\"] = 1] = \"year\";\n CalendarViewEnum[CalendarViewEnum[\"decade\"] = 2] = \"decade\";\n CalendarViewEnum[CalendarViewEnum[\"century\"] = 3] = \"century\";\n})(CalendarViewEnum || (CalendarViewEnum = {}));\n\nvar _a$4;\nvar services = (_a$4 = {},\n _a$4[CalendarViewEnum.month] = MonthViewService,\n _a$4[CalendarViewEnum.year] = YearViewService,\n _a$4[CalendarViewEnum.decade] = DecadeViewService,\n _a$4[CalendarViewEnum.century] = CenturyViewService,\n _a$4);\nvar viewOffset = function (view, offset) {\n var candidate = CalendarViewEnum[CalendarViewEnum[view + offset]];\n return candidate !== undefined ? candidate : view;\n};\n/**\n * @hidden\n */\nvar BusViewService = /** @class */ (function () {\n function BusViewService(injector) {\n this.injector = injector;\n this.viewChanged = new EventEmitter();\n this.bottom = CalendarViewEnum.month;\n this.top = CalendarViewEnum.century;\n }\n BusViewService.prototype.configure = function (bottom, top) {\n this.bottom = bottom;\n this.top = top;\n };\n BusViewService.prototype.service = function (view) {\n var serviceType = services[view];\n return serviceType ? this.injector.get(serviceType) : null;\n };\n BusViewService.prototype.moveDown = function (view) {\n this.move(view, -1);\n };\n BusViewService.prototype.moveUp = function (view) {\n this.move(view, 1);\n };\n BusViewService.prototype.moveToBottom = function (activeView) {\n if (activeView === this.bottom) {\n return;\n }\n this.viewChanged.emit({ view: this.bottom });\n };\n BusViewService.prototype.canMoveDown = function (view) {\n return this.bottom < view;\n };\n BusViewService.prototype.canMoveUp = function (view) {\n return view < this.top;\n };\n BusViewService.prototype.clamp = function (view) {\n if (view < this.bottom) {\n return this.bottom;\n }\n if (view > this.top) {\n return this.top;\n }\n return view;\n };\n BusViewService.prototype.move = function (view, offset) {\n var candidate = this.clamp(viewOffset(view, offset));\n if (candidate === view) {\n return;\n }\n this.viewChanged.emit({ view: candidate });\n };\n BusViewService.decorators = [\n { type: Injectable },\n ];\n /** @nocollapse */\n BusViewService.ctorParameters = function () { return [\n { type: Injector }\n ]; };\n return BusViewService;\n}());\n\nvar div = domContainerFactory('div');\nvar ul = domContainerFactory('ul');\nvar li = domContainerFactory('li');\nvar td = domContainerFactory('td');\nvar th = domContainerFactory('th');\nvar tr = domContainerFactory('tr');\nvar tbody = domContainerFactory('tbody');\nvar thead = domContainerFactory('thead');\nvar table = domContainerFactory('table');\nvar monthHeader = function () { return (div(\"\\n March 2017\\n TODAY\\n \", 'k-calendar-header')); };\nvar monthWeekHeader = function () { return (table([\n thead([\n tr([th('MO')])\n ])\n], 'k-calendar-weekdays')); };\nvar repeat = function (count, mapper) { return new Array(count).fill('1').map(mapper); };\nvar content = function (rows, cells) {\n if (cells === void 0) { cells = 1; }\n return (table([\n tbody([tr([th('1')])].concat(repeat(rows, function () { return tr(repeat(cells, function (c) { return td(\"\" + c + \"\"); })); })))\n ]));\n};\nvar scrollable = function (children) { return div(children, 'k-content k-scrollable'); };\nvar view = function (contentElement, className, renderWeekHeader) { return (div([\n monthHeader(),\n renderWeekHeader ? monthWeekHeader() : null,\n scrollable([contentElement, contentElement])\n], className, { left: '-10000px', position: 'absolute' })); };\nvar ɵ6 = function () {\n var navElement;\n return function () {\n if (!isDocumentAvailable) {\n return null;\n }\n if (!navElement) {\n navElement = div([scrollable([ul([li('FEB')])])], 'k-calendar-navigation', { left: '0px', position: 'absolute' });\n }\n return navElement;\n };\n};\nvar navigationList = (ɵ6)();\nvar viewFactory = function (_a, className, renderWeekHeader) {\n var cells = _a.cells, rows = _a.rows;\n var viewElement;\n return function () {\n if (!isDocumentAvailable) {\n return null;\n }\n if (!viewElement) {\n viewElement = view(content(rows, cells), className, renderWeekHeader);\n }\n return viewElement;\n };\n};\nvar getScrollable = function (element) { return element.querySelector('.k-scrollable'); };\nvar horizontal = function (element) {\n var scrollableElement = getScrollable(element);\n scrollableElement.classList.add('k-scrollable-horizontal');\n return element;\n};\nvar monthView = viewFactory({ cells: 7, rows: 6 }, 'k-calendar-view k-calendar-monthview', true);\nvar yearView = viewFactory({ cells: 5, rows: 3 }, 'k-calendar-view k-calendar-yearview', false);\nvar decadeView = viewFactory({ cells: 5, rows: 2 }, 'k-calendar-view k-calendar-decadeview', false);\nvar horzMonthView = function () { return horizontal(monthView()); };\nvar horzYearView = function () { return horizontal(yearView()); };\nvar horzDecadeView = function () { return horizontal(decadeView()); };\nvar height = function (element) { return (parseFloat(window.getComputedStyle(element).height) || element.offsetHeight); };\nvar width = function (element) {\n var styles = window.getComputedStyle(element);\n var computed = parseFloat(styles.width)\n + parseFloat(styles.paddingLeft)\n + parseFloat(styles.paddingRight);\n return computed || element.offsetWidth;\n};\nvar getBody = function (element) { return element.querySelector('tbody'); };\n/**\n * @hidden\n */\nvar CalendarDOMService = /** @class */ (function () {\n function CalendarDOMService() {\n }\n CalendarDOMService.prototype.ensureHeights = function () {\n if (this.calendarHeight !== undefined) {\n return;\n }\n this.calculateHeights();\n };\n CalendarDOMService.prototype.calculateHeights = function (container) {\n var _this = this;\n if (!isDocumentAvailable()) {\n return;\n }\n this.hostContainer = container;\n this.batch(monthView(), function (contentElement) {\n var viewElement = getBody(contentElement);\n _this.calendarHeight = height(contentElement);\n _this.monthViewHeight = height(viewElement);\n _this.headerHeight = height(viewElement.children[0]);\n _this.scrollableContentHeight = height(getScrollable(contentElement));\n });\n this.batch(horzMonthView(), function (contentElement) {\n var viewElement = getBody(contentElement);\n _this.calendarWidth = width(contentElement);\n _this.monthViewWidth = width(viewElement);\n _this.scrollableContentWidth = width(getScrollable(contentElement));\n });\n this.batch(yearView(), function (contentElement) {\n _this.yearViewHeight = height(getBody(contentElement));\n _this.scrollableYearContentHeight = height(getScrollable(contentElement));\n });\n this.batch(horzYearView(), function (contentElement) {\n _this.yearViewWidth = width(getBody(contentElement));\n });\n this.batch(decadeView(), function (contentElement) {\n _this.decadeViewHeight = height(getBody(contentElement));\n _this.centuryViewHeight = _this.decadeViewHeight;\n });\n this.batch(horzDecadeView(), function (contentElement) {\n _this.decadeViewWidth = width(getBody(contentElement));\n _this.centuryViewWidth = _this.decadeViewWidth;\n });\n this.batch(navigationList(), function (contentElement) {\n _this.navigationItemHeight = height(contentElement.querySelector('li'));\n });\n };\n CalendarDOMService.prototype.viewHeight = function (viewType) {\n return this.viewDimension(viewType, 'height');\n };\n CalendarDOMService.prototype.viewWidth = function (viewType) {\n return this.viewDimension(viewType, 'width');\n };\n CalendarDOMService.prototype.viewDimension = function (viewType, dimension) {\n var viewProp = dimension === 'height' ? 'ViewHeight' : 'ViewWidth';\n switch (viewType) {\n case CalendarViewEnum.month:\n return this[\"month\" + viewProp];\n case CalendarViewEnum.year:\n return this[\"year\" + viewProp];\n case CalendarViewEnum.decade:\n return this[\"decade\" + viewProp];\n case CalendarViewEnum.century:\n return this[\"century\" + viewProp];\n default:\n return 1;\n }\n };\n CalendarDOMService.prototype.batch = function (contentElement, action) {\n var hostContainer = this.hostContainer || document.body;\n var appendedContent = hostContainer.appendChild(contentElement);\n action(appendedContent);\n hostContainer.removeChild(appendedContent);\n };\n CalendarDOMService.decorators = [\n { type: Injectable },\n ];\n return CalendarDOMService;\n}());\n\n/**\n * @hidden\n */\nvar update = function (arr, idx, value) { return (arr.slice(0, idx + 1).concat((arr.slice(idx + 1).map(function (x) { return x + value; })))); };\n/**\n * @hidden\n */\nvar RowHeightService = /** @class */ (function () {\n function RowHeightService(total, rowHeight, detailRowHeight) {\n if (total === void 0) { total = 0; }\n this.total = total;\n this.rowHeight = rowHeight;\n this.detailRowHeight = detailRowHeight;\n this.offsets = [];\n this.heights = [];\n var agg = 0;\n for (var idx = 0; idx < total; idx++) {\n this.offsets.push(agg);\n agg += rowHeight;\n this.heights.push(rowHeight);\n }\n }\n RowHeightService.prototype.height = function (rowIndex) {\n return this.heights[rowIndex];\n };\n RowHeightService.prototype.expandDetail = function (rowIndex) {\n if (this.height(rowIndex) === this.rowHeight) {\n this.updateRowHeight(rowIndex, this.detailRowHeight);\n }\n };\n RowHeightService.prototype.collapseDetail = function (rowIndex) {\n if (this.height(rowIndex) > this.rowHeight) {\n this.updateRowHeight(rowIndex, this.detailRowHeight * -1);\n }\n };\n RowHeightService.prototype.index = function (position) {\n if (position < 0) {\n return undefined;\n }\n var result = this.offsets.reduce(function (prev, current, idx) {\n if (prev !== undefined) {\n return prev;\n }\n else if (current === position) {\n return idx;\n }\n else if (current > position) {\n return idx - 1;\n }\n return undefined;\n }, undefined); // tslint:disable-line:align\n return result === undefined ? this.total - 1 : result;\n };\n RowHeightService.prototype.offset = function (rowIndex) {\n return this.offsets[rowIndex];\n };\n RowHeightService.prototype.totalHeight = function () {\n return this.heights.reduce(function (prev, curr) { return prev + curr; }, 0);\n };\n RowHeightService.prototype.updateRowHeight = function (rowIndex, value) {\n this.heights[rowIndex] += value;\n this.offsets = update(this.offsets, rowIndex, value);\n };\n return RowHeightService;\n}());\n\nvar normalize = function (x) { return Math.max(x, 0); };\n/**\n * @hidden\n */\nvar ScrollAction = /** @class */ (function () {\n function ScrollAction(offset) {\n this.offset = offset;\n }\n return ScrollAction;\n}());\n/**\n * @hidden\n */\nvar PageAction = /** @class */ (function () {\n function PageAction(skip) {\n this.skip = skip;\n }\n return PageAction;\n}());\n/**\n * @hidden\n */\nvar ScrollerService = /** @class */ (function () {\n function ScrollerService(scrollObservable) {\n this.scrollObservable = scrollObservable;\n this.firstLoaded = 0;\n this.bottomOffset = 0;\n this.topOffset = 0;\n }\n ScrollerService.prototype.create = function (rowHeightService, skip, take, total, topOffset, bottomOffset, direction) {\n var _this = this;\n if (topOffset === void 0) { topOffset = 0; }\n if (bottomOffset === void 0) { bottomOffset = 0; }\n if (direction === void 0) { direction = 'vertical'; }\n this.rowHeightService = rowHeightService;\n this.firstLoaded = skip;\n this.lastLoaded = skip + take;\n this.take = take;\n this.total = total;\n this.lastScroll = 0;\n this.topOffset = topOffset;\n this.bottomOffset = bottomOffset;\n this.direction = direction;\n var subject = new ReplaySubject(2);\n var offsetBufferRows = this.rowsForHeight(topOffset);\n var skipWithOffset = normalize(skip - offsetBufferRows);\n subject.next(new ScrollAction(this.rowOffset(skipWithOffset)));\n if (offsetBufferRows) {\n subject.next(new PageAction(skipWithOffset));\n }\n this.subscription = Observable.create(function (observer) {\n _this.unsubscribe();\n _this.scrollSubscription = _this.scrollObservable.subscribe(function (x) { return _this.onScroll(x, observer); });\n }).subscribe(function (x) { return subject.next(x); });\n return subject;\n };\n ScrollerService.prototype.destroy = function () {\n this.unsubscribe();\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n };\n ScrollerService.prototype.onScroll = function (_a, observer) {\n var scrollLeft = _a.scrollLeft, scrollTop = _a.scrollTop, offsetHeight = _a.offsetHeight, offsetWidth = _a.offsetWidth;\n var scrollPosition = this.direction === 'vertical' ? scrollTop : scrollLeft;\n var offsetSize = this.direction === 'vertical' ? offsetHeight : offsetWidth;\n if (this.lastScroll === scrollPosition) {\n return;\n }\n var up = this.lastScroll >= scrollPosition;\n this.lastScroll = scrollPosition;\n var firstItemIndex = this.rowHeightService.index(normalize(scrollPosition - this.topOffset));\n var lastItemIndex = this.rowHeightService.index(normalize(scrollPosition + offsetSize - this.bottomOffset));\n if (!up && lastItemIndex >= this.lastLoaded && this.lastLoaded < this.total) {\n this.firstLoaded = firstItemIndex;\n observer.next(new ScrollAction(this.rowOffset(firstItemIndex)));\n this.lastLoaded = Math.min(this.firstLoaded + this.take, this.total);\n observer.next(new PageAction(this.firstLoaded));\n }\n if (up && firstItemIndex <= this.firstLoaded) {\n var nonVisibleBuffer = Math.floor(this.take * 0.3);\n this.firstLoaded = normalize(firstItemIndex - nonVisibleBuffer);\n observer.next(new ScrollAction(this.rowOffset(this.firstLoaded)));\n this.lastLoaded = Math.min(this.firstLoaded + this.take, this.total);\n observer.next(new PageAction(this.firstLoaded));\n }\n };\n ScrollerService.prototype.rowOffset = function (index) {\n return this.rowHeightService.offset(index) + this.topOffset;\n };\n ScrollerService.prototype.rowsForHeight = function (height) {\n return Math.ceil(height / this.rowHeightService.height(0));\n };\n ScrollerService.prototype.unsubscribe = function () {\n if (this.scrollSubscription) {\n this.scrollSubscription.unsubscribe();\n this.scrollSubscription = null;\n }\n };\n return ScrollerService;\n}());\n\nvar _a$5, _b, _c;\n/**\n * @hidden\n */\nvar SCROLLER_FACTORY_TOKEN = new InjectionToken('dateinputs-scroll-service-factory');\n/**\n * @hidden\n */\nfunction DEFAULT_SCROLLER_FACTORY(observable) {\n return new ScrollerService(observable);\n}\n/**\n * @hidden\n */\nvar ScrollDirection;\n(function (ScrollDirection) {\n ScrollDirection[ScrollDirection[\"Backward\"] = 0] = \"Backward\";\n ScrollDirection[ScrollDirection[\"Forward\"] = 1] = \"Forward\";\n})(ScrollDirection || (ScrollDirection = {}));\nvar FRAME_DURATION = 17;\nvar scrollModifiers = (_a$5 = {},\n _a$5[ScrollDirection.Forward] = function (step) { return function (value) { return value + step; }; },\n _a$5[ScrollDirection.Backward] = function (step) { return function (value) { return value - step; }; },\n _a$5);\nvar scrollNormalizers = (_b = {},\n _b[ScrollDirection.Forward] = function (end) { return function (value) { return Math.min(value, end); }; },\n _b[ScrollDirection.Backward] = function (end) { return function (value) { return Math.max(value, end); }; },\n _b);\nvar scrollValidators = (_c = {},\n _c[ScrollDirection.Forward] = function (end) { return function (start) { return start < end; }; },\n _c[ScrollDirection.Backward] = function (end) { return function (start) { return start > end; }; },\n _c);\nvar differenceToScroll = function (scrollTop, staticOffset, maxScrollDifference) {\n return Math.min(Math.abs(staticOffset - scrollTop), maxScrollDifference);\n};\n/**\n * @hidden\n */\nvar VirtualizationComponent = /** @class */ (function () {\n function VirtualizationComponent(scrollerFactory, container, renderer, zone) {\n this.container = container;\n this.renderer = renderer;\n this.zone = zone;\n this.direction = 'vertical';\n this.itemHeight = 1;\n this.itemWidth = 1;\n this.topOffset = 0;\n this.bottomOffset = 0;\n this.maxScrollDifference = 100;\n this.scrollOffsetSize = 0;\n this.scrollDuration = 150;\n this.activeIndexChange = new EventEmitter();\n this.pageChange = new EventEmitter();\n this.scrollChange = new EventEmitter();\n this.resolvedPromise = Promise.resolve(null);\n this.dispatcher = new Subject();\n this.scroller = scrollerFactory(this.dispatcher);\n }\n Object.defineProperty(VirtualizationComponent.prototype, \"totalVertexLength\", {\n get: function () {\n var value = this.totalSize + \"px\";\n return this.direction === 'vertical' ? { height: value } : { width: value };\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(VirtualizationComponent.prototype, \"containerOffsetSize\", {\n get: function () {\n return this.getContainerProperty(this.direction === 'vertical' ? 'offsetHeight' : 'offsetWidth');\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(VirtualizationComponent.prototype, \"containerScrollSize\", {\n get: function () {\n return this.getContainerProperty(this.direction === 'vertical' ? 'scrollHeight' : 'scrollWidth');\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(VirtualizationComponent.prototype, \"containerScrollPosition\", {\n get: function () {\n return this.getContainerProperty(this.direction === 'vertical' ? 'scrollTop' : 'scrollLeft');\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(VirtualizationComponent.prototype, \"wrapperClasses\", {\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(VirtualizationComponent.prototype, \"horizontalClass\", {\n get: function () {\n return this.direction === 'horizontal';\n },\n enumerable: true,\n configurable: true\n });\n VirtualizationComponent.prototype.ngOnChanges = function (changes) {\n if (changes.direction || changes.take || changes.total) {\n this.initServices();\n this.totalSize = this.rowHeightService.totalHeight() + this.bottomOffset;\n }\n };\n VirtualizationComponent.prototype.ngOnInit = function () {\n if (!this.rowHeightService) {\n this.rowHeightService = this.createRowHeightService();\n }\n };\n VirtualizationComponent.prototype.ngAfterViewInit = function () {\n var _this = this;\n this.zone.runOutsideAngular(function () {\n _this.containerScrollSubscription = _this.scroll$()\n .pipe(map(function (event) { return event.target; }))\n .subscribe(function (t) {\n _this.dispatcher.next(t);\n _this.emitActiveIndex();\n });\n });\n };\n VirtualizationComponent.prototype.ngOnDestroy = function () {\n if (this.containerScrollSubscription) {\n this.containerScrollSubscription.unsubscribe();\n }\n if (this.scrollSubscription) {\n this.scrollSubscription.unsubscribe();\n }\n if (this.animationSubscription) {\n this.animationSubscription.unsubscribe();\n }\n };\n VirtualizationComponent.prototype.getContainerProperty = function (propertyName) {\n return this.container.nativeElement[propertyName];\n };\n VirtualizationComponent.prototype.activeIndex = function () {\n return this.itemIndex(Math.ceil(this.containerScrollPosition)); //handle subpixeling\n };\n VirtualizationComponent.prototype.itemIndex = function (offset) {\n return this.rowHeightService.index(offset);\n };\n VirtualizationComponent.prototype.itemOffset = function (index) {\n return this.rowHeightService.offset(index);\n };\n VirtualizationComponent.prototype.isIndexVisible = function (index) {\n if (!this.rowHeightService) {\n return false;\n }\n var containerTop = this.containerScrollPosition;\n var containerBottom = containerTop + this.containerOffsetSize;\n var top = this.rowHeightService.offset(index);\n var bottom = top + this.rowHeightService.height(index);\n return top >= containerTop && bottom <= containerBottom;\n };\n VirtualizationComponent.prototype.isListScrolled = function (index) {\n return this.containerScrollPosition !== this.rowHeightService.offset(index);\n };\n VirtualizationComponent.prototype.scrollTo = function (value) {\n var scrollProperty = this.direction === \"vertical\" ? 'scrollTop' : 'scrollLeft';\n this.renderer.setProperty(this.container.nativeElement, scrollProperty, value);\n };\n VirtualizationComponent.prototype.scrollToIndex = function (index) {\n //XXX: scrolling with tick is required to prevent list jump in Chrome.\n //Original issue: focus first day in the month and press LEFT arrow.\n //Notice how the view jumps on every day change.\n //\n var _this = this;\n this.zone.runOutsideAngular(function () {\n _this.resolvedPromise.then(function () {\n _this.scrollTo(_this.rowHeightService.offset(index));\n });\n });\n };\n VirtualizationComponent.prototype.scrollToBottom = function () {\n this.scrollTo(this.totalSize);\n };\n VirtualizationComponent.prototype.animateToIndex = function (index) {\n var _this = this;\n if (this.animationSubscription) {\n this.animationSubscription.unsubscribe();\n }\n var indexOffset = this.rowHeightService.offset(index);\n var direction = this.getContainerScrollDirection(indexOffset);\n var _a = this.scrollRange(indexOffset, direction), start = _a.start, end = _a.end;\n if (start === end) {\n return;\n }\n var step = this.scrollStep(start, end);\n var modifyScroll = scrollModifiers[direction](step);\n var normalizeScroll = scrollNormalizers[direction](end);\n var isScrollValid = scrollValidators[direction](modifyScroll(end));\n this.zone.runOutsideAngular(function () {\n _this.animationSubscription =\n combineLatest(of(start), interval(0, animationFrameScheduler)).pipe(map(function (stream) { return stream[0]; }), scan(modifyScroll), takeWhile(isScrollValid), map(normalizeScroll)).subscribe(function (x) { return _this.scrollTo(x); });\n });\n };\n VirtualizationComponent.prototype.scrollRange = function (indexOffset, direction) {\n var containerScroll = this.containerScrollPosition;\n if (parseInt(indexOffset, 10) === parseInt(containerScroll, 10)) {\n return { start: indexOffset, end: indexOffset };\n }\n var maxScroll = this.containerMaxScroll();\n var sign = direction === ScrollDirection.Backward ? 1 : -1;\n var difference = differenceToScroll(containerScroll, indexOffset, this.maxScrollDifference);\n var end = Math.min(indexOffset, maxScroll);\n var start = Math.min(Math.max(end + (sign * difference), 0), maxScroll);\n return { start: start, end: end };\n };\n VirtualizationComponent.prototype.scrollStep = function (start, end) {\n return Math.abs(end - start) / (this.scrollDuration / FRAME_DURATION);\n };\n VirtualizationComponent.prototype.scroll$ = function () {\n return isDocumentAvailable() ? fromEvent(this.container.nativeElement, 'scroll') : EMPTY;\n };\n VirtualizationComponent.prototype.initServices = function () {\n var _this = this;\n this.rowHeightService = this.createRowHeightService();\n if (this.scrollSubscription) {\n this.scrollSubscription.unsubscribe();\n }\n this.scrollSubscription = this.scroller\n .create(this.rowHeightService, this.skip, this.take, this.total, this.topOffset, this.scrollOffsetSize, this.direction)\n .subscribe(function (x) {\n if (x instanceof PageAction) {\n _this.pageChange.emit(x);\n }\n else {\n _this.scrollChange.emit(x);\n }\n });\n };\n VirtualizationComponent.prototype.createRowHeightService = function () {\n var dimension = this.direction === 'vertical' ? this.itemHeight : this.itemWidth;\n return new RowHeightService(this.total, dimension, 0);\n };\n VirtualizationComponent.prototype.emitActiveIndex = function () {\n var index = this.rowHeightService.index(this.containerScrollPosition - this.topOffset);\n if (this.lastActiveIndex !== index) {\n this.lastActiveIndex = index;\n this.activeIndexChange.emit(index);\n }\n };\n VirtualizationComponent.prototype.containerMaxScroll = function () {\n return this.containerScrollSize - this.containerOffsetSize;\n };\n VirtualizationComponent.prototype.getContainerScrollDirection = function (indexOffset) {\n return indexOffset < this.containerScrollPosition ? ScrollDirection.Backward : ScrollDirection.Forward;\n };\n VirtualizationComponent.decorators = [\n { type: Component, args: [{\n providers: [{\n provide: SCROLLER_FACTORY_TOKEN,\n useValue: DEFAULT_SCROLLER_FACTORY\n }],\n selector: 'kendo-virtualization',\n template: \"\\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n VirtualizationComponent.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: Inject, args: [SCROLLER_FACTORY_TOKEN,] }] },\n { type: ElementRef },\n { type: Renderer2 },\n { type: NgZone }\n ]; };\n VirtualizationComponent.propDecorators = {\n direction: [{ type: Input }],\n itemHeight: [{ type: Input }],\n itemWidth: [{ type: Input }],\n topOffset: [{ type: Input }],\n bottomOffset: [{ type: Input }],\n maxScrollDifference: [{ type: Input }],\n scrollOffsetSize: [{ type: Input }],\n scrollDuration: [{ type: Input }],\n skip: [{ type: Input }],\n take: [{ type: Input }],\n total: [{ type: Input }],\n activeIndexChange: [{ type: Output }],\n pageChange: [{ type: Output }],\n scrollChange: [{ type: Output }],\n wrapperClasses: [{ type: HostBinding, args: ['class.k-content',] }, { type: HostBinding, args: ['class.k-scrollable',] }],\n horizontalClass: [{ type: HostBinding, args: ['class.k-scrollable-horizontal',] }]\n };\n return VirtualizationComponent;\n}());\n\n/**\n * @hidden\n */\nvar closestInScope = function (node, predicate, scope) {\n while (node && node !== scope && !predicate(node)) {\n node = node.parentNode;\n }\n if (node !== scope) {\n return node;\n }\n};\n/**\n * @hidden\n */\nvar closest = function (node, predicate) {\n while (node && !predicate(node)) {\n node = node.parentNode;\n }\n return node;\n};\n\n/* tslint:disable:component-selector-name component-selector-type */\nvar ITEMS_COUNT = 30;\n/**\n * @hidden\n */\nvar NavigationComponent = /** @class */ (function () {\n function NavigationComponent(bus, dom, intl, cdr, renderer) {\n this.bus = bus;\n this.dom = dom;\n this.intl = intl;\n this.cdr = cdr;\n this.renderer = renderer;\n this.min = new Date(MIN_DATE);\n this.max = new Date(MAX_DATE);\n this.focusedDate = new Date();\n this.valueChange = new EventEmitter();\n this.pageChange = new EventEmitter();\n this.dates = [];\n this.take = ITEMS_COUNT;\n this.indexToScroll = -1;\n }\n Object.defineProperty(NavigationComponent.prototype, \"getComponentClass\", {\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n NavigationComponent.prototype.ngOnInit = function () {\n this.dom.ensureHeights();\n var calendarHeight = this.dom.calendarHeight;\n this.itemHeight = this.dom.navigationItemHeight;\n this.maxViewHeight = this.dom.monthViewHeight;\n this.topOffset = (calendarHeight - this.itemHeight) / 2;\n this.bottomOffset = calendarHeight - this.itemHeight;\n this.intlSubscription = this.intl.changes.subscribe(this.intlChange.bind(this));\n };\n NavigationComponent.prototype.ngOnChanges = function (changes) {\n this.service = this.bus.service(this.activeView);\n if (!this.service) {\n return;\n }\n this.activeViewValue = CalendarViewEnum[this.activeView];\n var viewDate = dateInRange(this.focusedDate, this.min, this.max);\n var total = this.service.total(this.min, this.max);\n var totalChanged = this.total && this.total !== total;\n this.skip = this.service.skip(viewDate, this.min);\n this.total = total;\n if (totalChanged || !this.service.isInArray(viewDate, this.dates)) {\n this.dates = this.service.datesList(viewDate, this.getTake(this.skip));\n }\n if (!!changes.focusedDate || totalChanged) {\n this.indexToScroll = this.service.skip(this.focusedDate, this.min);\n }\n };\n NavigationComponent.prototype.ngOnDestroy = function () {\n if (this.intlSubscription) {\n this.intlSubscription.unsubscribe();\n }\n };\n NavigationComponent.prototype.ngAfterViewInit = function () {\n if (this.indexToScroll === -1) {\n return;\n }\n this.virtualization.scrollToIndex(this.indexToScroll);\n this.indexToScroll = -1;\n };\n NavigationComponent.prototype.ngAfterViewChecked = function () {\n if (this.indexToScroll === -1) {\n return;\n }\n this.virtualization.scrollToIndex(this.indexToScroll);\n this.indexToScroll = -1;\n };\n NavigationComponent.prototype.onPageChange = function (_a) {\n var skip = _a.skip;\n this.dates = this.service.datesList(this.service.addToDate(this.min, skip), this.getTake(skip));\n this.pageChange.emit();\n };\n NavigationComponent.prototype.scrollChange = function (_a) {\n var offset = _a.offset;\n var el = this.list.nativeElement;\n var translate = \"translateY(\" + offset + \"px)\";\n this.renderer.setStyle(el, 'transform', translate);\n this.renderer.setStyle(el, '-ms-transform', translate);\n };\n NavigationComponent.prototype.handleDateChange = function (args) {\n var item = closestInScope(args.target, function (node) { return node.hasAttribute('data-date-index'); }, this.list.nativeElement);\n if (item) {\n var index = parseInt(item.getAttribute('data-date-index'), 10);\n var candidate = this.dates[index];\n this.valueChange.emit(cloneDate(candidate));\n }\n };\n NavigationComponent.prototype.getTake = function (skip) {\n return Math.min(this.total - skip, this.take);\n };\n NavigationComponent.prototype.intlChange = function () {\n if (this.activeView === CalendarViewEnum.month) {\n this.cdr.markForCheck();\n }\n };\n NavigationComponent.decorators = [\n { type: Component, args: [{\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'kendo-calendar-navigation',\n template: \"\\n \\n \\n \\n - \\n \\n {{service.navigationTitle(date)}}\\n \\n \\n
\\n
\\n \\n \"\n },] },\n ];\n /** @nocollapse */\n NavigationComponent.ctorParameters = function () { return [\n { type: BusViewService },\n { type: CalendarDOMService },\n { type: IntlService },\n { type: ChangeDetectorRef },\n { type: Renderer2 }\n ]; };\n NavigationComponent.propDecorators = {\n activeView: [{ type: Input }],\n min: [{ type: Input }],\n max: [{ type: Input }],\n focusedDate: [{ type: Input }],\n templateRef: [{ type: Input }],\n valueChange: [{ type: Output }],\n pageChange: [{ type: Output }],\n virtualization: [{ type: ViewChild, args: [VirtualizationComponent,] }],\n list: [{ type: ViewChild, args: ['list', { static: true },] }],\n getComponentClass: [{ type: HostBinding, args: [\"class.k-calendar-navigation\",] }]\n };\n return NavigationComponent;\n}());\n\nvar VIEWS_COUNT = 5;\nvar isEqualMonthYear = function (date1, date2) { return (date1 && date2 &&\n date1.getFullYear() === date2.getFullYear() &&\n date1.getMonth() === date2.getMonth()); };\n/**\n * @hidden\n */\nvar ViewListComponent = /** @class */ (function () {\n function ViewListComponent(bus, cdr, intl, dom, renderer) {\n this.bus = bus;\n this.cdr = cdr;\n this.intl = intl;\n this.dom = dom;\n this.renderer = renderer;\n this.isActive = true;\n this.min = new Date(MIN_DATE);\n this.max = new Date(MAX_DATE);\n this.activeDateChange = new EventEmitter();\n this.valueChange = new EventEmitter();\n this.pageChange = new EventEmitter();\n this.dates = [];\n this.cols = [];\n this.weekNames = [];\n this.take = VIEWS_COUNT;\n this.animateToIndex = true;\n this.indexToScroll = -1;\n this.minViewsToRender = 1;\n }\n Object.defineProperty(ViewListComponent.prototype, \"weekNumber\", {\n get: function () {\n return this.showWeekNumbers && this.isMonthView();\n },\n set: function (showWeekNumbers) {\n this.showWeekNumbers = showWeekNumbers;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ViewListComponent.prototype, \"getComponentClass\", {\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ViewListComponent.prototype, \"getComponentMonthClass\", {\n get: function () {\n return this.activeView === CalendarViewEnum.month;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ViewListComponent.prototype, \"getComponentYearClass\", {\n get: function () {\n return this.activeView === CalendarViewEnum.year;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ViewListComponent.prototype, \"getComponentDecadeClass\", {\n get: function () {\n return this.activeView === CalendarViewEnum.decade;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ViewListComponent.prototype, \"getComponentCenturyClass\", {\n get: function () {\n return this.activeView === CalendarViewEnum.century;\n },\n enumerable: true,\n configurable: true\n });\n ViewListComponent.prototype.ngOnInit = function () {\n this.weekNames = this.getWeekNames();\n this.bottomOffset = this.getBottomOffset();\n this.viewOffset = -1 * this.dom.headerHeight;\n this.viewHeight = this.dom.viewHeight(this.activeView);\n this.intlSubscription = this.intl.changes.subscribe(this.intlChange.bind(this));\n };\n ViewListComponent.prototype.ngOnChanges = function (changes) {\n this.service = this.bus.service(this.activeView);\n if (!this.service) {\n return;\n }\n this.cols = new Array(this.service.rowLength(this.weekNumber)).fill('');\n this.colWidth = Math.round(100 / this.cols.length);\n this.weekNames = hasChange(changes, 'weekNumber') && this.weekNumber ? this.getWeekNames() : this.weekNames;\n var activeViewChanged = hasChange(changes, 'activeView');\n var focusedDate = this.focusedDate;\n var viewDate = dateInRange(this.service.viewDate(focusedDate, this.max, this.minViewsToRender), this.min, this.max);\n var total = this.service.total(this.min, this.max);\n var totalChanged = this.total && this.total !== total;\n var generateDates = totalChanged || !this.service.isInArray(focusedDate, this.dates);\n this.skip = this.service.skip(viewDate, this.min);\n this.total = total;\n this.animateToIndex = !activeViewChanged;\n this.bottomOffset = this.getBottomOffset();\n this.viewHeight = this.dom.viewHeight(this.activeView);\n if (generateDates) {\n this.dates = this.service.datesList(viewDate, this.getTake(this.skip));\n }\n if (!isEqualMonthYear(this.activeDate, focusedDate)) {\n this.activeDate = cloneDate(focusedDate);\n }\n var updateIndex = hasChange(changes, 'focusedDate') || activeViewChanged;\n if (generateDates || updateIndex || this.virtualization.isIndexVisible(this.skip)) {\n this.indexToScroll = this.service.skip(focusedDate, this.min);\n }\n };\n ViewListComponent.prototype.ngOnDestroy = function () {\n if (this.intlSubscription) {\n this.intlSubscription.unsubscribe();\n }\n };\n ViewListComponent.prototype.ngAfterViewInit = function () {\n if (this.indexToScroll === -1) {\n return;\n }\n this.virtualization.scrollToIndex(this.indexToScroll);\n this.indexToScroll = -1;\n };\n ViewListComponent.prototype.ngAfterViewChecked = function () {\n if (this.indexToScroll === -1) {\n return;\n }\n this.virtualization[this.animateToIndex ? 'animateToIndex' : 'scrollToIndex'](this.indexToScroll);\n this.animateToIndex = true;\n this.indexToScroll = -1;\n };\n ViewListComponent.prototype.onPageChange = function (_a) {\n var skip = _a.skip;\n this.dates = this.service.datesList(this.service.addToDate(this.min, skip), this.getTake(skip));\n this.pageChange.emit();\n };\n ViewListComponent.prototype.scrollChange = function (_a) {\n var offset = _a.offset;\n var el = this.list.nativeElement;\n var translate = \"translateY(\" + offset + \"px)\";\n this.renderer.setStyle(el, 'transform', translate);\n this.renderer.setStyle(el, '-ms-transform', translate);\n };\n ViewListComponent.prototype.setActiveDate = function (index) {\n var candidate = this.service.addToDate(this.min, index);\n if (isEqual(this.activeDate, candidate)) {\n return;\n }\n this.activeDate = candidate;\n this.activeDateChange.emit(candidate);\n this.cdr.detectChanges();\n };\n ViewListComponent.prototype.handleDateChange = function (candidate) {\n this.valueChange.emit(candidate);\n };\n ViewListComponent.prototype.isMonthView = function () {\n return this.activeView === CalendarViewEnum.month;\n };\n ViewListComponent.prototype.isScrolled = function () {\n return this.virtualization.isListScrolled(this.service.skip(this.focusedDate, this.min));\n };\n ViewListComponent.prototype.getBottomOffset = function () {\n return this.getScrollableHeight() - this.dom.viewHeight(this.activeView);\n };\n ViewListComponent.prototype.getScrollableHeight = function () {\n return this.activeView === CalendarViewEnum.month ?\n this.dom.scrollableContentHeight :\n this.dom.scrollableYearContentHeight;\n };\n ViewListComponent.prototype.getTake = function (skip) {\n return Math.min(this.total - skip, this.take);\n };\n ViewListComponent.prototype.getWeekNames = function () {\n var weekNames = shiftWeekNames(this.intl.dateFormatNames({ nameType: 'short', type: 'days' }), this.intl.firstDay());\n return this.weekNumber ? [''].concat(weekNames) : weekNames;\n };\n ViewListComponent.prototype.intlChange = function () {\n this.weekNames = this.getWeekNames();\n if (this.isMonthView()) {\n this.cdr.markForCheck();\n }\n };\n ViewListComponent.decorators = [\n { type: Component, args: [{\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'kendo-calendar-viewlist',\n template: \"\\n \\n \\n \\n \\n \\n {{name}} | \\n
\\n \\n
\\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n ViewListComponent.ctorParameters = function () { return [\n { type: BusViewService },\n { type: ChangeDetectorRef },\n { type: IntlService },\n { type: CalendarDOMService },\n { type: Renderer2 }\n ]; };\n ViewListComponent.propDecorators = {\n cellTemplateRef: [{ type: Input }],\n weekNumberTemplateRef: [{ type: Input }],\n headerTitleTemplateRef: [{ type: Input }],\n activeView: [{ type: Input }],\n cellUID: [{ type: Input }],\n focusedDate: [{ type: Input }],\n isActive: [{ type: Input }],\n min: [{ type: Input }],\n max: [{ type: Input }],\n value: [{ type: Input }],\n weekNumber: [{ type: Input }],\n activeDateChange: [{ type: Output }],\n valueChange: [{ type: Output }],\n pageChange: [{ type: Output }],\n virtualization: [{ type: ViewChild, args: [VirtualizationComponent,] }],\n list: [{ type: ViewChild, args: ['list', { static: true },] }],\n getComponentClass: [{ type: HostBinding, args: [\"class.k-calendar-view\",] }],\n getComponentMonthClass: [{ type: HostBinding, args: [\"class.k-calendar-monthview\",] }],\n getComponentYearClass: [{ type: HostBinding, args: [\"class.k-calendar-yearview\",] }],\n getComponentDecadeClass: [{ type: HostBinding, args: [\"class.k-calendar-decadeview\",] }],\n getComponentCenturyClass: [{ type: HostBinding, args: [\"class.k-calendar-centuryview\",] }]\n };\n return ViewListComponent;\n}());\n\nvar KEY_TO_ACTION = {\n '33': Action.PrevView,\n '34': Action.NextView,\n '35': Action.LastInView,\n '36': Action.FirstInView,\n '37': Action.Left,\n '38': Action.Up,\n '39': Action.Right,\n '40': Action.Down,\n 'meta+38': Action.UpperView,\n 'meta+40': Action.LowerView\n};\n/**\n * @hidden\n */\nvar NavigationService = /** @class */ (function () {\n function NavigationService(bus) {\n this.bus = bus;\n }\n NavigationService.prototype.action = function (event) {\n var action = \"\" + (event.ctrlKey || event.metaKey ? 'meta+' : '') + event.keyCode;\n return KEY_TO_ACTION[action];\n };\n NavigationService.prototype.move = function (value, action, activeView) {\n var service = this.bus.service(activeView);\n if (!service) {\n return value;\n }\n if (action === Action.UpperView && this.bus.canMoveUp(activeView)) {\n this.bus.moveUp(activeView);\n return value;\n }\n if (action === Action.LowerView && this.bus.canMoveDown(activeView)) {\n this.bus.moveDown(activeView);\n return value;\n }\n return service.move(value, action);\n };\n NavigationService.decorators = [\n { type: Injectable },\n ];\n /** @nocollapse */\n NavigationService.ctorParameters = function () { return [\n { type: BusViewService }\n ]; };\n return NavigationService;\n}());\n\nvar divideByMagnitude = function (magnitude) { return function (x) { return Math.floor(x / magnitude); }; };\nvar powerByMagnitude = function (magnitude) { return function (x) { return x * magnitude; }; };\n/**\n * @hidden\n */\nvar ScrollSyncService = /** @class */ (function () {\n function ScrollSyncService(dom, zone) {\n this.dom = dom;\n this.zone = zone;\n }\n ScrollSyncService.prototype.configure = function (activeView) {\n var magnitude = Math.max(this.dom.viewHeight(activeView) / this.dom.navigationItemHeight, 1);\n this.divideByMagnitude = divideByMagnitude(magnitude);\n this.powerByMagnitude = powerByMagnitude(magnitude);\n };\n ScrollSyncService.prototype.sync = function (navigator, view) {\n var _this = this;\n this.unsubscribe();\n if (!navigator || !view) {\n return;\n }\n this.navigator = navigator;\n this.view = view;\n this.zone.runOutsideAngular(function () {\n var navScrolled, monthScrolled;\n _this.navSubscription = navigator.scroll$()\n .subscribe(function (e) {\n if (monthScrolled) {\n monthScrolled = false;\n return;\n }\n navScrolled = true;\n _this.scrollSiblingOf(e.target);\n });\n _this.viewSubscription = view.scroll$()\n .subscribe(function (e) {\n if (navScrolled) {\n navScrolled = false;\n return;\n }\n monthScrolled = true;\n _this.scrollSiblingOf(e.target);\n });\n });\n };\n ScrollSyncService.prototype.scrollSiblingOf = function (scrolledElement) {\n var component = this.siblingComponent(scrolledElement);\n var scrollTop = this.calculateScroll(component, scrolledElement.scrollTop);\n component.scrollTo(scrollTop);\n };\n ScrollSyncService.prototype.siblingComponent = function (scrollableElement) {\n return this.navigator.container.nativeElement === scrollableElement ? this.view : this.navigator;\n };\n ScrollSyncService.prototype.calculateScroll = function (component, scrollTop) {\n var modifier = component === this.navigator ? this.divideByMagnitude : this.powerByMagnitude;\n return modifier(scrollTop);\n };\n ScrollSyncService.prototype.destroy = function () {\n this.unsubscribe();\n };\n ScrollSyncService.prototype.unsubscribe = function () {\n if (this.navSubscription) {\n this.navSubscription.unsubscribe();\n }\n if (this.viewSubscription) {\n this.viewSubscription.unsubscribe();\n }\n };\n ScrollSyncService.decorators = [\n { type: Injectable },\n ];\n /** @nocollapse */\n ScrollSyncService.ctorParameters = function () { return [\n { type: CalendarDOMService },\n { type: NgZone }\n ]; };\n return ScrollSyncService;\n}());\n\n/**\n * Used for rendering the cell content of the Calendar. To define the cell template, nest an `` tag\n * with the `kendoCalendarCellTemplate` directive inside the component tag. The template context is set to the\n * current component. To get a reference to the current date, use the `let-date` directive. To provide more details\n * about the current cell, get a reference to the current `cellContext` by using the `let-cellContext` directive.\n *\n * For more examples, refer to the article on [templates]({% slug templates_calendar %}).\n *\n * > `kendoCalendarCellTemplate` is equivalent to\n * > [`kendoCalendarMonthCellTemplate`]({% slug api_dateinputs_monthcelltemplatedirective %}).\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * styles: ['.custom { color: red; }'],\n * template: `\n * \n * \n * {{date.getDate()}}\n * \n * \n * `\n * })\n * class AppComponent { }\n * ```\n */\nvar CellTemplateDirective = /** @class */ (function () {\n function CellTemplateDirective(templateRef) {\n this.templateRef = templateRef;\n }\n CellTemplateDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoCalendarCellTemplate]'\n },] },\n ];\n /** @nocollapse */\n CellTemplateDirective.ctorParameters = function () { return [\n { type: TemplateRef }\n ]; };\n return CellTemplateDirective;\n}());\n\n/**\n * Used for rendering the month cell content of the Calendar. To define the month cell template, nest an `` tag\n * with the `kendoCalendarMonthCellTemplate` directive inside the component tag. The template context is set to the current\n * component. To get a reference to the current date, use the `let-date` directive. To provide more details about the current\n * month cell, get a reference to the current `cellContext` by using the `let-cellContext` directive.\n *\n * For more examples, refer to the article on [templates]({% slug templates_calendar %}).\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * styles: ['.custom { color: red; }'],\n * template: `\n * \n * \n * {{context.formattedValue}}\n * \n * \n * `\n * })\n * class AppComponent { }\n * ```\n */\nvar MonthCellTemplateDirective = /** @class */ (function () {\n function MonthCellTemplateDirective(templateRef) {\n this.templateRef = templateRef;\n }\n MonthCellTemplateDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoCalendarMonthCellTemplate]'\n },] },\n ];\n /** @nocollapse */\n MonthCellTemplateDirective.ctorParameters = function () { return [\n { type: TemplateRef }\n ]; };\n return MonthCellTemplateDirective;\n}());\n\n/**\n * Used for rendering the year cell content of the Calendar. To define the year cell template, nest an\n * `` tag with the `kendoCalendarYearCellTemplate` directive inside the component tag.\n * The template context is set to the current component. To get a reference to the current date, use\n * the `let-date` directive. To provide more details about the current year cell, get a reference to the\n * current `cellContext` by using the `let-cellContext` directive.\n *\n * For more examples, refer to the article on [templates]({% slug templates_calendar %}).\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * styles: ['.custom { color: red; }'],\n * template: `\n * \n * \n * {{context.formattedValue}}\n * \n * \n * `\n * })\n * class AppComponent {\n * public activeView: CalendarView = 'year';\n * }\n * ```\n */\nvar YearCellTemplateDirective = /** @class */ (function () {\n function YearCellTemplateDirective(templateRef) {\n this.templateRef = templateRef;\n }\n YearCellTemplateDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoCalendarYearCellTemplate]'\n },] },\n ];\n /** @nocollapse */\n YearCellTemplateDirective.ctorParameters = function () { return [\n { type: TemplateRef }\n ]; };\n return YearCellTemplateDirective;\n}());\n\n/**\n * Used for rendering the decade cell content of the Calendar. To define the decade cell template, nest an ``\n * tag with the `kendoCalendarDecadeCellTemplate` directive inside the component tag. The template context is set to the\n * current component. To get a reference to the current date, use the `let-date` directive. To provide more details about\n * the current decade cell, get a reference to the current `cellContext` by using the `let-cellContext` directive.\n *\n * For more examples, refer to the article on [templates]({% slug templates_calendar %}).\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * styles: ['.custom { color: red; }'],\n * template: `\n * \n * \n * {{context.formattedValue}}\n * \n * \n * `\n * })\n * class AppComponent {\n * public activeView: CalendarView = 'decade';\n * }\n * ```\n */\nvar DecadeCellTemplateDirective = /** @class */ (function () {\n function DecadeCellTemplateDirective(templateRef) {\n this.templateRef = templateRef;\n }\n DecadeCellTemplateDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoCalendarDecadeCellTemplate]'\n },] },\n ];\n /** @nocollapse */\n DecadeCellTemplateDirective.ctorParameters = function () { return [\n { type: TemplateRef }\n ]; };\n return DecadeCellTemplateDirective;\n}());\n\n/**\n * Used for rendering the century cell content of the Calendar. To define the century cell template, nest an ``\n * tag with the `kendoCalendarCenturyCellTemplate` directive inside the component tag. The template context is set to the\n * current component. To get a reference to the current date, use the `let-date` directive. To provide more details about\n * the current century cell, get a reference to the current `cellContext` by using the `let-cellContext` directive.\n *\n * For more examples, refer to the article on [templates]({% slug templates_calendar %}).\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * styles: ['.custom { color: red; }'],\n * template: `\n * \n * \n * {{context.formattedValue}}\n * \n * \n * `\n * })\n * class AppComponent {\n * public activeView: CalendarView = 'century';\n * }\n * ```\n */\nvar CenturyCellTemplateDirective = /** @class */ (function () {\n function CenturyCellTemplateDirective(templateRef) {\n this.templateRef = templateRef;\n }\n CenturyCellTemplateDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoCalendarCenturyCellTemplate]'\n },] },\n ];\n /** @nocollapse */\n CenturyCellTemplateDirective.ctorParameters = function () { return [\n { type: TemplateRef }\n ]; };\n return CenturyCellTemplateDirective;\n}());\n\n/**\n * Used for rendering the week number cell content in the month view of the Calendar. To define the month week number cell template,\n * nest an `` tag with the `kendoCalendarWeekNumberCellTemplate` directive inside the component tag. The template\n * context is set to the current component. To get a reference to the current date, use the `let-date` directive. To provide more\n * details about the current week number cell, get a reference to the current `cellContext` by using the `let-cellContext` directive.\n *\n * For more examples, refer to the article on [templates]({% slug templates_calendar %}).\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * styles: ['.custom { color: red; }'],\n * template: `\n * \n * \n * {{context.formattedValue}}\n * \n * \n * `\n * })\n * class AppComponent { }\n * ```\n */\nvar WeekNumberCellTemplateDirective = /** @class */ (function () {\n function WeekNumberCellTemplateDirective(templateRef) {\n this.templateRef = templateRef;\n }\n WeekNumberCellTemplateDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoCalendarWeekNumberCellTemplate]'\n },] },\n ];\n /** @nocollapse */\n WeekNumberCellTemplateDirective.ctorParameters = function () { return [\n { type: TemplateRef }\n ]; };\n return WeekNumberCellTemplateDirective;\n}());\n\n/**\n * Used for rendering the header title of the Calendar. To define the header title template, nest an `` tag\n * with the `kendoCalendarHeaderTitleTemplate` directive inside the component tag. The template context is set to the\n * current component. To get a reference to the current title, use the `let-title` directive. To provide more details about\n * the current title, get a reference to the current `date` by using the `let-date` directive or get a reference to the\n * current active view by using the `let-activeView` directive.\n *\n * For more examples, refer to the article on [templates]({% slug templates_calendar %}).\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * styles: ['.custom { color: red; }'],\n * template: `\n * \n * \n * {{title}}\n * \n * \n * `\n * })\n * class AppComponent { }\n * ```\n */\nvar HeaderTitleTemplateDirective = /** @class */ (function () {\n function HeaderTitleTemplateDirective(templateRef) {\n this.templateRef = templateRef;\n }\n HeaderTitleTemplateDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoCalendarHeaderTitleTemplate]'\n },] },\n ];\n /** @nocollapse */\n HeaderTitleTemplateDirective.ctorParameters = function () { return [\n { type: TemplateRef }\n ]; };\n return HeaderTitleTemplateDirective;\n}());\n\n/**\n * Used for rendering the navigation item of the Calendar. To define the navigation item template, nest an ``\n * tag with the `kendoCalendarNavigationItemTemplate` directive inside the component tag. The template context is set to the\n * current component. To get a reference to the current item value, use the `let-title` directive. To provide more details\n * about the current title, get a reference to the current `date` by using the `let-date='date'` directive or get a reference\n * to the current active view by using the `let-activeView='activeView'` directive.\n *\n * For more examples, refer to the article on [templates]({% slug templates_calendar %}).\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * styles: ['.custom { color: red; }'],\n * template: `\n * \n * \n * {{title}}\n * \n * \n * `\n * })\n * class AppComponent { }\n * ```\n */\nvar NavigationItemTemplateDirective = /** @class */ (function () {\n function NavigationItemTemplateDirective(templateRef) {\n this.templateRef = templateRef;\n }\n NavigationItemTemplateDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoCalendarNavigationItemTemplate]'\n },] },\n ];\n /** @nocollapse */\n NavigationItemTemplateDirective.ctorParameters = function () { return [\n { type: TemplateRef }\n ]; };\n return NavigationItemTemplateDirective;\n}());\n\n/**\n * @hidden\n */\nvar PickerService = /** @class */ (function () {\n function PickerService() {\n this.onFocus = new EventEmitter();\n this.onBlur = new EventEmitter();\n this.sameDateSelected = new EventEmitter();\n }\n return PickerService;\n}());\n\n/**\n * @hidden\n */\nvar minValidator = function (minValue) {\n return function (control) {\n var err = {\n minError: {\n minValue: minValue,\n value: control.value\n }\n };\n if (!minValue || !control.value) {\n return null;\n }\n return control.value < minValue ? err : null;\n };\n};\n\n/**\n * @hidden\n */\nvar maxValidator = function (maxValue) {\n return function (control) {\n var err = {\n maxError: {\n maxValue: maxValue,\n value: control.value\n }\n };\n if (!maxValue || !control.value) {\n return null;\n }\n return control.value > maxValue ? err : null;\n };\n};\n\n/**\n * @hidden\n */\nvar requiresZoneOnBlur = function (ngControl) { return ngControl &&\n (!ngControl.touched || (ngControl.control && ngControl.control.updateOn === 'blur')); };\n/**\n * @hidden\n */\nvar preventDefault = function (args) { return args.preventDefault(); };\n/**\n * @hidden\n */\nvar currentFocusTarget = function (blurArgs) { return blurArgs.relatedTarget || document.activeElement; };\n/**\n * @hidden\n */\nvar isPresent = function (value) { return value !== undefined && value !== null; };\n/**\n * @hidden\n *\n * If the provided parameter is an array with at least one item\n * and all items in the array are numbers, returns `true.\n */\nvar isNumberArray = function (value) { return Array.isArray(value) && value.length > 0 && value.every(function (item) { return typeof item === 'number'; }); };\n/**\n * @hidden\n *\n * If the provided parameter is an array with at least one item\n * and all items in the array are dates, returns `true`.\n */\nvar isDateArray = function (value) { return Array.isArray(value) && value.length > 0 && value.every(function (item) { return item instanceof Date; }); };\n\nvar noop$1 = function () { return false; };\nvar DISABLED_DATES_DOC_LINK = 'https://www.telerik.com/kendo-angular-ui/components/dateinputs/calendar/disabled-dates/';\n/**\n * @hidden\n */\nvar DisabledDatesService = /** @class */ (function () {\n function DisabledDatesService() {\n /**\n * Emits every time the `isDateDisabled` method changes.\n */\n this.changes = new Subject();\n /**\n * Based on the user-defined `disabledDates` input evaluates if the date is disabled.\n * If not set, returns `false`.\n */\n this.isDateDisabled = noop$1;\n }\n /**\n * Configures the `isDateDisabled` function.\n *\n * * If a function is provided, uses it as-is and passes each date to it for evaluation.\n * The time part is set to `midnight`.\n * * If a `Date[]` is provided, creates a function that checks the targeted date against\n * the listed dates and, if the targeted date is listed, marks it as disabled.\n * * If a `Day[]` is provided, creates a function that evaluates the provided days of the\n * week as disabled.\n */\n DisabledDatesService.prototype.initialize = function (disabledDates) {\n if (typeof disabledDates === 'function') {\n this.isDateDisabled = function (date) { return disabledDates(getDate(date)); };\n }\n else if (isNumberArray(disabledDates)) {\n var disabledWeekDays_1 = new Set(disabledDates);\n this.isDateDisabled = function (date) { return disabledWeekDays_1.has(date.getDay()); };\n }\n else if (isDateArray(disabledDates)) {\n var normalizedDisabledDates_1 = new Set(disabledDates.map(function (date) { return getDate(date).getTime(); }));\n this.isDateDisabled = function (date) { return normalizedDisabledDates_1.has(getDate(date).getTime()); };\n }\n else {\n this.isDateDisabled = noop$1;\n this.notifyInvalidInput(disabledDates);\n }\n this.notifyServiceChange();\n };\n DisabledDatesService.prototype.notifyInvalidInput = function (disabledDates) {\n if (isPresent(disabledDates) && isDevMode()) {\n throw new Error(\"The 'disabledDates' value should be a function, a Day array or a Date array. Check \" + DISABLED_DATES_DOC_LINK + \" for more information.\");\n }\n };\n DisabledDatesService.prototype.notifyServiceChange = function () {\n this.changes.next();\n };\n DisabledDatesService.decorators = [\n { type: Injectable },\n ];\n return DisabledDatesService;\n}());\n\n/* tslint:disable:no-forward-ref */\nvar BOTTOM_VIEW_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-bottomview';\nvar TOP_VIEW_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-topview';\nvar MIN_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-min';\nvar MAX_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-max';\nvar VALUE_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/calendar/#toc-using-with-json';\nvar virtualizationProp = function (x) { return x ? x.virtualization : null; };\n/**\n * @hidden\n */\nvar CALENDAR_VALUE_ACCESSOR = {\n multi: true,\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(function () { return CalendarComponent; }) //tslint:disable-line:no-use-before-declare\n};\n/**\n * @hidden\n */\nvar CALENDAR_RANGE_VALIDATORS = {\n multi: true,\n provide: NG_VALIDATORS,\n useExisting: forwardRef(function () { return CalendarComponent; }) //tslint:disable-line:no-use-before-declare\n};\n/**\n * @hidden\n */\nvar KENDO_INPUT_PROVIDER = {\n provide: KendoInput,\n useExisting: forwardRef(function () { return CalendarComponent; }) //tslint:disable-line:no-use-before-declare\n};\n/**\n * Represents the [Kendo UI Calendar component for Angular]({% slug overview_calendar %}#toc-basic-usage).\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * `\n * })\n * class AppComponent { }\n * ```\n */\nvar CalendarComponent = /** @class */ (function () {\n function CalendarComponent(bus, dom, element, navigator, renderer, cdr, ngZone, injector, scrollSyncService, disabledDatesService, pickerService) {\n this.bus = bus;\n this.dom = dom;\n this.element = element;\n this.navigator = navigator;\n this.renderer = renderer;\n this.cdr = cdr;\n this.ngZone = ngZone;\n this.injector = injector;\n this.scrollSyncService = scrollSyncService;\n this.disabledDatesService = disabledDatesService;\n this.pickerService = pickerService;\n /**\n * @hidden\n */\n this.id = guid();\n /**\n * Determines whether the built-in min or max validators are enforced when validating a form.\n */\n this.rangeValidation = false;\n /**\n * Sets or gets the `disabled` property of the Calendar and\n * determines whether the component is active\n * ([see example]({% slug disabled_calendar %})).\n */\n this.disabled = false;\n /**\n * Sets or gets the `tabindex` property of the Calendar. Based on the\n * [HTML `tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) behavior,\n * it determines whether the component is focusable.\n */\n this.tabindex = 0;\n /**\n * Sets or gets the `navigation` property of the Calendar\n * and determines whether the navigation side-bar will be displayed\n * ([see example]({% slug sidebar_calendar %})).\n */\n this.navigation = true;\n /**\n * Defines the active view that the Calendar initially renders\n * ([see example]({% slug activeview_calendar %})).\n * By default, the active view is `month`.\n *\n * > You have to set `activeView` within the `topView`-`bottomView` range.\n */\n this.activeView = CalendarViewEnum[CalendarViewEnum.month];\n /**\n * Defines the bottommost view to which the user can navigate\n * ([see example]({% slug dates_calendar %}#toc-partial-dates)).\n */\n this.bottomView = CalendarViewEnum[CalendarViewEnum.month];\n /**\n * Defines the topmost view to which the user can navigate\n * ([see example]({% slug sidebar_calendar %}#toc-partial-dates)).\n */\n this.topView = CalendarViewEnum[CalendarViewEnum.century];\n /**\n * Determines whether to display a week number column in the `month` view\n * ([see example]({% slug weeknumcolumn_calendar %})).\n */\n this.weekNumber = false;\n /**\n * Fires when the active view is changed\n * ([more information and example]({% slug overview_calendar %}#toc-events)).\n */\n this.activeViewChange = new EventEmitter();\n /**\n * Fires when the active view date is changed\n * ([more information and example]({% slug overview_calendar %}#toc-events)).\n */\n this.activeViewDateChange = new EventEmitter();\n /**\n * Fires when the value is changed\n * ([more information and example]({% slug overview_calendar %}#toc-events)).\n */\n this.valueChange = new EventEmitter();\n this.isActive = false;\n this.cellUID = guid();\n this._min = new Date(MIN_DATE);\n this._max = new Date(MAX_DATE);\n this._focusedDate = getToday();\n this.onControlChange = noop;\n this.onControlTouched = noop;\n this.onValidatorChange = noop;\n this.minValidateFn = noop;\n this.maxValidateFn = noop;\n this.syncNavigation = true;\n this.domEvents = [];\n this.resolvedPromise = Promise.resolve(null);\n this.destroyed = false;\n this.setClasses(element.nativeElement);\n if (this.pickerService) {\n this.pickerService.calendar = this;\n }\n }\n Object.defineProperty(CalendarComponent.prototype, \"focusedDate\", {\n get: function () {\n return this._focusedDate;\n },\n /**\n * Sets or gets the `focusedDate` property of the Calendar and\n * defines the focused date of the component\n * ([see example]({% slug dates_calendar %}#toc-focused-dates)).\n *\n * > If the Calendar is out of the min or max range, it normalizes the defined `focusedDate`.\n */\n set: function (focusedDate) {\n this._focusedDate = focusedDate || getToday();\n this.setAriaActivedescendant();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CalendarComponent.prototype, \"min\", {\n get: function () {\n return this._min;\n },\n /**\n * Sets or gets the `min` property of the Calendar and\n * defines the minimum allowed date value\n * ([see example]({% slug dateranges_calendar %})).\n * By default, the `min` value is `1900-1-1`.\n */\n set: function (min) {\n this._min = min || new Date(MIN_DATE);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CalendarComponent.prototype, \"max\", {\n get: function () {\n return this._max;\n },\n /**\n * Sets or gets the `max` property of the Calendar and\n * defines the maximum allowed date value\n * ([see example]({% slug dateranges_calendar %})).\n * By default, the `max` value is `2099-12-31`.\n */\n set: function (max) {\n this._max = max || new Date(MAX_DATE);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CalendarComponent.prototype, \"value\", {\n /**\n * Sets or gets the `value` property of the Calendar and defines the selected value of the component.\n *\n * > The `value` has to be a valid\n * [JavaScript `Date`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date) instance.\n */\n get: function () {\n return this._value;\n },\n set: function (candidate) {\n this.verifyValue(candidate);\n this._value = cloneDate(candidate);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CalendarComponent.prototype, \"tabIndex\", {\n get: function () {\n return this.tabindex;\n },\n /**\n * @hidden\n */\n set: function (tabIndex) {\n this.tabindex = tabIndex;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CalendarComponent.prototype, \"disabledDates\", {\n /**\n * Sets the dates of the Calendar that will be disabled\n * ([see example]({% slug disabled_dates_calendar %})).\n */\n set: function (value) {\n this.disabledDatesService.initialize(value);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CalendarComponent.prototype, \"cellTemplateRef\", {\n /**\n * @hidden\n */\n set: function (template) {\n this.cellTemplate = template;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CalendarComponent.prototype, \"monthCellTemplateRef\", {\n /**\n * @hidden\n */\n set: function (template) {\n this.monthCellTemplate = template;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CalendarComponent.prototype, \"yearCellTemplateRef\", {\n /**\n * @hidden\n */\n set: function (template) {\n this.yearCellTemplate = template;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CalendarComponent.prototype, \"decadeCellTemplateRef\", {\n /**\n * @hidden\n */\n set: function (template) {\n this.decadeCellTemplate = template;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CalendarComponent.prototype, \"centuryCellTemplateRef\", {\n /**\n * @hidden\n */\n set: function (template) {\n this.centuryCellTemplate = template;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CalendarComponent.prototype, \"weekNumberTemplateRef\", {\n /**\n * @hidden\n */\n set: function (template) {\n this.weekNumberTemplate = template;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CalendarComponent.prototype, \"headerTitleTemplateRef\", {\n /**\n * @hidden\n */\n set: function (template) {\n this.headerTitleTemplate = template;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CalendarComponent.prototype, \"navigationItemTemplateRef\", {\n /**\n * @hidden\n */\n set: function (template) {\n this.navigationItemTemplate = template;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CalendarComponent.prototype, \"activeViewEnum\", {\n get: function () {\n var activeView = CalendarViewEnum[this.activeView];\n return activeView < this.bottomViewEnum ? this.bottomViewEnum : activeView;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CalendarComponent.prototype, \"bottomViewEnum\", {\n get: function () {\n return CalendarViewEnum[this.bottomView];\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CalendarComponent.prototype, \"topViewEnum\", {\n get: function () {\n return CalendarViewEnum[this.topView];\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CalendarComponent.prototype, \"widgetId\", {\n get: function () {\n return this.id;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CalendarComponent.prototype, \"widgetRole\", {\n get: function () {\n return 'grid';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CalendarComponent.prototype, \"calendarTabIndex\", {\n get: function () {\n return this.disabled ? undefined : this.tabIndex;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(CalendarComponent.prototype, \"ariaDisabled\", {\n get: function () {\n return this.disabled;\n },\n enumerable: true,\n configurable: true\n });\n CalendarComponent.prototype.ngOnInit = function () {\n var _this = this;\n this.dom.calculateHeights(this.element.nativeElement);\n this.scrollSyncService.configure(this.activeViewEnum);\n this.viewChangeSubscription = this.bus.viewChanged.subscribe(function (_a) {\n var view = _a.view;\n _this.activeView = CalendarViewEnum[view];\n _this.emitEvent(_this.activeViewChange, _this.activeView);\n _this.scrollSyncService.configure(view);\n _this.detectChanges(); // requires zone if templates\n });\n this.control = this.injector.get(NgControl, null);\n if (this.element) {\n this.ngZone.runOutsideAngular(function () {\n _this.bindEvents();\n });\n }\n };\n CalendarComponent.prototype.ngOnChanges = function (changes) {\n this.verifyChanges();\n this.bus.configure(this.bottomViewEnum, this.topViewEnum);\n this.scrollSyncService.configure(this.activeViewEnum);\n var useValue = hasExistingValue(changes, 'value') && !hasExistingValue(changes, 'focusedDate');\n var focusedDate = dateInRange(cloneDate(useValue ? this.value : this.focusedDate), this.min, this.max);\n this.focusedDate = !isEqual(this.focusedDate, focusedDate) ? focusedDate : this.focusedDate;\n if (changes.navigation) {\n this.syncNavigation = true;\n }\n if (changes.min || changes.max || changes.rangeValidation) {\n this.minValidateFn = this.rangeValidation ? minValidator(this.min) : noop;\n this.maxValidateFn = this.rangeValidation ? maxValidator(this.max) : noop;\n this.onValidatorChange();\n }\n };\n CalendarComponent.prototype.ngAfterViewInit = function () {\n this.setAriaActivedescendant();\n };\n CalendarComponent.prototype.ngAfterViewChecked = function () {\n if (!this.syncNavigation) {\n return;\n }\n this.syncNavigation = false;\n this.scrollSyncService.sync(virtualizationProp(this.navigationView), virtualizationProp(this.monthView));\n };\n CalendarComponent.prototype.ngOnDestroy = function () {\n this.scrollSyncService.destroy();\n this.viewChangeSubscription.unsubscribe();\n this.domEvents.forEach(function (unbindCallback) { return unbindCallback(); });\n if (this.pickerService) {\n this.pickerService.calendar = null;\n }\n if (this.pageChangeSubscription) {\n this.pageChangeSubscription.unsubscribe();\n }\n this.destroyed = true;\n };\n /**\n * Focuses the host element of the Calendar.\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * `\n * })\n * class AppComponent { }\n * ```\n */\n CalendarComponent.prototype.focus = function () {\n if (!this.element) {\n return;\n }\n this.element.nativeElement.focus();\n };\n /**\n * Blurs the Calendar component.\n */\n CalendarComponent.prototype.blur = function () {\n if (!this.element) {\n return;\n }\n this.element.nativeElement.blur();\n };\n /**\n * @hidden\n */\n CalendarComponent.prototype.containsElement = function (element) {\n var _this = this;\n return Boolean(closest(element, function (node) { return node === _this.element.nativeElement; }));\n };\n /**\n * @hidden\n */\n CalendarComponent.prototype.handleNavigation = function (candidate) {\n if (this.disabled) {\n return;\n }\n this.focusedDate = dateInRange(cloneDate(candidate) || this.focusedDate, this.min, this.max);\n this.detectChanges();\n };\n /**\n * @hidden\n */\n CalendarComponent.prototype.onPageChange = function () {\n var _this = this;\n if (!NgZone.isInAngularZone()) {\n if (this.pageChangeSubscription) {\n this.pageChangeSubscription.unsubscribe();\n }\n this.pageChangeSubscription = from(this.resolvedPromise)\n .subscribe(function () {\n _this.detectChanges(); // requires zone if templates\n });\n }\n };\n /**\n * @hidden\n */\n CalendarComponent.prototype.handleDateChange = function (candidate) {\n var _this = this;\n var canNavigateDown = this.bus.canMoveDown(this.activeViewEnum);\n var isSameDate = !canNavigateDown && isEqual(candidate, this.value);\n this.focusedDate = cloneDate(candidate) || this.focusedDate;\n if (this.disabled) {\n return;\n }\n if (isSameDate) {\n this.emitSameDate();\n return;\n }\n if (canNavigateDown) {\n this.bus.moveDown(this.activeViewEnum);\n return;\n }\n if (!this.disabledDatesService.isDateDisabled(candidate)) {\n this.ngZone.run(function () {\n _this.value = cloneDate(candidate);\n _this.onControlChange(cloneDate(candidate));\n _this.valueChange.emit(cloneDate(candidate));\n _this.cdr.markForCheck();\n });\n }\n };\n /**\n * @hidden\n */\n CalendarComponent.prototype.writeValue = function (candidate) {\n this.verifyValue(candidate);\n this.focusedDate = dateInRange(cloneDate(candidate) || this.focusedDate, this.min, this.max);\n this.value = cloneDate(candidate);\n this.cdr.markForCheck();\n };\n /**\n * @hidden\n */\n CalendarComponent.prototype.registerOnChange = function (fn) {\n this.onControlChange = fn;\n };\n /**\n * @hidden\n */\n CalendarComponent.prototype.registerOnTouched = function (fn) {\n this.onControlTouched = fn;\n };\n /**\n * @hidden\n */\n CalendarComponent.prototype.setDisabledState = function (isDisabled) {\n this.disabled = isDisabled;\n this.cdr.markForCheck();\n };\n /**\n * @hidden\n */\n CalendarComponent.prototype.validate = function (control) {\n return this.minValidateFn(control) || this.maxValidateFn(control);\n };\n /**\n * @hidden\n */\n CalendarComponent.prototype.registerOnValidatorChange = function (fn) {\n this.onValidatorChange = fn;\n };\n /**\n * @hidden\n */\n CalendarComponent.prototype.activeCellTemplate = function () {\n switch (this.activeViewEnum) {\n case CalendarViewEnum.month:\n return this.monthCellTemplate || this.cellTemplate;\n case CalendarViewEnum.year:\n return this.yearCellTemplate;\n case CalendarViewEnum.decade:\n return this.decadeCellTemplate;\n case CalendarViewEnum.century:\n return this.centuryCellTemplate;\n default:\n return null;\n }\n };\n /**\n * @hidden\n */\n CalendarComponent.prototype.emitEvent = function (emitter, args) {\n if (hasObservers(emitter)) {\n this.ngZone.run(function () {\n emitter.emit(args);\n });\n }\n };\n CalendarComponent.prototype.setClasses = function (element) {\n this.renderer.addClass(element, 'k-widget');\n this.renderer.addClass(element, 'k-calendar');\n this.renderer.addClass(element, 'k-calendar-infinite');\n };\n CalendarComponent.prototype.verifyChanges = function () {\n if (!isDevMode()) {\n return;\n }\n if (this.min > this.max) {\n throw new Error(\"The max value should be bigger than the min. See \" + MIN_DOC_LINK + \" and \" + MAX_DOC_LINK + \".\");\n }\n if (this.bottomViewEnum > this.topViewEnum) {\n throw new Error(\"The topView should be greater than bottomView. See \" + BOTTOM_VIEW_DOC_LINK + \" and \" + TOP_VIEW_DOC_LINK + \".\");\n }\n };\n CalendarComponent.prototype.verifyValue = function (candidate) {\n if (!isDevMode()) {\n return;\n }\n if (candidate && !(candidate instanceof Date)) {\n throw new Error(\"The 'value' should be a valid JavaScript Date instance. Check \" + VALUE_DOC_LINK + \" for possible resolution.\");\n }\n };\n CalendarComponent.prototype.bindEvents = function () {\n var element = this.element.nativeElement;\n this.domEvents.push(this.renderer.listen(element, 'blur', this.handleBlur.bind(this)), this.renderer.listen(element, 'focus', this.handleFocus.bind(this)), this.renderer.listen(element, 'mousedown', preventDefault), this.renderer.listen(element, 'click', this.handleClick.bind(this)), this.renderer.listen(element, 'keydown', this.handleKeydown.bind(this)));\n };\n CalendarComponent.prototype.emitBlur = function (args) {\n if (this.pickerService) {\n this.pickerService.onBlur.emit(args);\n }\n };\n CalendarComponent.prototype.emitFocus = function () {\n if (this.pickerService) {\n this.pickerService.onFocus.emit();\n }\n };\n CalendarComponent.prototype.handleBlur = function (args) {\n var _this = this;\n this.isActive = false;\n // the injector can get the NgControl instance of the parent component (for example, the DateTimePicker)\n // and enters the zone for no reason because the parent component is still untouched\n if (!this.pickerService && requiresZoneOnBlur(this.control)) {\n this.ngZone.run(function () {\n _this.onControlTouched();\n _this.emitBlur(args);\n });\n }\n else {\n this.emitBlur(args);\n this.detectChanges();\n }\n };\n CalendarComponent.prototype.handleFocus = function () {\n this.isActive = true;\n if (!NgZone.isInAngularZone()) {\n this.detectChanges();\n }\n this.emitFocus();\n };\n CalendarComponent.prototype.handleClick = function () {\n if (!this.isActive) {\n if (this.monthView.isScrolled()) {\n this.focusedDate = cloneDate(this.focusedDate); //XXX: forces change detect\n this.detectChanges();\n }\n this.focus();\n }\n };\n CalendarComponent.prototype.handleKeydown = function (args) {\n // reserve the alt + arrow key commands for the picker\n var arrowKeyPressed = [Keys.ArrowUp, Keys.ArrowRight, Keys.ArrowDown, Keys.ArrowLeft].indexOf(args.keyCode) !== -1;\n if (isPresent(this.pickerService) && arrowKeyPressed && args.altKey) {\n return;\n }\n var candidate = dateInRange(this.navigator.move(this.focusedDate, this.navigator.action(args), this.activeViewEnum), this.min, this.max);\n if (!isEqual(this.focusedDate, candidate)) {\n this.focusedDate = candidate;\n this.detectChanges();\n args.preventDefault();\n }\n if (args.keyCode === Keys.Enter) {\n this.handleDateChange(this.focusedDate);\n }\n };\n CalendarComponent.prototype.detectChanges = function () {\n if (!this.destroyed) {\n this.cdr.detectChanges();\n }\n };\n CalendarComponent.prototype.emitSameDate = function () {\n if (this.pickerService) {\n this.pickerService.sameDateSelected.emit();\n }\n };\n CalendarComponent.prototype.setAriaActivedescendant = function () {\n if (!isPresent(this.element)) {\n return;\n }\n var focusedCellId = this.cellUID + this.focusedDate.getTime();\n this.renderer.setAttribute(this.element.nativeElement, 'aria-activedescendant', focusedCellId);\n };\n CalendarComponent.decorators = [\n { type: Component, args: [{\n changeDetection: ChangeDetectionStrategy.OnPush,\n exportAs: 'kendo-calendar',\n providers: [\n BusViewService,\n CALENDAR_VALUE_ACCESSOR,\n CALENDAR_RANGE_VALIDATORS,\n KENDO_INPUT_PROVIDER,\n LocalizationService,\n DisabledDatesService,\n {\n provide: L10N_PREFIX,\n useValue: 'kendo.calendar'\n },\n NavigationService,\n ScrollSyncService\n ],\n selector: 'kendo-calendar',\n template: \"\\n \\n \\n \\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n CalendarComponent.ctorParameters = function () { return [\n { type: BusViewService },\n { type: CalendarDOMService },\n { type: ElementRef },\n { type: NavigationService },\n { type: Renderer2 },\n { type: ChangeDetectorRef },\n { type: NgZone },\n { type: Injector },\n { type: ScrollSyncService },\n { type: DisabledDatesService },\n { type: PickerService, decorators: [{ type: Optional }] }\n ]; };\n CalendarComponent.propDecorators = {\n id: [{ type: Input }],\n focusedDate: [{ type: Input }],\n min: [{ type: Input }],\n max: [{ type: Input }],\n rangeValidation: [{ type: Input }],\n value: [{ type: Input }],\n disabled: [{ type: Input }],\n tabindex: [{ type: Input }],\n tabIndex: [{ type: Input }],\n disabledDates: [{ type: Input }],\n navigation: [{ type: Input }],\n activeView: [{ type: Input }],\n bottomView: [{ type: Input }],\n topView: [{ type: Input }],\n weekNumber: [{ type: Input }, { type: HostBinding, args: ['class.k-week-number',] }],\n activeViewChange: [{ type: Output }],\n activeViewDateChange: [{ type: Output }],\n valueChange: [{ type: Output }],\n cellTemplate: [{ type: ContentChild, args: [CellTemplateDirective, { static: true },] }],\n cellTemplateRef: [{ type: Input, args: ['cellTemplate',] }],\n monthCellTemplate: [{ type: ContentChild, args: [MonthCellTemplateDirective, { static: true },] }],\n monthCellTemplateRef: [{ type: Input, args: ['monthCellTemplate',] }],\n yearCellTemplate: [{ type: ContentChild, args: [YearCellTemplateDirective, { static: true },] }],\n yearCellTemplateRef: [{ type: Input, args: ['yearCellTemplate',] }],\n decadeCellTemplate: [{ type: ContentChild, args: [DecadeCellTemplateDirective, { static: true },] }],\n decadeCellTemplateRef: [{ type: Input, args: ['decadeCellTemplate',] }],\n centuryCellTemplate: [{ type: ContentChild, args: [CenturyCellTemplateDirective, { static: true },] }],\n centuryCellTemplateRef: [{ type: Input, args: ['centuryCellTemplate',] }],\n weekNumberTemplate: [{ type: ContentChild, args: [WeekNumberCellTemplateDirective, { static: true },] }],\n weekNumberTemplateRef: [{ type: Input, args: ['weekNumberTemplate',] }],\n headerTitleTemplate: [{ type: ContentChild, args: [HeaderTitleTemplateDirective, { static: true },] }],\n headerTitleTemplateRef: [{ type: Input, args: ['headerTitleTemplate',] }],\n navigationItemTemplate: [{ type: ContentChild, args: [NavigationItemTemplateDirective, { static: true },] }],\n navigationItemTemplateRef: [{ type: Input, args: ['navigationItemTemplate',] }],\n navigationView: [{ type: ViewChild, args: [NavigationComponent,] }],\n monthView: [{ type: ViewChild, args: [ViewListComponent,] }],\n widgetId: [{ type: HostBinding, args: ['attr.id',] }],\n widgetRole: [{ type: HostBinding, args: ['attr.role',] }],\n calendarTabIndex: [{ type: HostBinding, args: ['attr.tabindex',] }],\n ariaDisabled: [{ type: HostBinding, args: ['attr.aria-disabled',] }, { type: HostBinding, args: ['class.k-state-disabled',] }]\n };\n return CalendarComponent;\n}());\n\n/**\n * @hidden\n */\nvar Arrow;\n(function (Arrow) {\n Arrow[Arrow[\"Up\"] = 0] = \"Up\";\n Arrow[Arrow[\"Down\"] = 1] = \"Down\";\n Arrow[Arrow[\"None\"] = 2] = \"None\";\n})(Arrow || (Arrow = {}));\n\n/* tslint:disable:max-line-length */\nvar MIN_DOC_LINK$1 = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/DateInputComponent/#toc-min';\nvar MAX_DOC_LINK$1 = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/DateInputComponent/#toc-max';\nvar VALUE_DOC_LINK$1 = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/dateinput/#toc-using-with-json';\nvar DATE_PART_REGEXP = /year|month|/;\nvar TIME_PART_REGEXP = /hour|minute|second|millisecond/;\nvar SHORT_PATTERN_LENGTH_REGEXP = /d|M|H|h|m|s/;\nvar getTime = function (date) { return date ? date.getTime() : null; };\nvar padZero = function (length) { return new Array(Math.max(length, 0)).fill('0').join(''); };\nvar unpadZero = function (value) { return value.replace(/^0*/, ''); };\nvar Mask = /** @class */ (function () {\n function Mask() {\n this.symbols = \"\";\n }\n return Mask;\n}());\nvar KendoDate = /** @class */ (function () {\n function KendoDate(intl, formatPlaceholder, format, value) {\n this.intl = intl;\n this.formatPlaceholder = formatPlaceholder;\n this.format = format;\n this.year = true;\n this.month = true;\n this.date = true;\n this.hours = true;\n this.minutes = true;\n this.seconds = true;\n this.milliseconds = true;\n this.leadingZero = null;\n this.monthNames = null;\n this.typedMonthPart = \"\";\n this.value = getDate(new Date());\n this.knownParts = \"adHhmMsEy\";\n this.symbols = {\n \"E\": \"E\",\n \"H\": \"H\",\n \"M\": \"M\",\n \"a\": \"a\",\n \"d\": \"d\",\n \"h\": \"h\",\n \"m\": \"m\",\n \"s\": \"s\",\n \"y\": \"y\"\n };\n this.monthNames = this.allFormatedMonths();\n this.dayPeriods = this.allDayPeriods();\n if (!value) {\n this.value = getDate(new Date());\n var sampleFormat = this.dateFormatString(this.value, this.format).symbols;\n for (var i = 0; i < sampleFormat.length; i++) {\n this.setExisting(sampleFormat[i], false);\n }\n }\n else {\n this.value = cloneDate(value);\n }\n }\n KendoDate.prototype.hasValue = function () {\n var _this = this;\n var pred = function (a, p) { return a || p.type !== 'literal' && p.type !== 'dayperiod' && _this.getExisting(p.pattern[0]); };\n return this.intl.splitDateFormat(this.format).reduce(pred, false);\n };\n KendoDate.prototype.getDateObject = function () {\n for (var i = 0; i < this.knownParts.length; i++) {\n if (!this.getExisting(this.knownParts[i])) {\n return null;\n }\n }\n return cloneDate(this.value);\n };\n KendoDate.prototype.getTextAndFormat = function () {\n return this.merge(this.intl.formatDate(this.value, this.format), this.dateFormatString(this.value, this.format));\n };\n KendoDate.prototype.getExisting = function (symbol) {\n switch (symbol) {\n case \"y\": return this.year;\n case \"M\":\n case \"L\": return this.month;\n case \"d\": return this.date;\n case \"E\": return this.date && this.month && this.year;\n case \"h\":\n case \"H\": return this.hours;\n case \"m\": return this.minutes;\n case \"s\": return this.seconds;\n default: return true;\n }\n };\n KendoDate.prototype.setExisting = function (symbol, value) {\n switch (symbol) {\n case \"y\":\n this.year = value;\n if (value === false) {\n this.value.setFullYear(2000);\n }\n break; //allow 2/29 dates\n case \"M\":\n this.month = value;\n if (value === false) {\n this.value.setMonth(0);\n }\n break; //make sure you can type 31 at day part\n case \"d\":\n this.date = value;\n break;\n case \"h\":\n case \"H\":\n this.hours = value;\n break;\n case \"m\":\n this.minutes = value;\n break;\n case \"s\":\n this.seconds = value;\n break;\n default: return;\n }\n };\n KendoDate.prototype.modifyPart = function (symbol, offset) {\n var newValue = cloneDate(this.value);\n switch (symbol) {\n case \"y\":\n newValue.setFullYear(newValue.getFullYear() + offset);\n break;\n case \"M\":\n newValue = addMonths(this.value, offset);\n break;\n case \"d\":\n case \"E\":\n newValue.setDate(newValue.getDate() + offset);\n break;\n case \"h\":\n case \"H\":\n newValue.setHours(newValue.getHours() + offset);\n break;\n case \"m\":\n newValue.setMinutes(newValue.getMinutes() + offset);\n break;\n case \"s\":\n newValue.setSeconds(newValue.getSeconds() + offset);\n break;\n case \"a\":\n newValue.setHours(newValue.getHours() + (12 * offset));\n break;\n default: break;\n }\n if (newValue.getFullYear() > 0) {\n this.setExisting(symbol, true);\n this.value = newValue;\n }\n };\n KendoDate.prototype.parsePart = function (symbol, currentChar, resetSegmentValue) {\n if (!currentChar) {\n this.resetLeadingZero();\n this.setExisting(symbol, false);\n return { value: null, switchToNext: false };\n }\n var baseDate = this.intl.formatDate(this.value, this.format);\n var dateParts = this.dateFormatString(this.value, this.format);\n var baseFormat = dateParts.symbols;\n var replaced = false;\n var prefix = \"\";\n var current = \"\";\n var suffix = \"\";\n for (var i = 0; i < baseDate.length; i++) {\n if (baseFormat[i] === symbol) {\n current += this.getExisting(symbol) ? baseDate[i] : \"0\";\n replaced = true;\n }\n else if (!replaced) {\n prefix += baseDate[i];\n }\n else {\n suffix += baseDate[i];\n }\n }\n var currentMaxLength = current.length - 3;\n var parsedDate = null;\n var month = this.matchMonth(currentChar);\n var dayPeriod = this.matchDayPeriod(currentChar, symbol);\n var isZeroCurrentChar = currentChar === '0';\n var leadingZero = (this.leadingZero || {})[symbol] || 0;\n if (isZeroCurrentChar) {\n var valueNumber = parseInt(resetSegmentValue ? currentChar : current + currentChar, 10);\n if (valueNumber === 0 && !this.isAbbrMonth(dateParts.partMap, symbol)) {\n this.incrementLeadingZero(symbol);\n }\n }\n else {\n this.resetLeadingZero();\n }\n for (var i = Math.max(0, currentMaxLength); i <= current.length; i++) {\n var middle = resetSegmentValue ? currentChar : (current.substring(i) + currentChar);\n var middleNumber = parseInt(middle, 10);\n parsedDate = this.intl.parseDate(prefix + middle + suffix, this.format);\n if (!parsedDate && !isNaN(middleNumber) && !isNaN(parseInt(currentChar, 10))) {\n if (symbol === 'M' && !month) {\n var monthNumber = middleNumber - 1;\n if (monthNumber > -1 && monthNumber < 12) {\n parsedDate = cloneDate(this.value);\n parsedDate.setMonth(monthNumber);\n if (parsedDate.getMonth() !== monthNumber) {\n parsedDate = lastDayOfMonth(addMonths(parsedDate, -1));\n }\n }\n }\n if (symbol === 'y') {\n parsedDate = createDate(parseInt(middle, 10), this.month ? this.value.getMonth() : 0, this.date ? this.value.getDate() : 1, this.hours ? this.value.getHours() : 0, this.minutes ? this.value.getMinutes() : 0, this.seconds ? this.value.getSeconds() : 0, this.milliseconds ? this.value.getMilliseconds() : 0);\n if (this.date && parsedDate.getDate() !== this.value.getDate()) {\n parsedDate = lastDayOfMonth(addMonths(parsedDate, -1));\n }\n }\n }\n if (parsedDate) {\n //move to next segment if the part will overflow with next char\n //when start from empty date (01, then 010), padded zeros should be trimmed\n var patternValue = this.partPattern(dateParts.partMap, symbol).pattern;\n var peekDate = this.intl.parseDate(\"\" + prefix + this.peek(middle, patternValue) + suffix, this.format);\n var patternLength = this.patternLength(patternValue) || patternValue.length;\n var patternSatisfied = (leadingZero + (unpadZero(middle) || currentChar).length) >= patternLength;\n var switchToNext = peekDate === null || patternSatisfied;\n this.value = parsedDate;\n this.setExisting(symbol, true);\n return { value: this.value, switchToNext: switchToNext };\n }\n }\n if (month) {\n parsedDate = this.intl.parseDate(prefix + month + suffix, this.format);\n if (parsedDate) {\n this.value = parsedDate;\n this.setExisting(symbol, true);\n return { value: this.value, switchToNext: false };\n }\n }\n if (dayPeriod) {\n parsedDate = this.intl.parseDate(prefix + dayPeriod + suffix, this.format);\n if (parsedDate) {\n this.value = parsedDate;\n return { value: this.value, switchToNext: true };\n }\n }\n if (isZeroCurrentChar) {\n this.setExisting(symbol, false);\n }\n return { value: null, switchToNext: false };\n };\n KendoDate.prototype.resetLeadingZero = function () {\n var hasLeadingZero = this.leadingZero !== null;\n this.setLeadingZero(null);\n return hasLeadingZero;\n };\n KendoDate.prototype.setLeadingZero = function (leadingZero) {\n this.leadingZero = leadingZero;\n };\n KendoDate.prototype.incrementLeadingZero = function (symbol) {\n var leadingZero = this.leadingZero || {};\n leadingZero[symbol] = (leadingZero[symbol] || 0) + 1;\n this.leadingZero = leadingZero;\n };\n KendoDate.prototype.isAbbrMonth = function (parts, symbol) {\n var pattern = this.partPattern(parts, symbol);\n return pattern.type === 'month' && pattern.names;\n };\n KendoDate.prototype.partPattern = function (parts, symbol) {\n return parts.filter(function (part) { return part.pattern.indexOf(symbol) !== -1; })[0];\n };\n KendoDate.prototype.peek = function (value, pattern) {\n var peekValue = unpadZero(value) + '0';\n return padZero(pattern.length - peekValue.length) + peekValue;\n };\n KendoDate.prototype.matchMonth = function (typedChar) {\n this.typedMonthPart += typedChar.toLowerCase();\n if (!this.monthNames) {\n return \"\";\n }\n while (this.typedMonthPart.length > 0) {\n for (var i = 0; i < this.monthNames.length; i++) {\n if (this.monthNames[i].toLowerCase().indexOf(this.typedMonthPart) === 0) {\n return this.monthNames[i];\n }\n }\n var monthAsNum = parseInt(this.typedMonthPart, 10);\n if (monthAsNum >= 1 && monthAsNum <= 12 && monthAsNum.toString() === this.typedMonthPart /*ensure they exact match*/) {\n return this.monthNames[monthAsNum - 1];\n }\n this.typedMonthPart = this.typedMonthPart.substring(1, this.typedMonthPart.length);\n }\n return \"\";\n };\n KendoDate.prototype.matchDayPeriod = function (typedChar, symbol) {\n var lowerChart = String(typedChar).toLowerCase();\n if (symbol === 'a' && this.dayPeriods) {\n if (this.dayPeriods.am.toLowerCase().startsWith(lowerChart)) {\n return this.dayPeriods.am;\n }\n else if (this.dayPeriods.pm.toLowerCase().startsWith(lowerChart)) {\n return this.dayPeriods.pm;\n }\n }\n return '';\n };\n KendoDate.prototype.allFormatedMonths = function () {\n var dateFormatParts = this.intl.splitDateFormat(this.format);\n for (var i = 0; i < dateFormatParts.length; i++) {\n if (dateFormatParts[i].type === \"month\" && dateFormatParts[i].names) {\n return this.intl.dateFormatNames(dateFormatParts[i].names);\n }\n }\n return null;\n };\n KendoDate.prototype.allDayPeriods = function () {\n var dateFormatParts = this.intl.splitDateFormat(this.format);\n for (var i = 0; i < dateFormatParts.length; i++) {\n if (dateFormatParts[i].type === \"dayperiod\" && dateFormatParts[i].names) {\n return this.intl.dateFormatNames(dateFormatParts[i].names);\n }\n }\n return null;\n };\n KendoDate.prototype.patternLength = function (pattern) {\n if (pattern[0] === 'y') {\n return 4;\n }\n if (SHORT_PATTERN_LENGTH_REGEXP.test(pattern)) {\n return 2;\n }\n return 0;\n };\n //TODO: REMOVE!\n KendoDate.prototype.dateFormatString = function (date, format) {\n var dateFormatParts = this.intl.splitDateFormat(format);\n var parts = [];\n var partMap = [];\n for (var i = 0; i < dateFormatParts.length; i++) {\n var partLength = this.intl.formatDate(date, { pattern: dateFormatParts[i].pattern }).length;\n while (partLength > 0) {\n parts.push(this.symbols[dateFormatParts[i].pattern[0]] || \"_\");\n partMap.push(dateFormatParts[i]);\n partLength--;\n }\n }\n var returnValue = new Mask();\n returnValue.symbols = parts.join(\"\");\n returnValue.partMap = partMap;\n return returnValue;\n };\n KendoDate.prototype.merge = function (text, mask) {\n // Important: right to left.\n var resultText = \"\";\n var resultFormat = \"\";\n var format = mask.symbols;\n for (var r = format.length - 1; r >= 0; r--) {\n if (this.knownParts.indexOf(format[r]) === -1 || this.getExisting(format[r])) {\n resultText = text[r] + resultText;\n resultFormat = format[r] + resultFormat;\n }\n else {\n var currentSymbol = format[r];\n while (r >= 0 && currentSymbol === format[r]) {\n r--;\n }\n r++;\n if (this.leadingZero && this.leadingZero[currentSymbol]) {\n resultText = '0' + resultText;\n }\n else {\n resultText = this.dateFieldName(mask.partMap[r]) + resultText;\n }\n while (resultFormat.length < resultText.length) {\n resultFormat = format[r] + resultFormat;\n }\n }\n }\n return [resultText, resultFormat];\n };\n KendoDate.prototype.dateFieldName = function (part) {\n var formatPlaceholder = this.formatPlaceholder || 'wide';\n if (formatPlaceholder[part.type]) {\n return formatPlaceholder[part.type];\n }\n if (formatPlaceholder === 'formatPattern') {\n return part.pattern;\n }\n return this.intl.dateFieldName(Object.assign(part, { nameType: formatPlaceholder }));\n };\n return KendoDate;\n}());\n/**\n * Represents the [Kendo UI DateInput component for Angular]({% slug overview_dateinput %}#toc-basic-usage).\n */\nvar DateInputComponent = /** @class */ (function () {\n function DateInputComponent(cdr, intl, renderer, element, ngZone, injector, localization, pickerService) {\n this.cdr = cdr;\n this.intl = intl;\n this.renderer = renderer;\n this.element = element;\n this.ngZone = ngZone;\n this.injector = injector;\n this.localization = localization;\n this.pickerService = pickerService;\n /**\n * @hidden\n */\n this.focusableId = \"k-\" + guid();\n /**\n * Sets or gets the `disabled` property of the DateInput and\n * determines whether the component is active\n * ([see example]({% slug disabled_dateinput %})).\n */\n this.disabled = false;\n /**\n * Sets or gets the read-only state of the DateInput\n * ([see example]({% slug readonly_dateinput %})).\n */\n this.readonly = false;\n /**\n * Sets the title of the input element of the DateInput.\n */\n this.title = \"\";\n /**\n * Sets or gets the `tabIndex` property of the DateInput.\n * .\n */\n this.tabindex = 0;\n /**\n * Specifies the date format that is used to display the input value\n * ([see example]({% slug formats_dateinput %})).\n */\n this.format = \"d\";\n /**\n * Specifies the hint the DateInput displays when its value is `null`.\n * For more information, refer to the article on\n * [placeholders]({% slug placeholders_dateinput %}).\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * `\n * })\n * class AppComponent { }\n * ```\n */\n this.placeholder = null;\n /**\n * Determines whether the built-in min or max validators are to be enforced when a form is being validated.\n */\n this.rangeValidation = true;\n /**\n * @hidden\n * Based on the min and max values, specifies whether the value will be auto-corrected while typing.\n */\n this.autoCorrect = false;\n /**\n * Specifies whether the **Up** and **Down** spin buttons will be rendered.\n * For more information, refer to the article on\n * [spinner buttons]({% slug spinbuttons_dateinput %}).\n */\n this.spinners = false;\n /**\n * @hidden\n */\n this.isPopupOpen = false;\n /**\n * @hidden\n */\n this.hasPopup = false;\n /**\n * Fires each time the user selects a new value.\n * For more information, refer to the section on\n * [events]({% slug overview_dateinput %}#toc-events).\n */\n this.valueChange = new EventEmitter();\n /**\n * Fires each time the user selects a new value.\n * For more information, refer to the section on\n * [events]({% slug overview_dateinput %}#toc-events).\n */\n this.valueUpdate = new EventEmitter();\n /**\n * Fires each time the user focuses the input element.\n * For more information, refer to the section on\n * [events]({% slug overview_dateinput %}#toc-events).\n *\n * > To wire the event programmatically, use the `onFocus` property.\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * `\n * })\n * class AppComponent {\n * public handleFocus(): void {\n * console.log(\"Component is focused\");\n * }\n * }\n * ```\n *\n */\n this.onFocus = new EventEmitter(); //tslint:disable-line:no-output-rename\n /**\n * Fires each time the input element gets blurred.\n * For more information, refer to the section on\n * [events]({% slug overview_dateinput %}#toc-events).\n *\n * > To wire the event programmatically, use the `onBlur` property.\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * `\n * })\n * class AppComponent {\n * public handleBlur(): void {\n * console.log(\"Component is blurred\");\n * }\n * }\n * ```\n *\n */\n this.onBlur = new EventEmitter(); //tslint:disable-line:no-output-rename\n this.arrow = Arrow;\n this.arrowDirection = Arrow.None;\n this.formatSections = { date: false, time: false };\n this.hasMousedown = false;\n this.currentValue = \"\";\n this.currentFormat = \"\";\n this.backspace = false;\n this.resetSegmentValue = true;\n this.minValidateFn = noop;\n this.maxValidateFn = noop;\n this._value = null;\n this._active = false;\n this.kendoDate = null;\n this.paste = false;\n this.domEvents = [];\n this.onControlChange = noop;\n this.onControlTouched = noop;\n this.onValidatorChange = noop;\n this.symbolsMap = this.dateSymbolMap();\n this.updateFormatSections();\n if (this.pickerService) {\n this.pickerService.input = this;\n }\n }\n Object.defineProperty(DateInputComponent.prototype, \"tabIndex\", {\n get: function () {\n return this.tabindex;\n },\n /**\n * @hidden\n */\n set: function (tabIndex) {\n this.tabindex = tabIndex;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateInputComponent.prototype, \"max\", {\n get: function () {\n return this._max;\n },\n /**\n * Specifies the biggest date that is valid\n * ([see example]({% slug dateranges_dateinput %})).\n */\n set: function (max) {\n this._max = max;\n this.ariaValueMax = getTime(max);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateInputComponent.prototype, \"min\", {\n get: function () {\n return this._min;\n },\n /**\n * Specifies the smallest date that is valid\n * ([see example]({% slug dateranges_dateinput %})).\n */\n set: function (min) {\n this._min = min;\n this.ariaValueMin = getTime(min);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateInputComponent.prototype, \"value\", {\n get: function () {\n return this._value;\n },\n /**\n * Specifies the value of the DateInput component.\n *\n * > The `value` has to be a valid [JavaScript `Date`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date) instance.\n */\n set: function (value) {\n this.verifyValue(value);\n if (this.autoCorrect && !isInRange(value, this.min, this.max)) {\n return;\n }\n this._value = cloneDate(value);\n this.valueUpdate.emit(cloneDate(value));\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateInputComponent.prototype, \"wrapperClass\", {\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateInputComponent.prototype, \"disabledClass\", {\n get: function () {\n return this.disabled;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateInputComponent.prototype, \"inputElement\", {\n get: function () {\n return this.dateInput ? this.dateInput.nativeElement : null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateInputComponent.prototype, \"inputValue\", {\n get: function () {\n return (this.inputElement || {}).value || '';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateInputComponent.prototype, \"isActive\", {\n get: function () {\n return this._active;\n },\n set: function (value) {\n this._active = value;\n if (!this.wrap) {\n return;\n }\n var element = this.wrap.nativeElement;\n if (value) {\n this.renderer.addClass(element, 'k-state-focused');\n }\n else {\n this.renderer.removeClass(element, 'k-state-focused');\n }\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n * Used by the TextBoxContainer to determine if the component is empty\n */\n DateInputComponent.prototype.isEmpty = function () {\n return !this.currentValue || !String(this.currentValue).trim();\n };\n /**\n * @hidden\n */\n DateInputComponent.prototype.containsElement = function (element) {\n var _this = this;\n return Boolean(closest(element, function (node) { return node === _this.element.nativeElement; }));\n };\n /**\n * @hidden\n */\n DateInputComponent.prototype.ngOnChanges = function (changes) {\n this.verifyRange();\n if (changes.min || changes.max || changes.rangeValidation) {\n this.minValidateFn = this.rangeValidation ? minValidator(this.min) : noop;\n this.maxValidateFn = this.rangeValidation ? maxValidator(this.max) : noop;\n this.onValidatorChange();\n }\n if (changes.format) {\n this.symbolsMap = this.dateSymbolMap();\n this.updateFormatSections();\n }\n var isEqualToKendoDate = this.kendoDate && isEqual(this.value, this.kendoDate.getDateObject());\n if (changes.format || !isEqualToKendoDate || changes.placeholder) {\n this.kendoDate = this.getKendoDate(this.value);\n this.updateElementValue(this.isActive);\n }\n };\n DateInputComponent.prototype.ngOnDestroy = function () {\n if (this.intlSubscription) {\n this.intlSubscription.unsubscribe();\n }\n if (this.pickerService) {\n this.pickerService.input = null;\n }\n this.domEvents.forEach(function (unbindCallback) { return unbindCallback(); });\n };\n /**\n * @hidden\n */\n DateInputComponent.prototype.validate = function (control) {\n return this.minValidateFn(control) || this.maxValidateFn(control);\n };\n /**\n * @hidden\n */\n DateInputComponent.prototype.registerOnValidatorChange = function (fn) {\n this.onValidatorChange = fn;\n };\n /**\n * @hidden\n */\n DateInputComponent.prototype.ngOnInit = function () {\n var _this = this;\n this.kendoDate = this.getKendoDate(this.value);\n this.updateElementValue();\n this.intlSubscription = this.intl.changes.subscribe(this.intlChange.bind(this));\n this.control = this.injector.get(NgControl, null);\n if (this.element) {\n this.renderer.removeAttribute(this.element.nativeElement, 'tabindex');\n this.ngZone.runOutsideAngular(function () {\n _this.bindEvents();\n });\n }\n };\n /**\n * @hidden\n */\n DateInputComponent.prototype.setDisabledState = function (isDisabled) {\n this.disabled = isDisabled;\n this.cdr.markForCheck();\n };\n //ngModel binding\n /**\n * @hidden\n */\n DateInputComponent.prototype.writeValue = function (value) {\n this.verifyValue(value);\n this.kendoDate = this.getKendoDate(value);\n this.value = cloneDate(value);\n this.updateElementValue(this.isActive);\n };\n /**\n * @hidden\n */\n DateInputComponent.prototype.triggerChange = function () {\n var value = this.kendoDate.getDateObject();\n if (+value !== +this.value) {\n this.value = cloneDate(value);\n this.notify();\n }\n };\n /**\n * @hidden\n */\n DateInputComponent.prototype.notify = function () {\n var _this = this;\n this.ngZone.run(function () {\n _this.onControlChange(cloneDate(_this.value));\n _this.valueChange.emit(cloneDate(_this.value));\n });\n };\n /**\n * @hidden\n */\n DateInputComponent.prototype.registerOnChange = function (fn) {\n this.onControlChange = fn;\n };\n /**\n * @hidden\n */\n DateInputComponent.prototype.registerOnTouched = function (fn) {\n this.onControlTouched = fn;\n };\n /**\n * Focuses the DateInput component.\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * `\n * })\n * class AppComponent { }\n * ```\n */\n DateInputComponent.prototype.focus = function () {\n var input = this.inputElement;\n if (input) {\n input.focus();\n this.selectDateSegment(this.currentFormat[0]);\n }\n };\n /**\n * Blurs the DateInput component.\n */\n DateInputComponent.prototype.blur = function () {\n var input = this.inputElement;\n if (input) {\n input.blur();\n }\n };\n /**\n * @hidden\n */\n DateInputComponent.prototype.handleButtonClick = function (offset) {\n this.arrowDirection = Arrow.None;\n this.modifyDateSegmentValue(offset);\n };\n /**\n * @hidden\n */\n DateInputComponent.prototype.modifyDateSegmentValue = function (offset) {\n var caret = this.caret();\n var symbol = this.currentFormat[caret[0]];\n var step = (this.steps || {})[this.symbolsMap[symbol]] || 1;\n this.kendoDate.modifyPart(symbol, offset * step);\n this.putDateInRange();\n this.updateElementValue(this.isActive);\n this.triggerChange();\n this.selectDateSegment(symbol);\n };\n /**\n * @hidden\n */\n DateInputComponent.prototype.switchDateSegment = function (offset) {\n var caret = this.caret();\n if (this.kendoDate.resetLeadingZero()) {\n this.updateElementValue(this.isActive);\n }\n if (caret[0] < caret[1] && this.currentFormat[caret[0]] !== this.currentFormat[caret[1] - 1]) {\n this.selectNearestSegment(offset > 0 ? caret[0] : caret[1] - 1);\n this.resetSegmentValue = true;\n return true;\n }\n var previousFormatSymbol = this.currentFormat[caret[0]];\n var a = caret[0] + offset;\n while (a > 0 && a < this.currentFormat.length) {\n if (this.currentFormat[a] !== previousFormatSymbol &&\n this.currentFormat[a] !== \"_\") {\n break;\n }\n a += offset;\n }\n if (this.currentFormat[a] === \"_\") {\n //there is not known symbol found\n return false;\n }\n var b = a;\n while (b >= 0 && b < this.currentFormat.length) {\n if (this.currentFormat[b] !== this.currentFormat[a]) {\n break;\n }\n b += offset;\n }\n if (a > b && (b + 1 !== caret[0] || a + 1 !== caret[1])) {\n this.caret(b + 1, a + 1);\n this.resetSegmentValue = true;\n return true;\n }\n else if (a < b && (a !== caret[0] || b !== caret[1])) {\n this.caret(a, b);\n this.resetSegmentValue = true;\n return true;\n }\n return false;\n };\n /**\n * @hidden\n */\n DateInputComponent.prototype.selectDateSegment = function (symbol) {\n var begin = -1;\n var end = 0;\n for (var i = 0; i < this.currentFormat.length; i++) {\n if (this.currentFormat[i] === symbol) {\n end = i + 1;\n if (begin === -1) {\n begin = i;\n }\n }\n }\n if (begin < 0) {\n begin = 0;\n }\n this.caret(0, 0);\n this.caret(begin, end);\n };\n /**\n * @hidden\n */\n DateInputComponent.prototype.handleClick = function () {\n this.hasMousedown = false;\n if (this.isActive) {\n this.selectNearestSegment(this.caret()[0]);\n }\n };\n /**\n * @hidden\n */\n DateInputComponent.prototype.handleDragAndDrop = function (args) {\n args.preventDefault();\n };\n /**\n * @hidden\n */\n DateInputComponent.prototype.handleMousedown = function () {\n this.hasMousedown = true;\n };\n /**\n * @hidden\n */\n DateInputComponent.prototype.handleFocus = function (args) {\n var _this = this;\n this.isActive = true;\n this.updateElementValue();\n if (!this.hasMousedown) {\n this.caret(0, this.inputValue.length);\n }\n this.hasMousedown = false;\n if (hasObservers(this.onFocus)) {\n this.ngZone.run(function () {\n _this.emitFocus(args);\n });\n }\n else {\n this.emitFocus(args);\n }\n };\n /**\n * @hidden\n */\n DateInputComponent.prototype.handleBlur = function (args) {\n var _this = this;\n this.isActive = false;\n this.resetSegmentValue = true;\n this.kendoDate.resetLeadingZero();\n this.updateElementValue();\n if (hasObservers(this.onBlur) || requiresZoneOnBlur(this.control)) {\n this.ngZone.run(function () {\n _this.onControlTouched();\n _this.emitBlur(args);\n });\n }\n else {\n this.emitBlur(args);\n }\n };\n DateInputComponent.prototype.getKendoDate = function (value) {\n var leadingZero = ((this.kendoDate || {}) || null).leadingZero;\n var kendoDate = new KendoDate(this.intl, this.formatPlaceholder, this.format, value);\n kendoDate.setLeadingZero(this.isActive ? leadingZero : null);\n return kendoDate;\n };\n DateInputComponent.prototype.dateSymbolMap = function () {\n var reducer = function (map$$1, part) {\n map$$1[part.pattern[0]] = part.type;\n return map$$1;\n };\n return this.intl.splitDateFormat(this.format).reduce(reducer, {});\n };\n DateInputComponent.prototype.updateElementValue = function (isActive) {\n var start = this.caret()[0]; //XXX: get caret position before input is updated\n var texts = this.kendoDate.getTextAndFormat();\n var showPlaceholder = !this.isActive && this.placeholder !== null && this.placeholder !== undefined && !this.kendoDate.hasValue();\n var input = this.inputElement;\n this.currentFormat = texts[1];\n this.currentValue = !showPlaceholder ? texts[0] : '';\n this.renderer.setProperty(input, \"value\", this.currentValue);\n if (input.placeholder !== this.placeholder) {\n this.renderer.setProperty(input, \"placeholder\", this.placeholder);\n }\n var currentDate = this.kendoDate.getDateObject();\n this.ariaValueNow = getTime(currentDate);\n this.ariaValueText = this.intl.formatDate(currentDate, this.format);\n if (isActive) {\n this.selectNearestSegment(start);\n }\n };\n DateInputComponent.prototype.caret = function (start, end) {\n if (end === void 0) { end = start; }\n var isPosition = start !== undefined;\n var returnValue = [start, start];\n var element = this.inputElement;\n if (isPosition && (this.disabled || this.readonly)) {\n return undefined;\n }\n try {\n if (element.selectionStart !== undefined) {\n if (isPosition) {\n if (isDocumentAvailable() && document.activeElement !== element) {\n element.focus();\n }\n element.setSelectionRange(start, end);\n }\n returnValue = [element.selectionStart, element.selectionEnd];\n }\n }\n catch (e) {\n returnValue = [];\n }\n return returnValue;\n };\n DateInputComponent.prototype.selectNearestSegment = function (index) {\n // Finds the nearest (in both directions) known part.\n for (var i = index, j = index - 1; i < this.currentFormat.length || j >= 0; i++, j--) {\n if (i < this.currentFormat.length && this.currentFormat[i] !== \"_\") {\n this.selectDateSegment(this.currentFormat[i]);\n return;\n }\n if (j >= 0 && this.currentFormat[j] !== \"_\") {\n this.selectDateSegment(this.currentFormat[j]);\n return;\n }\n }\n };\n DateInputComponent.prototype.verifyRange = function () {\n if (!isDevMode()) {\n return;\n }\n if (!isValidRange(this.min, this.max)) {\n throw new Error(\"The max value should be bigger than the min. See \" + MIN_DOC_LINK$1 + \" and \" + MAX_DOC_LINK$1 + \".\");\n }\n };\n DateInputComponent.prototype.verifyValue = function (value) {\n if (!isDevMode()) {\n return;\n }\n if (value && !(value instanceof Date)) {\n throw new Error(\"The 'value' should be a valid JavaScript Date instance. Check \" + VALUE_DOC_LINK$1 + \" for possible resolution.\");\n }\n };\n DateInputComponent.prototype.putDateInRange = function () {\n var currentDate = this.kendoDate.getDateObject();\n var candidate = dateInRange(currentDate, this.min, this.max);\n if (this.autoCorrect && !isEqual(currentDate, candidate)) {\n this.kendoDate = this.getKendoDate(candidate);\n }\n };\n DateInputComponent.prototype.updateFormatSections = function () {\n this.formatSections = this.intl.splitDateFormat(this.format)\n .reduce(function (_a, p) {\n var date = _a.date, time = _a.time;\n return {\n date: date || DATE_PART_REGEXP.test(p.type),\n time: time || TIME_PART_REGEXP.test(p.type)\n };\n }, { date: false, time: false });\n };\n DateInputComponent.prototype.intlChange = function () {\n this.updateFormatSections();\n this.kendoDate = this.getKendoDate(this.value);\n this.updateElementValue(this.isActive);\n };\n DateInputComponent.prototype.updateOnPaste = function () {\n var value = this.intl.parseDate(this.inputValue, this.format) || this.value;\n var notify = +value !== +this.value;\n this.writeValue(value);\n if (notify) {\n this.notify();\n }\n };\n DateInputComponent.prototype.bindEvents = function () {\n var element = this.element.nativeElement;\n var mousewheelHandler = this.handleMouseWheel.bind(this);\n this.domEvents.push(this.renderer.listen(element, 'DOMMouseScroll', mousewheelHandler), this.renderer.listen(element, 'mousewheel', mousewheelHandler), this.renderer.listen(element, 'keydown', this.handleKeydown.bind(this)), this.renderer.listen(element, 'paste', this.handlePaste.bind(this)), this.renderer.listen(element, 'input', this.handleInput.bind(this)));\n };\n DateInputComponent.prototype.handleMouseWheel = function (event) {\n if (this.disabled || this.readonly || !this.isActive) {\n return;\n }\n event = window.event || event;\n if (event.shiftKey) {\n this.switchDateSegment((event.wheelDelta || -event.detail) > 0 ? -1 : 1);\n }\n else {\n this.modifyDateSegmentValue((event.wheelDelta || -event.detail) > 0 ? 1 : -1);\n }\n event.returnValue = false;\n if (event.preventDefault) {\n event.preventDefault();\n }\n if (event.stopPropagation) {\n event.stopPropagation();\n }\n };\n DateInputComponent.prototype.handlePaste = function () {\n this.paste = true;\n };\n DateInputComponent.prototype.handleKeydown = function (event) {\n if (this.disabled || this.readonly || event.altKey || event.ctrlKey || event.metaKey) {\n return;\n }\n if (event.keyCode === Keys.Tab) {\n var moved = this.switchDateSegment(event.shiftKey ? -1 : 1);\n if (moved) {\n event.preventDefault();\n }\n return;\n }\n if (event.keyCode === Keys.Backspace) {\n this.backspace = true;\n return;\n }\n switch (event.keyCode) {\n case Keys.ArrowDown:\n this.modifyDateSegmentValue(-1);\n break;\n case Keys.ArrowUp:\n this.modifyDateSegmentValue(1);\n break;\n case Keys.ArrowRight:\n this.switchDateSegment(1);\n break;\n case Keys.ArrowLeft:\n this.switchDateSegment(-1);\n break;\n case Keys.Home:\n this.selectNearestSegment(0);\n break;\n case Keys.End:\n this.selectNearestSegment(this.inputValue.length);\n break;\n default:\n return; //skip the preventDefault if we didn't handled the keyCode\n }\n event.preventDefault();\n };\n DateInputComponent.prototype.handleInput = function () {\n if (this.disabled || this.readonly) {\n return;\n }\n if (this.paste) {\n this.updateOnPaste();\n this.paste = false;\n return;\n }\n var diff = approximateStringMatching(this.currentValue, this.currentFormat, this.inputValue, this.caret()[0]);\n var navigationOnly = (diff.length === 1 && diff[0][1] === \"_\");\n var switchPart = false;\n if (!navigationOnly) {\n var parsedPart = void 0;\n for (var i = 0; i < diff.length; i++) {\n parsedPart = this.kendoDate.parsePart(diff[i][0], diff[i][1], this.resetSegmentValue);\n switchPart = parsedPart.switchToNext;\n }\n var candidate = this.kendoDate.getDateObject();\n if (this.value && candidate && !this.formatSections.date) {\n this.kendoDate = this.getKendoDate(setTime(this.value, candidate));\n }\n }\n this.resetSegmentValue = false;\n this.putDateInRange();\n this.updateElementValue(this.isActive);\n this.triggerChange();\n if (diff.length && diff[0][0] !== \"_\") {\n this.selectDateSegment(diff[0][0]);\n }\n if (switchPart || navigationOnly) {\n this.switchDateSegment(1);\n }\n if (this.backspace) {\n this.switchDateSegment(-1);\n }\n this.backspace = false;\n };\n DateInputComponent.prototype.emitFocus = function (args) {\n this.onFocus.emit();\n if (this.pickerService) {\n this.pickerService.onFocus.emit(args);\n }\n };\n DateInputComponent.prototype.emitBlur = function (args) {\n this.onBlur.emit();\n if (this.pickerService) {\n this.pickerService.onBlur.emit(args);\n }\n };\n DateInputComponent.decorators = [\n { type: Component, args: [{\n changeDetection: ChangeDetectionStrategy.OnPush,\n exportAs: 'kendo-dateinput',\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(function () { return DateInputComponent; }), multi: true },\n { provide: NG_VALIDATORS, useExisting: forwardRef(function () { return DateInputComponent; }), multi: true },\n { provide: L10N_PREFIX, useValue: 'kendo.dateinput' },\n { provide: KendoInput, useExisting: forwardRef(function () { return DateInputComponent; }) },\n LocalizationService\n ],\n selector: 'kendo-dateinput',\n template: \"\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n DateInputComponent.ctorParameters = function () { return [\n { type: ChangeDetectorRef },\n { type: IntlService },\n { type: Renderer2 },\n { type: ElementRef },\n { type: NgZone },\n { type: Injector },\n { type: LocalizationService },\n { type: PickerService, decorators: [{ type: Optional }] }\n ]; };\n DateInputComponent.propDecorators = {\n focusableId: [{ type: Input }],\n disabled: [{ type: Input }],\n readonly: [{ type: Input }],\n title: [{ type: Input }],\n tabindex: [{ type: Input }],\n tabIndex: [{ type: Input }],\n format: [{ type: Input }],\n formatPlaceholder: [{ type: Input }],\n placeholder: [{ type: Input }],\n steps: [{ type: Input }],\n max: [{ type: Input }],\n min: [{ type: Input }],\n rangeValidation: [{ type: Input }],\n autoCorrect: [{ type: Input }],\n value: [{ type: Input }],\n spinners: [{ type: Input }],\n isPopupOpen: [{ type: Input }],\n hasPopup: [{ type: Input }],\n valueChange: [{ type: Output }],\n valueUpdate: [{ type: Output }],\n onFocus: [{ type: Output, args: ['focus',] }],\n onBlur: [{ type: Output, args: ['blur',] }],\n dateInput: [{ type: ViewChild, args: ['dateInput', { static: true },] }],\n wrap: [{ type: ViewChild, args: ['wrap',] }],\n wrapperClass: [{ type: HostBinding, args: ['class.k-widget',] }, { type: HostBinding, args: ['class.k-dateinput',] }],\n disabledClass: [{ type: HostBinding, args: ['class.k-state-disabled',] }]\n };\n return DateInputComponent;\n}());\n\n/**\n * A preventable event instance which is triggered by the `open` and `close` events.\n */\nvar PreventableEvent = /** @class */ (function () {\n function PreventableEvent() {\n this.prevented = false;\n }\n /**\n * Prevents the default action for a specified event.\n * In this way, the source component suppresses the built-in behavior that follows the event.\n */\n PreventableEvent.prototype.preventDefault = function () {\n this.prevented = true;\n };\n /**\n * If the event is prevented by any of its subscribers, returns `true`.\n *\n * @returns `true` if the default action was prevented. Otherwise, returns `false`.\n */\n PreventableEvent.prototype.isDefaultPrevented = function () {\n return this.prevented;\n };\n return PreventableEvent;\n}());\n\n/**\n * @hidden\n */\nvar TOUCH_ENABLED = new InjectionToken('dateinputs-touch-enabled');\n\n/**\n * @hidden\n */\nvar disabledDatesValidator = function (isDateDisabled) {\n return function (control) {\n if (!isDateDisabled || !control.value) {\n return null;\n }\n var error = {\n disabledDate: true\n };\n return isDateDisabled(control.value) ? error : null;\n };\n};\n\n/* tslint:disable:max-line-length */\nvar MIN_DOC_LINK$2 = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/DatePickerComponent/#toc-min';\nvar MAX_DOC_LINK$2 = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/DatePickerComponent/#toc-max';\nvar VALUE_DOC_LINK$2 = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/datepicker/#toc-using-with-json';\n/**\n * Represents the [Kendo UI DatePicker component for Angular]({% slug overview_datepicker %}#toc-basic-usage).\n */\nvar DatePickerComponent = /** @class */ (function () {\n function DatePickerComponent(zone, localization, cdr, popupService, element, renderer, injector, pickerService, disabledDatesService, touchEnabled$$1) {\n this.zone = zone;\n this.localization = localization;\n this.cdr = cdr;\n this.popupService = popupService;\n this.element = element;\n this.renderer = renderer;\n this.injector = injector;\n this.pickerService = pickerService;\n this.disabledDatesService = disabledDatesService;\n this.touchEnabled = touchEnabled$$1;\n /**\n * @hidden\n */\n this.focusableId = \"k-\" + guid();\n /**\n * Defines the active view that the Calendar initially renders\n * ([see example]({% slug activeview_datepicker %})).\n * By default, the active view is `month`.\n *\n * > You have to set `activeView` within the `topView`-`bottomView` range.\n */\n this.activeView = CalendarViewEnum[CalendarViewEnum.month];\n /**\n * Defines the bottommost Calendar view to which the user can navigate\n * ([see example]({% slug dates_datepicker %}#toc-partial-dates)).\n */\n this.bottomView = CalendarViewEnum[CalendarViewEnum.month];\n /**\n * Defines the topmost Calendar view to which the user can navigate\n * ([see example]({% slug dates_datepicker %}#toc-partial-dates)).\n */\n this.topView = CalendarViewEnum[CalendarViewEnum.century];\n /**\n * Sets or gets the `disabled` property of the DatePicker and determines whether the component is active\n * ([see example]({% slug disabled_datepicker %})).\n */\n this.disabled = false;\n /**\n * Sets the read-only state of the DatePicker\n * ([see example]({% slug readonly_datepicker %})).\n */\n this.readonly = false;\n /**\n * Sets or gets the `navigation` property of the Calendar\n * and determines whether the navigation side-bar is displayed.\n * ([see example]({% slug sidebar_datepicker %})).\n */\n this.navigation = true;\n /**\n * Specifies the smallest valid date\n * ([see example]({% slug dateranges_datepicker %})).\n */\n this.min = cloneDate(MIN_DATE);\n /**\n * Specifies the biggest valid date\n * ([see example]({% slug dateranges_datepicker %})).\n */\n this.max = cloneDate(MAX_DATE);\n /**\n * Specifies the focused date of the Calendar component\n * ([see example]({% slug dates_datepicker %})).\n */\n this.focusedDate = null;\n /**\n * Specifies the date format that is used to display the input value\n * ([see example]({% slug formats_datepicker %})).\n */\n this.format = \"d\";\n /**\n * Specifies the hint the DatePicker displays when its value is `null`.\n * ([more information and exaples]({% slug placeholders_datepicker %})).\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * `\n * })\n * class AppComponent { }\n * ```\n */\n this.placeholder = null;\n /**\n * Sets or gets the `tabindex` property of the DatePicker.\n */\n this.tabindex = 0;\n /**\n * Sets the title of the input element of the DatePicker.\n */\n this.title = \"\";\n /**\n * Determines whether the built-in min or max validators are enforced when validating a form.\n */\n this.rangeValidation = true;\n /**\n * Determines whether the built-in validator for disabled\n * date ranges is enforced when validating a form\n * ([see example]({% slug disabled_dates_datepicker %}#toc-validation)).\n */\n this.disabledDatesValidation = true;\n /**\n * Determines whether to display a week number column in the `month` view of the Calendar\n * ([see example]({% slug weeknumcolumn_datepicker %})).\n */\n this.weekNumber = false;\n /**\n * Fires each time the user selects a new value\n * ([more information and example]({% slug overview_datepicker %}#toc-events)).\n */\n this.valueChange = new EventEmitter();\n /**\n * Fires each time the user focuses the input element\n * ([more information and example]({% slug overview_datepicker %}#toc-events)).\n *\n * > To wire the event programmatically, use the `onFocus` property.\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * `\n * })\n * class AppComponent {\n * public handleFocus(): void {\n * console.log(\"Component is focused\");\n * }\n * }\n * ```\n */\n this.onFocus = new EventEmitter(); //tslint:disable-line:no-output-rename\n /**\n * Fires each time the input element gets blurred\n * ([more information and example]({% slug overview_datepicker %}#toc-events)).\n *\n * > To wire the event programmatically, use the `onBlur` property.\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * `\n * })\n * class AppComponent {\n * public handleBlur(): void {\n * console.log(\"Component is blurred\");\n * }\n * }\n * ```\n */\n this.onBlur = new EventEmitter(); //tslint:disable-line:no-output-rename\n /**\n * Fires each time the popup is about to open.\n * This event is preventable. If you cancel the event, the popup will remain closed\n * ([more information and example]({% slug overview_datepicker %}#toc-events)).\n */\n this.open = new EventEmitter();\n /**\n * Fires each time the popup is about to close.\n * This event is preventable. If you cancel the event, the popup will remain open\n * ([more information and example]({% slug overview_datepicker %}#toc-events)).\n */\n this.close = new EventEmitter();\n this.popupUID = guid();\n this._popupSettings = { animate: true };\n this._show = false;\n this._value = null;\n this._active = false;\n this.onControlChange = noop;\n this.onControlTouched = noop;\n this.onValidatorChange = noop;\n this.minValidateFn = noop;\n this.maxValidateFn = noop;\n this.disabledDatesValidateFn = noop;\n this.resolvedPromise = Promise.resolve(null);\n this.domEvents = [];\n this.pickerSubscriptions = this.pickerService.onFocus.subscribe(this.handleFocus.bind(this));\n this.pickerSubscriptions.add(this.pickerService.onBlur.subscribe(this.handleBlur.bind(this)));\n this.pickerSubscriptions.add(this.pickerService.sameDateSelected.subscribe(this.handleSameSelection.bind(this)));\n }\n Object.defineProperty(DatePickerComponent.prototype, \"cellTemplateRef\", {\n /**\n * @hidden\n */\n set: function (template) {\n this.cellTemplate = template;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DatePickerComponent.prototype, \"monthCellTemplateRef\", {\n /**\n * @hidden\n */\n set: function (template) {\n this.monthCellTemplate = template;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DatePickerComponent.prototype, \"yearCellTemplateRef\", {\n /**\n * @hidden\n */\n set: function (template) {\n this.yearCellTemplate = template;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DatePickerComponent.prototype, \"decadeCellTemplateRef\", {\n /**\n * @hidden\n */\n set: function (template) {\n this.decadeCellTemplate = template;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DatePickerComponent.prototype, \"centuryCellTemplateRef\", {\n /**\n * @hidden\n */\n set: function (template) {\n this.centuryCellTemplate = template;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DatePickerComponent.prototype, \"weekNumberTemplateRef\", {\n /**\n * @hidden\n */\n set: function (template) {\n this.weekNumberTemplate = template;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DatePickerComponent.prototype, \"headerTitleTemplateRef\", {\n /**\n * @hidden\n */\n set: function (template) {\n this.headerTitleTemplate = template;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DatePickerComponent.prototype, \"navigationItemTemplateRef\", {\n /**\n * @hidden\n */\n set: function (template) {\n this.navigationItemTemplate = template;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DatePickerComponent.prototype, \"popupSettings\", {\n get: function () {\n return this._popupSettings;\n },\n /**\n * Configures the popup options of the DatePicker.\n *\n * The available options are:\n * - `animate: Boolean`—Controls the popup animation. By default, the open and close animations are enabled.\n * - `popupClass: String`—Specifies a list of CSS classes that are used to style the popup.\n */\n set: function (settings) {\n this._popupSettings = Object.assign({}, { animate: true }, settings);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DatePickerComponent.prototype, \"value\", {\n get: function () {\n return this._value;\n },\n /**\n * Specifies the value of the DatePicker component.\n *\n * > The `value` has to be a valid\n * [JavaScript `Date`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date) instance.\n */\n set: function (value) {\n this.verifyValue(value);\n this._value = cloneDate(value);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DatePickerComponent.prototype, \"tabIndex\", {\n get: function () {\n return this.tabindex;\n },\n /**\n * @hidden\n */\n set: function (tabIndex) {\n this.tabindex = tabIndex;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DatePickerComponent.prototype, \"disabledDates\", {\n get: function () {\n return this._disabledDates;\n },\n /**\n * Sets the dates of the DatePicker that will be disabled\n * ([see example]({% slug disabled_dates_datepicker %})).\n */\n set: function (value) {\n this._disabledDates = value;\n this.disabledDatesService.initialize(value);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DatePickerComponent.prototype, \"wrapperClasses\", {\n /**\n * @hidden\n */\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DatePickerComponent.prototype, \"disabledClass\", {\n /**\n * @hidden\n */\n get: function () {\n return this.disabled;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DatePickerComponent.prototype, \"isActive\", {\n get: function () {\n return this._active;\n },\n set: function (value) {\n this._active = value;\n if (!this.wrapper) {\n return;\n }\n var element = this.wrapper.nativeElement;\n if (value) {\n this.renderer.addClass(element, 'k-state-focused');\n }\n else {\n this.renderer.removeClass(element, 'k-state-focused');\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DatePickerComponent.prototype, \"show\", {\n get: function () {\n return this._show;\n },\n set: function (show) {\n var _this = this;\n if (show && (this.disabled || this.readonly)) {\n return;\n }\n var skipZone = !show && (!this._show || !hasObservers(this.close));\n if (!skipZone) {\n this.zone.run(function () {\n _this.togglePopup(show);\n });\n }\n else {\n this.togglePopup(show);\n }\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n * Used by the TextBoxContainer to determine if the component is empty.\n */\n DatePickerComponent.prototype.isEmpty = function () {\n return !this.value && this.input.isEmpty();\n };\n /**\n * @hidden\n */\n DatePickerComponent.prototype.ngOnInit = function () {\n var _this = this;\n this.localizationChangeSubscription = this.localization\n .changes\n .subscribe(function () { return _this.cdr.markForCheck(); });\n this.control = this.injector.get(NgControl, null);\n if (this.element) {\n this.renderer.removeAttribute(this.element.nativeElement, 'tabindex');\n this.zone.runOutsideAngular(function () {\n _this.bindEvents();\n });\n }\n };\n /**\n * @hidden\n */\n DatePickerComponent.prototype.ngOnChanges = function (changes) {\n this.verifySettings();\n if (changes.min || changes.max || changes.rangeValidation || changes.disabledDatesValidation || changes.disabledDates) {\n this.minValidateFn = this.rangeValidation ? minValidator(this.min) : noop;\n this.maxValidateFn = this.rangeValidation ? maxValidator(this.max) : noop;\n this.disabledDatesValidateFn = this.disabledDatesValidation ? disabledDatesValidator(this.disabledDatesService.isDateDisabled) : noop;\n this.onValidatorChange();\n }\n };\n /**\n * @hidden\n */\n DatePickerComponent.prototype.ngOnDestroy = function () {\n this.isActive = false;\n this.show = false;\n if (this.localizationChangeSubscription) {\n this.localizationChangeSubscription.unsubscribe();\n }\n if (this.windowBlurSubscription) {\n this.windowBlurSubscription.unsubscribe();\n }\n this.domEvents.forEach(function (unbindCallback) { return unbindCallback(); });\n this.pickerSubscriptions.unsubscribe();\n };\n Object.defineProperty(DatePickerComponent.prototype, \"isOpen\", {\n /**\n * Returns the current open state of the popup.\n */\n get: function () {\n return this.show;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n */\n DatePickerComponent.prototype.writeValue = function (value) {\n this.verifyValue(value);\n this.value = cloneDate(value);\n this.cdr.markForCheck();\n if (!value && this.input) {\n this.input.placeholder = this.placeholder;\n this.input.writeValue(value);\n }\n };\n /**\n * @hidden\n */\n DatePickerComponent.prototype.registerOnChange = function (fn) {\n this.onControlChange = fn;\n };\n /**\n * @hidden\n */\n DatePickerComponent.prototype.registerOnTouched = function (fn) {\n this.onControlTouched = fn;\n };\n /**\n * @hidden\n */\n DatePickerComponent.prototype.setDisabledState = function (isDisabled) {\n this.disabled = isDisabled;\n this.cdr.markForCheck();\n };\n /**\n * @hidden\n */\n DatePickerComponent.prototype.validate = function (control) {\n return this.minValidateFn(control) || this.maxValidateFn(control) || this.disabledDatesValidateFn(control);\n };\n /**\n * @hidden\n */\n DatePickerComponent.prototype.registerOnValidatorChange = function (fn) {\n this.onValidatorChange = fn;\n };\n /**\n * Focuses the DatePicker component.\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * `\n * })\n * class AppComponent { }\n * ```\n */\n DatePickerComponent.prototype.focus = function () {\n this.input.focus();\n };\n /**\n * Blurs the DatePicker component.\n */\n DatePickerComponent.prototype.blur = function () {\n (this.calendar || this.input)['blur'](); //tslint:disable-line:no-string-literal\n };\n /**\n * Toggles the visibility of the popup. If you use the `toggle` method to show or hide the popup,\n * the `open` and `close` events do not fire.\n *\n * @param show - The state of the popup.\n */\n DatePickerComponent.prototype.toggle = function (show) {\n var _this = this;\n if (this.disabled || this.readonly) {\n return;\n }\n this.resolvedPromise.then(function () {\n _this._toggle((show === undefined) ? !_this.show : show);\n });\n };\n /**\n * @hidden\n */\n DatePickerComponent.prototype.handleIconClick = function (event) {\n if (this.disabled || this.readonly) {\n return;\n }\n event.preventDefault();\n this.focusInput();\n //XXX: explicitly call the handleFocus handler here\n //due to async IE focus event\n this.handleFocus();\n this.show = !this.show;\n this.cdr.markForCheck();\n };\n /**\n * @hidden\n */\n DatePickerComponent.prototype.handleMousedown = function (args) {\n args.preventDefault();\n };\n /**\n * @hidden\n */\n DatePickerComponent.prototype.handleChange = function (value) {\n this.cdr.markForCheck();\n this.focusInput();\n this.value = value;\n this.show = false;\n this.onControlChange(cloneDate(value));\n this.valueChange.emit(cloneDate(value));\n };\n /**\n * @hidden\n */\n DatePickerComponent.prototype.handleInputChange = function (value) {\n this.handleChange(this.input.formatSections.time ? value : this.mergeTime(value));\n };\n Object.defineProperty(DatePickerComponent.prototype, \"popupClasses\", {\n /**\n * @hidden\n */\n get: function () {\n return [\n 'k-calendar-container',\n 'k-group',\n 'k-reset'\n ].concat(this.popupSettings.popupClass || []);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DatePickerComponent.prototype, \"appendTo\", {\n /**\n * @hidden\n */\n get: function () {\n var appendTo = this.popupSettings.appendTo;\n if (!appendTo || appendTo === 'root') {\n return undefined;\n }\n return appendTo === 'component' ? this.container : appendTo;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DatePickerComponent.prototype, \"input\", {\n get: function () {\n return this.pickerService.input;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DatePickerComponent.prototype, \"calendar\", {\n get: function () {\n return this.pickerService.calendar;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n */\n DatePickerComponent.prototype.mergeTime = function (value) {\n return this.value && value ? setTime(value, this.value) : value;\n };\n /**\n * @hidden\n */\n DatePickerComponent.prototype.handleKeydown = function (e) {\n var altKey = e.altKey, keyCode = e.keyCode;\n if (keyCode === Keys.Escape) {\n this.show = false;\n }\n if (altKey) {\n if (keyCode === Keys.ArrowDown && !this.show) {\n this.show = true;\n }\n if (keyCode === Keys.ArrowUp) {\n this.show = false;\n }\n }\n if (keyCode === Keys.Tab && this.show && this.calendar.isActive) {\n this.input.focus();\n this.show = false;\n }\n };\n DatePickerComponent.prototype.togglePopup = function (show) {\n var event = new PreventableEvent();\n if (!this._show && show) {\n this.open.emit(event);\n }\n else if (this._show && !show) {\n this.close.emit(event);\n }\n if (event.isDefaultPrevented()) {\n return;\n }\n this._toggle(show);\n this.toggleFocus();\n };\n DatePickerComponent.prototype._toggle = function (show) {\n var _this = this;\n this._show = show;\n if (this.popupRef) {\n this.popupRef.close();\n this.popupRef = null;\n this.subscription.unsubscribe();\n }\n if (this._show) {\n var direction = this.localization.rtl ? 'right' : 'left';\n this.popupRef = this.popupService.open({\n anchor: this.wrapper,\n anchorAlign: { vertical: 'bottom', horizontal: direction },\n animate: this.popupSettings.animate,\n appendTo: this.appendTo,\n content: this.popupTemplate,\n popupAlign: { vertical: 'top', horizontal: direction },\n popupClass: this.popupClasses,\n positionMode: 'absolute'\n });\n this.popupRef.popupElement.setAttribute('id', this.popupUID);\n this.subscription = this.popupRef.popupAnchorViewportLeave.subscribe(function () { return _this.show = false; });\n }\n };\n DatePickerComponent.prototype.focusInput = function () {\n if (this.touchEnabled) {\n return;\n }\n this.input.focus();\n };\n DatePickerComponent.prototype.toggleFocus = function () {\n if (!this.isActive) {\n return;\n }\n if (this.show) {\n if (!this.calendar) {\n this.cdr.detectChanges();\n }\n if (this.calendar) {\n this.calendar.focus();\n }\n }\n else if (!this.touchEnabled) {\n this.input.focus();\n }\n else if (!this.input.isActive) {\n this.handleBlur();\n }\n };\n DatePickerComponent.prototype.verifySettings = function () {\n if (!isDevMode()) {\n return;\n }\n if (!isValidRange(this.min, this.max)) {\n throw new Error(\"The max value should be bigger than the min. See \" + MIN_DOC_LINK$2 + \" and \" + MAX_DOC_LINK$2 + \".\");\n }\n };\n DatePickerComponent.prototype.verifyValue = function (value) {\n if (!isDevMode()) {\n return;\n }\n if (value && !(value instanceof Date)) {\n throw new Error(\"The 'value' should be a valid JavaScript Date instance. Check \" + VALUE_DOC_LINK$2 + \" for possible resolution.\");\n }\n };\n DatePickerComponent.prototype.bindEvents = function () {\n var element = this.element.nativeElement;\n this.domEvents.push(this.renderer.listen(element, 'keydown', this.handleKeydown.bind(this)));\n if (isWindowAvailable()) {\n this.windowBlurSubscription = fromEvent(window, 'blur').subscribe(this.handleWindowBlur.bind(this));\n }\n };\n DatePickerComponent.prototype.handleFocus = function () {\n var _this = this;\n if (this.isActive) {\n return;\n }\n this.isActive = true;\n if (hasObservers(this.onFocus)) {\n this.zone.run(function () {\n _this.onFocus.emit();\n });\n }\n };\n DatePickerComponent.prototype.handleWindowBlur = function () {\n if (!this.isOpen) {\n return;\n }\n this.show = false;\n };\n DatePickerComponent.prototype.handleBlur = function (args) {\n var _this = this;\n var currentTarget = args && currentFocusTarget(args);\n if (currentTarget && (this.input.containsElement(currentTarget) ||\n (this.calendar && this.calendar.containsElement(currentTarget)))) {\n return;\n }\n if (hasObservers(this.onBlur) || (this.show && hasObservers(this.close)) || requiresZoneOnBlur(this.control)) {\n this.zone.run(function () {\n _this.blurComponent();\n });\n }\n else {\n this.blurComponent();\n }\n };\n DatePickerComponent.prototype.blurComponent = function () {\n this.isActive = false; // order is important ¯\\_(ツ)_/¯\n this.show = false;\n this.cdr.detectChanges();\n this.onControlTouched();\n this.onBlur.emit();\n };\n DatePickerComponent.prototype.handleSameSelection = function () {\n if (this.show) {\n this.focusInput();\n this.show = false;\n }\n };\n DatePickerComponent.decorators = [\n { type: Component, args: [{\n changeDetection: ChangeDetectionStrategy.OnPush,\n exportAs: 'kendo-datepicker',\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(function () { return DatePickerComponent; }), multi: true },\n { provide: NG_VALIDATORS, useExisting: forwardRef(function () { return DatePickerComponent; }), multi: true },\n { provide: KendoInput, useExisting: forwardRef(function () { return DatePickerComponent; }) },\n LocalizationService,\n PickerService,\n DisabledDatesService,\n {\n provide: L10N_PREFIX,\n useValue: 'kendo.datepicker'\n }\n ],\n selector: 'kendo-datepicker',\n template: \"\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n DatePickerComponent.ctorParameters = function () { return [\n { type: NgZone },\n { type: LocalizationService },\n { type: ChangeDetectorRef },\n { type: PopupService },\n { type: ElementRef },\n { type: Renderer2 },\n { type: Injector },\n { type: PickerService },\n { type: DisabledDatesService },\n { type: Boolean, decorators: [{ type: Optional }, { type: Inject, args: [TOUCH_ENABLED,] }] }\n ]; };\n DatePickerComponent.propDecorators = {\n container: [{ type: ViewChild, args: ['container', { read: ViewContainerRef },] }],\n popupTemplate: [{ type: ViewChild, args: ['popupTemplate',] }],\n wrapper: [{ type: ViewChild, args: ['wrapper',] }],\n cellTemplate: [{ type: ContentChild, args: [CellTemplateDirective,] }],\n cellTemplateRef: [{ type: Input, args: ['cellTemplate',] }],\n monthCellTemplate: [{ type: ContentChild, args: [MonthCellTemplateDirective,] }],\n monthCellTemplateRef: [{ type: Input, args: ['monthCellTemplate',] }],\n yearCellTemplate: [{ type: ContentChild, args: [YearCellTemplateDirective,] }],\n yearCellTemplateRef: [{ type: Input, args: ['yearCellTemplate',] }],\n decadeCellTemplate: [{ type: ContentChild, args: [DecadeCellTemplateDirective,] }],\n decadeCellTemplateRef: [{ type: Input, args: ['decadeCellTemplate',] }],\n centuryCellTemplate: [{ type: ContentChild, args: [CenturyCellTemplateDirective,] }],\n centuryCellTemplateRef: [{ type: Input, args: ['centuryCellTemplate',] }],\n weekNumberTemplate: [{ type: ContentChild, args: [WeekNumberCellTemplateDirective,] }],\n weekNumberTemplateRef: [{ type: Input, args: ['weekNumberTemplate',] }],\n headerTitleTemplate: [{ type: ContentChild, args: [HeaderTitleTemplateDirective,] }],\n headerTitleTemplateRef: [{ type: Input, args: ['headerTitleTemplate',] }],\n navigationItemTemplate: [{ type: ContentChild, args: [NavigationItemTemplateDirective,] }],\n navigationItemTemplateRef: [{ type: Input, args: ['navigationItemTemplate',] }],\n focusableId: [{ type: Input }],\n activeView: [{ type: Input }],\n bottomView: [{ type: Input }],\n topView: [{ type: Input }],\n disabled: [{ type: Input }],\n readonly: [{ type: Input }],\n popupSettings: [{ type: Input }],\n navigation: [{ type: Input }],\n min: [{ type: Input }],\n max: [{ type: Input }],\n focusedDate: [{ type: Input }],\n value: [{ type: Input }],\n format: [{ type: Input }],\n formatPlaceholder: [{ type: Input }],\n placeholder: [{ type: Input }],\n tabindex: [{ type: Input }],\n tabIndex: [{ type: Input }],\n disabledDates: [{ type: Input }],\n title: [{ type: Input }],\n rangeValidation: [{ type: Input }],\n disabledDatesValidation: [{ type: Input }],\n weekNumber: [{ type: Input }],\n valueChange: [{ type: Output }],\n onFocus: [{ type: Output, args: ['focus',] }],\n onBlur: [{ type: Output, args: ['blur',] }],\n open: [{ type: Output }],\n close: [{ type: Output }],\n wrapperClasses: [{ type: HostBinding, args: ['class.k-widget',] }, { type: HostBinding, args: ['class.k-datepicker',] }, { type: HostBinding, args: ['class.k-header',] }],\n disabledClass: [{ type: HostBinding, args: ['class.k-state-disabled',] }]\n };\n return DatePickerComponent;\n}());\n\n/**\n * @hidden\n */\nvar TIME_PART = {\n dayperiod: 'dayperiod',\n hour: 'hour',\n millisecond: 'millisecond',\n minute: 'minute',\n second: 'second'\n};\n\n/**\n * @hidden\n */\nvar timeRangeValidator = function (min, max) {\n return function (control) {\n if (!min || !max || !control.value) {\n return null;\n }\n var err = {\n timeRangeError: {\n maxValue: max,\n minValue: min,\n value: control.value\n }\n };\n return isInTimeRange(control.value, min, max) ? null : err;\n };\n};\n\nvar VALUE_DOC_LINK$3 = 'https://www.telerik.com/kendo-angular-ui/components/dateinputs/timepicker/#toc-integration-with-json';\nvar INTL_DATE_FORMAT = 'https://github.com/telerik/kendo-intl/blob/master/docs/date-formatting/index.md';\nvar formatRegExp = new RegExp(TIME_PART.hour + \"|\" + TIME_PART.minute + \"|\" + TIME_PART.second + \"|\" + TIME_PART.dayperiod + \"|literal\");\n/**\n * Represents the [Kendo UI TimePicker component for Angular]({% slug overview_timepicker %}#toc-basic-usage).\n */\nvar TimePickerComponent = /** @class */ (function () {\n function TimePickerComponent(zone, localization, cdr, popupService, element, renderer, injector, pickerService, intl, touchEnabled$$1) {\n this.zone = zone;\n this.localization = localization;\n this.cdr = cdr;\n this.popupService = popupService;\n this.element = element;\n this.renderer = renderer;\n this.injector = injector;\n this.pickerService = pickerService;\n this.intl = intl;\n this.touchEnabled = touchEnabled$$1;\n /**\n * @hidden\n */\n this.focusableId = \"k-\" + guid();\n /**\n * Sets or gets the `disabled` property of the TimePicker and\n * determines whether the component is active\n * ([see example]({% slug disabled_timepicker %})).\n */\n this.disabled = false;\n /**\n * Sets the read-only state of the TimePicker\n * ([see example]({% slug readonly_timepicker %})).\n */\n this.readonly = false;\n /**\n * Specifies the time format that is used to display the input value\n * ([see example]({% slug formats_timepicker %})).\n */\n this.format = 't';\n /**\n * Specifies the hint the TimePicker displays when its value is `null`.\n * For more information, refer to the article on\n * [placeholders]({% slug placeholders_timepicker %}).\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * `\n * })\n * class AppComponent { }\n * ```\n */\n this.placeholder = null;\n /**\n * Determines whether to display the **Cancel** button in the popup.\n */\n this.cancelButton = true;\n /**\n * Determines whether to display the **Now** button in the popup.\n *\n * > If the current time is out of range or the incremental step is greater than `1`, the **Now** button will be hidden.\n */\n this.nowButton = true;\n /**\n * Sets or gets the `tabindex` property of the TimePicker.\n */\n this.tabindex = 0;\n /**\n * Sets the title of the input element of the TimePicker.\n */\n this.title = \"\";\n /**\n * Determines whether the built-in min or max validators are enforced when a form is being validated.\n */\n this.rangeValidation = true;\n /**\n * Fires each time the user selects a new value.\n * For more information, refer to the section on\n * [events]({% slug overview_timepicker %}#toc-events).\n */\n this.valueChange = new EventEmitter();\n /**\n * Fires each time the user focuses the input element.\n * For more information, refer to the section on\n * [events]({% slug overview_timepicker %}#toc-events).\n *\n * > To wire the event programmatically, use the `onFocus` property.\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * `\n * })\n * class AppComponent {\n * public handleFocus(): void {\n * console.log(\"Component is focused\");\n * }\n * }\n * ```\n */\n this.onFocus = new EventEmitter(); //tslint:disable-line:no-output-rename\n /**\n * Fires each time the input element gets blurred.\n * For more information, refer to the section on\n * [events]({% slug overview_timepicker %}#toc-events).\n *\n * > To wire the event programmatically, use the `onBlur` property.\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * `\n * })\n * class AppComponent {\n * public handleBlur(): void {\n * console.log(\"Component is blurred\");\n * }\n * }\n * ```\n */\n this.onBlur = new EventEmitter(); //tslint:disable-line:no-output-rename\n /**\n * Fires each time the popup is about to open.\n * This event is preventable. If you cancel the event, the popup will remain closed.\n * For more information, refer to the section on\n * [events]({% slug overview_timepicker %}#toc-events).\n */\n this.open = new EventEmitter();\n /**\n * Fires each time the popup is about to close.\n * This event is preventable. If you cancel the event, the popup will remain open.\n * For more information, refer to the section on\n * [events]({% slug overview_timepicker %}#toc-events).\n */\n this.close = new EventEmitter();\n this.popupUID = guid();\n this.onControlChange = noop;\n this.onControlTouched = noop;\n this.onValidatorChange = noop;\n this.resolvedPromise = Promise.resolve(null);\n this.timeRangeValidateFn = noop;\n this._min = cloneDate(MIN_TIME);\n this._max = cloneDate(MAX_TIME);\n this._popupSettings = { animate: true };\n this._show = false;\n this._steps = {};\n this._value = null;\n this._active = false;\n this.domEvents = [];\n this.pickerSubscriptions = this.pickerService.onFocus.subscribe(this.handleFocus.bind(this));\n this.pickerSubscriptions.add(this.pickerService.onBlur.subscribe(this.handleBlur.bind(this)));\n }\n Object.defineProperty(TimePickerComponent.prototype, \"min\", {\n get: function () {\n return this._min;\n },\n /**\n * Specifies the smallest valid time value\n * ([see example]({% slug timeranges_timepicker %})).\n */\n set: function (min) {\n this._min = cloneDate(min || MIN_TIME);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TimePickerComponent.prototype, \"max\", {\n get: function () {\n return this._max;\n },\n /**\n * Specifies the biggest valid time value\n * ([see example]({% slug timeranges_timepicker %})).\n */\n set: function (max) {\n this._max = cloneDate(max || MAX_TIME);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TimePickerComponent.prototype, \"steps\", {\n get: function () {\n return this._steps;\n },\n /**\n * Configures the incremental steps of the TimePicker.\n * For more information, refer to the article on\n * [incremental steps]({% slug incrementalsteps_timepicker %}).\n *\n * > If the incremental step is greater than `1`, the **Now** button will be hidden.\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * `\n * })\n * class AppComponent {\n * public steps = { hour: 2, minute: 15, second: 15 };\n * }\n * ```\n *\n */\n set: function (steps) {\n this._steps = steps || {};\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TimePickerComponent.prototype, \"popupSettings\", {\n get: function () {\n return this._popupSettings;\n },\n /**\n * Configures the popup of the TimePicker.\n *\n * The available options are:\n * - `animate: Boolean`—Controls the popup animation. By default, the open and close animations are enabled.\n * - `popupClass: String`—Specifies a list of CSS classes that are used to style the popup.\n */\n set: function (settings) {\n this._popupSettings = Object.assign({}, { animate: true }, settings);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TimePickerComponent.prototype, \"tabIndex\", {\n get: function () {\n return this.tabindex;\n },\n /**\n * @hidden\n */\n set: function (tabIndex) {\n this.tabindex = tabIndex;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TimePickerComponent.prototype, \"value\", {\n get: function () {\n return this._value;\n },\n /**\n * Specifies the value of the TimePicker component.\n */\n set: function (value) {\n this.verifyValue(value);\n this._value = cloneDate(value);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TimePickerComponent.prototype, \"wrapperClasses\", {\n /**\n * @hidden\n */\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TimePickerComponent.prototype, \"disabledClass\", {\n /**\n * @hidden\n */\n get: function () {\n return this.disabled;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TimePickerComponent.prototype, \"isActive\", {\n get: function () {\n return this._active;\n },\n set: function (value) {\n this._active = value;\n if (!this.wrapper) {\n return;\n }\n var element = this.wrapper.nativeElement;\n if (value) {\n this.renderer.addClass(element, 'k-state-focused');\n }\n else {\n this.renderer.removeClass(element, 'k-state-focused');\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TimePickerComponent.prototype, \"show\", {\n get: function () {\n return this._show;\n },\n set: function (show) {\n var _this = this;\n if (show && (this.disabled || this.readonly)) {\n return;\n }\n var skipZone = !show && (!this._show || !hasObservers(this.close));\n if (!skipZone) {\n this.zone.run(function () {\n _this.togglePopup(show);\n });\n }\n else {\n this.togglePopup(show);\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TimePickerComponent.prototype, \"input\", {\n get: function () {\n return this.pickerService.input;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TimePickerComponent.prototype, \"timeSelector\", {\n get: function () {\n return this.pickerService.timeSelector;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n * Used by the TextBoxContainer to determine if the component is empty\n */\n TimePickerComponent.prototype.isEmpty = function () {\n return !this.value && this.input.isEmpty();\n };\n /**\n * @hidden\n */\n TimePickerComponent.prototype.ngOnInit = function () {\n var _this = this;\n this.localizationChangeSubscription = this.localization\n .changes.subscribe(function () { return _this.cdr.markForCheck(); });\n this.control = this.injector.get(NgControl, null);\n if (this.element) {\n this.renderer.removeAttribute(this.element.nativeElement, 'tabindex');\n this.zone.runOutsideAngular(function () {\n _this.bindEvents();\n });\n }\n };\n /**\n * @hidden\n */\n TimePickerComponent.prototype.ngOnChanges = function (changes) {\n if (changes.min || changes.max || changes.rangeValidation) {\n this.timeRangeValidateFn = this.rangeValidation ? timeRangeValidator(this.min, this.max) : noop;\n this.onValidatorChange();\n }\n if (changes.format) {\n this.verifyFormat();\n }\n };\n /**\n * @hidden\n */\n TimePickerComponent.prototype.ngOnDestroy = function () {\n this.isActive = false;\n this.show = false;\n if (this.localizationChangeSubscription) {\n this.localizationChangeSubscription.unsubscribe();\n }\n if (this.windowBlurSubscription) {\n this.windowBlurSubscription.unsubscribe();\n }\n this.domEvents.forEach(function (unbindCallback) { return unbindCallback(); });\n this.pickerSubscriptions.unsubscribe();\n };\n /**\n * @hidden\n */\n TimePickerComponent.prototype.handleKeydown = function (event) {\n var altKey = event.altKey, keyCode = event.keyCode;\n if (keyCode === Keys.Escape) {\n this.show = false;\n return;\n }\n if (altKey) {\n if (keyCode === Keys.ArrowUp) {\n this.show = false;\n }\n if (keyCode === Keys.ArrowDown && !this.show) {\n this.show = true;\n }\n }\n };\n /**\n * @hidden\n */\n TimePickerComponent.prototype.writeValue = function (value) {\n this.verifyValue(value);\n this.value = cloneDate(value);\n this.cdr.markForCheck();\n if (!value && this.input) {\n this.input.placeholder = this.placeholder;\n this.input.writeValue(value);\n }\n };\n /**\n * @hidden\n */\n TimePickerComponent.prototype.registerOnChange = function (fn) {\n this.onControlChange = fn;\n };\n /**\n * @hidden\n */\n TimePickerComponent.prototype.registerOnTouched = function (fn) {\n this.onControlTouched = fn;\n };\n /**\n * @hidden\n */\n TimePickerComponent.prototype.setDisabledState = function (isDisabled) {\n this.disabled = isDisabled;\n this.cdr.markForCheck();\n };\n /**\n * @hidden\n */\n TimePickerComponent.prototype.validate = function (control) {\n return this.timeRangeValidateFn(control);\n };\n /**\n * @hidden\n */\n TimePickerComponent.prototype.registerOnValidatorChange = function (fn) {\n this.onValidatorChange = fn;\n };\n /**\n * Focuses the TimePicker component.\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * `\n * })\n * class AppComponent { }\n * ```\n */\n TimePickerComponent.prototype.focus = function () {\n this.input.focus();\n };\n /**\n * Blurs the TimePicker component.\n */\n TimePickerComponent.prototype.blur = function () {\n (this.timeSelector || this.input)['blur'](); //tslint:disable-line:no-string-literal\n };\n /**\n * Toggles the visibility of the popup. If you use the `toggle` method to show or hide the popup,\n * the `open` and `close` events do not fire.\n *\n * @param show - The state of the popup.\n */\n TimePickerComponent.prototype.toggle = function (show) {\n var _this = this;\n if (this.disabled || this.readonly) {\n return;\n }\n this.resolvedPromise.then(function () {\n _this._toggle((show === undefined) ? !_this.show : show);\n });\n };\n Object.defineProperty(TimePickerComponent.prototype, \"isOpen\", {\n /**\n * Returns the current open state of the popup.\n */\n get: function () {\n return this.show;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TimePickerComponent.prototype, \"appendTo\", {\n /**\n * @hidden\n */\n get: function () {\n var appendTo = this.popupSettings.appendTo;\n if (!appendTo || appendTo === 'root') {\n return undefined;\n }\n return appendTo === 'component' ? this.container : appendTo;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n */\n TimePickerComponent.prototype.handleChange = function (value) {\n var _this = this;\n if (isEqual(this.value, value)) {\n this.focusInput();\n this.show = false;\n return;\n }\n this.value = cloneDate(value);\n this.zone.run(function () {\n _this.focusInput();\n _this.show = false;\n _this.onControlChange(cloneDate(value));\n _this.valueChange.emit(cloneDate(value));\n });\n };\n /**\n * @hidden\n */\n TimePickerComponent.prototype.handleReject = function () {\n this.show = false;\n };\n /**\n * @hidden\n */\n TimePickerComponent.prototype.handleInputChange = function (value) {\n var val = this.input.formatSections.date ? value : this.mergeTime(value);\n this.handleChange(val);\n };\n /**\n * @hidden\n */\n TimePickerComponent.prototype.handleMousedown = function (args) {\n args.preventDefault();\n };\n /**\n * @hidden\n */\n TimePickerComponent.prototype.handleIconClick = function (event) {\n if (this.disabled || this.readonly) {\n return;\n }\n event.preventDefault();\n this.focusInput();\n //XXX: explicit call handleFocus handler here\n //due to async IE focus event\n this.handleFocus();\n this.show = !this.show;\n };\n Object.defineProperty(TimePickerComponent.prototype, \"popupClasses\", {\n /**\n * @hidden\n */\n get: function () {\n return [\n 'k-group',\n 'k-reset'\n ].concat(this.popupSettings.popupClass || []);\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n */\n TimePickerComponent.prototype.normalizeTime = function (date) {\n return setTime(MIDNIGHT_DATE, date);\n };\n /**\n * @hidden\n */\n TimePickerComponent.prototype.mergeTime = function (value) {\n return this.value && value ? setTime(this.value, value) : value;\n };\n TimePickerComponent.prototype.togglePopup = function (show) {\n var event = new PreventableEvent();\n if (!this._show && show) {\n this.open.emit(event);\n }\n else if (this._show && !show) {\n this.close.emit(event);\n }\n if (event.isDefaultPrevented()) {\n return;\n }\n this._toggle(show);\n this.toggleFocus();\n };\n TimePickerComponent.prototype._toggle = function (show) {\n var _this = this;\n this._show = show;\n this.cdr.markForCheck();\n if (this.popupRef) {\n this.popupRef.close();\n this.popupRef = null;\n }\n if (this._show) {\n var direction = this.localization.rtl ? 'right' : 'left';\n this.popupRef = this.popupService.open({\n anchor: this.wrapper,\n anchorAlign: { vertical: 'bottom', horizontal: direction },\n animate: this.popupSettings.animate,\n appendTo: this.appendTo,\n content: this.popupTemplate,\n popupAlign: { vertical: 'top', horizontal: direction },\n popupClass: this.popupClasses,\n positionMode: 'absolute'\n });\n this.popupRef.popupElement.setAttribute('id', this.popupUID);\n this.popupRef.popupAnchorViewportLeave.subscribe(function () { return _this.show = false; });\n }\n };\n TimePickerComponent.prototype.focusInput = function () {\n if (this.touchEnabled) {\n return;\n }\n this.input.focus();\n };\n TimePickerComponent.prototype.toggleFocus = function () {\n if (!this.isActive) {\n return;\n }\n if (this.show) {\n if (!this.timeSelector) {\n this.cdr.detectChanges();\n }\n if (this.isActive) {\n this.timeSelector.focus();\n }\n }\n else if (!this.touchEnabled) {\n this.input.focus();\n }\n else if (!this.input.isActive) {\n this.handleBlur();\n }\n };\n TimePickerComponent.prototype.verifyValue = function (value) {\n if (!isDevMode()) {\n return;\n }\n if (value && !(value instanceof Date)) {\n throw new Error(\"The 'value' should be a valid JavaScript Date instance. Check \" + VALUE_DOC_LINK$3 + \" for possible resolution.\");\n }\n };\n TimePickerComponent.prototype.verifyFormat = function () {\n if (!isDevMode()) {\n return;\n }\n var formatContainsDateParts = this.intl.splitDateFormat(this.format).some(function (part) { return !formatRegExp.test(part.type); });\n if (formatContainsDateParts) {\n throw new Error(\"Provided format is not supported. Supported specifiers are T|t|H|h|m|s|a. See \" + INTL_DATE_FORMAT);\n }\n };\n TimePickerComponent.prototype.bindEvents = function () {\n var element = this.element.nativeElement;\n this.domEvents.push(this.renderer.listen(element, 'keydown', this.handleKeydown.bind(this)));\n if (isWindowAvailable()) {\n this.windowBlurSubscription = fromEvent(window, 'blur').subscribe(this.handleWindowBlur.bind(this));\n }\n };\n TimePickerComponent.prototype.handleWindowBlur = function () {\n if (!this.isOpen) {\n return;\n }\n this.show = false;\n };\n TimePickerComponent.prototype.handleFocus = function () {\n var _this = this;\n if (this.isActive) {\n return;\n }\n this.isActive = true;\n if (hasObservers(this.onFocus)) {\n this.zone.run(function () {\n _this.onFocus.emit();\n });\n }\n };\n TimePickerComponent.prototype.handleBlur = function (args) {\n var _this = this;\n var currentTarget = args && currentFocusTarget(args);\n if (currentTarget && (this.input.containsElement(currentTarget) ||\n (this.timeSelector && this.timeSelector.containsElement(currentTarget)))) {\n return;\n }\n if (hasObservers(this.onBlur) || (this.show && hasObservers(this.close)) || requiresZoneOnBlur(this.control)) {\n this.zone.run(function () {\n _this.blurComponent();\n });\n }\n else {\n this.blurComponent();\n }\n };\n TimePickerComponent.prototype.blurComponent = function () {\n this.isActive = false; // order is important ¯\\_(ツ)_/¯\n this.show = false;\n this.onControlTouched();\n this.onBlur.emit();\n };\n TimePickerComponent.decorators = [\n { type: Component, args: [{\n changeDetection: ChangeDetectionStrategy.OnPush,\n exportAs: 'kendo-timepicker',\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(function () { return TimePickerComponent; }), multi: true },\n { provide: NG_VALIDATORS, useExisting: forwardRef(function () { return TimePickerComponent; }), multi: true },\n { provide: KendoInput, useExisting: forwardRef(function () { return TimePickerComponent; }) },\n LocalizationService,\n {\n provide: L10N_PREFIX,\n useValue: 'kendo.timepicker'\n },\n PickerService\n ],\n selector: 'kendo-timepicker',\n template: \"\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n TimePickerComponent.ctorParameters = function () { return [\n { type: NgZone },\n { type: LocalizationService },\n { type: ChangeDetectorRef },\n { type: PopupService },\n { type: ElementRef },\n { type: Renderer2 },\n { type: Injector },\n { type: PickerService },\n { type: IntlService },\n { type: Boolean, decorators: [{ type: Optional }, { type: Inject, args: [TOUCH_ENABLED,] }] }\n ]; };\n TimePickerComponent.propDecorators = {\n container: [{ type: ViewChild, args: ['container', { read: ViewContainerRef },] }],\n popupTemplate: [{ type: ViewChild, args: ['popupTemplate',] }],\n wrapper: [{ type: ViewChild, args: ['wrapper',] }],\n focusableId: [{ type: Input }],\n disabled: [{ type: Input }],\n readonly: [{ type: Input }],\n format: [{ type: Input }],\n formatPlaceholder: [{ type: Input }],\n placeholder: [{ type: Input }],\n min: [{ type: Input }],\n max: [{ type: Input }],\n cancelButton: [{ type: Input }],\n nowButton: [{ type: Input }],\n steps: [{ type: Input }],\n popupSettings: [{ type: Input }],\n tabindex: [{ type: Input }],\n tabIndex: [{ type: Input }],\n title: [{ type: Input }],\n rangeValidation: [{ type: Input }],\n value: [{ type: Input }],\n valueChange: [{ type: Output }],\n onFocus: [{ type: Output, args: ['focus',] }],\n onBlur: [{ type: Output, args: ['blur',] }],\n open: [{ type: Output }],\n close: [{ type: Output }],\n wrapperClasses: [{ type: HostBinding, args: ['class.k-widget',] }, { type: HostBinding, args: ['class.k-timepicker',] }, { type: HostBinding, args: ['class.k-header',] }],\n disabledClass: [{ type: HostBinding, args: ['class.k-state-disabled',] }]\n };\n return TimePickerComponent;\n}());\n\nvar timeFormatRegExp = new RegExp(TIME_PART.hour + \"|\" + TIME_PART.minute + \"|\" + TIME_PART.second + \"|\" + TIME_PART.dayperiod + \"|literal\");\nvar VALUE_DOC_LINK$4 = 'https://www.telerik.com/kendo-angular-ui/components/dateinputs/datetimepicker/integration-with-json/';\nvar MIN_MAX_DOC_LINK = 'https://www.telerik.com/kendo-angular-ui/components/dateinputs/datetimepicker/date-time-limits/';\nvar DEFAULT_ACTIVE_TAB = 'date';\nvar DEFAULT_DATEINPUT_FORMAT = 'g';\nvar DEFAULT_TIMESELECTOR_FORMAT = 't';\n/**\n * Represents the [Kendo UI DateTimePicker component for Angular]({% slug overview_datetimepicker %}).\n */\nvar DateTimePickerComponent = /** @class */ (function () {\n function DateTimePickerComponent(popupService, intl, cdr, pickerService, ngZone, host, touchEnabled$$1, localization, disabledDatesService) {\n this.popupService = popupService;\n this.intl = intl;\n this.cdr = cdr;\n this.pickerService = pickerService;\n this.ngZone = ngZone;\n this.host = host;\n this.touchEnabled = touchEnabled$$1;\n this.localization = localization;\n this.disabledDatesService = disabledDatesService;\n /**\n * @hidden\n */\n this.hostClasses = true;\n /**\n * @hidden\n */\n this.focusableId = \"k-\" + guid();\n /**\n * Sets the title of the input element of the DateTimePicker.\n */\n this.title = '';\n /**\n * Sets or gets the `disabled` property of the DateTimePicker and determines whether the component is active\n * ([see example]({% slug disabled_datetimepicker %})).\n */\n this.disabled = false;\n /**\n * Sets the read-only state of the DateTimePicker\n * ([see example]({% slug readonly_datetimepicker %})).\n */\n this.readonly = false;\n /**\n * Determines whether to display the **Cancel** button in the popup\n * ([see example]({% slug datetimepicker_popup_options %}#toc-toggling-the-cancel-button)).\n */\n this.cancelButton = true;\n /**\n * Determines whether to display a week number column in the `month` view of the popup Calendar\n * ([see example]({% slug datetimepicker_calendar_options %}#toc-week-number-column)).\n */\n this.weekNumber = false;\n /**\n * Determines whether the built-in min or max validators are enforced when validating a form\n * ([see example]({% slug dateranges_datetimepicker %}#toc-forms-range-validation)).\n */\n this.rangeValidation = true;\n /**\n * Determines whether the built-in validator for disabled\n * date ranges is enforced when validating a form\n * ([see example]({% slug disabled_dates_datetimepicker %}#toc-validation)).\n */\n this.disabledDatesValidation = true;\n /**\n * Fires each time the user selects a new value.\n * ([more information and example]({% slug overview_datetimepicker %}#toc-methods-and-events)).\n */\n this.valueChange = new EventEmitter();\n /**\n * Fires each time the popup is about to open.\n * This event is preventable. If you cancel the event by setting `event.preventDefault()`, the popup will remain closed.\n * ([more information and example]({% slug overview_datetimepicker %}#toc-methods-and-events)).\n */\n this.open = new EventEmitter();\n /**\n * Fires each time the popup is about to close.\n * This event is preventable. If you cancel the event by setting `event.preventDefault()`, the popup will remain open.\n * ([more information and example]({% slug overview_datetimepicker %}#toc-methods-and-events)).\n */\n this.close = new EventEmitter();\n /**\n * Fires each time the user focuses the component.\n * ([more information and example]({% slug overview_datetimepicker %}#toc-methods-and-events)).\n */\n this.onFocus = new EventEmitter();\n /**\n * Fires each time the user blurs the component.\n * ([more information and example]({% slug overview_datetimepicker %}#toc-methods-and-events)).\n */\n this.onBlur = new EventEmitter();\n /**\n * Indicates whether the component or its popup content is focused.\n */\n this.isActive = false;\n /**\n * @hidden\n *\n * Controls whether the Calendar or the TimeSelector will be displayed.\n */\n this.activeTab = DEFAULT_ACTIVE_TAB;\n /**\n * @hidden\n *\n * Specifies the stripped time-related format that is used in the TimeSelector.\n * Updates each time the `format` property value changes.\n */\n this.timeSelectorFormat = DEFAULT_TIMESELECTOR_FORMAT;\n /**\n * @hidden\n */\n this.timeSelectorMin = cloneDate(MIN_TIME);\n /**\n * @hidden\n */\n this.timeSelectorMax = cloneDate(MAX_TIME);\n /**\n * @hidden\n */\n this.calendarValue = null;\n /**\n * @hidden\n */\n this.calendarMin = cloneDate(MIN_DATE);\n /**\n * @hidden\n */\n this.calendarMax = lastMillisecondOfDate(MAX_DATE);\n this._popupSettings = { animate: true };\n this._value = null;\n this._format = DEFAULT_DATEINPUT_FORMAT;\n this._tabindex = 0;\n this._defaultTab = DEFAULT_ACTIVE_TAB;\n this._min = mergeDateAndTime(MIN_DATE, MIN_TIME);\n this._max = mergeDateAndTime(MAX_DATE, MAX_TIME);\n this.onControlTouched = noop;\n this.onControlChange = noop;\n this.onValidatorChange = noop;\n this.minValidateFn = noop;\n this.maxValidateFn = noop;\n this.disabledDatesValidateFn = noop;\n this.subscriptions = new Subscription();\n }\n Object.defineProperty(DateTimePickerComponent.prototype, \"input\", {\n /**\n * @hidden\n */\n get: function () {\n return this.pickerService.input;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateTimePickerComponent.prototype, \"calendar\", {\n /**\n * @hidden\n */\n get: function () {\n return this.pickerService.calendar;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateTimePickerComponent.prototype, \"timeSelector\", {\n /**\n * @hidden\n */\n get: function () {\n return this.pickerService.timeSelector;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateTimePickerComponent.prototype, \"value\", {\n get: function () {\n return this._value;\n },\n /**\n * Specifies the value of the DateTimePicker component.\n *\n * > The `value` has to be a valid [JavaScript `Date`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date) instance.\n */\n set: function (value) {\n this.verifyValue(value);\n this._value = cloneDate(value);\n this.setCalendarValue(value);\n this.cdr.markForCheck();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateTimePickerComponent.prototype, \"format\", {\n get: function () {\n return this._format;\n },\n /**\n * Specifies the date format for displaying the input value\n * ([see example]({% slug formats_datetimepicker %})).\n */\n set: function (value) {\n this._format = value;\n this.timeSelectorFormat = this.getTimeSelectorFormat(value);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateTimePickerComponent.prototype, \"tabindex\", {\n get: function () {\n return this.disabled ? -1 : this._tabindex;\n },\n /**\n * Specifies the [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the DateTimePicker.\n */\n set: function (value) {\n var tabindex = Number(value);\n var defaultValue = 0;\n this._tabindex = !isNaN(tabindex) ? tabindex : defaultValue;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateTimePickerComponent.prototype, \"disabledDates\", {\n get: function () {\n return this._disabledDates;\n },\n /**\n * Sets the dates of the DateTimePicker that will be disabled\n * ([see example]({% slug disabled_dates_datetimepicker %})).\n */\n set: function (value) {\n this._disabledDates = value;\n this.disabledDatesService.initialize(value);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateTimePickerComponent.prototype, \"popupSettings\", {\n get: function () {\n return this._popupSettings;\n },\n /**\n * Configures the popup settings of the DateTimePicker\n * ([see example]({% slug datetimepicker_popup_options %}#toc-customizing-the-popup)).\n *\n * The available options are:\n * - `animate: Boolean`—Controls the popup animation. By default, the open and close animations are enabled.\n * - `appendTo: 'root' | 'component' | ViewContainerRef`—Controls the popup container. By default, the popup will be appended to the root component.\n * - `popupClass: String`—Specifies a list of CSS classes that are used to style the popup.\n */\n set: function (settings) {\n this._popupSettings = Object.assign({}, { animate: true }, settings);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateTimePickerComponent.prototype, \"min\", {\n get: function () {\n return this._min;\n },\n /**\n * Specifies the smallest valid date.\n * The Calendar will not display dates before this value.\n * If the `min` value of the Calendar is selected, the TimePicker will not display\n * time entries before the specified time portion of this value\n * ([see example]({% slug dateranges_datetimepicker %})).\n */\n set: function (value) {\n if (!isPresent(value)) {\n return;\n }\n this._min = cloneDate(value);\n this.calendarMin = getDate(value);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateTimePickerComponent.prototype, \"max\", {\n get: function () {\n return this._max;\n },\n /**\n * Specifies the biggest valid date.\n * The Calendar will not display dates after this value.\n * If the `max` value of the Calendar is selected, the TimePicker will not display\n * time entries after the specified time portion of this value\n * ([see example]({% slug dateranges_datetimepicker %})).\n */\n set: function (value) {\n if (!isPresent(value)) {\n return;\n }\n this._max = cloneDate(value);\n this.calendarMax = lastMillisecondOfDate(value);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateTimePickerComponent.prototype, \"isOpen\", {\n /**\n * Indicates whether the component is currently open.\n */\n get: function () {\n return isPresent(this.popupRef);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateTimePickerComponent.prototype, \"defaultTab\", {\n get: function () {\n return this._defaultTab;\n },\n /**\n * Sets the active tab on opening the popup\n * ([see example]({% slug datetimepicker_popup_options %}#toc-setting-the-default-tab)).\n */\n set: function (tab) {\n this._defaultTab = tab || DEFAULT_ACTIVE_TAB;\n this.activeTab = this.defaultTab;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateTimePickerComponent.prototype, \"tabSwitchTransition\", {\n /**\n * @hidden\n */\n get: function () {\n /*\n When the popup is opening, disables the set transition in the themes. When `defaultTab` is set to `time`,\n the popup opens with an active **Time** tab and the animation of the initial transition is undesired.\n Setting the inline transition style to `none` overrides the set animation in the themes.\n Setting the inline transition style to `null` does not apply any inline styles or override the themes CSS.\n */\n return this.isOpen ? null : 'none';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateTimePickerComponent.prototype, \"disableCalendar\", {\n /**\n * @hidden\n *\n * Indicates whether the Calendar will be disabled.\n * The inactive tab component gets disabled and becomes inaccessible on tab click.\n */\n get: function () {\n return this.activeTab !== 'date' && !this.calendar.isActive;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateTimePickerComponent.prototype, \"disableTimeSelector\", {\n /**\n * @hidden\n *\n * Indicates whether the TimeSelector will be disabled.\n * The inactive tab component gets disabled and becomes inaccessible on tab click.\n */\n get: function () {\n return this.activeTab !== 'time' && !this.timeSelector.isActive;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateTimePickerComponent.prototype, \"activeTabComponent\", {\n get: function () {\n if (!this.isOpen) {\n return;\n }\n if (!(isPresent(this.calendar) || isPresent(this.timeSelector))) {\n this.cdr.detectChanges();\n }\n return this.activeTab === 'date' ? this.calendar : this.timeSelector;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateTimePickerComponent.prototype, \"appendTo\", {\n get: function () {\n var appendTo = this.popupSettings.appendTo;\n if (!isPresent(appendTo) || appendTo === 'root') {\n return undefined;\n }\n return appendTo === 'component' ? this.container : appendTo;\n },\n enumerable: true,\n configurable: true\n });\n DateTimePickerComponent.prototype.ngOnInit = function () {\n var _this = this;\n this.subscriptions\n // detect popup changes to disable the inactive view mark-up when the popup is open\n .add(this.pickerService.onFocus.pipe(tap(this.detectPopupChanges.bind(this))).subscribe(this.handleFocus.bind(this)))\n .add(this.pickerService.onBlur.subscribe(this.handleBlur.bind(this)))\n .add(this.pickerService.sameDateSelected.subscribe(this.handleCalendarValueChange.bind(this)))\n .add(this.localization.changes.subscribe(function () { return _this.cdr.markForCheck(); }));\n if (isWindowAvailable()) {\n this.subscriptions.add(this.ngZone.runOutsideAngular(function () { return fromEvent(window, 'blur').subscribe(_this.handleCancel.bind(_this)); }));\n }\n };\n DateTimePickerComponent.prototype.ngOnChanges = function (changes) {\n if (isPresent(changes.min) || isPresent(changes.max)) {\n this.verifyMinMaxRange();\n }\n if (changes.min || changes.max || changes.rangeValidation || changes.disabledDatesValidation || changes.disabledDates) {\n this.minValidateFn = this.rangeValidation ? minValidator(this.min) : noop;\n this.maxValidateFn = this.rangeValidation ? maxValidator(this.max) : noop;\n this.disabledDatesValidateFn = this.disabledDatesValidation ? disabledDatesValidator(this.disabledDatesService.isDateDisabled) : noop;\n this.onValidatorChange();\n }\n };\n DateTimePickerComponent.prototype.ngOnDestroy = function () {\n if (this.isOpen) {\n this.closePopup();\n }\n this.subscriptions.unsubscribe();\n };\n /**\n * * If the popup is closed, focuses the DateTimePicker input.\n * * If the popup is open, the focus is moved to its content.\n */\n DateTimePickerComponent.prototype.focus = function () {\n if (this.disabled) {\n return;\n }\n if (this.isOpen) {\n this.activeTabComponent.focus();\n }\n else {\n this.input.focus();\n }\n };\n /**\n * Blurs the DateTimePicker.\n */\n DateTimePickerComponent.prototype.blur = function () {\n if (this.isOpen && this.activeTabComponent.isActive) {\n this.activeTabComponent.blur();\n }\n else {\n this.input.blur();\n }\n };\n /**\n * Toggles the visibility of the popup. If you use the `toggle` method to show or hide the popup,\n * the `open` and `close` events do not fire.\n * ([more information and example]({% slug overview_datetimepicker %}#toc-methods-and-events)).\n *\n * @param show - The state of the popup.\n */\n DateTimePickerComponent.prototype.toggle = function (show) {\n if (this.disabled || this.readonly) {\n return;\n }\n var shouldOpen = isPresent(show) ? show : !this.isOpen;\n if (this.isOpen) {\n this.closePopup();\n // Changes the tab and the calendar or clock icon to the designated default.\n if (this.activeTab !== this.defaultTab) {\n this.activeTab = this.defaultTab;\n this.cdr.detectChanges();\n }\n }\n if (shouldOpen) {\n this.openPopup();\n }\n };\n /**\n * @hidden\n */\n DateTimePickerComponent.prototype.writeValue = function (value) {\n this.value = value;\n };\n /**\n * @hidden\n */\n DateTimePickerComponent.prototype.registerOnChange = function (fn) {\n this.onControlChange = fn;\n };\n /**\n * @hidden\n */\n DateTimePickerComponent.prototype.registerOnTouched = function (fn) {\n this.onControlTouched = fn;\n };\n /**\n * @hidden\n */\n DateTimePickerComponent.prototype.setDisabledState = function (disabled) {\n this.disabled = disabled;\n this.cdr.markForCheck();\n };\n /**\n * @hidden\n */\n DateTimePickerComponent.prototype.validate = function (control) {\n return this.minValidateFn(control) || this.maxValidateFn(control) || this.disabledDatesValidateFn(control);\n };\n /**\n * @hidden\n */\n DateTimePickerComponent.prototype.registerOnValidatorChange = function (fn) {\n this.onValidatorChange = fn;\n };\n /**\n * @hidden\n *\n * Used by the TextBoxContainer to determine if the floating label will render in the input.\n */\n DateTimePickerComponent.prototype.isEmpty = function () {\n return !isPresent(this.value) && this.input.isEmpty();\n };\n /**\n * @hidden\n */\n DateTimePickerComponent.prototype.handleIconClick = function (event) {\n var _this = this;\n if (this.disabled || this.readonly) {\n return;\n }\n // prevents the event default to evade focusing the DateInput input when placed inside a label (FF/IE/Edge)\n event.preventDefault();\n var runInZone = !this.isOpen || hasObservers(this.close);\n this.run(runInZone, function () {\n // handle focus first to maintain correct event order `focus` => `open`\n _this.handleFocus();\n _this.togglePopup(!_this.isOpen);\n });\n };\n /**\n * @hidden\n */\n DateTimePickerComponent.prototype.handleFocus = function () {\n var _this = this;\n if (this.isActive) {\n return;\n }\n this.isActive = true;\n this.cdr.detectChanges();\n if (hasObservers(this.onFocus)) {\n this.ngZone.run(function () { return _this.onFocus.emit(); });\n }\n };\n /**\n * @hidden\n */\n DateTimePickerComponent.prototype.handleBlur = function (event) {\n var _this = this;\n if (!this.isActive || this.focusTargetInComponent(event)) {\n return;\n }\n this.isActive = false;\n this.cdr.detectChanges();\n var isNgControlUntouched = this.host.nativeElement.classList.contains('ng-untouched');\n var runInZone = isNgControlUntouched || hasObservers(this.onBlur) || (this.isOpen && hasObservers(this.close));\n this.run(runInZone, function () {\n _this.onBlur.emit();\n _this.onControlTouched();\n _this.togglePopup(false);\n });\n };\n /**\n * @hidden\n */\n DateTimePickerComponent.prototype.changeActiveTab = function (tab) {\n if (!this.isOpen || this.activeTab === tab) {\n return;\n }\n // persists the Tcurrent value of the TimeSelector when switching between tabs\n if (!isEqual(this.timeSelector.value, this.timeSelector.current)) {\n this.timeSelector.handleAccept();\n }\n this.activeTab = tab;\n this.cdr.detectChanges();\n this.detectPopupChanges();\n };\n /**\n * @hidden\n */\n DateTimePickerComponent.prototype.handleTabChangeTransitionEnd = function (dateTimeSelector, event) {\n // handle only the .k-datetime-selector element transition, ignore any child element transitions\n if (event.target !== dateTimeSelector) {\n return;\n }\n this.activeTabComponent.focus();\n };\n /**\n * @hidden\n */\n DateTimePickerComponent.prototype.handleAccept = function () {\n var _this = this;\n if (!this.isOpen) {\n return;\n }\n var candidate = mergeDateAndTime(this.calendar.value, this.timeSelector.current);\n var valueChangePresent = !isEqual(this.value, candidate);\n var runInZone = valueChangePresent || hasObservers(this.close);\n this.run(runInZone, function () {\n _this.handleValueChange(candidate);\n _this.togglePopup(false);\n });\n };\n /**\n * @hidden\n */\n DateTimePickerComponent.prototype.handleCancel = function () {\n var _this = this;\n if (!this.isOpen) {\n return;\n }\n var runInZone = hasObservers(this.close);\n this.run(runInZone, function () { return _this.togglePopup(false); });\n };\n /**\n * @hidden\n */\n DateTimePickerComponent.prototype.handleInputValueChange = function (value) {\n this.handleValueChange(value);\n if (this.isOpen) {\n this.togglePopup(false);\n }\n };\n /**\n * @hidden\n */\n DateTimePickerComponent.prototype.handleCalendarValueChange = function () {\n this.setTimeSelectorMinMax(this.calendar.value);\n this.changeActiveTab('time');\n };\n /**\n * @hidden\n */\n DateTimePickerComponent.prototype.handleKeyDown = function (event) {\n var _this = this;\n if (this.disabled || this.readonly) {\n return;\n }\n var _a = event, keyCode = _a.keyCode, altKey = _a.altKey;\n switch (keyCode) {\n case altKey && Keys.ArrowUp:\n case Keys.Escape:\n this.handleCancel();\n break;\n case !this.isOpen && altKey && Keys.ArrowDown:\n this.ngZone.run(function () { return _this.togglePopup(true); });\n break;\n case altKey && Keys.ArrowRight:\n this.changeActiveTab('time');\n break;\n case altKey && Keys.ArrowLeft:\n this.changeActiveTab('date');\n break;\n case this.isOpen && this.timeSelector.isActive && isPresent(this.calendarValue) && Keys.Enter:\n this.handleAccept();\n break;\n default: return;\n }\n event.preventDefault();\n };\n /**\n * @hidden\n */\n DateTimePickerComponent.prototype.handleTabOut = function (event) {\n var _a = event, keyCode = _a.keyCode, shiftKey = _a.shiftKey, target = _a.target;\n // if no focusable next sibling elements exist in the controls sections, the user is tabbing out of the popup\n var focusableSiblingAvailable = isPresent(target.nextElementSibling) && !target.nextElementSibling.disabled;\n if (keyCode === Keys.Tab && !shiftKey && !focusableSiblingAvailable) {\n this.input.focus();\n this.handleCancel();\n }\n };\n /**\n * @hidden\n */\n DateTimePickerComponent.prototype.handleBackTabOut = function (event) {\n var _a = event, keyCode = _a.keyCode, shiftKey = _a.shiftKey;\n if (keyCode === Keys.Tab && shiftKey) {\n this.input.focus();\n }\n };\n /**\n * @hidden\n *\n * Prevents the diversion of the focus from the currently active element in the component.\n */\n DateTimePickerComponent.prototype.preventMouseDown = function (event) {\n event.preventDefault();\n };\n DateTimePickerComponent.prototype.verifyValue = function (value) {\n if (!isDevMode()) {\n return;\n }\n if (isPresent(value) && !(value instanceof Date)) {\n throw new Error(\"The 'value' should be a valid JavaScript Date instance. Check \" + VALUE_DOC_LINK$4 + \" for possible resolution.\");\n }\n };\n DateTimePickerComponent.prototype.verifyMinMaxRange = function () {\n if (!isDevMode()) {\n return;\n }\n if (!isValidRange(this.min, this.max)) {\n throw new Error(\"The max value should be bigger than the min. See \" + MIN_MAX_DOC_LINK + \".\");\n }\n };\n /**\n * Extracts the time slots and the literals that are not preceded by date parts\n * and concatenates the resulting parts into a string.\n * If the provided format value does not contain any time parts,\n * returns the designated format of the default popup component of the TimePicker.\n */\n DateTimePickerComponent.prototype.getTimeSelectorFormat = function (format) {\n var timeSelectorFormat = this.intl\n .splitDateFormat(format)\n .filter(this.timeFormatPartFilter)\n .reduce(function (format, part) { return format += part.pattern; }, '');\n return timeSelectorFormat || DEFAULT_TIMESELECTOR_FORMAT;\n };\n /**\n * The filter expression that filters out all format parts\n * except for `hour`, `minute`, `second`, `dayperiod`, and specific literals.\n * Literals will be left only if they are not preceded by date parts.\n */\n DateTimePickerComponent.prototype.timeFormatPartFilter = function (part, index, parts) {\n var previousPart = index >= 1 && parts[index - 1];\n if (previousPart && part.type === 'literal') {\n return timeFormatRegExp.test(previousPart.type);\n }\n return timeFormatRegExp.test(part.type);\n };\n DateTimePickerComponent.prototype.togglePopup = function (open) {\n if (open === this.isOpen) {\n return;\n }\n var event = new PreventableEvent();\n open ? this.open.emit(event) : this.close.emit(event);\n if (event.isDefaultPrevented()) {\n return;\n }\n this.toggle(open);\n this.switchFocus();\n };\n DateTimePickerComponent.prototype.switchFocus = function () {\n if (!this.isActive) {\n return;\n }\n if (this.isOpen) {\n this.activeTabComponent.focus();\n }\n else if (!this.touchEnabled) {\n this.input.focus();\n }\n else if (!this.input.isActive) {\n this.handleBlur();\n }\n };\n DateTimePickerComponent.prototype.openPopup = function () {\n var _this = this;\n this.setCalendarValue(this.value);\n this.setTimeSelectorMinMax(this.value);\n var direction = this.localization.rtl ? 'right' : 'left';\n this.popupRef = this.popupService.open({\n anchor: this.wrapper,\n content: this.popupTemplate,\n positionMode: 'absolute',\n animate: this.popupSettings.animate,\n appendTo: this.appendTo,\n popupClass: \"k-datetime-container \" + (this.popupSettings.popupClass || ''),\n anchorAlign: { vertical: 'bottom', horizontal: direction },\n popupAlign: { vertical: 'top', horizontal: direction }\n });\n this.popupRef.popupAnchorViewportLeave.subscribe(function () { return _this.handleCancel(); });\n };\n DateTimePickerComponent.prototype.closePopup = function () {\n if (!this.isOpen) {\n return;\n }\n this.popupRef.close();\n this.popupRef = null;\n };\n DateTimePickerComponent.prototype.handleValueChange = function (value) {\n if (isEqual(this.value, value)) {\n return;\n }\n this.value = cloneDate(value);\n this.valueChange.emit(cloneDate(value));\n this.onControlChange(cloneDate(value));\n };\n /**\n * Indicates whether the focus target is part of this component,\n * that is, whether the focus target is inside the component wrapper or in the popup.\n */\n DateTimePickerComponent.prototype.focusTargetInComponent = function (event) {\n if (!isPresent(event)) {\n return false;\n }\n var relatedTarget = event.relatedTarget || document.activeElement;\n var focusInPopup = isPresent(this.popupRef) && this.popupRef.popupElement.contains(relatedTarget);\n var focusInWrapper = this.wrapper.nativeElement.contains(relatedTarget);\n return focusInPopup || focusInWrapper;\n };\n DateTimePickerComponent.prototype.setTimeSelectorMinMax = function (selectedDate) {\n var minDateSelected = isPresent(selectedDate) && isEqual(getDate(selectedDate), getDate(this.min));\n this.timeSelectorMin = cloneDate(minDateSelected ? this.min : MIN_TIME);\n var maxDateSelected = isPresent(selectedDate) && isEqual(getDate(selectedDate), getDate(this.max));\n this.timeSelectorMax = cloneDate(maxDateSelected ? this.max : MAX_TIME);\n };\n DateTimePickerComponent.prototype.setCalendarValue = function (value) {\n var isInCalendarRange = isPresent(value) && isInRange(value, this.calendarMin, this.calendarMax);\n this.calendarValue = isInCalendarRange ? getDate(value) : null;\n };\n /**\n * If the popup is available, runs a popup change detection.\n */\n DateTimePickerComponent.prototype.detectPopupChanges = function () {\n if (!this.isOpen) {\n return;\n }\n this.popupRef.popup.changeDetectorRef.detectChanges();\n };\n /**\n * Depending on the predicate `runInZone` value that is passed,\n * runs the provided function either in the Angular or in the current zone.\n */\n DateTimePickerComponent.prototype.run = function (runInZone, fn) {\n if (runInZone) {\n this.ngZone.run(function () { return fn(); });\n }\n else {\n fn();\n }\n };\n DateTimePickerComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-datetimepicker',\n exportAs: 'kendo-datetimepicker',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n PickerService,\n LocalizationService,\n DisabledDatesService,\n { provide: L10N_PREFIX, useValue: 'kendo.datetimepicker' },\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(function () { return DateTimePickerComponent; }), multi: true },\n { provide: NG_VALIDATORS, useExisting: forwardRef(function () { return DateTimePickerComponent; }), multi: true },\n { provide: KendoInput, useExisting: forwardRef(function () { return DateTimePickerComponent; }) }\n ],\n template: \"\\n \\n \\n\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n\\n \\n\\n \\n \\n
\\n
\\n
\\n \\n \\n \\n \\n
\\n
\\n \\n \\n \\n \\n
\\n
\\n \\n
\\n \\n \"\n },] },\n ];\n /** @nocollapse */\n DateTimePickerComponent.ctorParameters = function () { return [\n { type: PopupService },\n { type: IntlService },\n { type: ChangeDetectorRef },\n { type: PickerService },\n { type: NgZone },\n { type: ElementRef },\n { type: Boolean, decorators: [{ type: Inject, args: [TOUCH_ENABLED,] }] },\n { type: LocalizationService },\n { type: DisabledDatesService }\n ]; };\n DateTimePickerComponent.propDecorators = {\n hostClasses: [{ type: HostBinding, args: ['class.k-widget',] }, { type: HostBinding, args: ['class.k-datetimepicker',] }],\n wrapper: [{ type: ViewChild, args: ['wrapper',] }],\n value: [{ type: Input }],\n format: [{ type: Input }],\n tabindex: [{ type: Input }],\n disabledDates: [{ type: Input }],\n popupSettings: [{ type: Input }],\n focusableId: [{ type: Input }],\n title: [{ type: Input }],\n disabled: [{ type: Input }],\n readonly: [{ type: Input }],\n cancelButton: [{ type: Input }],\n formatPlaceholder: [{ type: Input }],\n placeholder: [{ type: Input }],\n steps: [{ type: Input }],\n focusedDate: [{ type: Input }],\n weekNumber: [{ type: Input }],\n min: [{ type: Input }],\n max: [{ type: Input }],\n rangeValidation: [{ type: Input }],\n disabledDatesValidation: [{ type: Input }],\n valueChange: [{ type: Output }],\n open: [{ type: Output }],\n close: [{ type: Output }],\n onFocus: [{ type: Output, args: ['focus',] }],\n onBlur: [{ type: Output, args: ['blur',] }],\n defaultTab: [{ type: Input }],\n cellTemplate: [{ type: ContentChild, args: [CellTemplateDirective,] }],\n monthCellTemplate: [{ type: ContentChild, args: [MonthCellTemplateDirective,] }],\n yearCellTemplate: [{ type: ContentChild, args: [YearCellTemplateDirective,] }],\n decadeCellTemplate: [{ type: ContentChild, args: [DecadeCellTemplateDirective,] }],\n centuryCellTemplate: [{ type: ContentChild, args: [CenturyCellTemplateDirective,] }],\n weekNumberTemplate: [{ type: ContentChild, args: [WeekNumberCellTemplateDirective,] }],\n headerTitleTemplate: [{ type: ContentChild, args: [HeaderTitleTemplateDirective,] }],\n container: [{ type: ViewChild, args: ['container', { read: ViewContainerRef },] }],\n popupTemplate: [{ type: ViewChild, args: ['popupTemplate', { read: TemplateRef },] }]\n };\n return DateTimePickerComponent;\n}());\n\n/**\n * A directive which renders the content of the DateRange Popup. To define the cell template, nest an\n * `` tag with the `kendoRangePopupTemplate` directive inside the component tag.\n */\nvar DateRangePopupTemplateDirective = /** @class */ (function () {\n function DateRangePopupTemplateDirective(templateRef) {\n this.templateRef = templateRef;\n }\n DateRangePopupTemplateDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoDateRangePopupTemplate]'\n },] },\n ];\n /** @nocollapse */\n DateRangePopupTemplateDirective.ctorParameters = function () { return [\n { type: TemplateRef }\n ]; };\n return DateRangePopupTemplateDirective;\n}());\n\nvar isActive = function (cmp) { return (cmp && cmp.isActive) || false; };\nvar hasActiveContent = function (popup) { return popup && popup.hasActiveContent(); };\n/**\n * A service that handles the communication between the components that are placed inside the DateRangeComponent.\n * For example, the start and end `DateInput` and `DateRangePopup` components.\n */\nvar DateRangeService = /** @class */ (function () {\n function DateRangeService() {\n /**\n * An Observable instance that notifies when the `activeRangeEnd` state is changed.\n */\n this.activeRangeEnd$ = new BehaviorSubject(null);\n /**\n * An Observable instance that notifies when the `focusedDate` is changed.\n */\n this.focusedDate$ = new BehaviorSubject(null);\n /**\n * An Observable instance that notifies when the end `DateInput` component is changed.\n * For example, when a new end `DateInput` is attached or when the old one is detached.\n */\n this.endInput$ = new BehaviorSubject(null);\n /**\n * An Observable instance that notifies when the start `DateInput` component is changed.\n * For example, when a new start `DateInput` is attached or the old one is detached.\n */\n this.startInput$ = new BehaviorSubject(null);\n /**\n * An Observable instance that notifies when the `DateRangePopup` component is changed.\n */\n this.dateRangePopup$ = new BehaviorSubject(null);\n /**\n * An Observable instance that notifies when the state of the selection range is changed.\n */\n this.range$ = new BehaviorSubject(EMPTY_SELECTIONRANGE);\n }\n Object.defineProperty(DateRangeService.prototype, \"activeRangeEnd\", {\n /**\n * Gets the current `activeRangeEnd` value.\n */\n get: function () {\n return this.activeRangeEnd$.value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateRangeService.prototype, \"focusedDate\", {\n /**\n * Gets the current `focusedDate` value.\n */\n get: function () {\n return this.focusedDate$.value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateRangeService.prototype, \"min\", {\n /**\n * Gets the `min` range value.\n * The `min` value is extracted from the `start` DateInput value or the `min` value of the Calendar.\n */\n get: function () {\n return (this.startInput$.value || {}).min || null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateRangeService.prototype, \"max\", {\n /**\n * Gets the `max` range value.\n * The `max` value is extracted from the `end` DateInput value or the `max` value of the Calendar.\n */\n get: function () {\n return (this.endInput$.value || {}).max || null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateRangeService.prototype, \"selectionRange\", {\n /**\n * Gets the current `selectionRange` value.\n */\n get: function () {\n return this.range$.value;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Activates the registered `DateRangePopup` component.\n * The method opens the popup and focuses the calendar.\n */\n DateRangeService.prototype.activatePopup = function () {\n var dateRangePopup = this.dateRangePopup$.value;\n if (!dateRangePopup) {\n return;\n }\n dateRangePopup.activate();\n };\n /**\n * Deactivates the registered `DateRangePopup` component.\n * The method closes the popup.\n */\n DateRangeService.prototype.deactivatePopup = function () {\n var dateRangePopup = this.dateRangePopup$.value;\n if (!(dateRangePopup && dateRangePopup.show)) {\n return;\n }\n dateRangePopup.show = false;\n };\n /**\n * @hidden\n *\n * Deactivates the registered `DateRangePopup` component and fires the `cancel` event.\n * The method closes the popup.\n */\n DateRangeService.prototype.cancelPopup = function () {\n var dateRangePopup = this.dateRangePopup$.value;\n if (!(dateRangePopup && dateRangePopup.show)) {\n return;\n }\n dateRangePopup.cancelPopup();\n };\n /**\n * Completes all observables to mitigate possible memory leaks.\n * Calls the method when a component that uses it is destroyed.\n */\n DateRangeService.prototype.destroy = function () {\n this.activeRangeEnd$.complete();\n this.dateRangePopup$.complete();\n this.focusedDate$.complete();\n this.endInput$.complete();\n this.startInput$.complete();\n this.range$.complete();\n };\n /**\n * Returns `true` when an active component that is placed inside the `DateRangeComponent` is detected.\n * For example, the opened popup or the focused DateInput.\n *\n * @returns `true` if an active component is present.\n */\n DateRangeService.prototype.hasActiveComponent = function () {\n var popup = this.dateRangePopup$.value;\n var isPopup = isActive(popup);\n var isStart = isActive(this.startInput$.value);\n var isEnd = isActive(this.endInput$.value);\n return isPopup || isStart || isEnd || hasActiveContent(popup) || false;\n };\n /**\n * Registers a new start `DateInput` component. Notifies all `startInput$` listeners.\n */\n DateRangeService.prototype.registerStartInput = function (startInput) {\n this.startInput$.next(startInput);\n };\n /**\n * Registers a new end `DateInput` component. Notifies all `endInput$` listeners.\n */\n DateRangeService.prototype.registerEndInput = function (endInput) {\n this.endInput$.next(endInput);\n };\n /**\n * Registers a new `DateRangePopup` component. Notifies all `dateRangePopup$` listeners.\n */\n DateRangeService.prototype.registerPopup = function (dateRangePopup) {\n this.dateRangePopup$.next(dateRangePopup);\n };\n /**\n * Updates the `activeRangeEnd` value. Notifies all `activeRangeEnd$` listeners.\n */\n DateRangeService.prototype.setActiveRangeEnd = function (activeRange) {\n if (!activeRange || this.activeRangeEnd === activeRange) {\n return;\n }\n this.activeRangeEnd$.next(activeRange);\n };\n /**\n * Updates the focused date. Notifies all `focusedDate$` listeners.\n */\n DateRangeService.prototype.setFocusedDate = function (value) {\n if (isEqual(this.focusedDate$.value, value)) {\n return;\n }\n this.focusedDate$.next(value);\n };\n /**\n * Updates the selection range. Notifies all `range$` listeners.\n */\n DateRangeService.prototype.setRange = function (range) {\n if (range === void 0) { range = EMPTY_SELECTIONRANGE; }\n this.range$.next(range);\n };\n DateRangeService.decorators = [\n { type: Injectable },\n ];\n return DateRangeService;\n}());\n\n/* tslint:disable:component-selector-name component-selector-type */\nvar DEFAULT_VIEWS_LENGTH = 2;\n/**\n * @hidden\n */\nvar HorizontalViewListComponent = /** @class */ (function () {\n function HorizontalViewListComponent(bus, cdr) {\n this.bus = bus;\n this.cdr = cdr;\n this.activeView = CalendarViewEnum.month;\n this.isActive = true;\n this.min = new Date(MIN_DATE);\n this.max = new Date(MAX_DATE);\n this.views = DEFAULT_VIEWS_LENGTH;\n this.valueChange = new EventEmitter();\n this.cellEnter = new EventEmitter();\n this.cellLeave = new EventEmitter();\n this.dates = [];\n }\n Object.defineProperty(HorizontalViewListComponent.prototype, \"weekNumber\", {\n get: function () {\n return this.showWeekNumbers && this.isMonthView();\n },\n set: function (showWeekNumbers) {\n this.showWeekNumbers = showWeekNumbers;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(HorizontalViewListComponent.prototype, \"getComponentClass\", {\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(HorizontalViewListComponent.prototype, \"getComponentMonthClass\", {\n get: function () {\n return this.activeView === CalendarViewEnum.month;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(HorizontalViewListComponent.prototype, \"getComponentYearClass\", {\n get: function () {\n return this.activeView === CalendarViewEnum.year;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(HorizontalViewListComponent.prototype, \"getComponentDecadeClass\", {\n get: function () {\n return this.activeView === CalendarViewEnum.decade;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(HorizontalViewListComponent.prototype, \"getComponentCenturyClass\", {\n get: function () {\n return this.activeView === CalendarViewEnum.century;\n },\n enumerable: true,\n configurable: true\n });\n HorizontalViewListComponent.prototype.ngOnChanges = function (changes) {\n this.initService();\n if (!this.service) {\n return;\n }\n this.views = this.views || DEFAULT_VIEWS_LENGTH;\n var focusedDate = this.focusedDate;\n var viewDate = this.clampDate(this.service.viewDate(focusedDate, this.max, this.views));\n this.skip = this.service.skip(viewDate, this.min);\n this.total = this.service.total(this.min, this.max);\n var activeViewChanged = hasChange(changes, 'activeView');\n var viewsHasChanged = this.views > 0 && hasChange(changes, 'views');\n if (activeViewChanged || !this.isInDates(focusedDate) || viewsHasChanged || !this.activeDate) {\n this.dates = this.service.datesList(viewDate, this.getTake(this.skip));\n this.activeDate = cloneDate(this.dates[0]);\n }\n };\n HorizontalViewListComponent.prototype.initService = function () {\n this.service = this.bus.service(this.activeView);\n };\n HorizontalViewListComponent.prototype.handleDateChange = function (candidate) {\n this.valueChange.emit(candidate);\n };\n HorizontalViewListComponent.prototype.isMonthView = function () {\n return this.activeView === CalendarViewEnum.month;\n };\n HorizontalViewListComponent.prototype.navigate = function (action) {\n var candidate = this.move(action);\n var list = this.service.datesList(candidate, this.getTake(this.skip));\n if (this.isListInRange(list)) {\n this.dates = list;\n }\n this.activeDate = cloneDate(this.dates[0]);\n this.focusedDate = cloneDate(candidate);\n this.cdr.markForCheck();\n return cloneDate(candidate);\n };\n HorizontalViewListComponent.prototype.canNavigate = function (action) {\n if (!this.service) {\n return false;\n }\n return this.isListInRange(this.service.datesList(this.move(action), this.getTake(this.skip)));\n };\n HorizontalViewListComponent.prototype.clampDate = function (value) {\n return dateInRange(value, this.min, this.max);\n };\n HorizontalViewListComponent.prototype.move = function (action) {\n return this.service.move(this.dates[0] || this.focusedDate, action);\n };\n HorizontalViewListComponent.prototype.isListInRange = function (list) {\n var lowerBound = this.service.beginningOfPeriod(this.min);\n var upperBound = this.service.beginningOfPeriod(this.service.addToDate(this.max, 1));\n return lowerBound <= list[0] && list[list.length - 1] < upperBound;\n };\n HorizontalViewListComponent.prototype.isInDates = function (value) {\n return this.service.isInArray(value, this.dates);\n };\n HorizontalViewListComponent.prototype.getTake = function (skip) {\n return Math.min(this.total - skip, this.views);\n };\n HorizontalViewListComponent.decorators = [\n { type: Component, args: [{\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'kendo-calendar-horizontal',\n template: \"\\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n HorizontalViewListComponent.ctorParameters = function () { return [\n { type: BusViewService },\n { type: ChangeDetectorRef }\n ]; };\n HorizontalViewListComponent.propDecorators = {\n cellTemplateRef: [{ type: Input }],\n weekNumberTemplateRef: [{ type: Input }],\n headerTitleTemplateRef: [{ type: Input }],\n activeRangeEnd: [{ type: Input }],\n activeView: [{ type: Input }],\n cellUID: [{ type: Input }],\n focusedDate: [{ type: Input }],\n isActive: [{ type: Input }],\n min: [{ type: Input }],\n max: [{ type: Input }],\n selectionRange: [{ type: Input }],\n value: [{ type: Input }],\n views: [{ type: Input }],\n weekNumber: [{ type: Input }],\n valueChange: [{ type: Output }],\n cellEnter: [{ type: Output }],\n cellLeave: [{ type: Output }],\n getComponentClass: [{ type: HostBinding, args: [\"class.k-calendar-view\",] }],\n getComponentMonthClass: [{ type: HostBinding, args: [\"class.k-calendar-monthview\",] }],\n getComponentYearClass: [{ type: HostBinding, args: [\"class.k-calendar-yearview\",] }],\n getComponentDecadeClass: [{ type: HostBinding, args: [\"class.k-calendar-decadeview\",] }],\n getComponentCenturyClass: [{ type: HostBinding, args: [\"class.k-calendar-centuryview\",] }]\n };\n return HorizontalViewListComponent;\n}());\n\nvar noop$2 = function () { return null; };\n/**\n * @hidden\n */\nvar disabledDatesRangeValidator = function (isDateDisabled) {\n if (!isPresent(isDateDisabled)) {\n return noop$2;\n }\n return function (selectedRange) {\n var isRangeComplete = isPresent(selectedRange) && isPresent(selectedRange.start) && isPresent(selectedRange.end);\n if (!isRangeComplete || selectedRange.start > selectedRange.end) {\n return null;\n }\n var disabledDates = disabledDatesInRange(selectedRange.start, selectedRange.end, isDateDisabled);\n var error = {\n disabledDatesInRange: disabledDates\n };\n return disabledDates.length ? error : null;\n };\n};\n\n/* tslint:disable:no-forward-ref */\nvar BOTTOM_VIEW_DOC_LINK$1 = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-bottomview';\nvar TOP_VIEW_DOC_LINK$1 = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-topview';\nvar MIN_DOC_LINK$3 = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-min';\nvar MAX_DOC_LINK$3 = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-max';\nvar VALUE_DOC_LINK$5 = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/calendar/#toc-using-with-json';\n/**\n * @hidden\n */\nvar RANGE_CALENDAR_VALUE_ACCESSOR = {\n multi: true,\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(function () { return MultiViewCalendarComponent; }) //tslint:disable-line:no-use-before-declare\n};\n/**\n * @hidden\n */\nvar RANGE_CALENDAR_RANGE_VALIDATORS = {\n multi: true,\n provide: NG_VALIDATORS,\n useExisting: forwardRef(function () { return MultiViewCalendarComponent; }) //tslint:disable-line:no-use-before-declare\n};\n/**\n * Represents the Kendo UI MultiViewCalendar component for Angular.\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * `\n * })\n * class AppComponent { }\n * ```\n */\nvar MultiViewCalendarComponent = /** @class */ (function () {\n function MultiViewCalendarComponent(bus, element, localization, navigator, renderer, cdr, zone, disabledDatesService) {\n this.bus = bus;\n this.element = element;\n this.localization = localization;\n this.navigator = navigator;\n this.renderer = renderer;\n this.cdr = cdr;\n this.zone = zone;\n this.disabledDatesService = disabledDatesService;\n /**\n * @hidden\n */\n this.id = guid();\n /**\n * Determines whether the built-in min or max validators are enforced when validating a form.\n */\n this.rangeValidation = false;\n /**\n * Determines whether the built-in validator for disabled\n * date ranges is enforced when validating a form\n * ([see example]({% slug disabled_dates_multiviewcalendar %}#toc-validation)).\n */\n this.disabledDatesRangeValidation = false;\n /**\n * Sets or gets the `disabled` property of the Calendar and\n * determines whether the component is active\n * ([see example]({% slug disabled_multiviewcalendar %})).\n */\n this.disabled = false;\n /**\n * Sets or gets the `tabindex` property of the Calendar. Based on the\n * [HTML `tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) behavior,\n * it determines whether the component is focusable.\n */\n this.tabindex = 0;\n /**\n * Defines the active view that the Calendar initially renders\n * ([see example]({% slug activeview_multiviewcalendar %})).\n * By default, the active view is `month`.\n *\n * > You have to set `activeView` within the `topView`-`bottomView` range.\n */\n this.activeView = CalendarViewEnum[CalendarViewEnum.month];\n /**\n * Defines the bottommost view, to which the user can navigate\n * ([see example]({% slug dates_multiviewcalendar %}#toc-partial-dates)).\n */\n this.bottomView = CalendarViewEnum[CalendarViewEnum.month];\n /**\n * Defines the topmost view, to which the user can navigate.\n */\n this.topView = CalendarViewEnum[CalendarViewEnum.century];\n /**\n * Determines whether to display a week number column in the `month` view\n * ([see example]({% slug weeknumcolumn_multiviewcalendar %})).\n */\n this.weekNumber = false;\n /**\n * Sets or gets the `views` property of the Calendar and\n * defines the number of rendered months.\n */\n this.views = 2;\n /**\n * Fires when the active view is changed\n * ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).\n */\n this.activeViewChange = new EventEmitter();\n /**\n * Fires when a view cell is entered\n * ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).\n */\n this.cellEnter = new EventEmitter();\n /**\n * Fires when a view cell is leaved\n * ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).\n */\n this.cellLeave = new EventEmitter();\n /**\n * Fires when the value is changed\n * ([more information and example]({% slug overview_multiviewcalendar %}#toc-events)).\n */\n this.valueChange = new EventEmitter();\n this.cellUID = guid();\n this.isActive = false;\n this.isHovered = false;\n this.isPrevDisabled = true;\n this.isNextDisabled = true;\n this.prevView = Action.PrevView;\n this.nextView = Action.NextView;\n this._min = new Date(MIN_DATE);\n this._max = new Date(MAX_DATE);\n this._focusedDate = getToday();\n this.resolvedPromise = Promise.resolve();\n this.onControlChange = noop;\n this.onControlTouched = noop;\n this.onValidatorChange = noop;\n this.minValidateFn = noop;\n this.maxValidateFn = noop;\n this.disabledDatesRangeValidateFn = noop;\n this.subscriptions = new Subscription(function () { });\n this.setClasses(element.nativeElement);\n }\n Object.defineProperty(MultiViewCalendarComponent.prototype, \"focusedDate\", {\n get: function () {\n return this._focusedDate;\n },\n /**\n * Sets or gets the `focusedDate` property of the Calendar and\n * defines the focused date of the component\n * ([see example]({% slug dates_multiviewcalendar %}#toc-focused-dates)).\n *\n * > If the Calendar is out of the min or max range, it normalizes the defined `focusedDate`.\n */\n set: function (focusedDate) {\n this._focusedDate = focusedDate || getToday();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MultiViewCalendarComponent.prototype, \"min\", {\n get: function () {\n return this._min;\n },\n /**\n * Sets or gets the `min` property of the Calendar and\n * defines the minimum allowed date value.\n * By default, the `min` value is `1900-1-1`.\n */\n set: function (min) {\n this._min = min || new Date(MIN_DATE);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MultiViewCalendarComponent.prototype, \"max\", {\n get: function () {\n return this._max;\n },\n /**\n * Sets or gets the `max` property of the Calendar and\n * defines the maximum allowed date value.\n * By default, the `max` value is `2099-12-31`.\n */\n set: function (max) {\n this._max = max || new Date(MAX_DATE);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MultiViewCalendarComponent.prototype, \"value\", {\n /**\n * Sets or gets the `value` property of the Calendar and defines the selected value of the component.\n *\n * > The `value` has to be a valid\n * [JavaScript `Date`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date) instance.\n */\n get: function () {\n return this._value;\n },\n set: function (candidate) {\n this.verifyValue(candidate);\n this._value = cloneDate(candidate);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MultiViewCalendarComponent.prototype, \"tabIndex\", {\n get: function () {\n return this.tabindex;\n },\n /**\n * @hidden\n */\n set: function (tabIndex) {\n this.tabindex = tabIndex;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MultiViewCalendarComponent.prototype, \"disabledDates\", {\n /**\n * Sets the dates of the MultiViewCalendar that will be disabled\n * ([see example]({% slug disabled_dates_multiviewcalendar %})).\n */\n set: function (value) {\n this.disabledDatesService.initialize(value);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MultiViewCalendarComponent.prototype, \"selectionRange\", {\n get: function () {\n return this._selectionRange;\n },\n /**\n * Sets or gets the `selectionRange` property of the Calendar and\n * defines the selection range of the component\n * ([see example]({% slug dates_multiviewcalendar %}#toc-selection-range)).\n */\n set: function (range$$1) {\n this._selectionRange = range$$1;\n if (this.disabledDatesRangeValidation) {\n this.onValidatorChange();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MultiViewCalendarComponent.prototype, \"cellTemplateRef\", {\n /**\n * @hidden\n */\n set: function (template) {\n this.cellTemplate = template;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MultiViewCalendarComponent.prototype, \"monthCellTemplateRef\", {\n /**\n * @hidden\n */\n set: function (template) {\n this.monthCellTemplate = template;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MultiViewCalendarComponent.prototype, \"yearCellTemplateRef\", {\n /**\n * @hidden\n */\n set: function (template) {\n this.yearCellTemplate = template;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MultiViewCalendarComponent.prototype, \"decadeCellTemplateRef\", {\n /**\n * @hidden\n */\n set: function (template) {\n this.decadeCellTemplate = template;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MultiViewCalendarComponent.prototype, \"centuryCellTemplateRef\", {\n /**\n * @hidden\n */\n set: function (template) {\n this.centuryCellTemplate = template;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MultiViewCalendarComponent.prototype, \"weekNumberTemplateRef\", {\n /**\n * @hidden\n */\n set: function (template) {\n this.weekNumberTemplate = template;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MultiViewCalendarComponent.prototype, \"headerTitleTemplateRef\", {\n /**\n * @hidden\n */\n set: function (template) {\n this.headerTitleTemplate = template;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MultiViewCalendarComponent.prototype, \"activeViewEnum\", {\n get: function () {\n var activeView = CalendarViewEnum[this.activeView];\n return activeView < this.bottomViewEnum ? this.bottomViewEnum : activeView;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MultiViewCalendarComponent.prototype, \"bottomViewEnum\", {\n get: function () {\n return CalendarViewEnum[this.bottomView];\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MultiViewCalendarComponent.prototype, \"topViewEnum\", {\n get: function () {\n return CalendarViewEnum[this.topView];\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MultiViewCalendarComponent.prototype, \"widgetId\", {\n get: function () {\n return this.id;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MultiViewCalendarComponent.prototype, \"widgetRole\", {\n get: function () {\n return 'grid';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MultiViewCalendarComponent.prototype, \"calendarTabIndex\", {\n get: function () {\n return this.disabled ? undefined : this.tabIndex;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MultiViewCalendarComponent.prototype, \"ariaDisabled\", {\n get: function () {\n return this.disabled;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MultiViewCalendarComponent.prototype, \"ariaActivedescendant\", {\n get: function () {\n return this.cellUID + this.focusedDate.getTime();\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n */\n MultiViewCalendarComponent.prototype.handleBlur = function () {\n this.onControlTouched();\n this.isActive = false;\n this.isHovered = false; //ensure that hovered is also not active\n };\n /**\n * @hidden\n */\n MultiViewCalendarComponent.prototype.handleFocus = function () {\n this.isActive = true;\n };\n /**\n * @hidden\n */\n MultiViewCalendarComponent.prototype.handleMouseEnter = function () {\n this.isHovered = true;\n };\n /**\n * @hidden\n */\n MultiViewCalendarComponent.prototype.handleMouseLeave = function () {\n this.isHovered = false;\n };\n /**\n * @hidden\n */\n MultiViewCalendarComponent.prototype.handleMousedown = function (event) {\n event.preventDefault();\n };\n /**\n * @hidden\n */\n MultiViewCalendarComponent.prototype.handleClick = function () {\n if (this.isActive) {\n return;\n }\n this.focus();\n };\n /**\n * @hidden\n */\n MultiViewCalendarComponent.prototype.keydown = function (event) {\n var candidate = dateInRange(this.navigator.move(this.focusedDate, this.navigator.action(event), this.activeViewEnum), this.min, this.max);\n if (isEqual(this.focusedDate, candidate)) {\n return;\n }\n this.focusedDate = candidate;\n event.preventDefault();\n };\n /**\n * @hidden\n */\n MultiViewCalendarComponent.prototype.enter = function () {\n this.handleDateChange(this.focusedDate);\n };\n MultiViewCalendarComponent.prototype.ngOnInit = function () {\n var _this = this;\n this.setMessages();\n this.subscriptions.add(this.localization.changes.subscribe(function () { return _this.setMessages(); }));\n this.subscriptions.add(this.bus.viewChanged.subscribe(function (_a) {\n var view = _a.view;\n _this.activeView = CalendarViewEnum[view];\n _this.activeViewChange.emit(_this.activeView);\n _this.cdr.detectChanges();\n _this.updateButtonState();\n }));\n };\n MultiViewCalendarComponent.prototype.ngOnChanges = function (changes) {\n this.verifyChanges();\n this.bus.configure(this.bottomViewEnum, this.topViewEnum);\n var useValue = hasExistingValue(changes, 'value') && !hasExistingValue(changes, 'focusedDate');\n var focusedDate = dateInRange(cloneDate(useValue ? this.value : this.focusedDate), this.min, this.max);\n this.focusedDate = !isEqual(this.focusedDate, focusedDate) ? focusedDate : this.focusedDate;\n if (changes.min || changes.max || changes.rangeValidation || changes.disabledDates || changes.disabledDatesRangeValidation) {\n this.minValidateFn = this.rangeValidation ? minValidator(this.min) : noop;\n this.maxValidateFn = this.rangeValidation ? maxValidator(this.max) : noop;\n this.disabledDatesRangeValidateFn = this.disabledDatesRangeValidation ? disabledDatesRangeValidator(this.disabledDatesService.isDateDisabled) : noop;\n this.onValidatorChange();\n }\n if (changes.min || changes.max || changes.focusedDate || changes.activeView) {\n this.updateButtonState();\n }\n };\n MultiViewCalendarComponent.prototype.ngOnDestroy = function () {\n clearTimeout(this.messagesTimeout);\n this.subscriptions.unsubscribe();\n };\n MultiViewCalendarComponent.prototype.ngAfterViewInit = function () {\n this.updateButtonState();\n };\n /**\n * Focuses the host element of the Calendar.\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * `\n * })\n * class AppComponent { }\n * ```\n */\n MultiViewCalendarComponent.prototype.focus = function () {\n if (!this.element) {\n return;\n }\n this.element.nativeElement.focus();\n };\n /**\n * Blurs the Calendar component.\n */\n MultiViewCalendarComponent.prototype.blur = function () {\n if (!this.element) {\n return;\n }\n this.element.nativeElement.blur();\n };\n /**\n * @hidden\n */\n MultiViewCalendarComponent.prototype.handleDateChange = function (candidate) {\n var canNavigateDown = this.bus.canMoveDown(this.activeViewEnum);\n var isSameDate = !canNavigateDown && isEqual(candidate, this.value);\n this.focusedDate = cloneDate(candidate) || this.focusedDate;\n if (this.disabled || isSameDate) {\n return;\n }\n if (canNavigateDown) {\n this.bus.moveDown(this.activeViewEnum);\n return;\n }\n if (!this.disabledDatesService.isDateDisabled(candidate)) {\n this.value = cloneDate(candidate);\n this.onControlChange(cloneDate(candidate));\n this.valueChange.emit(cloneDate(candidate));\n }\n };\n /**\n * @hidden\n */\n MultiViewCalendarComponent.prototype.writeValue = function (candidate) {\n this.verifyValue(candidate);\n this.focusedDate = dateInRange(cloneDate(candidate) || this.focusedDate, this.min, this.max);\n this.value = cloneDate(candidate);\n this.cdr.markForCheck();\n };\n /**\n * @hidden\n */\n MultiViewCalendarComponent.prototype.registerOnChange = function (fn) {\n this.onControlChange = fn;\n };\n /**\n * @hidden\n */\n MultiViewCalendarComponent.prototype.registerOnTouched = function (fn) {\n this.onControlTouched = fn;\n };\n /**\n * @hidden\n */\n MultiViewCalendarComponent.prototype.setDisabledState = function (isDisabled) {\n this.disabled = isDisabled;\n this.cdr.markForCheck();\n };\n /**\n * @hidden\n */\n MultiViewCalendarComponent.prototype.validate = function (control) {\n return this.minValidateFn(control) || this.maxValidateFn(control) || this.disabledDatesRangeValidateFn(this.selectionRange);\n };\n /**\n * @hidden\n */\n MultiViewCalendarComponent.prototype.registerOnValidatorChange = function (fn) {\n this.onValidatorChange = fn;\n };\n /**\n * @hidden\n */\n MultiViewCalendarComponent.prototype.activeCellTemplate = function () {\n switch (this.activeViewEnum) {\n case CalendarViewEnum.month:\n return this.monthCellTemplate || this.cellTemplate;\n case CalendarViewEnum.year:\n return this.yearCellTemplate;\n case CalendarViewEnum.decade:\n return this.decadeCellTemplate;\n case CalendarViewEnum.century:\n return this.centuryCellTemplate;\n default:\n return null;\n }\n };\n /**\n * @hidden\n */\n MultiViewCalendarComponent.prototype.navigate = function (action) {\n this.focusedDate = this.viewList.navigate(action);\n this.updateButtonState();\n };\n /**\n * @hidden\n */\n MultiViewCalendarComponent.prototype.emitCellEvent = function (emitter, args) {\n if (hasObservers(emitter)) {\n this.zone.run(function () {\n emitter.emit(args);\n });\n }\n };\n MultiViewCalendarComponent.prototype.setClasses = function (element) {\n this.renderer.addClass(element, 'k-widget');\n this.renderer.addClass(element, 'k-calendar');\n this.renderer.addClass(element, 'k-calendar-infinite');\n this.renderer.addClass(element, 'k-calendar-range');\n };\n MultiViewCalendarComponent.prototype.setMessages = function () {\n var _this = this;\n this.zone.runOutsideAngular(function () {\n clearTimeout(_this.messagesTimeout);\n _this.messagesTimeout = setTimeout(function () {\n _this.prevButtonTitle = _this.localization.get('prevButtonTitle');\n _this.nextButtonTitle = _this.localization.get('nextButtonTitle');\n _this.cdr.detectChanges();\n });\n });\n };\n MultiViewCalendarComponent.prototype.verifyChanges = function () {\n if (!isDevMode()) {\n return;\n }\n if (this.min > this.max) {\n throw new Error(\"The max value should be bigger than the min. See \" + MIN_DOC_LINK$3 + \" and \" + MAX_DOC_LINK$3 + \".\");\n }\n if (this.bottomViewEnum > this.topViewEnum) {\n throw new Error(\"The topView should be greater than bottomView. See \" + BOTTOM_VIEW_DOC_LINK$1 + \" and \" + TOP_VIEW_DOC_LINK$1 + \".\");\n }\n };\n MultiViewCalendarComponent.prototype.verifyValue = function (candidate) {\n if (!isDevMode()) {\n return;\n }\n if (candidate && !(candidate instanceof Date)) {\n throw new Error(\"The 'value' should be a valid JavaScript Date instance. Check \" + VALUE_DOC_LINK$5 + \" for possible resolution.\");\n }\n };\n MultiViewCalendarComponent.prototype.updateButtonState = function () {\n var _this = this;\n this.resolvedPromise.then(function () {\n _this.isPrevDisabled = !_this.viewList.canNavigate(_this.prevView);\n _this.isNextDisabled = !_this.viewList.canNavigate(_this.nextView);\n _this.cdr.markForCheck();\n });\n };\n MultiViewCalendarComponent.decorators = [\n { type: Component, args: [{\n changeDetection: ChangeDetectionStrategy.OnPush,\n exportAs: 'kendo-multiviewcalendar',\n providers: [\n BusViewService,\n RANGE_CALENDAR_VALUE_ACCESSOR,\n RANGE_CALENDAR_RANGE_VALIDATORS,\n LocalizationService,\n DisabledDatesService,\n {\n provide: L10N_PREFIX,\n useValue: 'kendo.multiviewcalendar'\n },\n NavigationService\n ],\n selector: 'kendo-multiviewcalendar',\n template: \"\\n \\n \\n \\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n MultiViewCalendarComponent.ctorParameters = function () { return [\n { type: BusViewService },\n { type: ElementRef },\n { type: LocalizationService },\n { type: NavigationService },\n { type: Renderer2 },\n { type: ChangeDetectorRef },\n { type: NgZone },\n { type: DisabledDatesService }\n ]; };\n MultiViewCalendarComponent.propDecorators = {\n id: [{ type: Input }],\n focusedDate: [{ type: Input }],\n min: [{ type: Input }],\n max: [{ type: Input }],\n rangeValidation: [{ type: Input }],\n disabledDatesRangeValidation: [{ type: Input }],\n value: [{ type: Input }],\n disabled: [{ type: Input }],\n tabindex: [{ type: Input }],\n tabIndex: [{ type: Input }],\n disabledDates: [{ type: Input }],\n activeView: [{ type: Input }],\n bottomView: [{ type: Input }],\n topView: [{ type: Input }],\n weekNumber: [{ type: Input }],\n activeRangeEnd: [{ type: Input }],\n selectionRange: [{ type: Input }],\n views: [{ type: Input }],\n activeViewChange: [{ type: Output }],\n cellEnter: [{ type: Output }],\n cellLeave: [{ type: Output }],\n valueChange: [{ type: Output }],\n cellTemplate: [{ type: ContentChild, args: [CellTemplateDirective, { static: true },] }],\n cellTemplateRef: [{ type: Input, args: ['cellTemplate',] }],\n monthCellTemplate: [{ type: ContentChild, args: [MonthCellTemplateDirective, { static: true },] }],\n monthCellTemplateRef: [{ type: Input, args: ['monthCellTemplate',] }],\n yearCellTemplate: [{ type: ContentChild, args: [YearCellTemplateDirective, { static: true },] }],\n yearCellTemplateRef: [{ type: Input, args: ['yearCellTemplate',] }],\n decadeCellTemplate: [{ type: ContentChild, args: [DecadeCellTemplateDirective, { static: true },] }],\n decadeCellTemplateRef: [{ type: Input, args: ['decadeCellTemplate',] }],\n centuryCellTemplate: [{ type: ContentChild, args: [CenturyCellTemplateDirective, { static: true },] }],\n centuryCellTemplateRef: [{ type: Input, args: ['centuryCellTemplate',] }],\n weekNumberTemplate: [{ type: ContentChild, args: [WeekNumberCellTemplateDirective, { static: true },] }],\n weekNumberTemplateRef: [{ type: Input, args: ['weekNumberTemplate',] }],\n headerTitleTemplate: [{ type: ContentChild, args: [HeaderTitleTemplateDirective, { static: true },] }],\n headerTitleTemplateRef: [{ type: Input, args: ['headerTitleTemplate',] }],\n viewList: [{ type: ViewChild, args: [HorizontalViewListComponent,] }],\n widgetId: [{ type: HostBinding, args: ['attr.id',] }],\n widgetRole: [{ type: HostBinding, args: ['attr.role',] }],\n calendarTabIndex: [{ type: HostBinding, args: ['attr.tabindex',] }],\n ariaDisabled: [{ type: HostBinding, args: ['attr.aria-disabled',] }, { type: HostBinding, args: ['class.k-state-disabled',] }],\n ariaActivedescendant: [{ type: HostBinding, args: ['attr.aria-activedescendant',] }],\n handleBlur: [{ type: HostListener, args: [\"blur\",] }],\n handleFocus: [{ type: HostListener, args: [\"focus\",] }],\n handleMouseEnter: [{ type: HostListener, args: [\"mouseenter\",] }],\n handleMouseLeave: [{ type: HostListener, args: [\"mouseleave\",] }],\n handleMousedown: [{ type: HostListener, args: [\"mousedown\", ['$event'],] }],\n handleClick: [{ type: HostListener, args: [\"click\",] }],\n keydown: [{ type: HostListener, args: [\"keydown\", [\"$event\"],] }],\n enter: [{ type: HostListener, args: [\"keydown.enter\",] }]\n };\n return MultiViewCalendarComponent;\n}());\n\n/**\n * Represents the Kendo UI DateRangePopup component for Angular.\n *\n * @example\n * ```ts\n * import { DateInputsModule, DateRangeService } from '@progress/kendo-angular-dateinputs';\n *\n * _@Component({\n * providers: [DateRangeService],\n * selector: 'my-app',\n * template: `\n * \n * \n * `\n * })\n * class AppComponent {\n * }\n * ```\n */\nvar DateRangePopupComponent = /** @class */ (function () {\n function DateRangePopupComponent(popupService, dateRangeService, zone, rtl) {\n this.popupService = popupService;\n this.dateRangeService = dateRangeService;\n this.zone = zone;\n this.rtl = rtl;\n /**\n * Controls the popup animation.\n * By default, the opening and closing animations are enabled.\n * For more information about controlling the popup animations,\n * refer to the article on [animations]({% slug animations_popup %}).\n */\n this.animate = true;\n /**\n * Configures the collision behavior of the popup.\n * For more information, refer to the article on\n * [viewport boundary detection]({% slug viewportboundarydetection_popup %}).\n */\n this.collision = { horizontal: 'fit', vertical: 'flip' };\n /**\n * Fires each time the popup is about to open.\n * This event is preventable. If you cancel the event, the popup will remain closed.\n * For more information, refer to the section on\n * [events]({% slug overview_datepicker %}#toc-events).\n */\n this.open = new EventEmitter();\n /**\n * Fires each time the popup is about to close.\n * This event is preventable. If you cancel the event, the popup will remain open.\n * For more information, refer to the section on\n * [events]({% slug overview_datepicker %}#toc-events).\n */\n this.close = new EventEmitter();\n /**\n * Fires each time the calendar element is blurred.\n */\n this.onBlur = new EventEmitter(); //tslint:disable-line:no-output-rename\n /**\n * Fires each time the calendar element is focused.\n */\n this.onFocus = new EventEmitter(); //tslint:disable-line:no-output-rename\n /**\n * Fires each time the popup is closed either on `ESC` keypress or on leaving the viewport.\n */\n this.cancel = new EventEmitter();\n /**\n * @hidden\n */\n this.popupUID = guid();\n this.calendarSubscriptions = new Subscription(function () { });\n this.popupSubscriptions = new Subscription(function () { });\n this.resolvedPromise = Promise.resolve();\n }\n Object.defineProperty(DateRangePopupComponent.prototype, \"calendar\", {\n /**\n * The active calendar that is visible in the popup.\n *\n * > When the popup is closed, the property returns `null`.\n */\n get: function () {\n return this._calendar;\n },\n set: function (calendar) {\n this._calendar = calendar;\n this.subscribeFocusBlur(calendar);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateRangePopupComponent.prototype, \"isActive\", {\n /**\n * Gets the active state of the component.\n * When the opened calendar is active, returns `true`.\n */\n get: function () {\n return this.calendar && this.calendar.isActive;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateRangePopupComponent.prototype, \"show\", {\n get: function () {\n return this._show;\n },\n /**\n * Gets or sets the visibility state of the component.\n */\n set: function (show) {\n var event = new PreventableEvent();\n if (this._show === show) {\n return;\n }\n if (!this._show && show) {\n this.open.emit(event);\n }\n else if (this._show && !show) {\n this.close.emit(event);\n }\n if (event.isDefaultPrevented()) {\n return;\n }\n this._toggle(show);\n },\n enumerable: true,\n configurable: true\n });\n DateRangePopupComponent.prototype.ngOnInit = function () {\n this.dateRangeService.registerPopup(this);\n };\n DateRangePopupComponent.prototype.ngAfterViewInit = function () {\n var _this = this;\n this.calendarSubscriptions.add(this.contentCalendar.changes.subscribe(function (changes) { return _this.calendar = changes.first; }));\n this.calendarSubscriptions.add(this.viewCalendar.changes.subscribe(function (changes) { return _this.calendar = changes.first; }));\n if (isWindowAvailable()) {\n this.zone.runOutsideAngular(function () {\n return _this.windowBlurSubscription = fromEvent(window, 'blur').subscribe(_this.handleWindowBlur.bind(_this));\n });\n }\n };\n DateRangePopupComponent.prototype.ngOnDestroy = function () {\n this.popupSubscriptions.unsubscribe();\n this.calendarSubscriptions.unsubscribe();\n if (this.activateSubscription) {\n this.activateSubscription.unsubscribe();\n }\n if (this.blurSubscription) {\n this.blurSubscription.unsubscribe();\n this.focusSubscription.unsubscribe();\n }\n if (this.windowBlurSubscription) {\n this.windowBlurSubscription.unsubscribe();\n }\n };\n /**\n * Opens the popup component and focuses the calendar.\n */\n DateRangePopupComponent.prototype.activate = function () {\n var _this = this;\n if (this.show === true) {\n return;\n }\n if (this.activateSubscription) {\n this.activateSubscription.unsubscribe();\n }\n this.show = true;\n this.zone.runOutsideAngular(function () {\n _this.activateSubscription = merge(_this.contentCalendar.changes, _this.viewCalendar.changes)\n .pipe(filter(function (changes) { return changes && changes.first; }), map(function (changes) { return changes.first; }))\n .subscribe(function (calendar) { return setTimeout(function () { return calendar.focus(); }); });\n });\n };\n /**\n * Focuses the calendar (if available).\n */\n DateRangePopupComponent.prototype.focus = function () {\n if (this.calendar) {\n this.calendar.focus();\n }\n };\n /**\n * Checks if a focused element ids placed inside the popup.\n *\n * @return boolean;\n */\n DateRangePopupComponent.prototype.hasActiveContent = function () {\n if (!isDocumentAvailable() || !this.popupRef) {\n return false;\n }\n return this.popupRef.popupElement.contains(document.activeElement);\n };\n /**\n * Toggles the visibility of the popup.\n * If you use the `toggle` method to show or hide the popup,\n * the `open` and `close` events do not fire.\n *\n * @param show The state of the popup.\n */\n DateRangePopupComponent.prototype.toggle = function (show) {\n var _this = this;\n this.resolvedPromise.then(function () {\n _this._toggle((show === undefined) ? !_this.show : show);\n });\n };\n /**\n * @hidden\n *\n * Closes the popup and triggers the `cancel` event.\n */\n DateRangePopupComponent.prototype.cancelPopup = function () {\n this.show = false;\n this.cancel.emit();\n };\n DateRangePopupComponent.prototype.handleWindowBlur = function () {\n var _this = this;\n if (!this.show) {\n return;\n }\n if (hasObservers(this.close)) {\n this.zone.run(function () { return _this.show = false; });\n }\n else {\n this.show = false;\n }\n };\n DateRangePopupComponent.prototype.handleMouseLeave = function () {\n this.dateRangeService.setRange(this.dateRangeService.selectionRange);\n };\n DateRangePopupComponent.prototype.handleKeydown = function (event) {\n var _this = this;\n var altKey = event.altKey, keyCode = event.keyCode;\n if (keyCode === Keys.Escape || (altKey && keyCode === Keys.ArrowUp)) {\n this.zone.run(function () { return _this.cancelPopup(); });\n }\n };\n DateRangePopupComponent.prototype.subscribeFocusBlur = function (calendar) {\n var _this = this;\n if (this.blurSubscription) {\n this.blurSubscription.unsubscribe();\n this.focusSubscription.unsubscribe();\n }\n if (!calendar) {\n return;\n }\n var nativeElement = calendar.element.nativeElement;\n this.blurSubscription = fromEvent(nativeElement, 'blur').subscribe(function () { return _this.onBlur.emit(); });\n this.focusSubscription = fromEvent(nativeElement, 'focus').subscribe(function () { return _this.onFocus.emit(); });\n };\n DateRangePopupComponent.prototype.addPopupSubscriptions = function () {\n var _this = this;\n var subscriptions = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n subscriptions[_i] = arguments[_i];\n }\n subscriptions.map(function (s) { return _this.popupSubscriptions.add(s); });\n };\n Object.defineProperty(DateRangePopupComponent.prototype, \"_appendTo\", {\n get: function () {\n var appendTo = this.appendTo;\n if (!appendTo || appendTo === 'root') {\n return undefined;\n }\n return appendTo === 'component' ? this.container : appendTo;\n },\n enumerable: true,\n configurable: true\n });\n DateRangePopupComponent.prototype._toggle = function (show) {\n var _this = this;\n this._show = show;\n if (this.popupRef) {\n this.popupRef.close();\n this.popupRef = null;\n this.popupSubscriptions.unsubscribe();\n this.popupSubscriptions = new Subscription(function () { });\n }\n if (this._show) {\n var direction = this.rtl ? 'right' : 'left';\n this.popupRef = this.popupService.open({\n anchor: this.anchor,\n anchorAlign: this.anchorAlign || { vertical: 'bottom', horizontal: direction },\n animate: this.animate,\n appendTo: this._appendTo,\n collision: this.collision,\n content: (this.contentTemplate || {}).templateRef || this.defaultTemplate,\n margin: this.margin,\n popupAlign: this.popupAlign || { vertical: 'top', horizontal: direction },\n positionMode: 'absolute'\n });\n var _a = this.popupRef, popupElement_1 = _a.popupElement, popupAnchorViewportLeave = _a.popupAnchorViewportLeave;\n popupElement_1.setAttribute('id', this.popupUID);\n this.addPopupSubscriptions(this.zone.runOutsideAngular(function () { return fromEvent(popupElement_1, 'keydown').subscribe(_this.handleKeydown.bind(_this)); }), fromEvent(popupElement_1, 'mouseleave').subscribe(this.handleMouseLeave.bind(this)), popupAnchorViewportLeave.subscribe(function () { return _this.cancelPopup(); }));\n }\n };\n DateRangePopupComponent.decorators = [\n { type: Component, args: [{\n exportAs: 'kendo-daterange-popup',\n selector: 'kendo-daterange-popup',\n template: \"\\n \\n \\n \\n \\n \"\n },] },\n ];\n /** @nocollapse */\n DateRangePopupComponent.ctorParameters = function () { return [\n { type: PopupService },\n { type: DateRangeService },\n { type: NgZone },\n { type: Boolean, decorators: [{ type: Optional }, { type: Inject, args: [RTL,] }] }\n ]; };\n DateRangePopupComponent.propDecorators = {\n container: [{ type: ViewChild, args: ['container', { read: ViewContainerRef },] }],\n defaultTemplate: [{ type: ViewChild, args: ['defaultTemplate',] }],\n contentTemplate: [{ type: ContentChild, args: [DateRangePopupTemplateDirective,] }],\n viewCalendar: [{ type: ViewChildren, args: [MultiViewCalendarComponent,] }],\n contentCalendar: [{ type: ContentChildren, args: [MultiViewCalendarComponent,] }],\n animate: [{ type: Input }],\n anchor: [{ type: Input }],\n anchorAlign: [{ type: Input }],\n appendTo: [{ type: Input }],\n collision: [{ type: Input }],\n popupAlign: [{ type: Input }],\n margin: [{ type: Input }],\n open: [{ type: Output }],\n close: [{ type: Output }],\n onBlur: [{ type: Output, args: ['blur',] }],\n onFocus: [{ type: Output, args: ['focus',] }],\n cancel: [{ type: Output }]\n };\n return DateRangePopupComponent;\n}());\n\n/**\n * Represents the Kendo UI DateRange component for Angular.\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * \n * \n * `\n * })\n * class AppComponent {\n * public dateRange: any = { start: null, end: null };\n * }\n * ```\n */\nvar DateRangeComponent = /** @class */ (function () {\n function DateRangeComponent() {\n /**\n * @hidden\n */\n this.showDefault = false;\n }\n Object.defineProperty(DateRangeComponent.prototype, \"hasContentPopup\", {\n get: function () {\n return this.contentPopup.length > 0;\n },\n enumerable: true,\n configurable: true\n });\n DateRangeComponent.prototype.ngAfterContentInit = function () {\n var _this = this;\n this.showDefault = !this.hasContentPopup;\n this.subscription = this.contentPopup.changes.subscribe(function () {\n _this.showDefault = !_this.hasContentPopup;\n });\n };\n DateRangeComponent.prototype.ngOnDestroy = function () {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n };\n DateRangeComponent.decorators = [\n { type: Component, args: [{\n providers: [DateRangeService],\n selector: 'kendo-daterange',\n template: \"\\n \\n \\n \"\n },] },\n ];\n DateRangeComponent.propDecorators = {\n contentPopup: [{ type: ContentChildren, args: [DateRangePopupComponent,] }]\n };\n return DateRangeComponent;\n}());\n\n/**\n * @hidden\n */\nvar DateRangeInput = /** @class */ (function () {\n function DateRangeInput(activeRangeEnd, dateRangeService, input, element, renderer, zone) {\n this.activeRangeEnd = activeRangeEnd;\n this.dateRangeService = dateRangeService;\n this.input = input;\n this.element = element;\n this.renderer = renderer;\n this.zone = zone;\n this.navigateCalendarOnFocus = false;\n this.popupSubscriptions = new Subscription(function () { });\n this.subscriptions = new Subscription(function () { });\n }\n Object.defineProperty(DateRangeInput.prototype, \"isActiveEnd\", {\n get: function () {\n return this.dateRangeService.activeRangeEnd === this.activeRangeEnd;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateRangeInput.prototype, \"popupCalendarActivated\", {\n get: function () {\n var popup = this.dateRangeService.dateRangePopup$.value;\n return isPresent(popup) && isPresent(popup.calendar);\n },\n enumerable: true,\n configurable: true\n });\n DateRangeInput.prototype.init = function () {\n var _this = this;\n if (this.input.value) {\n this.dateRangeService.setRange(this.getRange(this.input.value));\n }\n [\n this.input.onBlur.subscribe(function () { return _this.deactivate(); }),\n this.input.onFocus.pipe(filter(function () { return !_this.popupCalendarActivated; })).subscribe(function () { return _this.activate(); }),\n this.input.valueUpdate.subscribe(function (value) { return _this.updateRange(value, 'change'); }),\n this.dateRangeService.activeRangeEnd$.subscribe(function () {\n if (_this.navigateCalendarOnFocus) {\n _this.focusActiveDate();\n }\n _this.toggleActiveClass(_this.isActiveEnd);\n }),\n this.dateRangeService.dateRangePopup$.subscribe(function (popup) { return _this.initPopup(popup); }),\n this.dateRangeService.range$.subscribe(function (range) { return _this.updateInputValue(range); }),\n fromEvent(this.element.nativeElement, 'click').subscribe(function () { return _this.activate(); }),\n fromEvent(this.element.nativeElement, 'keydown').subscribe(function (event) { return _this.togglePopup(event || {}); })\n ].map(function (s) { return _this.subscriptions.add(s); });\n };\n DateRangeInput.prototype.destroy = function () {\n this.subscriptions.unsubscribe();\n this.unsubscribePopup();\n };\n DateRangeInput.prototype.initPopup = function (popup) {\n var _this = this;\n if (!popup) {\n this.unsubscribePopup();\n return;\n }\n if (!popup.anchor) {\n popup.anchor = this.element.nativeElement;\n }\n [\n popup.cancel.subscribe(function () { return _this.isActiveEnd && _this.input.focus(); }),\n popup.onFocus.subscribe(function () { return _this.toggleActiveClass(_this.isActiveEnd); }),\n popup.onBlur.subscribe(function () { return _this.deactivate(); })\n ].map(function (s) { return _this.popupSubscriptions.add(s); });\n };\n DateRangeInput.prototype.unsubscribePopup = function () {\n this.popupSubscriptions.unsubscribe();\n this.popupSubscriptions = new Subscription(function () { });\n };\n DateRangeInput.prototype.activate = function () {\n this.dateRangeService.setActiveRangeEnd(this.activeRangeEnd);\n this.dateRangeService.activatePopup();\n };\n DateRangeInput.prototype.deactivate = function () {\n var _this = this;\n this.zone.runOutsideAngular(function () {\n setTimeout(function () {\n _this.updateRange(_this.input.value, 'blur');\n if (_this.dateRangeService.hasActiveComponent()) {\n return;\n }\n _this.toggleActiveClass(false);\n _this.zone.run(function () { return _this.dateRangeService.deactivatePopup(); });\n });\n });\n };\n DateRangeInput.prototype.updateRange = function (value, correctOn) {\n var range = this.getRange(value, correctOn);\n if (range) {\n this.focusActiveDate();\n this.dateRangeService.setRange(range);\n }\n };\n DateRangeInput.prototype.togglePopup = function (_a) {\n var altKey = _a.altKey, keyCode = _a.keyCode;\n if (keyCode === Keys.Escape) {\n this.dateRangeService.cancelPopup();\n }\n else if (altKey && keyCode === Keys.ArrowDown) {\n this.dateRangeService.activatePopup();\n }\n };\n DateRangeInput.prototype.focusActiveDate = function () {\n if (this.input.value && this.isActiveEnd) {\n this.dateRangeService.setFocusedDate(cloneDate(this.input.value));\n }\n };\n DateRangeInput.prototype.toggleActiveClass = function (show) {\n var action = show ? 'addClass' : 'removeClass';\n var nativeElement = this.element.nativeElement;\n if (nativeElement && nativeElement.querySelector) {\n this.renderer[action](nativeElement.querySelector('.k-dateinput-wrap'), 'k-state-focused');\n }\n };\n return DateRangeInput;\n}());\n\n/**\n * A directive which manages the end range selection.\n *\n * > You can use the DateRangeEndInputDirective only with a DateInput component.\n */\nvar DateRangeEndInputDirective = /** @class */ (function (_super) {\n __extends(DateRangeEndInputDirective, _super);\n function DateRangeEndInputDirective(rangeService, dateInput, element, renderer, zone) {\n var _this = _super.call(this, 'end', rangeService, dateInput, element, renderer, zone) || this;\n _this.rangeService = rangeService;\n _this.dateInput = dateInput;\n /**\n * Specifies the navigation behavior of the calendar when the active end is changed on input focus. When enabled,\n * the calendar navigates to the value of the focused input. Otherwise, the calendar displays the last picked date.\n *\n * By default, the automatic navigation behavior on input focus is disabled.\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * Toggle input focus to see the calendar navigating between range ends.
\n * \n * \n * \n * \n * `\n * })\n * class AppComponent {\n * public start: Date = new Date(2018, 3, 10);\n * public end: Date = new Date(2018, 10, 20);\n * }\n * ```\n */\n _this.navigateCalendarOnFocus = false;\n return _this;\n }\n DateRangeEndInputDirective.prototype.ngOnInit = function () {\n this.rangeService.registerEndInput(this.dateInput);\n _super.prototype.init.call(this);\n };\n DateRangeEndInputDirective.prototype.ngOnDestroy = function () {\n _super.prototype.destroy.call(this);\n };\n DateRangeEndInputDirective.prototype.getRange = function (value, correctOn) {\n var _a = this.dateInput, min = _a.min, max = _a.max;\n if (!isInRange(value, min, max)) {\n return null;\n }\n var start = (this.rangeService.selectionRange || EMPTY_SELECTIONRANGE).start;\n return this.autoCorrectOn === correctOn && value < start ? clampRange(value) : { start: start, end: cloneDate(value) };\n };\n DateRangeEndInputDirective.prototype.updateInputValue = function (range$$1) {\n var end = (range$$1 || EMPTY_SELECTIONRANGE).end;\n var _a = this.dateInput, min = _a.min, max = _a.max;\n if (isEqual(this.dateInput.value, end) || !isInRange(end, min, max)) {\n return;\n }\n this.dateInput.writeValue(cloneDate(end));\n this.dateInput.notify();\n };\n DateRangeEndInputDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoDateRangeEndInput]'\n },] },\n ];\n /** @nocollapse */\n DateRangeEndInputDirective.ctorParameters = function () { return [\n { type: DateRangeService },\n { type: DateInputComponent },\n { type: ElementRef },\n { type: Renderer2 },\n { type: NgZone }\n ]; };\n DateRangeEndInputDirective.propDecorators = {\n autoCorrectOn: [{ type: Input }],\n navigateCalendarOnFocus: [{ type: Input }]\n };\n return DateRangeEndInputDirective;\n}(DateRangeInput));\n\n/**\n * A directive which manages the start selection range.\n *\n * > You can use the DateRangeStartInputDirective only with a DateInput component.\n */\nvar DateRangeStartInputDirective = /** @class */ (function (_super) {\n __extends(DateRangeStartInputDirective, _super);\n function DateRangeStartInputDirective(rangeService, dateInput, element, renderer, zone) {\n var _this = _super.call(this, 'start', rangeService, dateInput, element, renderer, zone) || this;\n _this.rangeService = rangeService;\n _this.dateInput = dateInput;\n /**\n * Specifies the navigation behavior of the calendar when the active end is changed on input focus.\n * When enabled, the calendar navigates to the value of the focused input. Otherwise, the calendar\n * displays the last picked date.\n *\n * By default, the automatic navigation behavior on input focus is disabled.\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * Toggle input focus to see the calendar navigating between range ends.
\n * \n * \n * \n * \n * `\n * })\n * class AppComponent {\n * public start: Date = new Date(2018, 3, 10);\n * public end: Date = new Date(2018, 10, 20);\n * }\n * ```\n */\n _this.navigateCalendarOnFocus = false;\n return _this;\n }\n DateRangeStartInputDirective.prototype.ngOnInit = function () {\n this.rangeService.registerStartInput(this.dateInput);\n _super.prototype.init.call(this);\n };\n DateRangeStartInputDirective.prototype.ngOnDestroy = function () {\n _super.prototype.destroy.call(this);\n };\n DateRangeStartInputDirective.prototype.getRange = function (value, correctOn) {\n var _a = this.dateInput, min = _a.min, max = _a.max;\n if (!isInRange(value, min, max)) {\n return null;\n }\n var end = (this.rangeService.selectionRange || EMPTY_SELECTIONRANGE).end;\n var shouldClamp = this.autoCorrectOn === correctOn && end && value > end;\n return shouldClamp ? clampRange(value) : { start: cloneDate(value), end: end };\n };\n DateRangeStartInputDirective.prototype.updateInputValue = function (range$$1) {\n var start = (range$$1 || EMPTY_SELECTIONRANGE).start;\n var _a = this.dateInput, min = _a.min, max = _a.max;\n if (isEqual(this.dateInput.value, start) || !isInRange(start, min, max)) {\n return;\n }\n this.dateInput.writeValue(cloneDate(start));\n this.dateInput.notify();\n };\n DateRangeStartInputDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoDateRangeStartInput]'\n },] },\n ];\n /** @nocollapse */\n DateRangeStartInputDirective.ctorParameters = function () { return [\n { type: DateRangeService },\n { type: DateInputComponent },\n { type: ElementRef },\n { type: Renderer2 },\n { type: NgZone }\n ]; };\n DateRangeStartInputDirective.propDecorators = {\n autoCorrectOn: [{ type: Input }],\n navigateCalendarOnFocus: [{ type: Input }]\n };\n return DateRangeStartInputDirective;\n}(DateRangeInput));\n\n/**\n * A directive which manages the MultiViewCalendar range selection.\n */\nvar DateRangeSelectionDirective = /** @class */ (function () {\n function DateRangeSelectionDirective(calendar, cdr, element, renderer, dateRangeService) {\n this.calendar = calendar;\n this.cdr = cdr;\n this.element = element;\n this.dateRangeService = dateRangeService;\n /**\n * Specifies the auto-correction behavior. If the start date is greater than the end date,\n * the directive fixes the date range to a single date either on input change or on blur\n * ([see example]({% slug autocorrect_daterange %}#toc-configuring-the-calendar-selection-directive)).\n *\n * By default, the auto-correction is triggered on change.\n * To disable this behavior, set the `autoCorrectOn` property to `none`.\n */\n this.autoCorrectOn = 'change';\n /**\n * Fires when the active range end is changed. For more information, refer to\n * the section on [events]({% slug overview_multiviewcalendar %}#toc-events).\n */\n this.activeRangeEndChange = new EventEmitter();\n /**\n * Fires when the selection range is changed. For more information, refer to\n * the section on [events]({% slug overview_multiviewcalendar %}#toc-events).\n */\n this.selectionRangeChange = new EventEmitter();\n this.calendarSubscriptions = new Subscription(function () { });\n this.dateRangeService = this.dateRangeService || new DateRangeService();\n renderer.setAttribute(element.nativeElement, 'aria-multiselectable', 'true');\n }\n Object.defineProperty(DateRangeSelectionDirective.prototype, \"selectionRange\", {\n /**\n * Gets or sets the selection range of the calendar. When a new range is set,\n * the connected DateRangeService notifies all related parties.\n */\n get: function () {\n return this.calendar ? this.calendar.selectionRange : null;\n },\n set: function (range$$1) {\n if (!this.isEqualCalendarRange(range$$1)) {\n this.setSelectionRange(range$$1);\n }\n if (!isEqualRange(this.dateRangeService.selectionRange, range$$1)) {\n this.dateRangeService.setRange(range$$1);\n }\n this.updateFocusedDate(range$$1);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateRangeSelectionDirective.prototype, \"activeRangeEnd\", {\n /**\n * Gets or sets the active end of the selection range. This option determines which range end will be updated on\n * user interaction. When a new active end is set, the connected DateRangeService notifies all related parties.\n */\n /**\n * Specifies which end of the selection range will be marked as active. The active end gets modified upon user\n * interaction. When a new active end is set, the wired DateRangeService notifies all related components. For\n * example, the start and end DateInput components.\n *\n * > If the selection range is undefined, the value is ignored.\n */\n get: function () {\n return this.calendar.activeRangeEnd;\n },\n set: function (activeRange) {\n if (this.dateRangeService.activeRangeEnd === activeRange) {\n return;\n }\n this.calendar.activeRangeEnd = activeRange;\n this.dateRangeService.setActiveRangeEnd(activeRange);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateRangeSelectionDirective.prototype, \"calendarRange\", {\n get: function () {\n return this.selectionRange || EMPTY_SELECTIONRANGE;\n },\n enumerable: true,\n configurable: true\n });\n DateRangeSelectionDirective.prototype.ngOnInit = function () {\n var _this = this;\n var calendar = this.calendar;\n var dateRangeService = this.dateRangeService;\n calendar.min = either(dateRangeService.min, calendar.min);\n calendar.max = either(dateRangeService.max, calendar.max);\n this.addSubscriptions(calendar.cellEnter.subscribe(function (value) { return _this.handleHover(value); }), calendar.valueChange.subscribe(function (value) { return _this.handleChange(value); }), dateRangeService.focusedDate$.subscribe(function (focusedDate) {\n if (!isEqual(calendar.focusedDate, focusedDate)) {\n calendar.focusedDate = focusedDate;\n }\n }), dateRangeService.activeRangeEnd$.subscribe(function (rangeEnd) {\n if (calendar.activeRangeEnd === rangeEnd) {\n return;\n }\n calendar.activeRangeEnd = rangeEnd;\n _this.activeRangeEndChange.emit(rangeEnd);\n _this.cdr.markForCheck();\n }), dateRangeService.range$.subscribe(function (range$$1) {\n if (!_this.isEqualCalendarRange(range$$1)) {\n _this.acceptAndEmit(range$$1);\n }\n _this.updateFocusedDate(range$$1);\n }), fromEvent(this.element.nativeElement, 'blur').subscribe(function () { return _this.handleBlur(); }));\n };\n DateRangeSelectionDirective.prototype.ngOnDestroy = function () {\n this.calendarSubscriptions.unsubscribe();\n };\n DateRangeSelectionDirective.prototype.addSubscriptions = function () {\n var _this = this;\n var subscriptions = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n subscriptions[_i] = arguments[_i];\n }\n subscriptions.map(function (s) { return _this.calendarSubscriptions.add(s); });\n };\n DateRangeSelectionDirective.prototype.isEqualCalendarRange = function (range$$1) {\n return isEqualRange(this.calendar.selectionRange, range$$1);\n };\n DateRangeSelectionDirective.prototype.handleBlur = function () {\n var _a = this.calendarRange, start = _a.start, end = _a.end;\n var autoCorrect = this.autoCorrectOn === 'blur' && start !== null && end !== null && end < start;\n if (autoCorrect) {\n this.dateRangeService.setRange(clampRange(start));\n }\n };\n DateRangeSelectionDirective.prototype.handleChange = function (value) {\n var service = this.dateRangeService;\n var autoCorrect = this.autoCorrectOn === 'change' && this.shouldAutoCorrect(value);\n var activeEnd = this.calendar.activeRangeEnd !== 'end' ? 'end' : (autoCorrect ? 'end' : 'start');\n var range$$1 = autoCorrect ? clampRange(value) : this.updateRange(value);\n if (!isEqualRange(service.selectionRange, range$$1)) {\n this.acceptAndEmit(range$$1);\n service.setActiveRangeEnd(activeEnd);\n service.setRange(range$$1);\n }\n };\n DateRangeSelectionDirective.prototype.handleHover = function (value) {\n this.dateRangeService.setFocusedDate(cloneDate(value));\n if (this.hasCompleteRange()) {\n return;\n }\n var _a = this.calendarRange, start = _a.start, end = _a.end;\n var activeRangeEnd = this.calendar.activeRangeEnd;\n var updateRange = (start && activeRangeEnd === 'end') || (end && activeRangeEnd === 'start');\n if (updateRange) {\n this.setSelectionRange(this.updateRange(value));\n }\n };\n DateRangeSelectionDirective.prototype.hasCompleteRange = function () {\n var _a = this.dateRangeService.selectionRange || EMPTY_SELECTIONRANGE, start = _a.start, end = _a.end;\n return Boolean(start) && Boolean(end);\n };\n DateRangeSelectionDirective.prototype.shouldAutoCorrect = function (value) {\n var _a = this.calendarRange, end = _a.end, start = _a.start;\n if (this.calendar.activeRangeEnd !== 'end') {\n return end !== null && value > end;\n }\n else {\n return start !== null && value < start;\n }\n };\n DateRangeSelectionDirective.prototype.updateFocusedDate = function (range$$1) {\n if (!range$$1 || this.dateRangeService.focusedDate) {\n return;\n }\n this.dateRangeService.setFocusedDate(range$$1.start || range$$1.end);\n };\n DateRangeSelectionDirective.prototype.updateRange = function (value) {\n var _a = this.calendarRange, end = _a.end, start = _a.start;\n return this.calendar.activeRangeEnd !== 'end' ? ({ start: value, end: end }) : ({ start: start, end: value });\n };\n DateRangeSelectionDirective.prototype.setSelectionRange = function (range$$1) {\n this.calendar.selectionRange = range$$1;\n this.calendar.writeValue(null);\n };\n DateRangeSelectionDirective.prototype.acceptAndEmit = function (range$$1) {\n this.setSelectionRange(range$$1);\n this.selectionRangeChange.emit(range$$1);\n };\n DateRangeSelectionDirective.decorators = [\n { type: Directive, args: [{\n selector: '[kendoDateRangeSelection]'\n },] },\n ];\n /** @nocollapse */\n DateRangeSelectionDirective.ctorParameters = function () { return [\n { type: MultiViewCalendarComponent },\n { type: ChangeDetectorRef },\n { type: ElementRef },\n { type: Renderer2 },\n { type: DateRangeService, decorators: [{ type: Optional }] }\n ]; };\n DateRangeSelectionDirective.propDecorators = {\n autoCorrectOn: [{ type: Input }],\n selectionRange: [{ type: Input }],\n activeRangeEnd: [{ type: Input }],\n activeRangeEndChange: [{ type: Output }],\n selectionRangeChange: [{ type: Output }]\n };\n return DateRangeSelectionDirective;\n}());\n\n/* tslint:disable:directive-class-suffix directive-selector */\n/**\n * @hidden\n */\nvar KForOfContext = /** @class */ (function () {\n function KForOfContext($implicit, kForOf, index, count) {\n this.$implicit = $implicit;\n this.kForOf = kForOf;\n this.index = index;\n this.count = count;\n }\n Object.defineProperty(KForOfContext.prototype, \"first\", {\n get: function () { return this.index === 0; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(KForOfContext.prototype, \"last\", {\n get: function () { return this.index === this.count - 1; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(KForOfContext.prototype, \"even\", {\n get: function () { return this.index % 2 === 0; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(KForOfContext.prototype, \"odd\", {\n get: function () { return !this.even; },\n enumerable: true,\n configurable: true\n });\n return KForOfContext;\n}());\n/**\n * @hidden\n */\nvar KForOf = /** @class */ (function () {\n function KForOf(_viewContainer, _template, _differs) {\n this._viewContainer = _viewContainer;\n this._template = _template;\n this._differs = _differs;\n this._differ = null;\n }\n Object.defineProperty(KForOf.prototype, \"kForTemplate\", {\n set: function (value) {\n if (value) {\n this._template = value;\n }\n },\n enumerable: true,\n configurable: true\n });\n KForOf.prototype.ngOnChanges = function (changes) {\n if ('kForOf' in changes) {\n var value = changes.kForOf.currentValue;\n if (this._differ || !value) {\n return;\n }\n try {\n this._differ = this._differs.find(value).create(this.kForTrackBy);\n }\n catch (e) {\n throw new Error(\"Cannot find a differ supporting object '\" + value + \"' of type '\" + getTypeNameForDebugging(value) + \"'.\");\n }\n }\n };\n KForOf.prototype.ngDoCheck = function () {\n if (this._differ) {\n var changes = this._differ.diff(this.kForOf);\n if (changes) {\n this._applyChanges(changes);\n }\n }\n };\n KForOf.prototype._applyChanges = function (changes) {\n if (!isDocumentAvailable()) {\n return;\n }\n var viewContainerLength = this._viewContainer.length;\n var dataLength = this.kForOf.length;\n var tuples = {};\n changes.forEachOperation(function (record, _, currentIndex) {\n if (currentIndex !== null) {\n tuples[currentIndex] = record.item;\n }\n });\n for (var i = viewContainerLength; i < dataLength; i++) {\n this._viewContainer.createEmbeddedView(this._template, new KForOfContext(null, this.kForOf, -1, -1), i);\n }\n for (var i = this._viewContainer.length; i > dataLength; i--) {\n this._viewContainer.remove(i - 1);\n }\n for (var i = 0; i < this._viewContainer.length; i++) {\n var view = this._viewContainer.get(i);\n view.context.index = i;\n view.context.count = length;\n view.context.$implicit = tuples[i] || null;\n }\n };\n KForOf.decorators = [\n { type: Directive, args: [{ selector: '[kFor][kForOf]' },] },\n ];\n /** @nocollapse */\n KForOf.ctorParameters = function () { return [\n { type: ViewContainerRef },\n { type: TemplateRef },\n { type: IterableDiffers }\n ]; };\n KForOf.propDecorators = {\n kForOf: [{ type: Input }],\n kForTrackBy: [{ type: Input }],\n kForTemplate: [{ type: Input }]\n };\n return KForOf;\n}());\n/**\n * @hidden\n */\nfunction getTypeNameForDebugging(type) {\n return type.name || typeof type;\n}\n\n/**\n * @hidden\n */\nvar HeaderComponent = /** @class */ (function () {\n function HeaderComponent(bus, cdr, localization, intl, disabledDatesService) {\n this.bus = bus;\n this.cdr = cdr;\n this.localization = localization;\n this.intl = intl;\n this.disabledDatesService = disabledDatesService;\n this.navigate = true;\n this.todayAvailable = true;\n this.min = new Date(MIN_DATE);\n this.max = new Date(MAX_DATE);\n this.rangeLength = 1;\n this.today = new EventEmitter();\n this.subscriptions = new Subscription();\n }\n Object.defineProperty(HeaderComponent.prototype, \"getComponentClass\", {\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n HeaderComponent.prototype.ngOnInit = function () {\n this.subscriptions\n .add(this.intl.changes.subscribe(this.intlChange.bind(this)))\n .add(this.localization.changes.subscribe(this.l10nChange.bind(this)))\n .add(this.disabledDatesService.changes.subscribe(this.setTodayAvailability.bind(this)));\n };\n HeaderComponent.prototype.ngOnChanges = function (_) {\n var service = this.bus.service(this.activeView);\n if (!service) {\n return;\n }\n this.activeViewValue = CalendarViewEnum[this.activeView];\n this.todayMessage = this.localization.get('today');\n this.setTodayAvailability();\n this.navigate = this.bus.canMoveUp(this.activeView);\n this.title = this.getTitle();\n };\n HeaderComponent.prototype.ngOnDestroy = function () {\n this.subscriptions.unsubscribe();\n };\n HeaderComponent.prototype.handleTodayClick = function () {\n if (!this.todayAvailable) {\n return;\n }\n this.bus.moveToBottom(this.activeView);\n this.today.emit(dateInRange(getToday(), this.min, this.max));\n };\n HeaderComponent.prototype.handleNavigation = function () {\n if (!this.navigate) {\n return;\n }\n this.bus.moveUp(this.activeView);\n };\n HeaderComponent.prototype.intlChange = function () {\n if (this.currentDate && this.bus.service(this.activeView)) {\n this.title = this.getTitle();\n this.cdr.markForCheck();\n }\n };\n HeaderComponent.prototype.l10nChange = function () {\n this.todayMessage = this.localization.get('today');\n this.cdr.markForCheck();\n };\n HeaderComponent.prototype.getTitle = function () {\n if (!this.currentDate) {\n return '';\n }\n var service = this.bus.service(this.activeView);\n var take = this.rangeLength - 1;\n var title = service.title(this.currentDate);\n var nextDate = service.addToDate(this.currentDate, take);\n if (take < 1 || !service.isInRange(nextDate, this.min, this.max)) {\n return title;\n }\n return title + \" - \" + service.title(nextDate);\n };\n HeaderComponent.prototype.setTodayAvailability = function () {\n var today = getToday();\n var isTodayInRange = isInRange(today, getDate(this.min), getDate(this.max));\n var isDisabled = this.disabledDatesService.isDateDisabled(today);\n this.todayAvailable = isTodayInRange && !isDisabled;\n this.cdr.markForCheck();\n };\n HeaderComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-calendar-header',\n template: \"\\n \\n {{title}}\\n \\n \\n \\n {{todayMessage}}\\n \\n \"\n },] },\n ];\n /** @nocollapse */\n HeaderComponent.ctorParameters = function () { return [\n { type: BusViewService },\n { type: ChangeDetectorRef },\n { type: LocalizationService },\n { type: IntlService },\n { type: DisabledDatesService }\n ]; };\n HeaderComponent.propDecorators = {\n activeView: [{ type: Input }],\n currentDate: [{ type: Input }],\n min: [{ type: Input }],\n max: [{ type: Input }],\n rangeLength: [{ type: Input }],\n templateRef: [{ type: Input }],\n today: [{ type: Output }],\n getComponentClass: [{ type: HostBinding, args: [\"class.k-calendar-header\",] }]\n };\n return HeaderComponent;\n}());\n\n/**\n * @hidden\n */\nvar WeekNamesService = /** @class */ (function () {\n function WeekNamesService(intl) {\n this.intl = intl;\n }\n WeekNamesService.prototype.getWeekNames = function (includeWeekNumber) {\n if (includeWeekNumber === void 0) { includeWeekNumber = false; }\n var weekNames = shiftWeekNames(this.intl.dateFormatNames({ nameType: 'short', type: 'days' }), this.intl.firstDay());\n return includeWeekNumber ? [''].concat(weekNames) : weekNames;\n };\n WeekNamesService.decorators = [\n { type: Injectable },\n ];\n /** @nocollapse */\n WeekNamesService.ctorParameters = function () { return [\n { type: IntlService }\n ]; };\n return WeekNamesService;\n}());\n\n/**\n * @hidden\n */\nvar ViewComponent = /** @class */ (function () {\n function ViewComponent(bus, intl, cdr, weekService, element, zone, renderer, disabledDatesService) {\n this.bus = bus;\n this.intl = intl;\n this.cdr = cdr;\n this.weekService = weekService;\n this.element = element;\n this.zone = zone;\n this.renderer = renderer;\n this.disabledDatesService = disabledDatesService;\n this.direction = 'vertical';\n this.isActive = true;\n this.change = new EventEmitter();\n this.cellEnter = new EventEmitter();\n this.cellLeave = new EventEmitter();\n this.weekNames = [];\n this.colSpan = 0;\n this.subscriptions = new Subscription();\n this.domEvents = [];\n this.subscriptions\n .add(this.intl.changes.subscribe(this.intlChange.bind(this)))\n .add(this.disabledDatesService.changes.subscribe(this.disabledDatesChange.bind(this)));\n }\n Object.defineProperty(ViewComponent.prototype, \"weekNumber\", {\n get: function () {\n return this.showWeekNumbers && this.activeView === CalendarViewEnum.month;\n },\n set: function (showWeekNumbers) {\n this.showWeekNumbers = showWeekNumbers;\n },\n enumerable: true,\n configurable: true\n });\n ViewComponent.prototype.ngOnInit = function () {\n var _this = this;\n if (this.element) {\n this.zone.runOutsideAngular(function () {\n _this.bindEvents();\n });\n }\n };\n ViewComponent.prototype.ngOnChanges = function (changes) {\n this.service = this.bus.service(this.activeView);\n if (!this.service) {\n return;\n }\n var generateWeekNames = this.isHorizontal() && this.weekNames.length === 0;\n if (generateWeekNames && (changes.weekNumber || changes.direction)) {\n this.weekNames = this.weekService.getWeekNames(this.weekNumber);\n }\n this.colSpan = this.service.rowLength(this.weekNumber);\n this.title = this.service.title(this.viewDate);\n this.updateData();\n if (changes.activeView) {\n this.currentCellIndex = null;\n }\n };\n ViewComponent.prototype.ngOnDestroy = function () {\n this.subscriptions.unsubscribe();\n this.domEvents.forEach(function (unsubscribeCallback) { return unsubscribeCallback(); });\n };\n ViewComponent.prototype.isHorizontal = function () {\n return this.direction === 'horizontal';\n };\n ViewComponent.prototype.isMonthView = function () {\n return this.activeView === CalendarViewEnum.month;\n };\n ViewComponent.prototype.firstDate = function (rowCtx) {\n var ctx = this.firstWeekDateContext(rowCtx);\n return ctx ? ctx.value : null;\n };\n ViewComponent.prototype.getWeekNumber = function (date) {\n if (!this.weekNumber) {\n return null;\n }\n return weekInYear(date, this.intl.firstDay());\n };\n ViewComponent.prototype.getWeekNumberContext = function (rowCtx) {\n var ctx = this.firstWeekDateContext(rowCtx);\n if (!this.weekNumber || !ctx) {\n return null;\n }\n var weekNumber = weekInYear(ctx.value, this.intl.firstDay()).toString();\n return {\n formattedValue: weekNumber,\n id: null,\n isFocused: false,\n isSelected: false,\n isWeekend: false,\n title: weekNumber,\n value: cloneDate(ctx.value)\n };\n };\n ViewComponent.prototype.getStyles = function (context) {\n var isRangeEnd = context.isRangeEnd, isRangeStart = context.isRangeStart;\n var isEndActive = this.activeRangeEnd === 'end' && isRangeEnd;\n var isStartActive = this.activeRangeEnd === 'start' && isRangeStart;\n return stringifyClassObject({\n 'k-range-end': isRangeEnd,\n 'k-range-mid': context.isRangeMid,\n 'k-range-split-end': context.isRangeSplitEnd,\n 'k-range-split-start': context.isRangeSplitStart,\n 'k-range-start': isRangeStart,\n 'k-state-active': isStartActive || isEndActive,\n 'k-state-focused': this.isActive && context.isFocused,\n 'k-state-selected': context.isSelected || isRangeStart || isRangeEnd,\n 'k-today': context.isToday,\n 'k-weekend': context.isWeekend,\n 'k-state-disabled': context.isDisabled\n });\n };\n ViewComponent.prototype.tableCellIndex = function (rowIndex, cellIndex) {\n return rowIndex + \":\" + cellIndex;\n };\n ViewComponent.prototype.firstWeekDateContext = function (rowCtx) {\n if (!this.weekNumber) {\n return null;\n }\n var idx = 0;\n var ctx = rowCtx[idx];\n while (!ctx && idx < rowCtx.length) {\n ctx = rowCtx[++idx];\n }\n return ctx;\n };\n ViewComponent.prototype.updateData = function () {\n var time = this.selectedDate || getToday();\n var viewDate = setTime(this.viewDate, time);\n this.data = this.service.data({\n cellUID: this.cellUID,\n focusedDate: this.focusedDate,\n isActiveView: !this.bus.canMoveDown(this.activeView),\n max: this.max,\n min: this.min,\n selectedDate: this.selectedDate,\n selectionRange: this.selectionRange,\n viewDate: viewDate,\n isDateDisabled: this.disabledDatesService.isDateDisabled\n });\n };\n ViewComponent.prototype.intlChange = function () {\n this.updateData();\n if (this.isHorizontal()) {\n this.weekNames = this.weekService.getWeekNames(this.weekNumber);\n }\n this.cdr.markForCheck();\n };\n ViewComponent.prototype.disabledDatesChange = function () {\n this.updateData();\n this.cdr.markForCheck();\n };\n ViewComponent.prototype.bindEvents = function () {\n var element = this.element.nativeElement;\n this.domEvents.push(this.renderer.listen(element, 'mouseover', this.cellMouseoverHandler.bind(this)), this.renderer.listen(element, 'mouseleave', this.mouseLeaveHandler.bind(this)), this.renderer.listen(element, 'click', this.clickHandler.bind(this)));\n };\n ViewComponent.prototype.clickHandler = function (args) {\n var cell = this.closestCell(args);\n if (cell) {\n var index = cell.getAttribute('data-cell-index');\n var cellContext = this.cellByIndex(index);\n if (!cellContext.isDisabled) {\n this.change.emit(cellContext.value);\n }\n }\n };\n ViewComponent.prototype.mouseLeaveHandler = function () {\n if (this.currentCellIndex) {\n this.emitCellLeave();\n }\n };\n ViewComponent.prototype.cellMouseoverHandler = function (args) {\n var cell = this.closestCell(args);\n if (cell) {\n var index = cell.getAttribute('data-cell-index');\n if (this.currentCellIndex && this.currentCellIndex !== index) {\n this.emitCellLeave();\n }\n var value = this.cellByIndex(index).value;\n this.cellEnter.emit(value);\n this.currentCellIndex = index;\n }\n else if (this.currentCellIndex) {\n this.emitCellLeave();\n }\n };\n ViewComponent.prototype.closestCell = function (eventArgs) {\n return closestInScope(eventArgs.target, function (node) { return node.hasAttribute('data-cell-index'); }, this.element.nativeElement);\n };\n ViewComponent.prototype.emitCellLeave = function () {\n var item = this.cellByIndex(this.currentCellIndex);\n if (item) {\n this.cellLeave.emit(item.value);\n }\n this.currentCellIndex = null;\n };\n ViewComponent.prototype.cellByIndex = function (index) {\n var _a = index.split(':'), rowIndex = _a[0], cellIndex = _a[1];\n return this.data[rowIndex][cellIndex];\n };\n ViewComponent.decorators = [\n { type: Component, args: [{\n selector: '[kendoCalendarView]',\n template: \"\\n | \\n {{title}} |
\\n \\n {{name}} | \\n
\\n \\n \\n \\n \\n {{getWeekNumber(firstDate(row))}}\\n \\n \\n | \\n \\n \\n \\n \\n {{cell.formattedValue}}\\n \\n \\n | \\n \\n
\\n \"\n },] },\n ];\n /** @nocollapse */\n ViewComponent.ctorParameters = function () { return [\n { type: BusViewService },\n { type: IntlService },\n { type: ChangeDetectorRef },\n { type: WeekNamesService },\n { type: ElementRef },\n { type: NgZone },\n { type: Renderer2 },\n { type: DisabledDatesService }\n ]; };\n ViewComponent.propDecorators = {\n direction: [{ type: Input }],\n isActive: [{ type: Input }],\n activeView: [{ type: Input }],\n cellUID: [{ type: Input }],\n focusedDate: [{ type: Input }],\n selectedDate: [{ type: Input }],\n viewDate: [{ type: Input }],\n activeRangeEnd: [{ type: Input }],\n selectionRange: [{ type: Input }],\n min: [{ type: Input }],\n max: [{ type: Input }],\n weekNumber: [{ type: Input }],\n viewIndex: [{ type: Input }],\n templateRef: [{ type: Input }],\n weekNumberTemplateRef: [{ type: Input }],\n change: [{ type: Output }],\n cellEnter: [{ type: Output }],\n cellLeave: [{ type: Output }]\n };\n return ViewComponent;\n}());\n\n/**\n * @hidden\n *\n * The exported package module.\n *\n * The package exports:\n * - `HeaderComponent`—The component that renders the UI for vertical navigation.\n * - `ViewComponent`—The component that renders the active Calendar view.\n */\nvar CalendarCommonModule = /** @class */ (function () {\n function CalendarCommonModule() {\n }\n CalendarCommonModule.decorators = [\n { type: NgModule, args: [{\n declarations: [\n KForOf,\n HeaderComponent,\n ViewComponent\n ],\n exports: [\n KForOf,\n HeaderComponent,\n ViewComponent\n ],\n imports: [CommonModule, EventsModule]\n },] },\n ];\n return CalendarCommonModule;\n}());\n\n/**\n * @hidden\n *\n * The exported package module.\n *\n * The package exports:\n * - `CellTemplateDirective`—The month cell template directive.\n * - `MonthCellTemplateDirective`—The month cell template directive.\n * - `YearCellTemplateDirective`—The year cell template directive.\n * - `DecadeCellTemplateDirective`—The decade cell template directive.\n * - `CenturyCellTemplateDirective`—The century cell template directive.\n * - `WeekNumberCellTemplateDirective`—The month week number cell template directive.\n * - `HeaderTitleTemplateDirective`—The header title template directive.\n * - `NavigationItemTemplateDirective`—The navigation item template directive.\n */\nvar TemplatesModule = /** @class */ (function () {\n function TemplatesModule() {\n }\n TemplatesModule.decorators = [\n { type: NgModule, args: [{\n declarations: [\n CellTemplateDirective,\n MonthCellTemplateDirective,\n YearCellTemplateDirective,\n DecadeCellTemplateDirective,\n CenturyCellTemplateDirective,\n WeekNumberCellTemplateDirective,\n HeaderTitleTemplateDirective,\n NavigationItemTemplateDirective\n ],\n exports: [\n CellTemplateDirective,\n MonthCellTemplateDirective,\n YearCellTemplateDirective,\n DecadeCellTemplateDirective,\n CenturyCellTemplateDirective,\n WeekNumberCellTemplateDirective,\n HeaderTitleTemplateDirective,\n NavigationItemTemplateDirective\n ]\n },] },\n ];\n return TemplatesModule;\n}());\n\n/**\n * @hidden\n */\nvar CalendarMessages = /** @class */ (function (_super) {\n __extends(CalendarMessages, _super);\n function CalendarMessages() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n CalendarMessages.propDecorators = {\n today: [{ type: Input }]\n };\n return CalendarMessages;\n}(ComponentMessages));\n\n/**\n * @hidden\n */\nvar CalendarLocalizedMessagesDirective = /** @class */ (function (_super) {\n __extends(CalendarLocalizedMessagesDirective, _super);\n function CalendarLocalizedMessagesDirective(service) {\n var _this = _super.call(this) || this;\n _this.service = service;\n return _this;\n }\n CalendarLocalizedMessagesDirective.decorators = [\n { type: Directive, args: [{\n providers: [\n {\n provide: CalendarMessages,\n useExisting: forwardRef(function () { return CalendarLocalizedMessagesDirective; }) // tslint:disable-line:no-forward-ref\n }\n ],\n selector: '[kendoCalendarLocalizedMessages]'\n },] },\n ];\n /** @nocollapse */\n CalendarLocalizedMessagesDirective.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return CalendarLocalizedMessagesDirective;\n}(CalendarMessages));\n\n/**\n * Custom component messages override default component messages ([see example]({% slug globalization_dateinputs %}#toc-custom-messages)).\n */\nvar CalendarCustomMessagesComponent = /** @class */ (function (_super) {\n __extends(CalendarCustomMessagesComponent, _super);\n function CalendarCustomMessagesComponent(service) {\n var _this = _super.call(this) || this;\n _this.service = service;\n return _this;\n }\n Object.defineProperty(CalendarCustomMessagesComponent.prototype, \"override\", {\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n CalendarCustomMessagesComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: CalendarMessages,\n useExisting: forwardRef(function () { return CalendarCustomMessagesComponent; }) // tslint:disable-line:no-forward-ref\n }\n ],\n selector: 'kendo-calendar-messages',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n CalendarCustomMessagesComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return CalendarCustomMessagesComponent;\n}(CalendarMessages));\n\nvar COMPONENT_DIRECTIVES = [\n VirtualizationComponent\n];\n/**\n * @hidden\n *\n * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})\n * definition for the Virtualization component.\n */\nvar VirtualizationModule = /** @class */ (function () {\n function VirtualizationModule() {\n }\n VirtualizationModule.decorators = [\n { type: NgModule, args: [{\n declarations: [COMPONENT_DIRECTIVES],\n exports: [COMPONENT_DIRECTIVES],\n imports: [CommonModule]\n },] },\n ];\n return VirtualizationModule;\n}());\n\n/**\n * The exported package module.\n *\n * The package exports:\n * - `CellTemplateDirective`—The month cell template directive.\n * - `MonthCellTemplateDirective`—The month cell template directive.\n * - `YearCellTemplateDirective`—The year cell template directive.\n * - `DecadeCellTemplateDirective`—The decade cell template directive.\n * - `CenturyCellTemplateDirective`—The century cell template directive.\n * - `WeekNumberCellTemplateDirective`—The month week number cell template directive.\n * - `HeaderTitleTemplateDirective`—The header title template directive.\n * - `NavigationItemTemplateDirective`—The navigation item template directive.\n *\n * @example\n *\n * ```ts-no-run\n * // Import the Calendar module\n * import { CalendarModule } from '@progress/kendo-angular-dateinputs';\n *\n * // The browser platform with a compiler\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n *\n * import { NgModule } from '@angular/core';\n *\n * // Import the app component\n * import { AppComponent } from './app.component';\n *\n * // Define the app module\n * _@NgModule({\n * declarations: [AppComponent], // declare app component\n * imports: [BrowserModule, CalendarModule], // import Calendar module\n * bootstrap: [AppComponent]\n * })\n * export class AppModule {}\n *\n * // Compile and launch the module\n * platformBrowserDynamic().bootstrapModule(AppModule);\n *\n * ```\n */\nvar CalendarModule = /** @class */ (function () {\n function CalendarModule() {\n }\n CalendarModule.decorators = [\n { type: NgModule, args: [{\n declarations: [\n CalendarComponent,\n NavigationComponent,\n CalendarCustomMessagesComponent,\n CalendarLocalizedMessagesDirective,\n ViewListComponent\n ],\n exports: [\n CalendarComponent,\n NavigationComponent,\n CalendarCustomMessagesComponent,\n CalendarLocalizedMessagesDirective,\n ViewListComponent,\n CalendarCommonModule,\n TemplatesModule\n ],\n imports: [CommonModule, CalendarCommonModule, IntlModule, TemplatesModule, VirtualizationModule, EventsModule],\n providers: [\n CalendarDOMService,\n CenturyViewService,\n DecadeViewService,\n MonthViewService,\n YearViewService,\n WeekNamesService\n ]\n },] },\n ];\n return CalendarModule;\n}());\n\n/**\n * @hidden\n */\nvar Messages = /** @class */ (function (_super) {\n __extends(Messages, _super);\n function Messages() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Messages.propDecorators = {\n today: [{ type: Input }],\n prevButtonTitle: [{ type: Input }],\n nextButtonTitle: [{ type: Input }]\n };\n return Messages;\n}(ComponentMessages));\n\n/**\n * @hidden\n */\nvar MultiViewCalendarLocalizedMessagesDirective = /** @class */ (function (_super) {\n __extends(MultiViewCalendarLocalizedMessagesDirective, _super);\n function MultiViewCalendarLocalizedMessagesDirective(service) {\n var _this = _super.call(this) || this;\n _this.service = service;\n return _this;\n }\n MultiViewCalendarLocalizedMessagesDirective.decorators = [\n { type: Directive, args: [{\n providers: [\n {\n provide: Messages,\n useExisting: forwardRef(function () { return MultiViewCalendarLocalizedMessagesDirective; }) // tslint:disable-line:no-forward-ref\n }\n ],\n selector: '[kendoMultiViewCalendarLocalizedMessages]'\n },] },\n ];\n /** @nocollapse */\n MultiViewCalendarLocalizedMessagesDirective.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return MultiViewCalendarLocalizedMessagesDirective;\n}(Messages));\n\n/**\n * Custom component messages override default component messages ([see example]({% slug globalization_dateinputs %}#toc-custom-messages)).\n */\nvar MultiViewCalendarCustomMessagesComponent = /** @class */ (function (_super) {\n __extends(MultiViewCalendarCustomMessagesComponent, _super);\n function MultiViewCalendarCustomMessagesComponent(service) {\n var _this = _super.call(this) || this;\n _this.service = service;\n return _this;\n }\n Object.defineProperty(MultiViewCalendarCustomMessagesComponent.prototype, \"override\", {\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n MultiViewCalendarCustomMessagesComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: Messages,\n useExisting: forwardRef(function () { return MultiViewCalendarCustomMessagesComponent; }) // tslint:disable-line:no-forward-ref\n }\n ],\n selector: 'kendo-multiviewcalendar-messages',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n MultiViewCalendarCustomMessagesComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return MultiViewCalendarCustomMessagesComponent;\n}(Messages));\n\n/**\n * The package exports:\n * - `CellTemplateDirective`—The month cell template directive.\n * - `MonthCellTemplateDirective`—The month cell template directive.\n * - `YearCellTemplateDirective`—The year cell template directive.\n * - `DecadeCellTemplateDirective`—The decade cell template directive.\n * - `CenturyCellTemplateDirective`—The century cell template directive.\n * - `WeekNumberCellTemplateDirective`—The month week number cell template directive.\n * - `HeaderTitleTemplateDirective`—The header title template directive.\n *\n * @example\n *\n * ```ts-no-run\n * // Import the MultiViewCalendar module\n * import { MultiViewCalendarModule } from '@progress/kendo-angular-dateinputs';\n *\n * // The browser platform with a compiler\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n *\n * import { NgModule } from '@angular/core';\n *\n * // Import the app component\n * import { AppComponent } from './app.component';\n *\n * // Define the app module\n * _@NgModule({\n * declarations: [AppComponent], // declare app component\n * imports: [BrowserModule, MultiViewCalendarModule], // import MultiViewCalendar module\n * bootstrap: [AppComponent]\n * })\n * export class AppModule {}\n *\n * // Compile and launch the module\n * platformBrowserDynamic().bootstrapModule(AppModule);\n */\nvar MultiViewCalendarModule = /** @class */ (function () {\n function MultiViewCalendarModule() {\n }\n MultiViewCalendarModule.decorators = [\n { type: NgModule, args: [{\n declarations: [\n HorizontalViewListComponent,\n MultiViewCalendarLocalizedMessagesDirective,\n MultiViewCalendarCustomMessagesComponent,\n MultiViewCalendarComponent\n ],\n exports: [\n HorizontalViewListComponent,\n MultiViewCalendarLocalizedMessagesDirective,\n MultiViewCalendarCustomMessagesComponent,\n MultiViewCalendarComponent,\n CalendarCommonModule,\n TemplatesModule\n ],\n imports: [CommonModule, CalendarCommonModule, IntlModule, TemplatesModule, PopupModule],\n providers: [\n NavigationService,\n CenturyViewService,\n DecadeViewService,\n MonthViewService,\n YearViewService,\n WeekNamesService\n ]\n },] },\n ];\n return MultiViewCalendarModule;\n}());\n\n/**\n * The exported package module.\n *\n * The package exports:\n * - `CalendarModule`—The calendar module.\n * - `MultiViewCalendarModule`—The multi-view calendar module.\n *\n * @example\n *\n * ```ts-no-run\n * // Import the Calendars module\n * import { CalendarsModule } from '@progress/kendo-angular-dateinputs';\n *\n * // The browser platform with a compiler\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n *\n * import { NgModule } from '@angular/core';\n *\n * // Import the app component\n * import { AppComponent } from './app.component';\n *\n * // Define the app module\n * _@NgModule({\n * declarations: [AppComponent], // declare app component\n * imports: [BrowserModule, CalendarsModule], // import the Calendars module\n * bootstrap: [AppComponent]\n * })\n * export class AppModule {}\n *\n * // Compile and launch the module\n * platformBrowserDynamic().bootstrapModule(AppModule);\n *\n * ```\n */\nvar CalendarsModule = /** @class */ (function () {\n function CalendarsModule() {\n }\n CalendarsModule.decorators = [\n { type: NgModule, args: [{\n exports: [\n CalendarModule,\n MultiViewCalendarModule\n ],\n imports: [\n CalendarModule,\n MultiViewCalendarModule\n ]\n },] },\n ];\n return CalendarsModule;\n}());\n\n/**\n * @hidden\n */\nvar DateInputMessages = /** @class */ (function (_super) {\n __extends(DateInputMessages, _super);\n function DateInputMessages() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DateInputMessages.propDecorators = {\n decrement: [{ type: Input }],\n increment: [{ type: Input }]\n };\n return DateInputMessages;\n}(ComponentMessages));\n\n/**\n * @hidden\n */\nvar DateInputLocalizedMessagesDirective = /** @class */ (function (_super) {\n __extends(DateInputLocalizedMessagesDirective, _super);\n function DateInputLocalizedMessagesDirective(service) {\n var _this = _super.call(this) || this;\n _this.service = service;\n return _this;\n }\n DateInputLocalizedMessagesDirective.decorators = [\n { type: Directive, args: [{\n providers: [\n {\n provide: DateInputMessages,\n useExisting: forwardRef(function () { return DateInputLocalizedMessagesDirective; }) // tslint:disable-line:no-forward-ref\n }\n ],\n selector: '[kendoDateInputLocalizedMessages]'\n },] },\n ];\n /** @nocollapse */\n DateInputLocalizedMessagesDirective.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return DateInputLocalizedMessagesDirective;\n}(DateInputMessages));\n\n/**\n * Custom component messages override default component messages ([see example]({% slug globalization_dateinputs %}#toc-custom-messages)).\n */\nvar DateInputCustomMessagesComponent = /** @class */ (function (_super) {\n __extends(DateInputCustomMessagesComponent, _super);\n function DateInputCustomMessagesComponent(service) {\n var _this = _super.call(this) || this;\n _this.service = service;\n return _this;\n }\n Object.defineProperty(DateInputCustomMessagesComponent.prototype, \"override\", {\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n DateInputCustomMessagesComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: DateInputMessages,\n useExisting: forwardRef(function () { return DateInputCustomMessagesComponent; }) // tslint:disable-line:no-forward-ref\n }\n ],\n selector: 'kendo-dateinput-messages',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n DateInputCustomMessagesComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return DateInputCustomMessagesComponent;\n}(DateInputMessages));\n\n/**\n * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})\n * definition for the DateInput component.\n */\nvar DateInputModule = /** @class */ (function () {\n function DateInputModule() {\n }\n DateInputModule.decorators = [\n { type: NgModule, args: [{\n declarations: [\n DateInputComponent,\n DateInputCustomMessagesComponent,\n DateInputLocalizedMessagesDirective\n ],\n exports: [\n DateInputComponent,\n DateInputCustomMessagesComponent,\n DateInputLocalizedMessagesDirective\n ],\n imports: [CommonModule, IntlModule, EventsModule]\n },] },\n ];\n return DateInputModule;\n}());\n\n/**\n * @hidden\n */\nvar DatePickerMessages = /** @class */ (function (_super) {\n __extends(DatePickerMessages, _super);\n function DatePickerMessages() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DatePickerMessages.propDecorators = {\n today: [{ type: Input }],\n toggle: [{ type: Input }]\n };\n return DatePickerMessages;\n}(ComponentMessages));\n\n/**\n * @hidden\n */\nvar DatePickerLocalizedMessagesDirective = /** @class */ (function (_super) {\n __extends(DatePickerLocalizedMessagesDirective, _super);\n function DatePickerLocalizedMessagesDirective(service) {\n var _this = _super.call(this) || this;\n _this.service = service;\n return _this;\n }\n DatePickerLocalizedMessagesDirective.decorators = [\n { type: Directive, args: [{\n providers: [\n {\n provide: DatePickerMessages,\n useExisting: forwardRef(function () { return DatePickerLocalizedMessagesDirective; }) // tslint:disable-line:no-forward-ref\n }\n ],\n selector: '[kendoDatePickerLocalizedMessages]'\n },] },\n ];\n /** @nocollapse */\n DatePickerLocalizedMessagesDirective.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return DatePickerLocalizedMessagesDirective;\n}(DatePickerMessages));\n\n/**\n * Custom component messages override default component messages ([see example]({% slug globalization_dateinputs %}#toc-custom-messages)).\n */\nvar DatePickerCustomMessagesComponent = /** @class */ (function (_super) {\n __extends(DatePickerCustomMessagesComponent, _super);\n function DatePickerCustomMessagesComponent(service) {\n var _this = _super.call(this) || this;\n _this.service = service;\n return _this;\n }\n Object.defineProperty(DatePickerCustomMessagesComponent.prototype, \"override\", {\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n DatePickerCustomMessagesComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: DatePickerMessages,\n useExisting: forwardRef(function () { return DatePickerCustomMessagesComponent; }) // tslint:disable-line:no-forward-ref\n }\n ],\n selector: 'kendo-datepicker-messages',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n DatePickerCustomMessagesComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return DatePickerCustomMessagesComponent;\n}(DatePickerMessages));\n\nvar ɵ0$e = touchEnabled;\n/**\n * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})\n * definition for the DatePicker component.\n */\nvar DatePickerModule = /** @class */ (function () {\n function DatePickerModule() {\n }\n DatePickerModule.decorators = [\n { type: NgModule, args: [{\n declarations: [\n DatePickerComponent,\n DatePickerCustomMessagesComponent,\n DatePickerLocalizedMessagesDirective\n ],\n exports: [\n DatePickerComponent,\n DatePickerCustomMessagesComponent,\n DatePickerLocalizedMessagesDirective,\n TemplatesModule\n ],\n imports: [\n CommonModule,\n DateInputModule,\n CalendarModule,\n IntlModule,\n PopupModule,\n TemplatesModule,\n EventsModule\n ],\n providers: [{ provide: TOUCH_ENABLED, useValue: ɵ0$e }]\n },] },\n ];\n return DatePickerModule;\n}());\n\nvar COMPONENT_DIRECTIVES$1 = [\n DateRangeComponent,\n DateRangePopupComponent,\n DateRangePopupTemplateDirective,\n DateRangeSelectionDirective,\n DateRangeStartInputDirective,\n DateRangeEndInputDirective\n];\nvar COMPONENT_MODULES = [\n MultiViewCalendarModule,\n DateInputModule,\n PopupModule,\n EventsModule\n];\n/**\n * The exported package module.\n *\n * The package exports:\n * - `DateRangeComponent`—The DateRange component class.\n * - `DateRangePopupComponent`—The DateRangePopup component class.\n * - `DateRangeSelectionDirective`—The MultiviewCalendar date range selection directive.\n * - `DateRangeEndInputDirective`—The end DateInput date range selection directive.\n * - `DateRangeStartInputDirective`—The start DateInput date range selection directive.\n * - `DateRangePopupTemplateDirective`—The DateRangePopup content template directive.\n * - `MultiViewCalendarModule`—The MultiViewCalendar module.\n *\n * @example\n *\n * ```ts-no-run\n * // Import the DateRange module\n * import { DateRangeModule } from '@progress/kendo-angular-dateinputs';\n *\n * // The browser platform with a compiler\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n *\n * import { NgModule } from '@angular/core';\n *\n * // Import the app component\n * import { AppComponent } from './app.component';\n *\n * // Define the app module\n * _@NgModule({\n * declarations: [AppComponent], // declare app component\n * imports: [BrowserModule, DateRangeModule], // import DateRange module\n * bootstrap: [AppComponent]\n * })\n * export class AppModule {}\n *\n * // Compile and launch the module\n * platformBrowserDynamic().bootstrapModule(AppModule);\n *\n * ```\n */\nvar DateRangeModule = /** @class */ (function () {\n function DateRangeModule() {\n }\n DateRangeModule.decorators = [\n { type: NgModule, args: [{\n declarations: [COMPONENT_DIRECTIVES$1],\n exports: [COMPONENT_DIRECTIVES$1],\n imports: [CommonModule, COMPONENT_MODULES]\n },] },\n ];\n return DateRangeModule;\n}());\n\nvar div$1 = domContainerFactory('div');\nvar ul$1 = domContainerFactory('ul');\nvar li$1 = domContainerFactory('li');\nvar listItem = function () { return li$1('02', 'k-item'); };\nvar list = function () { return ul$1([listItem()], 'k-reset'); };\nvar scrollable$1 = function () { return (div$1([list()], 'k-time-container k-content k-scrollable')); };\nvar timeListWrapper = function () {\n if (!isDocumentAvailable()) {\n return null;\n }\n return div$1([div$1([scrollable$1()], 'k-time-list')], 'k-time-list-wrapper', { left: '-10000px', position: 'absolute' });\n};\nvar TIMELIST_WRAPPER = timeListWrapper();\n/**\n * @hidden\n */\nvar TimePickerDOMService = /** @class */ (function () {\n function TimePickerDOMService() {\n }\n TimePickerDOMService.prototype.ensureHeights = function () {\n if (this.timeListHeight !== undefined) {\n return;\n }\n this.calculateHeights();\n };\n TimePickerDOMService.prototype.calculateHeights = function (container) {\n if (!isDocumentAvailable()) {\n return;\n }\n var listContainer = container && container.querySelector('.k-time-list-container');\n var hostContainer = listContainer || document.body;\n var wrapper = hostContainer.appendChild(TIMELIST_WRAPPER);\n this.timeListHeight = wrapper.querySelector('.k-scrollable').getBoundingClientRect().height;\n this.itemHeight = wrapper.querySelector('li').getBoundingClientRect().height;\n hostContainer.removeChild(wrapper);\n };\n TimePickerDOMService.prototype.isActive = function (element) {\n if (!isDocumentAvailable() || !element) {\n return false;\n }\n return (element.nativeElement || element) === document.activeElement;\n };\n TimePickerDOMService.decorators = [\n { type: Injectable },\n ];\n return TimePickerDOMService;\n}());\n\nvar HOURS_IN_DAY = 24;\nvar clampToRange = function (rangeValue) { return function (value) { return value % rangeValue; }; };\nvar clamp = clampToRange(HOURS_IN_DAY);\nvar stepper = function (start, step) { return function (idx) { return clamp(start + (idx * step)); }; };\nvar distanceFromMin = function (value, min) { return clamp(HOURS_IN_DAY + value - min); };\nvar limit = function (borderValue) { return function (barrier, value) {\n var useBarrier = !value || getDate(barrier).getTime() === getDate(value).getTime();\n return useBarrier ? barrier : setHours(barrier, borderValue);\n}; };\nvar limitDown = limit(0);\nvar limitUp = limit(HOURS_IN_DAY - 1);\n/**\n * @hidden\n */\nvar HoursService = /** @class */ (function () {\n function HoursService(intl) {\n this.intl = intl;\n this.boundRange = false;\n this.insertUndividedMax = false;\n }\n HoursService.prototype.apply = function (value, candidate) {\n return setHours(value, candidate.getHours());\n };\n HoursService.prototype.configure = function (settings) {\n var _this = this;\n var _a = settings.boundRange, boundRange = _a === void 0 ? this.boundRange : _a, _b = settings.insertUndividedMax, insertUndividedMax = _b === void 0 ? this.insertUndividedMax : _b, _c = settings.min, min = _c === void 0 ? this.min : _c, _d = settings.max, max = _d === void 0 ? this.max : _d, part = settings.part, _e = settings.step, step = _e === void 0 ? this.step : _e;\n this.boundRange = boundRange;\n this.insertUndividedMax = insertUndividedMax;\n this.toListItem = function (hour) {\n var date = setHours(MIDNIGHT_DATE, hour);\n return {\n text: _this.intl.formatDate(date, part.pattern),\n value: date\n };\n };\n this.min = min;\n this.max = max;\n this.step = step;\n };\n HoursService.prototype.data = function (selectedValue) {\n var _this = this;\n var min = this.range(selectedValue)[0];\n var getHour = stepper(min, this.step);\n var convertToItem = function (idx) { return (_this.toListItem(getHour(idx))); };\n var data = range(0, this.countFromMin(selectedValue)).map(convertToItem);\n this.addLast(data);\n this.addMissing(data, selectedValue);\n return data;\n };\n HoursService.prototype.isRangeChanged = function (min, max) {\n return !isEqual(this.min, min) || !isEqual(this.max, max);\n };\n HoursService.prototype.limitRange = function (min, max, value) {\n return this.boundRange ? [limitDown(min, value), limitUp(max, value)] : [min, max];\n };\n HoursService.prototype.total = function (value) {\n var last$$1 = this.insertUndividedMax && this.isLastMissing(value) ? 1 : 0;\n var missing = this.isMissing(value) ? 1 : 0;\n return this.countFromMin(value) + missing + last$$1;\n };\n HoursService.prototype.selectedIndex = function (value) {\n return Math.ceil(this.divideByStep(value));\n };\n HoursService.prototype.valueInList = function (value) {\n if (!value) {\n return true;\n }\n var matchMax = this.insertUndividedMax && this.lastHour(value) === value.getHours();\n return matchMax || !this.isMissing(value);\n };\n HoursService.prototype.addLast = function (data, value) {\n if (this.insertUndividedMax && this.isLastMissing(value)) {\n data.push(this.toListItem(this.lastHour(value)));\n }\n return data;\n };\n HoursService.prototype.addMissing = function (data, value) {\n if (this.valueInList(value)) {\n return data;\n }\n var missingItem = this.toListItem(value.getHours());\n data.splice(this.selectedIndex(value), 0, missingItem);\n return data;\n };\n HoursService.prototype.countFromMin = function (value) {\n var _a = this.range(value), min = _a[0], max = _a[1];\n return Math.floor(distanceFromMin(max, min) / this.step) + 1; /* include min */\n };\n HoursService.prototype.isMissing = function (value) {\n if (!value) {\n return false;\n }\n return this.selectedIndex(value) !== this.divideByStep(value);\n };\n HoursService.prototype.isLastMissing = function (value) {\n return this.isMissing(setHours(this.max, this.lastHour(value)));\n };\n HoursService.prototype.divideByStep = function (value) {\n return distanceFromMin(value.getHours(), this.min.getHours()) / this.step;\n };\n HoursService.prototype.lastHour = function (value) {\n return this.range(value)[1];\n };\n HoursService.prototype.range = function (value) {\n var _a = this.limitRange(this.min, this.max, value), min = _a[0], max = _a[1];\n return [min.getHours(), max.getHours()];\n };\n HoursService.decorators = [\n { type: Injectable },\n ];\n /** @nocollapse */\n HoursService.ctorParameters = function () { return [\n { type: IntlService }\n ]; };\n return HoursService;\n}());\n\nvar MINUTES_IN_HOUR = 60;\nvar clampToRange$1 = function (rangeValue) { return function (value) { return value % rangeValue; }; };\nvar clamp$1 = clampToRange$1(MINUTES_IN_HOUR);\nvar stepper$1 = function (start, step) { return function (idx) { return clamp$1(start + (idx * step)); }; };\nvar distanceFromMin$1 = function (value, min) { return clamp$1(MINUTES_IN_HOUR + value - min); };\nvar limit$1 = function (borderValue) { return function (barrier, value) {\n var useBarrier = !value || barrier.getHours() === value.getHours();\n return useBarrier ? barrier : setMinutes(barrier, borderValue);\n}; };\nvar limitDown$1 = limit$1(0);\nvar limitUp$1 = limit$1(MINUTES_IN_HOUR - 1);\n/**\n * @hidden\n */\nvar MinutesService = /** @class */ (function () {\n function MinutesService(intl) {\n this.intl = intl;\n this.insertUndividedMax = false;\n }\n MinutesService.prototype.apply = function (value, candidate) {\n return setMinutes(value, candidate.getMinutes());\n };\n MinutesService.prototype.configure = function (settings) {\n var _this = this;\n var _a = settings.insertUndividedMax, insertUndividedMax = _a === void 0 ? this.insertUndividedMax : _a, _b = settings.min, min = _b === void 0 ? this.min : _b, _c = settings.max, max = _c === void 0 ? this.max : _c, part = settings.part, _d = settings.step, step = _d === void 0 ? this.step : _d;\n this.insertUndividedMax = insertUndividedMax;\n this.toListItem = function (minute) {\n var date = setMinutes(MIDNIGHT_DATE, minute);\n return {\n text: _this.intl.formatDate(date, part.pattern),\n value: date\n };\n };\n this.min = min;\n this.max = max;\n this.step = step;\n };\n MinutesService.prototype.data = function (selectedValue) {\n var _this = this;\n var min = this.range(selectedValue)[0];\n var getMinute = stepper$1(min, this.step);\n var convertToItem = function (idx) { return (_this.toListItem(getMinute(idx))); };\n var data = range(0, this.countFromMin(selectedValue)).map(convertToItem);\n this.addLast(data);\n this.addMissing(data, selectedValue);\n return data;\n };\n MinutesService.prototype.isRangeChanged = function (min, max) {\n return !isEqual(this.min, min) || !isEqual(this.max, max);\n };\n MinutesService.prototype.limitRange = function (min, max, value) {\n return [limitDown$1(min, value), limitUp$1(max, value)];\n };\n MinutesService.prototype.total = function (value) {\n var last$$1 = this.insertUndividedMax && this.isLastMissing(value) ? 1 : 0;\n var missing = this.isMissing(value) ? 1 : 0;\n return this.countFromMin(value) + missing + last$$1;\n };\n MinutesService.prototype.selectedIndex = function (value) {\n return Math.ceil(this.divideByStep(value));\n };\n MinutesService.prototype.valueInList = function (value) {\n if (!value) {\n return true;\n }\n var matchMax = this.insertUndividedMax && this.lastMinute(value) === value.getMinutes();\n return matchMax || !this.isMissing(value);\n };\n MinutesService.prototype.addLast = function (data, value) {\n if (this.insertUndividedMax && this.isLastMissing(value)) {\n data.push(this.toListItem(this.lastMinute(value)));\n }\n return data;\n };\n MinutesService.prototype.addMissing = function (data, value) {\n if (this.valueInList(value)) {\n return data;\n }\n var missingItem = this.toListItem(value.getMinutes());\n data.splice(this.selectedIndex(value), 0, missingItem);\n return data;\n };\n MinutesService.prototype.countFromMin = function (value) {\n var _a = this.range(value), min = _a[0], max = _a[1];\n return Math.floor(distanceFromMin$1(max, min) / this.step) + 1; /* include min */\n };\n MinutesService.prototype.isMissing = function (value) {\n if (!value) {\n return false;\n }\n return this.selectedIndex(value) !== this.divideByStep(value);\n };\n MinutesService.prototype.isLastMissing = function (value) {\n return this.isMissing(setMinutes(this.max, this.lastMinute(value)));\n };\n MinutesService.prototype.divideByStep = function (value) {\n return distanceFromMin$1(value.getMinutes(), this.min.getMinutes()) / this.step;\n };\n MinutesService.prototype.lastMinute = function (value) {\n return this.range(value)[1];\n };\n MinutesService.prototype.range = function (value) {\n var _a = this.limitRange(this.min, this.max, value), min = _a[0], max = _a[1];\n return [min.getMinutes(), max.getMinutes()];\n };\n MinutesService.decorators = [\n { type: Injectable },\n ];\n /** @nocollapse */\n MinutesService.ctorParameters = function () { return [\n { type: IntlService }\n ]; };\n return MinutesService;\n}());\n\nvar SECONDS_IN_HOUR = 60;\nvar clampToRange$2 = function (rangeValue) { return function (value) { return value % rangeValue; }; };\nvar clamp$2 = clampToRange$2(SECONDS_IN_HOUR);\nvar stepper$2 = function (start, step) { return function (idx) { return clamp$2(start + (idx * step)); }; };\nvar distanceFromMin$2 = function (value, min) { return clamp$2(SECONDS_IN_HOUR + value - min); };\nvar limit$2 = function (borderValue) { return function (barrier, value) {\n var useBarrier = !value || barrier.getHours() === value.getHours() && barrier.getMinutes() === value.getMinutes();\n return useBarrier ? barrier : setSeconds(barrier, borderValue);\n}; };\nvar limitDown$2 = limit$2(0);\nvar limitUp$2 = limit$2(SECONDS_IN_HOUR - 1);\n/**\n * @hidden\n */\nvar SecondsService = /** @class */ (function () {\n function SecondsService(intl) {\n this.intl = intl;\n this.insertUndividedMax = false;\n }\n SecondsService.prototype.apply = function (value, candidate) {\n return setSeconds(value, candidate.getSeconds());\n };\n SecondsService.prototype.configure = function (settings) {\n var _this = this;\n var _a = settings.insertUndividedMax, insertUndividedMax = _a === void 0 ? this.insertUndividedMax : _a, _b = settings.min, min = _b === void 0 ? this.min : _b, _c = settings.max, max = _c === void 0 ? this.max : _c, part = settings.part, _d = settings.step, step = _d === void 0 ? this.step : _d;\n this.insertUndividedMax = insertUndividedMax;\n this.toListItem = function (minute) {\n var date = setSeconds(MIDNIGHT_DATE, minute);\n return {\n text: _this.intl.formatDate(date, part.pattern),\n value: date\n };\n };\n this.min = min;\n this.max = max;\n this.step = step;\n };\n SecondsService.prototype.data = function (selectedValue) {\n var _this = this;\n var min = this.range(selectedValue)[0];\n var getSecond = stepper$2(min, this.step);\n var convertToItem = function (idx) { return (_this.toListItem(getSecond(idx))); };\n var data = range(0, this.countFromMin(selectedValue)).map(convertToItem);\n this.addLast(data);\n this.addMissing(data, selectedValue);\n return data;\n };\n SecondsService.prototype.isRangeChanged = function (min, max) {\n return !isEqual(this.min, min) || !isEqual(this.max, max);\n };\n SecondsService.prototype.limitRange = function (min, max, value) {\n return [limitDown$2(min, value), limitUp$2(max, value)];\n };\n SecondsService.prototype.total = function (value) {\n var last$$1 = this.insertUndividedMax && this.isLastMissing(value) ? 1 : 0;\n var missing = this.isMissing(value) ? 1 : 0;\n return this.countFromMin(value) + missing + last$$1;\n };\n SecondsService.prototype.selectedIndex = function (value) {\n return Math.ceil(this.divideByStep(value));\n };\n SecondsService.prototype.valueInList = function (value) {\n if (!value) {\n return true;\n }\n var matchMax = this.insertUndividedMax && this.lastSecond(value) === value.getSeconds();\n return matchMax || !this.isMissing(value);\n };\n SecondsService.prototype.divideByStep = function (value) {\n return distanceFromMin$2(value.getSeconds(), this.min.getSeconds()) / this.step;\n };\n SecondsService.prototype.addLast = function (data, value) {\n if (this.insertUndividedMax && this.isLastMissing(value)) {\n data.push(this.toListItem(this.lastSecond(value)));\n }\n return data;\n };\n SecondsService.prototype.addMissing = function (data, value) {\n if (this.valueInList(value)) {\n return data;\n }\n var missingItem = this.toListItem(value.getSeconds());\n data.splice(this.selectedIndex(value), 0, missingItem);\n return data;\n };\n SecondsService.prototype.countFromMin = function (value) {\n var _a = this.range(value), min = _a[0], max = _a[1];\n return Math.floor(distanceFromMin$2(max, min) / this.step) + 1; /* include min */\n };\n SecondsService.prototype.isMissing = function (value) {\n if (!value) {\n return false;\n }\n return this.selectedIndex(value) !== this.divideByStep(value);\n };\n SecondsService.prototype.isLastMissing = function (value) {\n return this.isMissing(setSeconds(this.max, this.lastSecond(value)));\n };\n SecondsService.prototype.lastSecond = function (value) {\n return this.range(value)[1];\n };\n SecondsService.prototype.range = function (value) {\n var _a = this.limitRange(this.min, this.max, value), min = _a[0], max = _a[1];\n return [min.getSeconds(), max.getSeconds()];\n };\n SecondsService.decorators = [\n { type: Injectable },\n ];\n /** @nocollapse */\n SecondsService.ctorParameters = function () { return [\n { type: IntlService }\n ]; };\n return SecondsService;\n}());\n\nvar setHours$1 = function (date, hours) {\n var clone = cloneDate(date);\n clone.setHours(hours);\n return clone;\n};\nvar isAM = function (value) { return value !== null && value < 12; };\nvar isPM = function (value) { return value !== null && (!value || value > 11); };\nvar inRange = function (value, min, max) { return ((!min && !max) || (value >= min && value <= max)); };\nvar inReverseRange = function (value, min, max) { return ((!min && !max) || value >= min || value <= max); };\n/**\n * @hidden\n */\nvar DayPeriodService = /** @class */ (function () {\n function DayPeriodService(intl) {\n this.intl = intl;\n }\n /**\n * @hidden\n */\n DayPeriodService.prototype.apply = function (value, candidate) {\n var hour = value.getHours();\n var hourAM = isAM(hour);\n var candidateAM = isAM(candidate.getHours());\n if ((hourAM && candidateAM) || (!hourAM && !candidateAM)) {\n return value;\n }\n var _a = this.normalizedRange(), min = _a[0], _b = _a[1], max = _b === void 0 ? 24 : _b;\n var result = hour + (candidateAM ? -12 : 12);\n return setHours$1(value, Math.min(Math.max(min, result), (max || 24)));\n };\n /**\n * @hidden\n */\n DayPeriodService.prototype.configure = function (settings) {\n var _a = settings.min, min = _a === void 0 ? this.min : _a, _b = settings.max, max = _b === void 0 ? this.max : _b, _c = settings.part, part = _c === void 0 ? this.part : _c;\n this.min = min;\n this.max = max;\n this.part = part;\n };\n /**\n * @hidden\n */\n DayPeriodService.prototype.data = function (_) {\n var names = this.part.names;\n if (!names) {\n return [];\n }\n var data = [];\n var _a = this.normalizedRange(), min = _a[0], max = _a[1];\n var dayPeriod = this.intl.dateFormatNames(names);\n if (isAM(min)) {\n data.push({ text: dayPeriod.am, value: setHours$1(this.min, min) });\n }\n if (isPM(max)) {\n data.push({ text: dayPeriod.pm, value: setHours$1(this.min, Math.max(12, max)) });\n }\n return this.min.getHours() !== min ? data.reverse() : data;\n };\n /**\n * @hidden\n */\n DayPeriodService.prototype.isRangeChanged = function (_, __) {\n return false;\n };\n /**\n * @hidden\n */\n DayPeriodService.prototype.limitRange = function (min, max, _) {\n return [min, max];\n };\n /**\n * @hidden\n */\n DayPeriodService.prototype.total = function () {\n var _a = this.normalizedRange(), min = _a[0], max = _a[1];\n if (!min && !max) {\n return 2;\n }\n if (min > 11 || max < 12) {\n return 1;\n }\n return 2;\n };\n /**\n * @hidden\n */\n DayPeriodService.prototype.selectedIndex = function (value) {\n if (!this.valueInList(value)) {\n return -1;\n }\n var index = Math.floor(value.getHours() / 12);\n return this.min.getHours() === this.normalizedRange()[0] ? index : (index === 0 ? 1 : 0);\n };\n /**\n * @hidden\n */\n DayPeriodService.prototype.valueInList = function (value) {\n var reverse = this.min.getHours() !== this.normalizedRange()[0];\n var isInRange = reverse ? inReverseRange : inRange;\n return isInRange(value.getHours(), this.min.getHours(), this.max.getHours());\n };\n DayPeriodService.prototype.normalizedRange = function () {\n var minHour = this.min.getHours();\n var maxHour = this.max.getHours();\n return [\n Math.min(minHour, maxHour),\n Math.max(minHour, maxHour)\n ];\n };\n DayPeriodService.decorators = [\n { type: Injectable },\n ];\n /** @nocollapse */\n DayPeriodService.ctorParameters = function () { return [\n { type: IntlService }\n ]; };\n return DayPeriodService;\n}());\n\nvar _a$6;\nvar SNAP_THRESHOLD = 0.05; //% of the item height\nvar SCROLL_THRESHOLD = 2; //< 2px threshold\nvar nil = function () { return (null); };\nvar getters = {\n 35: function (data, _) { return data[data.length - 1]; },\n 36: function (data, _) { return data[0]; },\n 38: function (data, index) { return data[index - 1]; },\n 40: function (data, index) { return data[index + 1]; }\n};\nvar services$1 = (_a$6 = {},\n _a$6[TIME_PART.dayperiod] = DayPeriodService,\n _a$6[TIME_PART.hour] = HoursService,\n _a$6[TIME_PART.minute] = MinutesService,\n _a$6[TIME_PART.second] = SecondsService,\n _a$6);\n/**\n * @hidden\n */\nvar TimeListComponent = /** @class */ (function () {\n function TimeListComponent(element, injector, dom, renderer, zone) {\n this.element = element;\n this.injector = injector;\n this.dom = dom;\n this.renderer = renderer;\n this.zone = zone;\n this.min = cloneDate(MIDNIGHT_DATE);\n this.max = cloneDate(MAX_TIME);\n this.step = 1;\n this.disabled = false;\n this.valueChange = new EventEmitter();\n this.componentClass = true;\n this.animateToIndex = true;\n this.isActive = false;\n this.skip = 0;\n this.total = 60;\n this.data = [];\n this.indexToScroll = -1;\n this.domEvents = [];\n }\n Object.defineProperty(TimeListComponent.prototype, \"tabIndex\", {\n get: function () {\n return this.disabled ? undefined : 0;\n },\n enumerable: true,\n configurable: true\n });\n TimeListComponent.prototype.ngOnChanges = function (changes) {\n if (changes.part) {\n this.service = this.injector.get(services$1[this.part.type]);\n this.service.configure(this.serviceSettings());\n }\n var value = this.value;\n var valueChanges = changes.value || {};\n var _a = this.service.limitRange(this.min, this.max, value), min = _a[0], max = _a[1];\n if (this.service.isRangeChanged(min, max) || changes.min || changes.max || changes.step) {\n this.data = [];\n this.service.configure(this.serviceSettings({ min: min, max: max }));\n }\n // Skip the rendering of the list whenever possible\n if (!this.data.length || this.hasMissingValue(valueChanges)) {\n this.animateToIndex = false;\n this.data = this.service.data(value);\n }\n this.animateToIndex = this.animateToIndex && this.textHasChanged(valueChanges);\n this.total = this.service.total(value);\n this.indexToScroll = this.selectedIndex(value);\n };\n TimeListComponent.prototype.ngOnInit = function () {\n var _this = this;\n this.animateToIndex = true;\n this.dom.ensureHeights();\n this.itemHeight = this.dom.itemHeight;\n this.listHeight = this.dom.timeListHeight;\n this.topOffset = (this.listHeight - this.itemHeight) / 2;\n this.bottomOffset = this.listHeight - this.itemHeight;\n this.topThreshold = this.itemHeight * SNAP_THRESHOLD;\n this.bottomThreshold = this.itemHeight * (1 - SNAP_THRESHOLD);\n var translate = \"translateY(\" + this.topOffset + \"px)\";\n this.style = { transform: translate, '-ms-transform': translate };\n if (this.element) {\n this.zone.runOutsideAngular(function () {\n _this.bindEvents();\n });\n }\n };\n TimeListComponent.prototype.ngOnDestroy = function () {\n this.scrollSubscription.unsubscribe();\n this.domEvents.forEach(function (unbindCallback) { return unbindCallback(); });\n };\n TimeListComponent.prototype.ngAfterViewInit = function () {\n var _this = this;\n this.scrollOnce(function (index) { return _this.virtualization.scrollToIndex(index); });\n };\n TimeListComponent.prototype.ngAfterViewChecked = function () {\n var _this = this;\n this.scrollOnce(function (index) {\n var action = _this.animateToIndex ? 'animateToIndex' : 'scrollToIndex';\n _this.virtualization[action](index);\n _this.animateToIndex = true;\n });\n };\n TimeListComponent.prototype.handleChange = function (dataItem) {\n var candidate = this.service.apply(this.value, dataItem.value);\n if (this.value.getTime() === candidate.getTime()) {\n return;\n }\n this.indexToScroll = this.data.indexOf(dataItem);\n this.value = candidate;\n this.valueChange.emit(candidate);\n };\n TimeListComponent.prototype.handleItemClick = function (args) {\n var item = closestInScope(args.target, function (node) { return node.hasAttribute('data-timelist-item-index'); }, this.element.nativeElement);\n if (item) {\n var index = item.getAttribute('data-timelist-item-index');\n this.handleChange(this.data[index]);\n }\n };\n /**\n * Focuses the host element of the TimeList.\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * `\n * })\n * class AppComponent { }\n * ```\n */\n TimeListComponent.prototype.focus = function () {\n if (!this.element) {\n return;\n }\n this.element.nativeElement.focus();\n };\n /**\n * Blurs the TimeList component.\n */\n TimeListComponent.prototype.blur = function () {\n if (!this.element) {\n return;\n }\n this.element.nativeElement.blur();\n };\n TimeListComponent.prototype.itemOffset = function (scrollTop) {\n var valueIndex = this.selectedIndex(this.value);\n var activeIndex = this.virtualization.activeIndex();\n var offset = this.virtualization.itemOffset(activeIndex);\n var distance = Math.abs(Math.ceil(scrollTop) - offset);\n if (valueIndex === activeIndex && distance < SCROLL_THRESHOLD) {\n return offset;\n }\n var scrollUp = valueIndex > activeIndex;\n var moveToNext = scrollUp && distance >= this.bottomThreshold || !scrollUp && distance > this.topThreshold;\n return moveToNext ? this.virtualization.itemOffset(activeIndex + 1) : offset;\n };\n TimeListComponent.prototype.hasMissingValue = function (_a) {\n var previousValue = _a.previousValue, currentValue = _a.currentValue;\n var isPreviousMissing = previousValue && !this.service.valueInList(previousValue);\n var isCurrentMissing = currentValue && !this.service.valueInList(currentValue);\n return isPreviousMissing || isCurrentMissing;\n };\n TimeListComponent.prototype.scrollOnce = function (action) {\n if (this.indexToScroll !== -1) {\n action(this.indexToScroll);\n this.indexToScroll = -1;\n }\n };\n TimeListComponent.prototype.serviceSettings = function (settings) {\n var defaults = {\n boundRange: false,\n insertUndividedMax: false,\n max: this.max,\n min: this.min,\n part: this.part,\n step: this.step\n };\n var result = Object.assign({}, defaults, settings);\n result.boundRange = result.part.type !== 'hour';\n return result;\n };\n TimeListComponent.prototype.selectedIndex = function (value) {\n if (!value) {\n return -1;\n }\n return this.service.selectedIndex(value);\n };\n TimeListComponent.prototype.textHasChanged = function (_a) {\n var previousValue = _a.previousValue, currentValue = _a.currentValue;\n if (!previousValue || !currentValue) {\n return false;\n }\n var oldData = this.data[this.selectedIndex(previousValue)];\n var newData = this.data[this.selectedIndex(currentValue)];\n return oldData && newData && oldData.text !== newData.text;\n };\n TimeListComponent.prototype.handleKeyDown = function (e) {\n var getter = getters[e.keyCode] || nil;\n var dataItem = getter(this.data, this.service.selectedIndex(this.value));\n if (dataItem) {\n this.handleChange(dataItem);\n e.preventDefault();\n }\n };\n TimeListComponent.prototype.bindEvents = function () {\n var _this = this;\n this.scrollSubscription = this.virtualization\n .scroll$()\n .pipe(debounceTime(100), map(function (e) { return e.target.scrollTop; }), map(function (top) { return _this.itemOffset(top); }), map(function (itemOffset) { return _this.virtualization.itemIndex(itemOffset); }))\n .subscribe(function (index) {\n _this.virtualization.scrollToIndex(index);\n _this.handleChange(_this.data[index]);\n });\n var element = this.element.nativeElement;\n this.domEvents.push(this.renderer.listen(element, 'mouseover', function () { return !_this.isActive && _this.focus(); }), this.renderer.listen(element, 'click', function () { return _this.focus(); }), this.renderer.listen(element, 'blur', function () { return _this.isActive = false; }), this.renderer.listen(element, 'focus', function () { return _this.isActive = true; }), this.renderer.listen(element, 'keydown', this.handleKeyDown.bind(this)));\n };\n TimeListComponent.decorators = [\n { type: Component, args: [{\n selector: 'kendo-timelist',\n template: \"\\n \\n \\n - \\n {{item.text}}\\n
\\n
\\n \\n \"\n },] },\n ];\n /** @nocollapse */\n TimeListComponent.ctorParameters = function () { return [\n { type: ElementRef },\n { type: Injector },\n { type: TimePickerDOMService },\n { type: Renderer2 },\n { type: NgZone }\n ]; };\n TimeListComponent.propDecorators = {\n min: [{ type: Input }],\n max: [{ type: Input }],\n part: [{ type: Input }],\n step: [{ type: Input }],\n disabled: [{ type: Input }],\n value: [{ type: Input }],\n valueChange: [{ type: Output }],\n virtualization: [{ type: ViewChild, args: [VirtualizationComponent, { static: true },] }],\n tabIndex: [{ type: HostBinding, args: [\"attr.tabindex\",] }],\n componentClass: [{ type: HostBinding, args: [\"class.k-time-list\",] }]\n };\n return TimeListComponent;\n}());\n\nvar isEqualTillMinute = function (value, min) { return value.getHours() === min.getHours() && value.getMinutes() === min.getMinutes(); };\nvar isEqualTillSecond = function (value, min) { return isEqualTillMinute(value, min) && value.getSeconds() === min.getSeconds(); };\nvar isEqualTillMillisecond = function (value, min) { return isEqualTillSecond(value, min) && value.getMilliseconds() === min.getMilliseconds(); };\nvar ɵ3$6 = function (value) { return value.getHours(); }, ɵ4$2 = function (_, min) { return min.getHours(); }, ɵ5$1 = function (value) { return value.getMinutes(); }, ɵ6$1 = function (value, min) { return isEqualTillMinute(value, min) ? min.getMinutes() : 0; }, ɵ7$1 = function (value) { return value.getSeconds(); }, ɵ8$1 = function (value, min) { return isEqualTillSecond(value, min) ? min.getSeconds() : 0; }, ɵ9$1 = function (value) { return value.getMilliseconds(); }, ɵ10$1 = function (value, min) { return isEqualTillMillisecond(value, min) ? min.getMilliseconds() : 0; };\nvar defaultGetters = [\n {\n type: TIME_PART.hour,\n getter: ɵ3$6,\n minGetter: ɵ4$2\n }, {\n type: TIME_PART.minute,\n getter: ɵ5$1,\n minGetter: ɵ6$1\n }, {\n type: TIME_PART.second,\n getter: ɵ7$1,\n minGetter: ɵ8$1\n }, {\n type: TIME_PART.millisecond,\n getter: ɵ9$1,\n minGetter: ɵ10$1\n }\n];\nvar left = function (getter) { return function (origin, _) { return getter(origin); }; };\nvar right = function (getter) { return function (_, candidate) { return getter(candidate); }; };\nvar convertToObject = function (parts) { return parts.reduce(function (obj, p) { obj[p.type] = p.type; return obj; }, {}); };\nvar getterByPart = function (parts) { return function (g) { return parts[g.type] ? right(g.getter) : left(g.getter); }; };\nvar gettersFactory = function (getters) { return function (parts) { return (getters.map(getterByPart(convertToObject(parts)))); }; };\nvar snapValue = function (getter, minGetter, step) { return function (date, min) {\n var value = getter(date);\n var minValue = minGetter(date, min);\n var rest = value - minValue;\n if (rest < 0) {\n return minValue;\n }\n var mod = rest % step;\n return value - mod + (mod > step / 2 ? step : 0);\n}; };\nvar snappersFactory = function (getters) { return function (steps) { return (getters.map(function (g) {\n var step = steps[g.type];\n return step ? snapValue(g.getter, g.minGetter, step) : g.getter;\n})); }; };\n/**\n * @hidden\n */\nvar generateGetters = gettersFactory(defaultGetters);\n/**\n * @hidden\n */\nvar generateSnappers = snappersFactory(defaultGetters);\n/**\n * @hidden\n */\nvar valueMerger = function (getters) { return function (origin, candidate) {\n origin.setHours.apply(origin, getters.map(function (g) { return g(origin, candidate); }));\n return origin;\n}; };\n/**\n * @hidden\n */\nvar snapTime = function (snappers) { return function (candidate, min) {\n var date = cloneDate(candidate);\n date.setHours.apply(date, snappers.map(function (s) { return s(date, min); }));\n return date;\n}; };\n\nvar listReducer = function (state, list, idx, all) {\n if (state.length || !list.isActive) {\n return state;\n }\n return [{\n next: all[idx + 1] || list,\n prev: all[idx - 1] || list\n }];\n};\nvar Direction;\n(function (Direction) {\n Direction[Direction[\"Left\"] = 0] = \"Left\";\n Direction[Direction[\"Right\"] = 1] = \"Right\";\n})(Direction || (Direction = {}));\n/**\n * @hidden\n *\n * Represents the Kendo UI TimeSelector component for Angular.\n */\nvar TimeSelectorComponent = /** @class */ (function () {\n function TimeSelectorComponent(localization, cdr, element, intl, dom, zone, renderer, pickerService) {\n this.localization = localization;\n this.cdr = cdr;\n this.element = element;\n this.intl = intl;\n this.dom = dom;\n this.zone = zone;\n this.renderer = renderer;\n this.pickerService = pickerService;\n /**\n * @hidden\n */\n this.componentClass = true;\n /**\n * Specifies the time format used to display the time list columns.\n */\n this.format = 't';\n /**\n * Specifies the smallest valid time value.\n */\n this.min = cloneDate(MIN_TIME);\n /**\n * Specifies the biggest valid time value.\n */\n this.max = cloneDate(MAX_TIME);\n /**\n * Determines whether to display the **Cancel** button in the popup.\n */\n this.cancelButton = true;\n /**\n * Determines whether to display the **Set** button in the popup.\n */\n this.setButton = true;\n /**\n * Determines whether to display the **Now** button in the popup.\n *\n * > If the current time is out of range or the incremental step is greater than `1`, the **Now** button will be hidden.\n */\n this.nowButton = true;\n /**\n * Sets or gets the `disabled` property of the TimeSelector and determines whether the component is active.\n */\n this.disabled = false;\n /**\n * Specifies the value of the TimeSelector component.\n */\n this.value = null;\n /**\n * Fires each time the user selects a new value.\n */\n this.valueChange = new EventEmitter();\n /**\n * Fires each time the user cancels the selected value.\n */\n this.valueReject = new EventEmitter();\n this.isActive = false;\n this.showNowButton = true;\n this._activeListIndex = -1;\n this._steps = {};\n this.domEvents = [];\n if (this.pickerService) {\n this.pickerService.timeSelector = this;\n }\n }\n Object.defineProperty(TimeSelectorComponent.prototype, \"disabledClass\", {\n /**\n * @hidden\n */\n get: function () {\n return this.disabled;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TimeSelectorComponent.prototype, \"steps\", {\n get: function () {\n return this._steps;\n },\n /**\n * Configures the incremental steps of the TimeSelector.\n *\n * The available options are:\n * - `hour: Number`—Controls the incremental step of the hour value.\n * - `minute: Number`—Controls the incremental step of the minute value.\n * - `second: Number`—Controls the incremental step of the second value.\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * `\n * })\n * class AppComponent {\n * public steps = { hour: 2, minute: 15, second: 15 };\n * }\n * ```\n *\n * > If the incremental step is greater than `1`, the **Now** button will be hidden.\n */\n set: function (steps) {\n this._steps = steps || {};\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TimeSelectorComponent.prototype, \"current\", {\n get: function () {\n return this._current;\n },\n set: function (value) {\n this._current = timeInRange(this.snapTime(cloneDate(value || MIDNIGHT_DATE), this.min), this.min, this.max);\n if (!NgZone.isInAngularZone()) {\n this.cdr.detectChanges();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TimeSelectorComponent.prototype, \"activeListIndex\", {\n get: function () {\n return this._activeListIndex;\n },\n set: function (value) {\n var _this = this;\n this._activeListIndex = value;\n if (!this.timeListWrappers || !this.timeListWrappers.length) {\n return;\n }\n this.timeListWrappers.forEach(function (listWrapper) {\n _this.renderer.removeClass(listWrapper.nativeElement, 'k-state-focused');\n });\n if (value >= 0) {\n var listIndex = this.listIndex(value);\n var focusedWrapper = this.timeListWrappers.toArray()[listIndex];\n if (focusedWrapper) {\n this.renderer.addClass(focusedWrapper.nativeElement, 'k-state-focused');\n }\n }\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @hidden\n */\n TimeSelectorComponent.prototype.ngOnInit = function () {\n var _this = this;\n this.subscriptions = this.intl.changes.subscribe(this.intlChange.bind(this));\n if (this.localization) {\n this.subscriptions.add(this.localization\n .changes\n .subscribe(function () { return _this.cdr.markForCheck(); }));\n }\n this.dom.calculateHeights(this.element.nativeElement);\n this.init();\n this.bindEvents();\n };\n /**\n * @hidden\n */\n TimeSelectorComponent.prototype.ngOnChanges = function (_) {\n this.init();\n };\n TimeSelectorComponent.prototype.ngOnDestroy = function () {\n if (this.subscriptions) {\n this.subscriptions.unsubscribe();\n }\n if (this.pickerService) {\n this.pickerService.timeSelector = null;\n }\n this.domEvents.forEach(function (unbindCallback) { return unbindCallback(); });\n };\n /**\n * Focuses the TimeSelector component.\n *\n * @example\n * ```ts\n * _@Component({\n * selector: 'my-app',\n * template: `\n * \n * \n * `\n * })\n * class AppComponent { }\n * ```\n */\n TimeSelectorComponent.prototype.focus = function () {\n var list = this.timeLists.first;\n if (!list) {\n return;\n }\n list.focus();\n };\n /**\n * Blurs the TimeSelector component.\n */\n TimeSelectorComponent.prototype.blur = function () {\n var list = this.timeLists.first;\n if (!list) {\n return;\n }\n list.blur();\n };\n /**\n * @hidden\n */\n TimeSelectorComponent.prototype.handleAccept = function () {\n this.handleChange(this.mergeValue(cloneDate(this.value || getDate(getNow())), this.current));\n };\n /**\n * @hidden\n */\n TimeSelectorComponent.prototype.handleNow = function () {\n this.current = getNow();\n this.handleChange(this.current);\n this.cdr.markForCheck();\n };\n /**\n * @hidden\n */\n TimeSelectorComponent.prototype.handleReject = function () {\n this.current = this.value;\n this.valueReject.emit();\n };\n /**\n * @hidden\n */\n TimeSelectorComponent.prototype.handleFocus = function (args) {\n if (this.isActive) {\n return;\n }\n this.isActive = true;\n this.emitFocus(args);\n };\n /**\n * @hidden\n */\n TimeSelectorComponent.prototype.handleListFocus = function (args) {\n var index = parseInt(args.target.getAttribute('data-timelist-index'), 10);\n this.activeListIndex = index;\n this.handleFocus(args);\n };\n /**\n * @hidden\n */\n TimeSelectorComponent.prototype.handleBlur = function (args) {\n var currentTarget = currentFocusTarget(args);\n if (currentTarget && this.containsElement(currentTarget)) {\n return;\n }\n this.activeListIndex = -1;\n this.isActive = false;\n this.emitBlur(args);\n };\n /**\n * @hidden\n */\n TimeSelectorComponent.prototype.containsElement = function (element) {\n var _this = this;\n return Boolean(closest(element, function (node) { return node === _this.element.nativeElement; }));\n };\n TimeSelectorComponent.prototype.partStep = function (part) {\n return this.steps[part.type] || 1;\n };\n TimeSelectorComponent.prototype.init = function (changes) {\n if (!changes || hasChange(changes, 'format')) {\n this.dateFormatParts = this.intl.splitDateFormat(this.format);\n this.mergeValue = valueMerger(generateGetters(this.dateFormatParts));\n }\n if (!changes || hasChange(changes, 'steps')) {\n this.snapTime = snapTime(generateSnappers(this.steps));\n }\n if (!changes || hasChange(changes, 'value')) {\n this.current = this.value;\n }\n this.showNowButton = !this.hasSteps() && this.nowButton && isInTimeRange(getNow(), this.min, this.max);\n };\n TimeSelectorComponent.prototype.focusList = function (dir) {\n if (!this.timeLists.length) {\n return;\n }\n this.timeLists.reduce(listReducer, [])\n .map(function (state) { return dir === Direction.Right ? state.next : state.prev; })\n .map(function (list) { return list && list.focus(); });\n };\n TimeSelectorComponent.prototype.handleChange = function (value) {\n this.value = value;\n this.valueChange.emit(cloneDate(value));\n };\n TimeSelectorComponent.prototype.hasActiveButton = function () {\n var _this = this;\n if (!this.accept) {\n return false;\n }\n return [this.accept, this.cancel, this.now].reduce(function (isActive, el) { return isActive || _this.dom.isActive(el); }, false);\n };\n TimeSelectorComponent.prototype.hasSteps = function () {\n var _this = this;\n var keys = Object.keys(this.steps);\n return keys.length !== keys.reduce(function (acc, k) { return acc + _this.steps[k]; }, 0);\n };\n TimeSelectorComponent.prototype.intlChange = function () {\n this.dateFormatParts = this.intl.splitDateFormat(this.format);\n this.mergeValue = valueMerger(generateGetters(this.dateFormatParts));\n this.cdr.markForCheck();\n };\n TimeSelectorComponent.prototype.bindEvents = function () {\n var _this = this;\n if (this.element) {\n this.zone.runOutsideAngular(function () {\n _this.domEvents.push(_this.renderer.listen(_this.element.nativeElement, 'keydown', _this.handleKeydown.bind(_this)));\n });\n }\n };\n TimeSelectorComponent.prototype.handleKeydown = function (args) {\n var keyCode = args.keyCode, altKey = args.altKey;\n // reserve the alt + arrow key commands for the picker\n var arrowKeyPressed = [Keys.ArrowLeft, Keys.ArrowRight].indexOf(keyCode) !== -1;\n if (isPresent(this.pickerService) && arrowKeyPressed && altKey) {\n return;\n }\n if (keyCode === Keys.Enter && !this.hasActiveButton()) {\n this.handleAccept();\n }\n else if (keyCode === Keys.ArrowLeft || keyCode === Keys.ArrowRight) {\n this.focusList(keyCode === Keys.ArrowLeft ? Direction.Left : Direction.Right);\n }\n };\n TimeSelectorComponent.prototype.emitBlur = function (args) {\n if (this.pickerService) {\n this.pickerService.onBlur.emit(args);\n }\n };\n TimeSelectorComponent.prototype.emitFocus = function (args) {\n if (this.pickerService) {\n this.pickerService.onFocus.emit(args);\n }\n };\n TimeSelectorComponent.prototype.listIndex = function (partIndex) {\n var listIdx = 0;\n var partIdx = 0;\n while (partIdx < partIndex) {\n if (this.dateFormatParts[partIdx].type !== 'literal') {\n listIdx++;\n }\n partIdx++;\n }\n return listIdx;\n };\n TimeSelectorComponent.decorators = [\n { type: Component, args: [{\n changeDetection: ChangeDetectionStrategy.OnPush,\n exportAs: 'kendo-timeselector',\n providers: [\n LocalizationService,\n {\n provide: L10N_PREFIX,\n useValue: 'kendo.timeselector'\n }\n ],\n selector: 'kendo-timeselector',\n template: \"\\n \\n \\n \\n \\n
\\n
\\n \\n {{intl.dateFieldName(part)}}\\n \\n
\\n \\n {{part.pattern}}\\n
\\n \\n
\\n \\n \"\n },] },\n ];\n /** @nocollapse */\n TimeSelectorComponent.ctorParameters = function () { return [\n { type: LocalizationService },\n { type: ChangeDetectorRef },\n { type: ElementRef },\n { type: IntlService },\n { type: TimePickerDOMService },\n { type: NgZone },\n { type: Renderer2 },\n { type: PickerService, decorators: [{ type: Optional }] }\n ]; };\n TimeSelectorComponent.propDecorators = {\n accept: [{ type: ViewChild, args: ['accept',] }],\n cancel: [{ type: ViewChild, args: ['cancel',] }],\n now: [{ type: ViewChild, args: ['now',] }],\n timeLists: [{ type: ViewChildren, args: [TimeListComponent,] }],\n timeListWrappers: [{ type: ViewChildren, args: ['listWrapper',] }],\n componentClass: [{ type: HostBinding, args: ['class.k-timeselector',] }],\n disabledClass: [{ type: HostBinding, args: ['class.k-state-disabled',] }],\n format: [{ type: Input }],\n min: [{ type: Input }],\n max: [{ type: Input }],\n cancelButton: [{ type: Input }],\n setButton: [{ type: Input }],\n nowButton: [{ type: Input }],\n disabled: [{ type: Input }],\n steps: [{ type: Input }],\n value: [{ type: Input }],\n valueChange: [{ type: Output }],\n valueReject: [{ type: Output }]\n };\n return TimeSelectorComponent;\n}());\n\n/**\n * @hidden\n */\nvar TimePickerMessages = /** @class */ (function (_super) {\n __extends(TimePickerMessages, _super);\n function TimePickerMessages() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TimePickerMessages.propDecorators = {\n accept: [{ type: Input }],\n acceptLabel: [{ type: Input }],\n cancel: [{ type: Input }],\n cancelLabel: [{ type: Input }],\n now: [{ type: Input }],\n nowLabel: [{ type: Input }],\n toggle: [{ type: Input }]\n };\n return TimePickerMessages;\n}(ComponentMessages));\n\n/**\n * @hidden\n */\nvar TimePickerLocalizedMessagesDirective = /** @class */ (function (_super) {\n __extends(TimePickerLocalizedMessagesDirective, _super);\n function TimePickerLocalizedMessagesDirective(service) {\n var _this = _super.call(this) || this;\n _this.service = service;\n return _this;\n }\n TimePickerLocalizedMessagesDirective.decorators = [\n { type: Directive, args: [{\n providers: [\n {\n provide: TimePickerMessages,\n useExisting: forwardRef(function () { return TimePickerLocalizedMessagesDirective; }) // tslint:disable-line:no-forward-ref\n }\n ],\n selector: '[kendoTimePickerLocalizedMessages]'\n },] },\n ];\n /** @nocollapse */\n TimePickerLocalizedMessagesDirective.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return TimePickerLocalizedMessagesDirective;\n}(TimePickerMessages));\n\n/**\n * Custom component messages override default component messages ([see example]({% slug globalization_dateinputs %}#toc-custom-messages)).\n */\nvar TimePickerCustomMessagesComponent = /** @class */ (function (_super) {\n __extends(TimePickerCustomMessagesComponent, _super);\n function TimePickerCustomMessagesComponent(service) {\n var _this = _super.call(this) || this;\n _this.service = service;\n return _this;\n }\n Object.defineProperty(TimePickerCustomMessagesComponent.prototype, \"override\", {\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n TimePickerCustomMessagesComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: TimePickerMessages,\n useExisting: forwardRef(function () { return TimePickerCustomMessagesComponent; }) // tslint:disable-line:no-forward-ref\n }\n ],\n selector: 'kendo-timepicker-messages',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n TimePickerCustomMessagesComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return TimePickerCustomMessagesComponent;\n}(TimePickerMessages));\n\n/**\n * @hidden\n */\nvar TimeSelectorLocalizedMessagesDirective = /** @class */ (function (_super) {\n __extends(TimeSelectorLocalizedMessagesDirective, _super);\n function TimeSelectorLocalizedMessagesDirective(service) {\n var _this = _super.call(this) || this;\n _this.service = service;\n return _this;\n }\n TimeSelectorLocalizedMessagesDirective.decorators = [\n { type: Directive, args: [{\n providers: [\n {\n provide: TimePickerMessages,\n useExisting: forwardRef(function () { return TimeSelectorLocalizedMessagesDirective; }) // tslint:disable-line:no-forward-ref\n }\n ],\n selector: '[kendoTimeSelectorLocalizedMessages]'\n },] },\n ];\n /** @nocollapse */\n TimeSelectorLocalizedMessagesDirective.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return TimeSelectorLocalizedMessagesDirective;\n}(TimePickerMessages));\n\n/**\n * @hidden\n *\n * Custom component messages override default component messages.\n */\nvar TimeSelectorCustomMessagesComponent = /** @class */ (function (_super) {\n __extends(TimeSelectorCustomMessagesComponent, _super);\n function TimeSelectorCustomMessagesComponent(service) {\n var _this = _super.call(this) || this;\n _this.service = service;\n return _this;\n }\n Object.defineProperty(TimeSelectorCustomMessagesComponent.prototype, \"override\", {\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n TimeSelectorCustomMessagesComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: TimePickerMessages,\n useExisting: forwardRef(function () { return TimeSelectorCustomMessagesComponent; }) // tslint:disable-line:no-forward-ref\n }\n ],\n selector: 'kendo-timeselector-messages',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n TimeSelectorCustomMessagesComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return TimeSelectorCustomMessagesComponent;\n}(TimePickerMessages));\n\nvar COMPONENT_DIRECTIVES$2 = [\n TimePickerLocalizedMessagesDirective,\n TimeListComponent,\n TimePickerCustomMessagesComponent,\n TimePickerComponent,\n TimeSelectorLocalizedMessagesDirective,\n TimeSelectorCustomMessagesComponent,\n TimeSelectorComponent\n];\nvar COMPONENT_MODULES$1 = [\n DateInputModule,\n IntlModule,\n PopupModule,\n VirtualizationModule,\n EventsModule\n];\nvar ɵ0$n = touchEnabled;\nvar providers = [\n TimePickerDOMService,\n HoursService,\n MinutesService,\n SecondsService,\n DayPeriodService,\n {\n provide: TOUCH_ENABLED,\n useValue: ɵ0$n\n }\n];\n/**\n * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})\n * definition for the TimePicker component.\n */\nvar TimePickerModule = /** @class */ (function () {\n function TimePickerModule() {\n }\n TimePickerModule.decorators = [\n { type: NgModule, args: [{\n declarations: [COMPONENT_DIRECTIVES$2],\n exports: [COMPONENT_DIRECTIVES$2],\n imports: [CommonModule].concat(COMPONENT_MODULES$1),\n providers: providers\n },] },\n ];\n return TimePickerModule;\n}());\n\n/**\n * @hidden\n */\nvar Messages$1 = /** @class */ (function (_super) {\n __extends(Messages, _super);\n function Messages() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Messages.propDecorators = {\n toggle: [{ type: Input }],\n dateTab: [{ type: Input }],\n dateTabLabel: [{ type: Input }],\n timeTab: [{ type: Input }],\n timeTabLabel: [{ type: Input }],\n accept: [{ type: Input }],\n acceptLabel: [{ type: Input }],\n cancel: [{ type: Input }],\n cancelLabel: [{ type: Input }],\n today: [{ type: Input }],\n now: [{ type: Input }],\n nowLabel: [{ type: Input }]\n };\n return Messages;\n}(ComponentMessages));\n\n/**\n * Custom component messages override default component messages ([see example]({% slug globalization_dateinputs %}#toc-custom-messages)).\n */\nvar DateTimePickerCustomMessagesComponent = /** @class */ (function (_super) {\n __extends(DateTimePickerCustomMessagesComponent, _super);\n function DateTimePickerCustomMessagesComponent(service) {\n var _this = _super.call(this) || this;\n _this.service = service;\n return _this;\n }\n Object.defineProperty(DateTimePickerCustomMessagesComponent.prototype, \"override\", {\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n DateTimePickerCustomMessagesComponent.decorators = [\n { type: Component, args: [{\n providers: [\n {\n provide: Messages$1,\n useExisting: forwardRef(function () { return DateTimePickerCustomMessagesComponent; })\n }\n ],\n selector: 'kendo-datetimepicker-messages',\n template: \"\"\n },] },\n ];\n /** @nocollapse */\n DateTimePickerCustomMessagesComponent.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return DateTimePickerCustomMessagesComponent;\n}(Messages$1));\n\n/**\n * @hidden\n */\nvar LocalizedMessagesDirective = /** @class */ (function (_super) {\n __extends(LocalizedMessagesDirective, _super);\n function LocalizedMessagesDirective(service) {\n var _this = _super.call(this) || this;\n _this.service = service;\n return _this;\n }\n LocalizedMessagesDirective.decorators = [\n { type: Directive, args: [{\n providers: [\n {\n provide: Messages$1,\n useExisting: forwardRef(function () { return LocalizedMessagesDirective; })\n }\n ],\n selector: '[kendoDateTimePickerLocalizedMessages]'\n },] },\n ];\n /** @nocollapse */\n LocalizedMessagesDirective.ctorParameters = function () { return [\n { type: LocalizationService }\n ]; };\n return LocalizedMessagesDirective;\n}(Messages$1));\n\nvar COMPONENT_DIRECTIVES$3 = [\n DateTimePickerComponent,\n DateTimePickerCustomMessagesComponent,\n LocalizedMessagesDirective\n];\nvar ɵ0$o = touchEnabled;\n/**\n * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})\n * definition for the DateTimePicker component.\n */\nvar DateTimePickerModule = /** @class */ (function () {\n function DateTimePickerModule() {\n }\n DateTimePickerModule.decorators = [\n { type: NgModule, args: [{\n declarations: COMPONENT_DIRECTIVES$3.slice(),\n exports: COMPONENT_DIRECTIVES$3.concat([\n TemplatesModule\n ]),\n imports: [\n CommonModule,\n IntlModule,\n DateInputModule,\n CalendarModule,\n TimePickerModule,\n PopupModule,\n EventsModule,\n TemplatesModule\n ],\n providers: [\n { provide: TOUCH_ENABLED, useValue: ɵ0$o }\n ]\n },] },\n ];\n return DateTimePickerModule;\n}());\n\nvar COMPONENT_MODULES$2 = [\n CalendarsModule,\n DateInputModule,\n DatePickerModule,\n TimePickerModule,\n DateRangeModule,\n DateTimePickerModule\n];\n/**\n * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})\n * definition for the Date Inputs components.\n *\n * @example\n *\n * ```ts-no-run\n * // Import the Date Inputs module\n * import { DateInputsModule } from '@progress/kendo-angular-dateinputs';\n *\n * // The browser platform with a compiler\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n *\n * import { NgModule } from '@angular/core';\n *\n * // Import the app component\n * import { AppComponent } from './app.component';\n *\n * // Define the app module\n * _@NgModule({\n * declarations: [AppComponent], // declare the app component\n * imports: [BrowserModule, DateInputsModule], // import the Date Inputs module\n * bootstrap: [AppComponent]\n * })\n * export class AppModule {}\n *\n * // Compile and launch the module\n * platformBrowserDynamic().bootstrapModule(AppModule);\n *\n * ```\n */\nvar DateInputsModule = /** @class */ (function () {\n function DateInputsModule() {\n }\n DateInputsModule.decorators = [\n { type: NgModule, args: [{\n exports: COMPONENT_MODULES$2,\n imports: COMPONENT_MODULES$2\n },] },\n ];\n return DateInputsModule;\n}());\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { CalendarCommonModule, CALENDAR_RANGE_VALIDATORS, CALENDAR_VALUE_ACCESSOR, KENDO_INPUT_PROVIDER, KForOf, KForOfContext, HeaderComponent, HorizontalViewListComponent, CalendarMessages, MultiViewCalendarCustomMessagesComponent, Messages, MultiViewCalendarComponent, RANGE_CALENDAR_RANGE_VALIDATORS, RANGE_CALENDAR_VALUE_ACCESSOR, NavigationComponent, BusViewService, CenturyViewService, DecadeViewService, DisabledDatesService, CalendarDOMService, MonthViewService, NavigationService, ScrollSyncService, WeekNamesService, YearViewService, TemplatesModule, CellTemplateDirective, CenturyCellTemplateDirective, DecadeCellTemplateDirective, HeaderTitleTemplateDirective, MonthCellTemplateDirective, NavigationItemTemplateDirective, WeekNumberCellTemplateDirective, YearCellTemplateDirective, ViewListComponent, ViewComponent, PickerService, DateInputMessages, DatePickerMessages, DateRangeInput, DateRangePopupTemplateDirective, DateTimePickerCustomMessagesComponent, LocalizedMessagesDirective, Messages$1, TimePickerMessages, TimePickerCustomMessagesComponent, TimeSelectorCustomMessagesComponent, DayPeriodService, TimePickerDOMService, HoursService, MinutesService, SecondsService, TimeListComponent, TimeSelectorComponent, TOUCH_ENABLED, ScrollerService, DEFAULT_SCROLLER_FACTORY, SCROLLER_FACTORY_TOKEN, VirtualizationComponent, VirtualizationModule, CalendarComponent, DateInputComponent, DatePickerComponent, TimePickerComponent, DateTimePickerComponent, DateRangeComponent, DateRangePopupComponent, DateRangeEndInputDirective, DateRangeStartInputDirective, DateRangeSelectionDirective, CalendarModule, CalendarsModule, DateInputModule, DatePickerModule, DateInputsModule, TimePickerModule, DateTimePickerModule, MultiViewCalendarModule, DateRangeModule, DateRangeService, CalendarCustomMessagesComponent, DateInputCustomMessagesComponent, DatePickerCustomMessagesComponent, PreventableEvent, CalendarLocalizedMessagesDirective, MultiViewCalendarLocalizedMessagesDirective, DateInputLocalizedMessagesDirective, DatePickerLocalizedMessagesDirective, TimePickerLocalizedMessagesDirective, TimeSelectorLocalizedMessagesDirective };\n","export function saveAs(data, fileName, options) {\n if ( options === void 0 ) options = {};\n\n var save = postToProxy;\n\n if (options.forceProxy && !options.proxyURL) {\n throw new Error('No proxyURL is set, but forceProxy is true');\n }\n\n if (!options.forceProxy) {\n if (canDownload()) {\n save = saveAsDataURI;\n }\n\n if (navigator.msSaveBlob) {\n save = saveAsBlob;\n }\n }\n\n save(data, fileName, options);\n}\n\nvar anchor = function () { return document.createElement('a'); };\nvar canDownload = function () { return 'download' in anchor(); };\n\nfunction saveAsBlob(data, fileName) {\n var blob = data; // could be a Blob object\n\n if (typeof data === 'string') {\n var parts = data.split(';base64,');\n var contentType = parts[0];\n var base64 = atob(parts[1]);\n var array = new Uint8Array(base64.length);\n\n for (var idx = 0; idx < base64.length; idx++) {\n array[idx] = base64.charCodeAt(idx);\n }\n\n blob = new Blob([ array.buffer ], { type: contentType });\n }\n\n navigator.msSaveBlob(blob, fileName);\n}\n\nfunction saveAsDataURI(data, fileName) {\n var dataURI = data;\n if (window.Blob && data instanceof Blob) {\n dataURI = URL.createObjectURL(data);\n }\n\n var fileSaver = anchor();\n fileSaver.download = fileName;\n fileSaver.href = dataURI;\n\n var e = document.createEvent('MouseEvents');\n e.initMouseEvent('click', true, false, window,\n 0, 0, 0, 0, 0, false, false, false, false, 0, null);\n\n fileSaver.dispatchEvent(e);\n setTimeout(function () { return URL.revokeObjectURL(dataURI); });\n}\n\nfunction postToProxy(dataURI, fileName, options) {\n if (!options.proxyURL) {\n return;\n }\n\n var form = document.createElement('form');\n form.setAttribute('action', options.proxyURL);\n form.setAttribute('method', 'POST');\n form.setAttribute('target', options.proxyTarget || '_self');\n\n var formData = options.proxyData || {};\n formData.fileName = fileName;\n\n var parts = dataURI.split(\";base64,\");\n formData.contentType = parts[0].replace(\"data:\", \"\");\n formData.base64 = parts[1];\n\n for (var name in formData) {\n if (formData.hasOwnProperty(name)) {\n var input = document.createElement('input');\n input.setAttribute('type', 'hidden');\n input.setAttribute('name', name);\n input.setAttribute('value', formData[name]);\n\n form.appendChild(input);\n }\n }\n\n document.body.appendChild(form);\n form.submit();\n document.body.removeChild(form);\n}\n\n","export { saveAs } from './save-as';\nexport { encodeBase64 } from './base64';\n","var proxy = function (a, b) { return function (e) { return b(a(e)); }; };\n\nvar bind = function (el, event, callback) { return el.addEventListener && el.addEventListener(event, callback); };\n\nvar unbind = function (el, event, callback) { return el && el.removeEventListener && el.removeEventListener(event, callback); };\n\nvar noop = function () { /* empty */ };\n\nvar preventDefault = function (e) { return e.preventDefault(); };\n\nvar touchRegExp = /touch/;\n\n// 300ms is the usual mouse interval;\n// // However, an underpowered mobile device under a heavy load may queue mouse events for a longer period.\nvar IGNORE_MOUSE_TIMEOUT = 2000;\n\nfunction normalizeEvent(e) {\n if (e.type.match(touchRegExp)) {\n return {\n pageX: e.changedTouches[0].pageX,\n pageY: e.changedTouches[0].pageY,\n clientX: e.changedTouches[0].clientX,\n clientY: e.changedTouches[0].clientY,\n type: e.type,\n originalEvent: e,\n isTouch: true\n };\n }\n\n return {\n pageX: e.pageX,\n pageY: e.pageY,\n clientX: e.clientX,\n clientY: e.clientY,\n offsetX: e.offsetX,\n offsetY: e.offsetY,\n type: e.type,\n ctrlKey: e.ctrlKey,\n shiftKey: e.shiftKey,\n altKey: e.altKey,\n originalEvent: e\n };\n}\n\nexport var Draggable = function Draggable(ref) {\n var this$1 = this;\n var press = ref.press; if ( press === void 0 ) press = noop;\n var drag = ref.drag; if ( drag === void 0 ) drag = noop;\n var release = ref.release; if ( release === void 0 ) release = noop;\n var mouseOnly = ref.mouseOnly; if ( mouseOnly === void 0 ) mouseOnly = false;\n\n this._pressHandler = proxy(normalizeEvent, press);\n this._dragHandler = proxy(normalizeEvent, drag);\n this._releaseHandler = proxy(normalizeEvent, release);\n this._ignoreMouse = false;\n this._mouseOnly = mouseOnly;\n\n this._touchstart = function (e) {\n if (e.touches.length === 1) {\n this$1._pressHandler(e);\n }\n };\n\n this._touchmove = function (e) {\n if (e.touches.length === 1) {\n this$1._dragHandler(e);\n }\n };\n\n this._touchend = function (e) {\n // the last finger has been lifted, and the user is not doing gesture.\n // there might be a better way to handle this.\n if (e.touches.length === 0 && e.changedTouches.length === 1) {\n this$1._releaseHandler(e);\n this$1._ignoreMouse = true;\n setTimeout(this$1._restoreMouse, IGNORE_MOUSE_TIMEOUT);\n }\n };\n\n this._restoreMouse = function () {\n this$1._ignoreMouse = false;\n };\n\n this._mousedown = function (e) {\n var which = e.which;\n\n if ((which && which > 1) || this$1._ignoreMouse) {\n return;\n }\n\n bind(document, \"mousemove\", this$1._mousemove);\n bind(document, \"mouseup\", this$1._mouseup);\n this$1._pressHandler(e);\n };\n\n this._mousemove = function (e) {\n this$1._dragHandler(e);\n };\n\n this._mouseup = function (e) {\n unbind(document, \"mousemove\", this$1._mousemove);\n unbind(document, \"mouseup\", this$1._mouseup);\n this$1._releaseHandler(e);\n };\n\n this._pointerdown = function (e) {\n if (e.isPrimary && e.button === 0) {\n bind(document, \"pointermove\", this$1._pointermove);\n bind(document, \"pointerup\", this$1._pointerup);\n bind(document, \"pointercancel\", this$1._pointerup);\n bind(document, \"contextmenu\", preventDefault);\n\n this$1._pressHandler(e);\n }\n };\n\n this._pointermove = function (e) {\n if (e.isPrimary) {\n this$1._dragHandler(e);\n }\n };\n\n this._pointerup = function (e) {\n if (e.isPrimary) {\n unbind(document, \"pointermove\", this$1._pointermove);\n unbind(document, \"pointerup\", this$1._pointerup);\n unbind(document, \"pointercancel\", this$1._pointerup);\n unbind(document, \"contextmenu\", preventDefault);\n\n this$1._releaseHandler(e);\n }\n };\n};\n\nDraggable.supportPointerEvent = function supportPointerEvent () {\n return (typeof window !== 'undefined') && window.PointerEvent;\n};\n\nDraggable.prototype.bindTo = function bindTo (element) {\n if (element === this._element) {\n return;\n }\n\n if (this._element) {\n this._unbindFromCurrent();\n }\n\n this._element = element;\n this._bindToCurrent();\n};\n\nDraggable.prototype._bindToCurrent = function _bindToCurrent () {\n var element = this._element;\n\n if (this._usePointers()) {\n bind(element, \"pointerdown\", this._pointerdown);\n return;\n }\n\n bind(element, \"mousedown\", this._mousedown);\n\n if (!this._mouseOnly) {\n bind(element, \"touchstart\", this._touchstart);\n bind(element, \"touchmove\", this._touchmove);\n bind(element, \"touchend\", this._touchend);\n }\n};\n\nDraggable.prototype._unbindFromCurrent = function _unbindFromCurrent () {\n var element = this._element;\n\n if (this._usePointers()) {\n unbind(element, \"pointerdown\", this._pointerdown);\n unbind(document, \"pointermove\", this._pointermove);\n unbind(document, \"pointerup\", this._pointerup);\n unbind(document, \"contextmenu\", preventDefault);\n unbind(document, \"pointercancel\", this._pointerup);\n return;\n }\n\n unbind(element, \"mousedown\", this._mousedown);\n\n if (!this._mouseOnly) {\n unbind(element, \"touchstart\", this._touchstart);\n unbind(element, \"touchmove\", this._touchmove);\n unbind(element, \"touchend\", this._touchend);\n }\n};\n\nDraggable.prototype._usePointers = function _usePointers () {\n return !this._mouseOnly && Draggable.supportPointerEvent();\n};\n\nDraggable.prototype.update = function update (ref) {\n var press = ref.press; if ( press === void 0 ) press = noop;\n var drag = ref.drag; if ( drag === void 0 ) drag = noop;\n var release = ref.release; if ( release === void 0 ) release = noop;\n var mouseOnly = ref.mouseOnly; if ( mouseOnly === void 0 ) mouseOnly = false;\n\n this._pressHandler = proxy(normalizeEvent, press);\n this._dragHandler = proxy(normalizeEvent, drag);\n this._releaseHandler = proxy(normalizeEvent, release);\n this._mouseOnly = mouseOnly;\n};\n\nDraggable.prototype.destroy = function destroy () {\n this._unbindFromCurrent();\n this._element = null;\n};\n\n// Re-export as \"default\" field to address a bug\n// where the ES Module is imported by CommonJS code.\n//\n// See https://github.com/telerik/kendo-angular/issues/1314\nDraggable.default = Draggable;\n\n// Rollup won't output exports['default'] otherwise\nexport default Draggable;\n\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { DOCUMENT } from '@angular/common';\nimport { inject, InjectionToken, EventEmitter, Inject, Injectable, Optional, Directive, Output, Input, NgModule, ɵɵdefineInjectable, ɵɵinject } from '@angular/core';\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n/**\n * Injection token used to inject the document into Directionality.\n * This is used so that the value can be faked in tests.\n *\n * We can't use the real document in tests because changing the real `dir` causes geometry-based\n * tests in Safari to fail.\n *\n * We also can't re-provide the DOCUMENT token from platform-brower because the unit tests\n * themselves use things like `querySelector` in test code.\n *\n * This token is defined in a separate file from Directionality as a workaround for\n * https://github.com/angular/angular/issues/22559\n *\n * \\@docs-private\n * @type {?}\n */\nvar DIR_DOCUMENT = new InjectionToken('cdk-dir-doc', {\n providedIn: 'root',\n factory: DIR_DOCUMENT_FACTORY,\n});\n/**\n * \\@docs-private\n * @return {?}\n */\nfunction DIR_DOCUMENT_FACTORY() {\n return inject(DOCUMENT);\n}\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n/**\n * The directionality (LTR / RTL) context for the application (or a subtree of it).\n * Exposes the current direction and a stream of direction changes.\n */\nvar Directionality = /** @class */ (function () {\n function Directionality(_document) {\n /**\n * The current 'ltr' or 'rtl' value.\n */\n this.value = 'ltr';\n /**\n * Stream that emits whenever the 'ltr' / 'rtl' state changes.\n */\n this.change = new EventEmitter();\n if (_document) {\n // TODO: handle 'auto' value -\n // We still need to account for dir=\"auto\".\n // It looks like HTMLElemenet.dir is also \"auto\" when that's set to the attribute,\n // but getComputedStyle return either \"ltr\" or \"rtl\". avoiding getComputedStyle for now\n /** @type {?} */\n var bodyDir = _document.body ? _document.body.dir : null;\n /** @type {?} */\n var htmlDir = _document.documentElement ? _document.documentElement.dir : null;\n /** @type {?} */\n var value = bodyDir || htmlDir;\n this.value = (value === 'ltr' || value === 'rtl') ? value : 'ltr';\n }\n }\n /**\n * @return {?}\n */\n Directionality.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () {\n this.change.complete();\n };\n Directionality.decorators = [\n { type: Injectable, args: [{ providedIn: 'root' },] },\n ];\n /** @nocollapse */\n Directionality.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [DIR_DOCUMENT,] }] }\n ]; };\n /** @nocollapse */ Directionality.ngInjectableDef = ɵɵdefineInjectable({ factory: function Directionality_Factory() { return new Directionality(ɵɵinject(DIR_DOCUMENT, 8)); }, token: Directionality, providedIn: \"root\" });\n return Directionality;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n/**\n * Directive to listen for changes of direction of part of the DOM.\n *\n * Provides itself as Directionality such that descendant directives only need to ever inject\n * Directionality to get the closest direction.\n */\nvar Dir = /** @class */ (function () {\n function Dir() {\n /**\n * Normalized direction that accounts for invalid/unsupported values.\n */\n this._dir = 'ltr';\n /**\n * Whether the `value` has been set to its initial value.\n */\n this._isInitialized = false;\n /**\n * Event emitted when the direction changes.\n */\n this.change = new EventEmitter();\n }\n Object.defineProperty(Dir.prototype, \"dir\", {\n /** @docs-private */\n get: /**\n * \\@docs-private\n * @return {?}\n */\n function () { return this._dir; },\n set: /**\n * @param {?} value\n * @return {?}\n */\n function (value) {\n /** @type {?} */\n var old = this._dir;\n /** @type {?} */\n var normalizedValue = value ? value.toLowerCase() : value;\n this._rawDir = value;\n this._dir = (normalizedValue === 'ltr' || normalizedValue === 'rtl') ? normalizedValue : 'ltr';\n if (old !== this._dir && this._isInitialized) {\n this.change.emit(this._dir);\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Dir.prototype, \"value\", {\n /** Current layout direction of the element. */\n get: /**\n * Current layout direction of the element.\n * @return {?}\n */\n function () { return this.dir; },\n enumerable: true,\n configurable: true\n });\n /** Initialize once default value has been set. */\n /**\n * Initialize once default value has been set.\n * @return {?}\n */\n Dir.prototype.ngAfterContentInit = /**\n * Initialize once default value has been set.\n * @return {?}\n */\n function () {\n this._isInitialized = true;\n };\n /**\n * @return {?}\n */\n Dir.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () {\n this.change.complete();\n };\n Dir.decorators = [\n { type: Directive, args: [{\n selector: '[dir]',\n providers: [{ provide: Directionality, useExisting: Dir }],\n host: { '[attr.dir]': '_rawDir' },\n exportAs: 'dir',\n },] },\n ];\n Dir.propDecorators = {\n change: [{ type: Output, args: ['dirChange',] }],\n dir: [{ type: Input }]\n };\n return Dir;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\nvar BidiModule = /** @class */ (function () {\n function BidiModule() {\n }\n BidiModule.decorators = [\n { type: NgModule, args: [{\n exports: [Dir],\n declarations: [Dir],\n },] },\n ];\n return BidiModule;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n\nexport { Directionality, DIR_DOCUMENT, Dir, BidiModule, DIR_DOCUMENT_FACTORY as ɵa };\n//# sourceMappingURL=bidi.es5.js.map\n","/**\n * @fileoverview This file was generated by the Angular template compiler. Do not edit.\n *\n * @suppress {suspiciousCode,uselessCode,missingProperties,missingOverride,checkTypes}\n * tslint:disable\n */ \nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"@angular/router\";\nvar RouterModuleNgFactory = i0.ɵcmf(i1.RouterModule, [], function (_l) { return i0.ɵmod([i0.ɵmpd(512, i0.ComponentFactoryResolver, i0.ɵCodegenComponentFactoryResolver, [[8, [ɵangular_packages_router_router_lNgFactory]], [3, i0.ComponentFactoryResolver], i0.NgModuleRef]), i0.ɵmpd(1073742336, i1.RouterModule, i1.RouterModule, [[2, i1.ɵangular_packages_router_router_a], [2, i1.Router]])]); });\nexport { RouterModuleNgFactory as RouterModuleNgFactory };\nvar styles_ɵangular_packages_router_router_l = [];\nvar RenderType_ɵangular_packages_router_router_l = i0.ɵcrt({ encapsulation: 2, styles: styles_ɵangular_packages_router_router_l, data: {} });\nexport { RenderType_ɵangular_packages_router_router_l as RenderType_ɵangular_packages_router_router_l };\nexport function View_ɵangular_packages_router_router_l_0(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 16777216, null, null, 1, \"router-outlet\", [], null, null, null, null, null)), i0.ɵdid(1, 212992, null, 0, i1.RouterOutlet, [i1.ChildrenOutletContexts, i0.ViewContainerRef, i0.ComponentFactoryResolver, [8, null], i0.ChangeDetectorRef], null, null)], function (_ck, _v) { _ck(_v, 1, 0); }, null); }\nexport function View_ɵangular_packages_router_router_l_Host_0(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 1, \"ng-component\", [], null, null, null, View_ɵangular_packages_router_router_l_0, RenderType_ɵangular_packages_router_router_l)), i0.ɵdid(1, 49152, null, 0, i1.ɵangular_packages_router_router_l, [], null, null)], null, null); }\nvar ɵangular_packages_router_router_lNgFactory = i0.ɵccf(\"ng-component\", i1.ɵangular_packages_router_router_l, View_ɵangular_packages_router_router_l_Host_0, {}, {}, []);\nexport { ɵangular_packages_router_router_lNgFactory as ɵangular_packages_router_router_lNgFactory };\n","","/**\n * @fileoverview This file was generated by the Angular template compiler. Do not edit.\n *\n * @suppress {suspiciousCode,uselessCode,missingProperties,missingOverride,checkTypes}\n * tslint:disable\n */ \nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"@angular/material/expansion\";\nimport * as i2 from \"@angular/common\";\nimport * as i3 from \"@angular/cdk/accordion\";\nimport * as i4 from \"@angular/cdk/portal\";\nimport * as i5 from \"@angular/cdk/collections\";\nimport * as i6 from \"@angular/platform-browser/animations\";\nimport * as i7 from \"@angular/cdk/a11y\";\nvar MatExpansionModuleNgFactory = i0.ɵcmf(i1.MatExpansionModule, [], function (_l) { return i0.ɵmod([i0.ɵmpd(512, i0.ComponentFactoryResolver, i0.ɵCodegenComponentFactoryResolver, [[8, []], [3, i0.ComponentFactoryResolver], i0.NgModuleRef]), i0.ɵmpd(4608, i2.NgLocalization, i2.NgLocaleLocalization, [i0.LOCALE_ID, [2, i2.ɵangular_packages_common_common_a]]), i0.ɵmpd(1073742336, i2.CommonModule, i2.CommonModule, []), i0.ɵmpd(1073742336, i3.CdkAccordionModule, i3.CdkAccordionModule, []), i0.ɵmpd(1073742336, i4.PortalModule, i4.PortalModule, []), i0.ɵmpd(1073742336, i1.MatExpansionModule, i1.MatExpansionModule, [])]); });\nexport { MatExpansionModuleNgFactory as MatExpansionModuleNgFactory };\nvar styles_MatExpansionPanel = [\".mat-expansion-panel{box-sizing:content-box;display:block;margin:0;border-radius:4px;overflow:hidden;transition:margin 225ms cubic-bezier(.4,0,.2,1),box-shadow 280ms cubic-bezier(.4,0,.2,1)}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:4px;border-top-left-radius:4px}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:4px;border-bottom-left-radius:4px}@media (-ms-high-contrast:active){.mat-expansion-panel{outline:solid 1px}}.mat-expansion-panel._mat-animation-noopable,.mat-expansion-panel.ng-animate-disabled,.ng-animate-disabled .mat-expansion-panel{transition:none}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px}.mat-action-row button.mat-button-base{margin-left:8px}[dir=rtl] .mat-action-row button.mat-button-base{margin-left:0;margin-right:8px}\"];\nvar RenderType_MatExpansionPanel = i0.ɵcrt({ encapsulation: 2, styles: styles_MatExpansionPanel, data: { \"animation\": [{ type: 7, name: \"bodyExpansion\", definitions: [{ type: 0, name: \"collapsed, void\", styles: { type: 6, styles: { height: \"0px\", visibility: \"hidden\" }, offset: null }, options: undefined }, { type: 0, name: \"expanded\", styles: { type: 6, styles: { height: \"*\", visibility: \"visible\" }, offset: null }, options: undefined }, { type: 1, expr: \"expanded <=> collapsed, void => collapsed\", animation: { type: 4, styles: null, timings: \"225ms cubic-bezier(0.4,0.0,0.2,1)\" }, options: null }], options: {} }] } });\nexport { RenderType_MatExpansionPanel as RenderType_MatExpansionPanel };\nfunction View_MatExpansionPanel_1(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵand(0, null, null, 0))], null, null); }\nexport function View_MatExpansionPanel_0(_l) { return i0.ɵvid(2, [i0.ɵqud(671088640, 1, { _body: 0 }), i0.ɵncd(null, 0), (_l()(), i0.ɵeld(2, 0, [[1, 0], [\"body\", 1]], null, 5, \"div\", [[\"class\", \"mat-expansion-panel-content\"], [\"role\", \"region\"]], [[24, \"@bodyExpansion\", 0], [1, \"aria-labelledby\", 0], [8, \"id\", 0]], [[null, \"@bodyExpansion.done\"]], function (_v, en, $event) { var ad = true; var _co = _v.component; if ((\"@bodyExpansion.done\" === en)) {\n var pd_0 = (_co._bodyAnimationDone.next($event) !== false);\n ad = (pd_0 && ad);\n } return ad; }, null, null)), (_l()(), i0.ɵeld(3, 0, null, null, 3, \"div\", [[\"class\", \"mat-expansion-panel-body\"]], null, null, null, null, null)), i0.ɵncd(null, 1), (_l()(), i0.ɵand(16777216, null, null, 1, null, View_MatExpansionPanel_1)), i0.ɵdid(6, 212992, null, 0, i4.CdkPortalOutlet, [i0.ComponentFactoryResolver, i0.ViewContainerRef], { portal: [0, \"portal\"] }, null), i0.ɵncd(null, 2)], function (_ck, _v) { var _co = _v.component; var currVal_3 = _co._portal; _ck(_v, 6, 0, currVal_3); }, function (_ck, _v) { var _co = _v.component; var currVal_0 = _co._getExpandedState(); var currVal_1 = _co._headerId; var currVal_2 = _co.id; _ck(_v, 2, 0, currVal_0, currVal_1, currVal_2); }); }\nexport function View_MatExpansionPanel_Host_0(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 16777216, null, null, 3, \"mat-expansion-panel\", [[\"class\", \"mat-expansion-panel\"]], [[2, \"mat-expanded\", null], [2, \"_mat-animation-noopable\", null], [2, \"mat-expansion-panel-spacing\", null]], null, null, View_MatExpansionPanel_0, RenderType_MatExpansionPanel)), i0.ɵdid(1, 1753088, null, 1, i1.MatExpansionPanel, [[3, i1.MAT_ACCORDION], i0.ChangeDetectorRef, i5.UniqueSelectionDispatcher, i0.ViewContainerRef, i2.DOCUMENT, [2, i6.ANIMATION_MODULE_TYPE], [2, i1.MAT_EXPANSION_PANEL_DEFAULT_OPTIONS]], null, null), i0.ɵqud(603979776, 1, { _lazyContent: 0 }), i0.ɵprd(256, null, i1.MAT_ACCORDION, undefined, [])], null, function (_ck, _v) { var currVal_0 = i0.ɵnov(_v, 1).expanded; var currVal_1 = (i0.ɵnov(_v, 1)._animationMode === \"NoopAnimations\"); var currVal_2 = i0.ɵnov(_v, 1)._hasSpacing(); _ck(_v, 0, 0, currVal_0, currVal_1, currVal_2); }); }\nvar MatExpansionPanelNgFactory = i0.ɵccf(\"mat-expansion-panel\", i1.MatExpansionPanel, View_MatExpansionPanel_Host_0, { expanded: \"expanded\", disabled: \"disabled\", hideToggle: \"hideToggle\", togglePosition: \"togglePosition\" }, { closed: \"closed\", opened: \"opened\", destroyed: \"destroyed\", expandedChange: \"expandedChange\", afterExpand: \"afterExpand\", afterCollapse: \"afterCollapse\" }, [\"mat-expansion-panel-header\", \"*\", \"mat-action-row\"]);\nexport { MatExpansionPanelNgFactory as MatExpansionPanelNgFactory };\nvar styles_MatExpansionPanelHeader = [\".mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px;border-radius:inherit}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:0}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before{flex-direction:row-reverse}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 16px 0 0}[dir=rtl] .mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 0 0 16px}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-expansion-panel-header-description,.mat-expansion-panel-header-title{display:flex;flex-grow:1;margin-right:16px}[dir=rtl] .mat-expansion-panel-header-description,[dir=rtl] .mat-expansion-panel-header-title{margin-right:0;margin-left:16px}.mat-expansion-panel-header-description{flex-grow:2}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:'';display:inline-block;padding:3px;transform:rotate(45deg);vertical-align:middle}\"];\nvar RenderType_MatExpansionPanelHeader = i0.ɵcrt({ encapsulation: 2, styles: styles_MatExpansionPanelHeader, data: { \"animation\": [{ type: 7, name: \"indicatorRotate\", definitions: [{ type: 0, name: \"collapsed, void\", styles: { type: 6, styles: { transform: \"rotate(0deg)\" }, offset: null }, options: undefined }, { type: 0, name: \"expanded\", styles: { type: 6, styles: { transform: \"rotate(180deg)\" }, offset: null }, options: undefined }, { type: 1, expr: \"expanded <=> collapsed, void => collapsed\", animation: { type: 4, styles: null, timings: \"225ms cubic-bezier(0.4,0.0,0.2,1)\" }, options: null }], options: {} }, { type: 7, name: \"expansionHeight\", definitions: [{ type: 0, name: \"collapsed, void\", styles: { type: 6, styles: { height: \"{{collapsedHeight}}\" }, offset: null }, options: { params: { collapsedHeight: \"48px\" } } }, { type: 0, name: \"expanded\", styles: { type: 6, styles: { height: \"{{expandedHeight}}\" }, offset: null }, options: { params: { expandedHeight: \"64px\" } } }, { type: 1, expr: \"expanded <=> collapsed, void => collapsed\", animation: { type: 3, steps: [{ type: 11, selector: \"@indicatorRotate\", animation: { type: 9, options: null }, options: { optional: true } }, { type: 4, styles: null, timings: \"225ms cubic-bezier(0.4,0.0,0.2,1)\" }], options: null }, options: null }], options: {} }] } });\nexport { RenderType_MatExpansionPanelHeader as RenderType_MatExpansionPanelHeader };\nfunction View_MatExpansionPanelHeader_1(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 0, \"span\", [[\"class\", \"mat-expansion-indicator\"]], [[24, \"@indicatorRotate\", 0]], null, null, null, null))], null, function (_ck, _v) { var _co = _v.component; var currVal_0 = _co._getExpandedState(); _ck(_v, 0, 0, currVal_0); }); }\nexport function View_MatExpansionPanelHeader_0(_l) { return i0.ɵvid(2, [(_l()(), i0.ɵeld(0, 0, null, null, 3, \"span\", [[\"class\", \"mat-content\"]], null, null, null, null, null)), i0.ɵncd(null, 0), i0.ɵncd(null, 1), i0.ɵncd(null, 2), (_l()(), i0.ɵand(16777216, null, null, 1, null, View_MatExpansionPanelHeader_1)), i0.ɵdid(5, 16384, null, 0, i2.NgIf, [i0.ViewContainerRef, i0.TemplateRef], { ngIf: [0, \"ngIf\"] }, null)], function (_ck, _v) { var _co = _v.component; var currVal_0 = _co._showToggle(); _ck(_v, 5, 0, currVal_0); }, null); }\nexport function View_MatExpansionPanelHeader_Host_0(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 3, \"mat-expansion-panel-header\", [[\"class\", \"mat-expansion-panel-header\"], [\"role\", \"button\"]], [[1, \"id\", 0], [1, \"tabindex\", 0], [1, \"aria-controls\", 0], [1, \"aria-expanded\", 0], [1, \"aria-disabled\", 0], [2, \"mat-expanded\", null], [2, \"mat-expansion-toggle-indicator-after\", null], [2, \"mat-expansion-toggle-indicator-before\", null], [40, \"@.disabled\", 0], [40, \"@expansionHeight\", 0]], [[null, \"click\"], [null, \"keydown\"], [\"component\", \"@expansionHeight.start\"]], function (_v, en, $event) { var ad = true; if ((\"click\" === en)) {\n var pd_0 = (i0.ɵnov(_v, 1)._toggle() !== false);\n ad = (pd_0 && ad);\n } if ((\"keydown\" === en)) {\n var pd_1 = (i0.ɵnov(_v, 1)._keydown($event) !== false);\n ad = (pd_1 && ad);\n } if ((\"component:@expansionHeight.start\" === en)) {\n var pd_2 = (i0.ɵnov(_v, 1)._animationStarted() !== false);\n ad = (pd_2 && ad);\n } return ad; }, View_MatExpansionPanelHeader_0, RenderType_MatExpansionPanelHeader)), i0.ɵdid(1, 180224, null, 0, i1.MatExpansionPanelHeader, [i1.MatExpansionPanel, i0.ElementRef, i7.FocusMonitor, i0.ChangeDetectorRef, [2, i1.MAT_EXPANSION_PANEL_DEFAULT_OPTIONS]], null, null), i0.ɵpod(2, { collapsedHeight: 0, expandedHeight: 1 }), i0.ɵpod(3, { value: 0, params: 1 })], null, function (_ck, _v) { var currVal_0 = i0.ɵnov(_v, 1).panel._headerId; var currVal_1 = (i0.ɵnov(_v, 1).disabled ? (0 - 1) : 0); var currVal_2 = i0.ɵnov(_v, 1)._getPanelId(); var currVal_3 = i0.ɵnov(_v, 1)._isExpanded(); var currVal_4 = i0.ɵnov(_v, 1).panel.disabled; var currVal_5 = i0.ɵnov(_v, 1)._isExpanded(); var currVal_6 = (i0.ɵnov(_v, 1)._getTogglePosition() === \"after\"); var currVal_7 = (i0.ɵnov(_v, 1)._getTogglePosition() === \"before\"); var currVal_8 = i0.ɵnov(_v, 1)._animationsDisabled; var currVal_9 = _ck(_v, 3, 0, i0.ɵnov(_v, 1)._getExpandedState(), _ck(_v, 2, 0, i0.ɵnov(_v, 1).collapsedHeight, i0.ɵnov(_v, 1).expandedHeight)); _ck(_v, 0, 0, currVal_0, currVal_1, currVal_2, currVal_3, currVal_4, currVal_5, currVal_6, currVal_7, currVal_8, currVal_9); }); }\nvar MatExpansionPanelHeaderNgFactory = i0.ɵccf(\"mat-expansion-panel-header\", i1.MatExpansionPanelHeader, View_MatExpansionPanelHeader_Host_0, { expandedHeight: \"expandedHeight\", collapsedHeight: \"collapsedHeight\" }, {}, [\"mat-panel-title\", \"mat-panel-description\", \"*\"]);\nexport { MatExpansionPanelHeaderNgFactory as MatExpansionPanelHeaderNgFactory };\n","","","/** PURE_IMPORTS_START tslib,_util_isArray,_fromArray,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { isArray } from '../util/isArray';\nimport { fromArray } from './fromArray';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nexport function race() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n if (observables.length === 1) {\n if (isArray(observables[0])) {\n observables = observables[0];\n }\n else {\n return observables[0];\n }\n }\n return fromArray(observables, undefined).lift(new RaceOperator());\n}\nvar RaceOperator = /*@__PURE__*/ (function () {\n function RaceOperator() {\n }\n RaceOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new RaceSubscriber(subscriber));\n };\n return RaceOperator;\n}());\nexport { RaceOperator };\nvar RaceSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(RaceSubscriber, _super);\n function RaceSubscriber(destination) {\n var _this = _super.call(this, destination) || this;\n _this.hasFirst = false;\n _this.observables = [];\n _this.subscriptions = [];\n return _this;\n }\n RaceSubscriber.prototype._next = function (observable) {\n this.observables.push(observable);\n };\n RaceSubscriber.prototype._complete = function () {\n var observables = this.observables;\n var len = observables.length;\n if (len === 0) {\n this.destination.complete();\n }\n else {\n for (var i = 0; i < len && !this.hasFirst; i++) {\n var observable = observables[i];\n var subscription = subscribeToResult(this, observable, observable, i);\n if (this.subscriptions) {\n this.subscriptions.push(subscription);\n }\n this.add(subscription);\n }\n this.observables = null;\n }\n };\n RaceSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n if (!this.hasFirst) {\n this.hasFirst = true;\n for (var i = 0; i < this.subscriptions.length; i++) {\n if (i !== outerIndex) {\n var subscription = this.subscriptions[i];\n subscription.unsubscribe();\n this.remove(subscription);\n }\n }\n this.subscriptions = null;\n }\n this.destination.next(innerValue);\n };\n return RaceSubscriber;\n}(OuterSubscriber));\nexport { RaceSubscriber };\n//# sourceMappingURL=race.js.map\n","/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from './Subscriber';\nvar InnerSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(InnerSubscriber, _super);\n function InnerSubscriber(parent, outerValue, outerIndex) {\n var _this = _super.call(this) || this;\n _this.parent = parent;\n _this.outerValue = outerValue;\n _this.outerIndex = outerIndex;\n _this.index = 0;\n return _this;\n }\n InnerSubscriber.prototype._next = function (value) {\n this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this);\n };\n InnerSubscriber.prototype._error = function (error) {\n this.parent.notifyError(error, this);\n this.unsubscribe();\n };\n InnerSubscriber.prototype._complete = function () {\n this.parent.notifyComplete(this);\n this.unsubscribe();\n };\n return InnerSubscriber;\n}(Subscriber));\nexport { InnerSubscriber };\n//# sourceMappingURL=InnerSubscriber.js.map\n","module.exports = require('prosemirror-model');\n","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar core_1 = require(\"@angular/core\");\nvar i0 = require(\"@angular/core\");\nvar InlineSVGService = (function () {\n function InlineSVGService(rendererFactory) {\n this._ranScripts = {};\n this._renderer = rendererFactory.createRenderer(null, null);\n }\n InlineSVGService.prototype.insertEl = function (dir, parentEl, content, replaceContents, prepend) {\n if (replaceContents && !prepend) {\n var parentNode = dir._prevSVG && dir._prevSVG.parentNode;\n if (parentNode) {\n this._renderer.removeChild(parentNode, dir._prevSVG);\n }\n parentEl.innerHTML = '';\n }\n if (prepend) {\n this._renderer.insertBefore(parentEl, content, parentEl.firstChild);\n }\n else {\n this._renderer.appendChild(parentEl, content);\n }\n if (content.nodeName === 'svg') {\n dir._prevSVG = content;\n }\n };\n InlineSVGService.prototype.evalScripts = function (svg, url, evalMode) {\n var scripts = svg.querySelectorAll('script');\n var scriptsToEval = [];\n for (var i = 0; i < scripts.length; i++) {\n var scriptType = scripts[i].getAttribute('type');\n if (!scriptType || scriptType === 'application/ecmascript' || scriptType === 'application/javascript') {\n var script = scripts[i].innerText || scripts[i].textContent;\n scriptsToEval.push(script);\n this._renderer.removeChild(scripts[i].parentNode, scripts[i]);\n }\n }\n if (scriptsToEval.length > 0 && (evalMode === \"always\" ||\n (evalMode === \"once\" && !this._ranScripts[url]))) {\n for (var i = 0; i < scriptsToEval.length; i++) {\n new Function(scriptsToEval[i])(window);\n }\n this._ranScripts[url] = true;\n }\n };\n InlineSVGService.ngInjectableDef = i0.ɵɵdefineInjectable({ factory: function InlineSVGService_Factory() { return new InlineSVGService(i0.ɵɵinject(i0.RendererFactory2)); }, token: InlineSVGService, providedIn: \"root\" });\n InlineSVGService = __decorate([\n core_1.Injectable({\n providedIn: 'root'\n }),\n __metadata(\"design:paramtypes\", [core_1.RendererFactory2])\n ], InlineSVGService);\n return InlineSVGService;\n}());\nexports.InlineSVGService = InlineSVGService;\n","/** PURE_IMPORTS_START tslib,_Subscriber,_Notification PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nimport { Notification } from '../Notification';\nexport function observeOn(scheduler, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n return function observeOnOperatorFunction(source) {\n return source.lift(new ObserveOnOperator(scheduler, delay));\n };\n}\nvar ObserveOnOperator = /*@__PURE__*/ (function () {\n function ObserveOnOperator(scheduler, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n this.scheduler = scheduler;\n this.delay = delay;\n }\n ObserveOnOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay));\n };\n return ObserveOnOperator;\n}());\nexport { ObserveOnOperator };\nvar ObserveOnSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(ObserveOnSubscriber, _super);\n function ObserveOnSubscriber(destination, scheduler, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n var _this = _super.call(this, destination) || this;\n _this.scheduler = scheduler;\n _this.delay = delay;\n return _this;\n }\n ObserveOnSubscriber.dispatch = function (arg) {\n var notification = arg.notification, destination = arg.destination;\n notification.observe(destination);\n this.unsubscribe();\n };\n ObserveOnSubscriber.prototype.scheduleMessage = function (notification) {\n var destination = this.destination;\n destination.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(notification, this.destination)));\n };\n ObserveOnSubscriber.prototype._next = function (value) {\n this.scheduleMessage(Notification.createNext(value));\n };\n ObserveOnSubscriber.prototype._error = function (err) {\n this.scheduleMessage(Notification.createError(err));\n this.unsubscribe();\n };\n ObserveOnSubscriber.prototype._complete = function () {\n this.scheduleMessage(Notification.createComplete());\n this.unsubscribe();\n };\n return ObserveOnSubscriber;\n}(Subscriber));\nexport { ObserveOnSubscriber };\nvar ObserveOnMessage = /*@__PURE__*/ (function () {\n function ObserveOnMessage(notification, destination) {\n this.notification = notification;\n this.destination = destination;\n }\n return ObserveOnMessage;\n}());\nexport { ObserveOnMessage };\n//# sourceMappingURL=observeOn.js.map\n","/**\n * @license NgRx 8.6.0\n * (c) 2015-2018 Brandon Roberts, Mike Ryan, Rob Wormald, Victor Savkin\n * License: MIT\n */\nimport { __assign, __spread, __extends, __decorate, __param, __metadata } from 'tslib';\nimport { compose, ScannedActionsSubject, Store, createAction, StoreRootModule, StoreFeatureModule } from '@ngrx/store';\nimport { merge, Observable, Subject, defer, Notification } from 'rxjs';\nimport { catchError, ignoreElements, materialize, map, filter, groupBy, mergeMap, exhaustMap, dematerialize, concatMap, finalize } from 'rxjs/operators';\nimport { Injectable, Inject, ErrorHandler, InjectionToken, NgModule, Optional, SkipSelf } from '@angular/core';\n\nvar DEFAULT_EFFECT_CONFIG = {\n dispatch: true,\n resubscribeOnError: true,\n};\nvar CREATE_EFFECT_METADATA_KEY = '__@ngrx/effects_create__';\n\n/**\n * @description\n * Creates an effect from an `Observable` and an `EffectConfig`.\n *\n * @param source A function which returns an `Observable`.\n * @param config A `Partial` to configure the effect. By default, `dispatch` is true and `resubscribeOnError` is true.\n * @returns If `EffectConfig`#`dispatch` is true, returns `Observable`. Else, returns `Observable`.\n *\n * @usageNotes\n *\n * ** Mapping to a different action **\n * ```ts\n * effectName$ = createEffect(\n * () => this.actions$.pipe(\n * ofType(FeatureActions.actionOne),\n * map(() => FeatureActions.actionTwo())\n * )\n * );\n * ```\n *\n * ** Non-dispatching effects **\n * ```ts\n * effectName$ = createEffect(\n * () => this.actions$.pipe(\n * ofType(FeatureActions.actionOne),\n * tap(() => console.log('Action One Dispatched'))\n * ),\n * { dispatch: false }\n * // FeatureActions.actionOne is not dispatched\n * );\n * ```\n */\nfunction createEffect(source, config) {\n var effect = source();\n var value = __assign({}, DEFAULT_EFFECT_CONFIG, config);\n Object.defineProperty(effect, CREATE_EFFECT_METADATA_KEY, {\n value: value,\n });\n return effect;\n}\nfunction getCreateEffectMetadata(instance) {\n var propertyNames = Object.getOwnPropertyNames(instance);\n var metadata = propertyNames\n .filter(function (propertyName) {\n return instance[propertyName] &&\n instance[propertyName].hasOwnProperty(CREATE_EFFECT_METADATA_KEY);\n })\n .map(function (propertyName) {\n var metaData = instance[propertyName][CREATE_EFFECT_METADATA_KEY];\n return __assign({ propertyName: propertyName }, metaData);\n });\n return metadata;\n}\n\nfunction getSourceForInstance(instance) {\n return Object.getPrototypeOf(instance);\n}\n\nvar METADATA_KEY = '__@ngrx/effects__';\nfunction Effect(config) {\n if (config === void 0) { config = {}; }\n return function (target, propertyName) {\n var metadata = __assign({}, DEFAULT_EFFECT_CONFIG, config, { // Overrides any defaults if values are provided\n propertyName: propertyName });\n addEffectMetadataEntry(target, metadata);\n };\n}\nfunction getEffectDecoratorMetadata(instance) {\n var effectsDecorators = compose(getEffectMetadataEntries, getSourceForInstance)(instance);\n return effectsDecorators;\n}\n/**\n * Type guard to detemine whether METADATA_KEY is already present on the Class\n * constructor\n */\nfunction hasMetadataEntries(sourceProto) {\n return sourceProto.constructor.hasOwnProperty(METADATA_KEY);\n}\n/** Add Effect Metadata to the Effect Class constructor under specific key */\nfunction addEffectMetadataEntry(sourceProto, metadata) {\n if (hasMetadataEntries(sourceProto)) {\n sourceProto.constructor[METADATA_KEY].push(metadata);\n }\n else {\n Object.defineProperty(sourceProto.constructor, METADATA_KEY, {\n value: [metadata],\n });\n }\n}\nfunction getEffectMetadataEntries(sourceProto) {\n return hasMetadataEntries(sourceProto)\n ? sourceProto.constructor[METADATA_KEY]\n : [];\n}\n\nfunction getEffectsMetadata(instance) {\n return getSourceMetadata(instance).reduce(function (acc, _a) {\n var propertyName = _a.propertyName, dispatch = _a.dispatch, resubscribeOnError = _a.resubscribeOnError;\n acc[propertyName] = { dispatch: dispatch, resubscribeOnError: resubscribeOnError };\n return acc;\n }, {});\n}\nfunction getSourceMetadata(instance) {\n var effects = [\n getEffectDecoratorMetadata,\n getCreateEffectMetadata,\n ];\n return effects.reduce(function (sources, source) { return sources.concat(source(instance)); }, []);\n}\n\nfunction mergeEffects(sourceInstance, errorHandler) {\n var sourceName = getSourceForInstance(sourceInstance).constructor.name;\n var observables$ = getSourceMetadata(sourceInstance).map(function (_a) {\n var propertyName = _a.propertyName, dispatch = _a.dispatch, resubscribeOnError = _a.resubscribeOnError;\n var observable$ = typeof sourceInstance[propertyName] === 'function'\n ? sourceInstance[propertyName]()\n : sourceInstance[propertyName];\n var resubscribable$ = resubscribeOnError\n ? resubscribeInCaseOfError(observable$, errorHandler)\n : observable$;\n if (dispatch === false) {\n return resubscribable$.pipe(ignoreElements());\n }\n var materialized$ = resubscribable$.pipe(materialize());\n return materialized$.pipe(map(function (notification) { return ({\n effect: sourceInstance[propertyName],\n notification: notification,\n propertyName: propertyName,\n sourceName: sourceName,\n sourceInstance: sourceInstance,\n }); }));\n });\n return merge.apply(void 0, __spread(observables$));\n}\nfunction resubscribeInCaseOfError(observable$, errorHandler) {\n return observable$.pipe(catchError(function (error) {\n if (errorHandler)\n errorHandler.handleError(error);\n // Return observable that produces this particular effect\n return resubscribeInCaseOfError(observable$, errorHandler);\n }));\n}\n\nvar Actions = /** @class */ (function (_super) {\n __extends(Actions, _super);\n function Actions(source) {\n var _this = _super.call(this) || this;\n if (source) {\n _this.source = source;\n }\n return _this;\n }\n Actions_1 = Actions;\n Actions.prototype.lift = function (operator) {\n var observable = new Actions_1();\n observable.source = this;\n observable.operator = operator;\n return observable;\n };\n var Actions_1;\n Actions = Actions_1 = __decorate([\n Injectable(),\n __param(0, Inject(ScannedActionsSubject)),\n __metadata(\"design:paramtypes\", [Observable])\n ], Actions);\n return Actions;\n}(Observable));\nfunction ofType() {\n var allowedTypes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n allowedTypes[_i] = arguments[_i];\n }\n return filter(function (action) {\n return allowedTypes.some(function (typeOrActionCreator) {\n if (typeof typeOrActionCreator === 'string') {\n // Comparing the string to type\n return typeOrActionCreator === action.type;\n }\n // We are filtering by ActionCreator\n return typeOrActionCreator.type === action.type;\n });\n });\n}\n\nfunction reportInvalidActions(output, reporter) {\n if (output.notification.kind === 'N') {\n var action = output.notification.value;\n var isInvalidAction = !isAction(action);\n if (isInvalidAction) {\n reporter.handleError(new Error(\"Effect \" + getEffectName(output) + \" dispatched an invalid action: \" + stringify(action)));\n }\n }\n}\nfunction isAction(action) {\n return (typeof action !== 'function' &&\n action &&\n action.type &&\n typeof action.type === 'string');\n}\nfunction getEffectName(_a) {\n var propertyName = _a.propertyName, sourceInstance = _a.sourceInstance, sourceName = _a.sourceName;\n var isMethod = typeof sourceInstance[propertyName] === 'function';\n return \"\\\"\" + sourceName + \".\" + String(propertyName) + (isMethod ? '()' : '') + \"\\\"\";\n}\nfunction stringify(action) {\n try {\n return JSON.stringify(action);\n }\n catch (_a) {\n return action;\n }\n}\n\nvar onIdentifyEffectsKey = 'ngrxOnIdentifyEffects';\nvar onRunEffectsKey = 'ngrxOnRunEffects';\nvar onInitEffects = 'ngrxOnInitEffects';\n\nvar EffectSources = /** @class */ (function (_super) {\n __extends(EffectSources, _super);\n function EffectSources(errorHandler, store) {\n var _this = _super.call(this) || this;\n _this.errorHandler = errorHandler;\n _this.store = store;\n return _this;\n }\n EffectSources.prototype.addEffects = function (effectSourceInstance) {\n this.next(effectSourceInstance);\n if (onInitEffects in effectSourceInstance &&\n typeof effectSourceInstance[onInitEffects] === 'function') {\n this.store.dispatch(effectSourceInstance[onInitEffects]());\n }\n };\n /**\n * @internal\n */\n EffectSources.prototype.toActions = function () {\n var _this = this;\n return this.pipe(groupBy(getSourceForInstance), mergeMap(function (source$) { return source$.pipe(groupBy(effectsInstance)); }), mergeMap(function (source$) {\n return source$.pipe(exhaustMap(resolveEffectSource(_this.errorHandler)), map(function (output) {\n reportInvalidActions(output, _this.errorHandler);\n return output.notification;\n }), filter(function (notification) {\n return notification.kind === 'N';\n }), dematerialize());\n }));\n };\n EffectSources = __decorate([\n Injectable(),\n __metadata(\"design:paramtypes\", [ErrorHandler, Store])\n ], EffectSources);\n return EffectSources;\n}(Subject));\nfunction effectsInstance(sourceInstance) {\n if (onIdentifyEffectsKey in sourceInstance &&\n typeof sourceInstance[onIdentifyEffectsKey] === 'function') {\n return sourceInstance[onIdentifyEffectsKey]();\n }\n return '';\n}\nfunction resolveEffectSource(errorHandler) {\n return function (sourceInstance) {\n var mergedEffects$ = mergeEffects(sourceInstance, errorHandler);\n if (isOnRunEffects(sourceInstance)) {\n return sourceInstance.ngrxOnRunEffects(mergedEffects$);\n }\n return mergedEffects$;\n };\n}\nfunction isOnRunEffects(sourceInstance) {\n var source = getSourceForInstance(sourceInstance);\n return (onRunEffectsKey in source && typeof source[onRunEffectsKey] === 'function');\n}\n\nvar _ROOT_EFFECTS_GUARD = new InjectionToken('@ngrx/effects Internal Root Guard');\nvar IMMEDIATE_EFFECTS = new InjectionToken('ngrx/effects: Immediate Effects');\nvar ROOT_EFFECTS = new InjectionToken('ngrx/effects: Root Effects');\nvar FEATURE_EFFECTS = new InjectionToken('ngrx/effects: Feature Effects');\n\nvar EffectsRunner = /** @class */ (function () {\n function EffectsRunner(effectSources, store) {\n this.effectSources = effectSources;\n this.store = store;\n this.effectsSubscription = null;\n }\n EffectsRunner.prototype.start = function () {\n if (!this.effectsSubscription) {\n this.effectsSubscription = this.effectSources\n .toActions()\n .subscribe(this.store);\n }\n };\n EffectsRunner.prototype.ngOnDestroy = function () {\n if (this.effectsSubscription) {\n this.effectsSubscription.unsubscribe();\n this.effectsSubscription = null;\n }\n };\n EffectsRunner = __decorate([\n Injectable(),\n __metadata(\"design:paramtypes\", [EffectSources,\n Store])\n ], EffectsRunner);\n return EffectsRunner;\n}());\n\nvar ROOT_EFFECTS_INIT = '@ngrx/effects/init';\nvar rootEffectsInit = createAction(ROOT_EFFECTS_INIT);\nvar EffectsRootModule = /** @class */ (function () {\n function EffectsRootModule(sources, runner, store, rootEffects, storeRootModule, storeFeatureModule, guard) {\n this.sources = sources;\n runner.start();\n rootEffects.forEach(function (effectSourceInstance) {\n return sources.addEffects(effectSourceInstance);\n });\n store.dispatch({ type: ROOT_EFFECTS_INIT });\n }\n EffectsRootModule.prototype.addEffects = function (effectSourceInstance) {\n this.sources.addEffects(effectSourceInstance);\n };\n EffectsRootModule = __decorate([\n NgModule({}),\n __param(3, Inject(ROOT_EFFECTS)),\n __param(4, Optional()),\n __param(5, Optional()),\n __param(6, Optional()),\n __param(6, Inject(_ROOT_EFFECTS_GUARD)),\n __metadata(\"design:paramtypes\", [EffectSources,\n EffectsRunner,\n Store, Array, StoreRootModule,\n StoreFeatureModule, Object])\n ], EffectsRootModule);\n return EffectsRootModule;\n}());\n\nvar EffectsFeatureModule = /** @class */ (function () {\n function EffectsFeatureModule(root, effectSourceGroups, storeRootModule, storeFeatureModule) {\n effectSourceGroups.forEach(function (group) {\n return group.forEach(function (effectSourceInstance) {\n return root.addEffects(effectSourceInstance);\n });\n });\n }\n EffectsFeatureModule = __decorate([\n NgModule({}),\n __param(1, Inject(FEATURE_EFFECTS)),\n __param(2, Optional()),\n __param(3, Optional()),\n __metadata(\"design:paramtypes\", [EffectsRootModule, Array, StoreRootModule,\n StoreFeatureModule])\n ], EffectsFeatureModule);\n return EffectsFeatureModule;\n}());\n\nvar EffectsModule = /** @class */ (function () {\n function EffectsModule() {\n }\n EffectsModule.forFeature = function (featureEffects) {\n return {\n ngModule: EffectsFeatureModule,\n providers: [\n featureEffects,\n {\n provide: FEATURE_EFFECTS,\n multi: true,\n deps: featureEffects,\n useFactory: createSourceInstances,\n },\n ],\n };\n };\n EffectsModule.forRoot = function (rootEffects) {\n return {\n ngModule: EffectsRootModule,\n providers: [\n {\n provide: _ROOT_EFFECTS_GUARD,\n useFactory: _provideForRootGuard,\n deps: [[EffectsRunner, new Optional(), new SkipSelf()]],\n },\n EffectsRunner,\n EffectSources,\n Actions,\n rootEffects,\n {\n provide: ROOT_EFFECTS,\n deps: rootEffects,\n useFactory: createSourceInstances,\n },\n ],\n };\n };\n EffectsModule = __decorate([\n NgModule({})\n ], EffectsModule);\n return EffectsModule;\n}());\nfunction createSourceInstances() {\n var instances = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n instances[_i] = arguments[_i];\n }\n return instances;\n}\nfunction _provideForRootGuard(runner) {\n if (runner) {\n throw new TypeError(\"EffectsModule.forRoot() called twice. Feature modules should use EffectsModule.forFeature() instead.\");\n }\n return 'guarded';\n}\n\nfunction act(\n/** Allow to take either config object or project/error functions */\nconfigOrProject, errorFn) {\n var _a = typeof configOrProject === 'function'\n ? {\n project: configOrProject,\n error: errorFn,\n operator: concatMap,\n complete: undefined,\n unsubscribe: undefined,\n }\n : __assign({}, configOrProject, { operator: configOrProject.operator || concatMap }), project = _a.project, error = _a.error, complete = _a.complete, operator = _a.operator, unsubscribe = _a.unsubscribe;\n return function (source) {\n return defer(function () {\n var subject = new Subject();\n return merge(source.pipe(operator(function (input, index) {\n return defer(function () {\n var completed = false;\n var errored = false;\n var projectedCount = 0;\n return project(input, index).pipe(materialize(), map(function (notification) {\n switch (notification.kind) {\n case 'E':\n errored = true;\n return new Notification(\n // TODO: remove any in RxJS 6.5\n 'N', error(notification.error, input));\n case 'C':\n completed = true;\n return complete\n ? new Notification(\n // TODO: remove any in RxJS 6.5\n 'N', complete(projectedCount, input))\n : undefined;\n default:\n ++projectedCount;\n return notification;\n }\n }), filter(function (n) { return n != null; }), dematerialize(), finalize(function () {\n if (!completed && !errored && unsubscribe) {\n subject.next(unsubscribe(projectedCount, input));\n }\n }));\n });\n })), subject);\n });\n };\n}\n\n/**\n * DO NOT EDIT\n *\n * This file is automatically generated at build\n */\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { getSourceMetadata as ɵngrx_modules_effects_effects_a, _provideForRootGuard as ɵngrx_modules_effects_effects_c, createSourceInstances as ɵngrx_modules_effects_effects_b, EffectsRunner as ɵngrx_modules_effects_effects_g, FEATURE_EFFECTS as ɵngrx_modules_effects_effects_f, ROOT_EFFECTS as ɵngrx_modules_effects_effects_e, _ROOT_EFFECTS_GUARD as ɵngrx_modules_effects_effects_d, createEffect, Effect, getEffectsMetadata, mergeEffects, Actions, ofType, EffectsModule, EffectSources, EffectsFeatureModule, ROOT_EFFECTS_INIT, rootEffectsInit, EffectsRootModule, act };\n//# sourceMappingURL=effects.js.map\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isArray = (function () { return Array.isArray || (function (x) { return x && typeof x.length === 'number'; }); })();\n//# sourceMappingURL=isArray.js.map","import { liftTarget, canJoin, joinPoint, canSplit, ReplaceAroundStep, findWrapping } from 'prosemirror-transform';\nimport { Fragment, Slice } from 'prosemirror-model';\nimport { NodeSelection, Selection, TextSelection, AllSelection } from 'prosemirror-state';\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// Delete the selection, if there is one.\nfunction deleteSelection(state, dispatch) {\n if (state.selection.empty) { return false }\n if (dispatch) { dispatch(state.tr.deleteSelection().scrollIntoView()); }\n return true\n}\n\n// :: (EditorState, ?(tr: Transaction), ?EditorView) → bool\n// If the selection is empty and at the start of a textblock, try to\n// reduce the distance between that block and the one before it—if\n// there's a block directly before it that can be joined, join them.\n// If not, try to move the selected block closer to the next one in\n// the document structure by lifting it out of its parent or moving it\n// into a parent of the previous block. Will use the view for accurate\n// (bidi-aware) start-of-textblock detection if given.\nfunction joinBackward(state, dispatch, view) {\n var ref = state.selection;\n var $cursor = ref.$cursor;\n if (!$cursor || (view ? !view.endOfTextblock(\"backward\", state)\n : $cursor.parentOffset > 0))\n { return false }\n\n var $cut = findCutBefore($cursor);\n\n // If there is no node before this, try to lift\n if (!$cut) {\n var range = $cursor.blockRange(), target = range && liftTarget(range);\n if (target == null) { return false }\n if (dispatch) { dispatch(state.tr.lift(range, target).scrollIntoView()); }\n return true\n }\n\n var before = $cut.nodeBefore;\n // Apply the joining algorithm\n if (!before.type.spec.isolating && deleteBarrier(state, $cut, dispatch))\n { return true }\n\n // If the node below has no content and the node above is\n // selectable, delete the node below and select the one above.\n if ($cursor.parent.content.size == 0 &&\n (textblockAt(before, \"end\") || NodeSelection.isSelectable(before))) {\n if (dispatch) {\n var tr = state.tr.deleteRange($cursor.before(), $cursor.after());\n tr.setSelection(textblockAt(before, \"end\") ? Selection.findFrom(tr.doc.resolve(tr.mapping.map($cut.pos, -1)), -1)\n : NodeSelection.create(tr.doc, $cut.pos - before.nodeSize));\n dispatch(tr.scrollIntoView());\n }\n return true\n }\n\n // If the node before is an atom, delete it\n if (before.isAtom && $cut.depth == $cursor.depth - 1) {\n if (dispatch) { dispatch(state.tr.delete($cut.pos - before.nodeSize, $cut.pos).scrollIntoView()); }\n return true\n }\n\n return false\n}\n\nfunction textblockAt(node, side) {\n for (; node; node = (side == \"start\" ? node.firstChild : node.lastChild))\n { if (node.isTextblock) { return true } }\n return false\n}\n\n// :: (EditorState, ?(tr: Transaction), ?EditorView) → bool\n// When the selection is empty and at the start of a textblock, select\n// the node before that textblock, if possible. This is intended to be\n// bound to keys like backspace, after\n// [`joinBackward`](#commands.joinBackward) or other deleting\n// commands, as a fall-back behavior when the schema doesn't allow\n// deletion at the selected point.\nfunction selectNodeBackward(state, dispatch, view) {\n var ref = state.selection;\n var $cursor = ref.$cursor;\n if (!$cursor || (view ? !view.endOfTextblock(\"backward\", state)\n : $cursor.parentOffset > 0))\n { return false }\n\n var $cut = findCutBefore($cursor), node = $cut && $cut.nodeBefore;\n if (!node || !NodeSelection.isSelectable(node)) { return false }\n if (dispatch)\n { dispatch(state.tr.setSelection(NodeSelection.create(state.doc, $cut.pos - node.nodeSize)).scrollIntoView()); }\n return true\n}\n\nfunction findCutBefore($pos) {\n if (!$pos.parent.type.spec.isolating) { for (var i = $pos.depth - 1; i >= 0; i--) {\n if ($pos.index(i) > 0) { return $pos.doc.resolve($pos.before(i + 1)) }\n if ($pos.node(i).type.spec.isolating) { break }\n } }\n return null\n}\n\n// :: (EditorState, ?(tr: Transaction), ?EditorView) → bool\n// If the selection is empty and the cursor is at the end of a\n// textblock, try to reduce or remove the boundary between that block\n// and the one after it, either by joining them or by moving the other\n// block closer to this one in the tree structure. Will use the view\n// for accurate start-of-textblock detection if given.\nfunction joinForward(state, dispatch, view) {\n var ref = state.selection;\n var $cursor = ref.$cursor;\n if (!$cursor || (view ? !view.endOfTextblock(\"forward\", state)\n : $cursor.parentOffset < $cursor.parent.content.size))\n { return false }\n\n var $cut = findCutAfter($cursor);\n\n // If there is no node after this, there's nothing to do\n if (!$cut) { return false }\n\n var after = $cut.nodeAfter;\n // Try the joining algorithm\n if (deleteBarrier(state, $cut, dispatch)) { return true }\n\n // If the node above has no content and the node below is\n // selectable, delete the node above and select the one below.\n if ($cursor.parent.content.size == 0 &&\n (textblockAt(after, \"start\") || NodeSelection.isSelectable(after))) {\n if (dispatch) {\n var tr = state.tr.deleteRange($cursor.before(), $cursor.after());\n tr.setSelection(textblockAt(after, \"start\") ? Selection.findFrom(tr.doc.resolve(tr.mapping.map($cut.pos)), 1)\n : NodeSelection.create(tr.doc, tr.mapping.map($cut.pos)));\n dispatch(tr.scrollIntoView());\n }\n return true\n }\n\n // If the next node is an atom, delete it\n if (after.isAtom && $cut.depth == $cursor.depth - 1) {\n if (dispatch) { dispatch(state.tr.delete($cut.pos, $cut.pos + after.nodeSize).scrollIntoView()); }\n return true\n }\n\n return false\n}\n\n// :: (EditorState, ?(tr: Transaction), ?EditorView) → bool\n// When the selection is empty and at the end of a textblock, select\n// the node coming after that textblock, if possible. This is intended\n// to be bound to keys like delete, after\n// [`joinForward`](#commands.joinForward) and similar deleting\n// commands, to provide a fall-back behavior when the schema doesn't\n// allow deletion at the selected point.\nfunction selectNodeForward(state, dispatch, view) {\n var ref = state.selection;\n var $cursor = ref.$cursor;\n if (!$cursor || (view ? !view.endOfTextblock(\"forward\", state)\n : $cursor.parentOffset < $cursor.parent.content.size))\n { return false }\n\n var $cut = findCutAfter($cursor), node = $cut && $cut.nodeAfter;\n if (!node || !NodeSelection.isSelectable(node)) { return false }\n if (dispatch)\n { dispatch(state.tr.setSelection(NodeSelection.create(state.doc, $cut.pos)).scrollIntoView()); }\n return true\n}\n\nfunction findCutAfter($pos) {\n if (!$pos.parent.type.spec.isolating) { for (var i = $pos.depth - 1; i >= 0; i--) {\n var parent = $pos.node(i);\n if ($pos.index(i) + 1 < parent.childCount) { return $pos.doc.resolve($pos.after(i + 1)) }\n if (parent.type.spec.isolating) { break }\n } }\n return null\n}\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// Join the selected block or, if there is a text selection, the\n// closest ancestor block of the selection that can be joined, with\n// the sibling above it.\nfunction joinUp(state, dispatch) {\n var sel = state.selection, nodeSel = sel instanceof NodeSelection, point;\n if (nodeSel) {\n if (sel.node.isTextblock || !canJoin(state.doc, sel.from)) { return false }\n point = sel.from;\n } else {\n point = joinPoint(state.doc, sel.from, -1);\n if (point == null) { return false }\n }\n if (dispatch) {\n var tr = state.tr.join(point);\n if (nodeSel) { tr.setSelection(NodeSelection.create(tr.doc, point - state.doc.resolve(point).nodeBefore.nodeSize)); }\n dispatch(tr.scrollIntoView());\n }\n return true\n}\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// Join the selected block, or the closest ancestor of the selection\n// that can be joined, with the sibling after it.\nfunction joinDown(state, dispatch) {\n var sel = state.selection, point;\n if (sel instanceof NodeSelection) {\n if (sel.node.isTextblock || !canJoin(state.doc, sel.to)) { return false }\n point = sel.to;\n } else {\n point = joinPoint(state.doc, sel.to, 1);\n if (point == null) { return false }\n }\n if (dispatch)\n { dispatch(state.tr.join(point).scrollIntoView()); }\n return true\n}\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// Lift the selected block, or the closest ancestor block of the\n// selection that can be lifted, out of its parent node.\nfunction lift(state, dispatch) {\n var ref = state.selection;\n var $from = ref.$from;\n var $to = ref.$to;\n var range = $from.blockRange($to), target = range && liftTarget(range);\n if (target == null) { return false }\n if (dispatch) { dispatch(state.tr.lift(range, target).scrollIntoView()); }\n return true\n}\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// If the selection is in a node whose type has a truthy\n// [`code`](#model.NodeSpec.code) property in its spec, replace the\n// selection with a newline character.\nfunction newlineInCode(state, dispatch) {\n var ref = state.selection;\n var $head = ref.$head;\n var $anchor = ref.$anchor;\n if (!$head.parent.type.spec.code || !$head.sameParent($anchor)) { return false }\n if (dispatch) { dispatch(state.tr.insertText(\"\\n\").scrollIntoView()); }\n return true\n}\n\nfunction defaultBlockAt(match) {\n for (var i = 0; i < match.edgeCount; i++) {\n var ref = match.edge(i);\n var type = ref.type;\n if (type.isTextblock && !type.hasRequiredAttrs()) { return type }\n }\n return null\n}\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// When the selection is in a node with a truthy\n// [`code`](#model.NodeSpec.code) property in its spec, create a\n// default block after the code block, and move the cursor there.\nfunction exitCode(state, dispatch) {\n var ref = state.selection;\n var $head = ref.$head;\n var $anchor = ref.$anchor;\n if (!$head.parent.type.spec.code || !$head.sameParent($anchor)) { return false }\n var above = $head.node(-1), after = $head.indexAfter(-1), type = defaultBlockAt(above.contentMatchAt(after));\n if (!above.canReplaceWith(after, after, type)) { return false }\n if (dispatch) {\n var pos = $head.after(), tr = state.tr.replaceWith(pos, pos, type.createAndFill());\n tr.setSelection(Selection.near(tr.doc.resolve(pos), 1));\n dispatch(tr.scrollIntoView());\n }\n return true\n}\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// If a block node is selected, create an empty paragraph before (if\n// it is its parent's first child) or after it.\nfunction createParagraphNear(state, dispatch) {\n var ref = state.selection;\n var $from = ref.$from;\n var $to = ref.$to;\n if ($from.parent.inlineContent || $to.parent.inlineContent) { return false }\n var type = defaultBlockAt($from.parent.contentMatchAt($to.indexAfter()));\n if (!type || !type.isTextblock) { return false }\n if (dispatch) {\n var side = (!$from.parentOffset && $to.index() < $to.parent.childCount ? $from : $to).pos;\n var tr = state.tr.insert(side, type.createAndFill());\n tr.setSelection(TextSelection.create(tr.doc, side + 1));\n dispatch(tr.scrollIntoView());\n }\n return true\n}\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// If the cursor is in an empty textblock that can be lifted, lift the\n// block.\nfunction liftEmptyBlock(state, dispatch) {\n var ref = state.selection;\n var $cursor = ref.$cursor;\n if (!$cursor || $cursor.parent.content.size) { return false }\n if ($cursor.depth > 1 && $cursor.after() != $cursor.end(-1)) {\n var before = $cursor.before();\n if (canSplit(state.doc, before)) {\n if (dispatch) { dispatch(state.tr.split(before).scrollIntoView()); }\n return true\n }\n }\n var range = $cursor.blockRange(), target = range && liftTarget(range);\n if (target == null) { return false }\n if (dispatch) { dispatch(state.tr.lift(range, target).scrollIntoView()); }\n return true\n}\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// Split the parent block of the selection. If the selection is a text\n// selection, also delete its content.\nfunction splitBlock(state, dispatch) {\n var ref = state.selection;\n var $from = ref.$from;\n var $to = ref.$to;\n if (state.selection instanceof NodeSelection && state.selection.node.isBlock) {\n if (!$from.parentOffset || !canSplit(state.doc, $from.pos)) { return false }\n if (dispatch) { dispatch(state.tr.split($from.pos).scrollIntoView()); }\n return true\n }\n\n if (!$from.parent.isBlock) { return false }\n\n if (dispatch) {\n var atEnd = $to.parentOffset == $to.parent.content.size;\n var tr = state.tr;\n if (state.selection instanceof TextSelection) { tr.deleteSelection(); }\n var deflt = $from.depth == 0 ? null : defaultBlockAt($from.node(-1).contentMatchAt($from.indexAfter(-1)));\n var types = atEnd && deflt ? [{type: deflt}] : null;\n var can = canSplit(tr.doc, tr.mapping.map($from.pos), 1, types);\n if (!types && !can && canSplit(tr.doc, tr.mapping.map($from.pos), 1, deflt && [{type: deflt}])) {\n types = [{type: deflt}];\n can = true;\n }\n if (can) {\n tr.split(tr.mapping.map($from.pos), 1, types);\n if (!atEnd && !$from.parentOffset && $from.parent.type != deflt &&\n $from.node(-1).canReplace($from.index(-1), $from.indexAfter(-1), Fragment.from(deflt.create(), $from.parent)))\n { tr.setNodeMarkup(tr.mapping.map($from.before()), deflt); }\n }\n dispatch(tr.scrollIntoView());\n }\n return true\n}\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// Acts like [`splitBlock`](#commands.splitBlock), but without\n// resetting the set of active marks at the cursor.\nfunction splitBlockKeepMarks(state, dispatch) {\n return splitBlock(state, dispatch && (function (tr) {\n var marks = state.storedMarks || (state.selection.$to.parentOffset && state.selection.$from.marks());\n if (marks) { tr.ensureMarks(marks); }\n dispatch(tr);\n }))\n}\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// Move the selection to the node wrapping the current selection, if\n// any. (Will not select the document node.)\nfunction selectParentNode(state, dispatch) {\n var ref = state.selection;\n var $from = ref.$from;\n var to = ref.to;\n var pos;\n var same = $from.sharedDepth(to);\n if (same == 0) { return false }\n pos = $from.before(same);\n if (dispatch) { dispatch(state.tr.setSelection(NodeSelection.create(state.doc, pos))); }\n return true\n}\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// Select the whole document.\nfunction selectAll(state, dispatch) {\n if (dispatch) { dispatch(state.tr.setSelection(new AllSelection(state.doc))); }\n return true\n}\n\nfunction joinMaybeClear(state, $pos, dispatch) {\n var before = $pos.nodeBefore, after = $pos.nodeAfter, index = $pos.index();\n if (!before || !after || !before.type.compatibleContent(after.type)) { return false }\n if (!before.content.size && $pos.parent.canReplace(index - 1, index)) {\n if (dispatch) { dispatch(state.tr.delete($pos.pos - before.nodeSize, $pos.pos).scrollIntoView()); }\n return true\n }\n if (!$pos.parent.canReplace(index, index + 1) || !(after.isTextblock || canJoin(state.doc, $pos.pos)))\n { return false }\n if (dispatch)\n { dispatch(state.tr\n .clearIncompatible($pos.pos, before.type, before.contentMatchAt(before.childCount))\n .join($pos.pos)\n .scrollIntoView()); }\n return true\n}\n\nfunction deleteBarrier(state, $cut, dispatch) {\n var before = $cut.nodeBefore, after = $cut.nodeAfter, conn, match;\n if (before.type.spec.isolating || after.type.spec.isolating) { return false }\n if (joinMaybeClear(state, $cut, dispatch)) { return true }\n\n if ($cut.parent.canReplace($cut.index(), $cut.index() + 1) &&\n (conn = (match = before.contentMatchAt(before.childCount)).findWrapping(after.type)) &&\n match.matchType(conn[0] || after.type).validEnd) {\n if (dispatch) {\n var end = $cut.pos + after.nodeSize, wrap = Fragment.empty;\n for (var i = conn.length - 1; i >= 0; i--)\n { wrap = Fragment.from(conn[i].create(null, wrap)); }\n wrap = Fragment.from(before.copy(wrap));\n var tr = state.tr.step(new ReplaceAroundStep($cut.pos - 1, end, $cut.pos, end, new Slice(wrap, 1, 0), conn.length, true));\n var joinAt = end + 2 * conn.length;\n if (canJoin(tr.doc, joinAt)) { tr.join(joinAt); }\n dispatch(tr.scrollIntoView());\n }\n return true\n }\n\n var selAfter = Selection.findFrom($cut, 1);\n var range = selAfter && selAfter.$from.blockRange(selAfter.$to), target = range && liftTarget(range);\n if (target != null && target >= $cut.depth) {\n if (dispatch) { dispatch(state.tr.lift(range, target).scrollIntoView()); }\n return true\n }\n\n return false\n}\n\n// Parameterized commands\n\n// :: (NodeType, ?Object) → (state: EditorState, dispatch: ?(tr: Transaction)) → bool\n// Wrap the selection in a node of the given type with the given\n// attributes.\nfunction wrapIn(nodeType, attrs) {\n return function(state, dispatch) {\n var ref = state.selection;\n var $from = ref.$from;\n var $to = ref.$to;\n var range = $from.blockRange($to), wrapping = range && findWrapping(range, nodeType, attrs);\n if (!wrapping) { return false }\n if (dispatch) { dispatch(state.tr.wrap(range, wrapping).scrollIntoView()); }\n return true\n }\n}\n\n// :: (NodeType, ?Object) → (state: EditorState, dispatch: ?(tr: Transaction)) → bool\n// Returns a command that tries to set the selected textblocks to the\n// given node type with the given attributes.\nfunction setBlockType(nodeType, attrs) {\n return function(state, dispatch) {\n var ref = state.selection;\n var from = ref.from;\n var to = ref.to;\n var applicable = false;\n state.doc.nodesBetween(from, to, function (node, pos) {\n if (applicable) { return false }\n if (!node.isTextblock || node.hasMarkup(nodeType, attrs)) { return }\n if (node.type == nodeType) {\n applicable = true;\n } else {\n var $pos = state.doc.resolve(pos), index = $pos.index();\n applicable = $pos.parent.canReplaceWith(index, index + 1, nodeType);\n }\n });\n if (!applicable) { return false }\n if (dispatch) { dispatch(state.tr.setBlockType(from, to, nodeType, attrs).scrollIntoView()); }\n return true\n }\n}\n\nfunction markApplies(doc, ranges, type) {\n var loop = function ( i ) {\n var ref = ranges[i];\n var $from = ref.$from;\n var $to = ref.$to;\n var can = $from.depth == 0 ? doc.type.allowsMarkType(type) : false;\n doc.nodesBetween($from.pos, $to.pos, function (node) {\n if (can) { return false }\n can = node.inlineContent && node.type.allowsMarkType(type);\n });\n if (can) { return { v: true } }\n };\n\n for (var i = 0; i < ranges.length; i++) {\n var returned = loop( i );\n\n if ( returned ) return returned.v;\n }\n return false\n}\n\n// :: (MarkType, ?Object) → (state: EditorState, dispatch: ?(tr: Transaction)) → bool\n// Create a command function that toggles the given mark with the\n// given attributes. Will return `false` when the current selection\n// doesn't support that mark. This will remove the mark if any marks\n// of that type exist in the selection, or add it otherwise. If the\n// selection is empty, this applies to the [stored\n// marks](#state.EditorState.storedMarks) instead of a range of the\n// document.\nfunction toggleMark(markType, attrs) {\n return function(state, dispatch) {\n var ref = state.selection;\n var empty = ref.empty;\n var $cursor = ref.$cursor;\n var ranges = ref.ranges;\n if ((empty && !$cursor) || !markApplies(state.doc, ranges, markType)) { return false }\n if (dispatch) {\n if ($cursor) {\n if (markType.isInSet(state.storedMarks || $cursor.marks()))\n { dispatch(state.tr.removeStoredMark(markType)); }\n else\n { dispatch(state.tr.addStoredMark(markType.create(attrs))); }\n } else {\n var has = false, tr = state.tr;\n for (var i = 0; !has && i < ranges.length; i++) {\n var ref$1 = ranges[i];\n var $from = ref$1.$from;\n var $to = ref$1.$to;\n has = state.doc.rangeHasMark($from.pos, $to.pos, markType);\n }\n for (var i$1 = 0; i$1 < ranges.length; i$1++) {\n var ref$2 = ranges[i$1];\n var $from$1 = ref$2.$from;\n var $to$1 = ref$2.$to;\n if (has) { tr.removeMark($from$1.pos, $to$1.pos, markType); }\n else { tr.addMark($from$1.pos, $to$1.pos, markType.create(attrs)); }\n }\n dispatch(tr.scrollIntoView());\n }\n }\n return true\n }\n}\n\nfunction wrapDispatchForJoin(dispatch, isJoinable) {\n return function (tr) {\n if (!tr.isGeneric) { return dispatch(tr) }\n\n var ranges = [];\n for (var i = 0; i < tr.mapping.maps.length; i++) {\n var map = tr.mapping.maps[i];\n for (var j = 0; j < ranges.length; j++)\n { ranges[j] = map.map(ranges[j]); }\n map.forEach(function (_s, _e, from, to) { return ranges.push(from, to); });\n }\n\n // Figure out which joinable points exist inside those ranges,\n // by checking all node boundaries in their parent nodes.\n var joinable = [];\n for (var i$1 = 0; i$1 < ranges.length; i$1 += 2) {\n var from = ranges[i$1], to = ranges[i$1 + 1];\n var $from = tr.doc.resolve(from), depth = $from.sharedDepth(to), parent = $from.node(depth);\n for (var index = $from.indexAfter(depth), pos = $from.after(depth + 1); pos <= to; ++index) {\n var after = parent.maybeChild(index);\n if (!after) { break }\n if (index && joinable.indexOf(pos) == -1) {\n var before = parent.child(index - 1);\n if (before.type == after.type && isJoinable(before, after))\n { joinable.push(pos); }\n }\n pos += after.nodeSize;\n }\n }\n // Join the joinable points\n joinable.sort(function (a, b) { return a - b; });\n for (var i$2 = joinable.length - 1; i$2 >= 0; i$2--) {\n if (canJoin(tr.doc, joinable[i$2])) { tr.join(joinable[i$2]); }\n }\n dispatch(tr);\n }\n}\n\n// :: ((state: EditorState, ?(tr: Transaction)) → bool, union<(before: Node, after: Node) → bool, [string]>) → (state: EditorState, ?(tr: Transaction)) → bool\n// Wrap a command so that, when it produces a transform that causes\n// two joinable nodes to end up next to each other, those are joined.\n// Nodes are considered joinable when they are of the same type and\n// when the `isJoinable` predicate returns true for them or, if an\n// array of strings was passed, if their node type name is in that\n// array.\nfunction autoJoin(command, isJoinable) {\n if (Array.isArray(isJoinable)) {\n var types = isJoinable;\n isJoinable = function (node) { return types.indexOf(node.type.name) > -1; };\n }\n return function (state, dispatch) { return command(state, dispatch && wrapDispatchForJoin(dispatch, isJoinable)); }\n}\n\n// :: (...[(EditorState, ?(tr: Transaction), ?EditorView) → bool]) → (EditorState, ?(tr: Transaction), ?EditorView) → bool\n// Combine a number of command functions into a single function (which\n// calls them one by one until one returns true).\nfunction chainCommands() {\n var commands = [], len = arguments.length;\n while ( len-- ) commands[ len ] = arguments[ len ];\n\n return function(state, dispatch, view) {\n for (var i = 0; i < commands.length; i++)\n { if (commands[i](state, dispatch, view)) { return true } }\n return false\n }\n}\n\nvar backspace = chainCommands(deleteSelection, joinBackward, selectNodeBackward);\nvar del = chainCommands(deleteSelection, joinForward, selectNodeForward);\n\n// :: Object\n// A basic keymap containing bindings not specific to any schema.\n// Binds the following keys (when multiple commands are listed, they\n// are chained with [`chainCommands`](#commands.chainCommands)):\n//\n// * **Enter** to `newlineInCode`, `createParagraphNear`, `liftEmptyBlock`, `splitBlock`\n// * **Mod-Enter** to `exitCode`\n// * **Backspace** and **Mod-Backspace** to `deleteSelection`, `joinBackward`, `selectNodeBackward`\n// * **Delete** and **Mod-Delete** to `deleteSelection`, `joinForward`, `selectNodeForward`\n// * **Mod-Delete** to `deleteSelection`, `joinForward`, `selectNodeForward`\n// * **Mod-a** to `selectAll`\nvar pcBaseKeymap = {\n \"Enter\": chainCommands(newlineInCode, createParagraphNear, liftEmptyBlock, splitBlock),\n \"Mod-Enter\": exitCode,\n \"Backspace\": backspace,\n \"Mod-Backspace\": backspace,\n \"Delete\": del,\n \"Mod-Delete\": del,\n \"Mod-a\": selectAll\n};\n\n// :: Object\n// A copy of `pcBaseKeymap` that also binds **Ctrl-h** like Backspace,\n// **Ctrl-d** like Delete, **Alt-Backspace** like Ctrl-Backspace, and\n// **Ctrl-Alt-Backspace**, **Alt-Delete**, and **Alt-d** like\n// Ctrl-Delete.\nvar macBaseKeymap = {\n \"Ctrl-h\": pcBaseKeymap[\"Backspace\"],\n \"Alt-Backspace\": pcBaseKeymap[\"Mod-Backspace\"],\n \"Ctrl-d\": pcBaseKeymap[\"Delete\"],\n \"Ctrl-Alt-Backspace\": pcBaseKeymap[\"Mod-Delete\"],\n \"Alt-Delete\": pcBaseKeymap[\"Mod-Delete\"],\n \"Alt-d\": pcBaseKeymap[\"Mod-Delete\"]\n};\nfor (var key in pcBaseKeymap) { macBaseKeymap[key] = pcBaseKeymap[key]; }\n\n// declare global: os, navigator\nvar mac = typeof navigator != \"undefined\" ? /Mac/.test(navigator.platform)\n : typeof os != \"undefined\" ? os.platform() == \"darwin\" : false;\n\n// :: Object\n// Depending on the detected platform, this will hold\n// [`pcBasekeymap`](#commands.pcBaseKeymap) or\n// [`macBaseKeymap`](#commands.macBaseKeymap).\nvar baseKeymap = mac ? macBaseKeymap : pcBaseKeymap;\n\nexport { autoJoin, baseKeymap, chainCommands, createParagraphNear, deleteSelection, exitCode, joinBackward, joinDown, joinForward, joinUp, lift, liftEmptyBlock, macBaseKeymap, newlineInCode, pcBaseKeymap, selectAll, selectNodeBackward, selectNodeForward, selectParentNode, setBlockType, splitBlock, splitBlockKeepMarks, toggleMark, wrapIn };\n//# sourceMappingURL=index.es.js.map\n","import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n","/** PURE_IMPORTS_START tslib,_util_isFunction,_Observer,_Subscription,_internal_symbol_rxSubscriber,_config,_util_hostReportError PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { empty as emptyObserver } from './Observer';\nimport { Subscription } from './Subscription';\nimport { rxSubscriber as rxSubscriberSymbol } from '../internal/symbol/rxSubscriber';\nimport { config } from './config';\nimport { hostReportError } from './util/hostReportError';\nvar Subscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(Subscriber, _super);\n function Subscriber(destinationOrNext, error, complete) {\n var _this = _super.call(this) || this;\n _this.syncErrorValue = null;\n _this.syncErrorThrown = false;\n _this.syncErrorThrowable = false;\n _this.isStopped = false;\n switch (arguments.length) {\n case 0:\n _this.destination = emptyObserver;\n break;\n case 1:\n if (!destinationOrNext) {\n _this.destination = emptyObserver;\n break;\n }\n if (typeof destinationOrNext === 'object') {\n if (destinationOrNext instanceof Subscriber) {\n _this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;\n _this.destination = destinationOrNext;\n destinationOrNext.add(_this);\n }\n else {\n _this.syncErrorThrowable = true;\n _this.destination = new SafeSubscriber(_this, destinationOrNext);\n }\n break;\n }\n default:\n _this.syncErrorThrowable = true;\n _this.destination = new SafeSubscriber(_this, destinationOrNext, error, complete);\n break;\n }\n return _this;\n }\n Subscriber.prototype[rxSubscriberSymbol] = function () { return this; };\n Subscriber.create = function (next, error, complete) {\n var subscriber = new Subscriber(next, error, complete);\n subscriber.syncErrorThrowable = false;\n return subscriber;\n };\n Subscriber.prototype.next = function (value) {\n if (!this.isStopped) {\n this._next(value);\n }\n };\n Subscriber.prototype.error = function (err) {\n if (!this.isStopped) {\n this.isStopped = true;\n this._error(err);\n }\n };\n Subscriber.prototype.complete = function () {\n if (!this.isStopped) {\n this.isStopped = true;\n this._complete();\n }\n };\n Subscriber.prototype.unsubscribe = function () {\n if (this.closed) {\n return;\n }\n this.isStopped = true;\n _super.prototype.unsubscribe.call(this);\n };\n Subscriber.prototype._next = function (value) {\n this.destination.next(value);\n };\n Subscriber.prototype._error = function (err) {\n this.destination.error(err);\n this.unsubscribe();\n };\n Subscriber.prototype._complete = function () {\n this.destination.complete();\n this.unsubscribe();\n };\n Subscriber.prototype._unsubscribeAndRecycle = function () {\n var _parentOrParents = this._parentOrParents;\n this._parentOrParents = null;\n this.unsubscribe();\n this.closed = false;\n this.isStopped = false;\n this._parentOrParents = _parentOrParents;\n return this;\n };\n return Subscriber;\n}(Subscription));\nexport { Subscriber };\nvar SafeSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(SafeSubscriber, _super);\n function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) {\n var _this = _super.call(this) || this;\n _this._parentSubscriber = _parentSubscriber;\n var next;\n var context = _this;\n if (isFunction(observerOrNext)) {\n next = observerOrNext;\n }\n else if (observerOrNext) {\n next = observerOrNext.next;\n error = observerOrNext.error;\n complete = observerOrNext.complete;\n if (observerOrNext !== emptyObserver) {\n context = Object.create(observerOrNext);\n if (isFunction(context.unsubscribe)) {\n _this.add(context.unsubscribe.bind(context));\n }\n context.unsubscribe = _this.unsubscribe.bind(_this);\n }\n }\n _this._context = context;\n _this._next = next;\n _this._error = error;\n _this._complete = complete;\n return _this;\n }\n SafeSubscriber.prototype.next = function (value) {\n if (!this.isStopped && this._next) {\n var _parentSubscriber = this._parentSubscriber;\n if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(this._next, value);\n }\n else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {\n this.unsubscribe();\n }\n }\n };\n SafeSubscriber.prototype.error = function (err) {\n if (!this.isStopped) {\n var _parentSubscriber = this._parentSubscriber;\n var useDeprecatedSynchronousErrorHandling = config.useDeprecatedSynchronousErrorHandling;\n if (this._error) {\n if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(this._error, err);\n this.unsubscribe();\n }\n else {\n this.__tryOrSetError(_parentSubscriber, this._error, err);\n this.unsubscribe();\n }\n }\n else if (!_parentSubscriber.syncErrorThrowable) {\n this.unsubscribe();\n if (useDeprecatedSynchronousErrorHandling) {\n throw err;\n }\n hostReportError(err);\n }\n else {\n if (useDeprecatedSynchronousErrorHandling) {\n _parentSubscriber.syncErrorValue = err;\n _parentSubscriber.syncErrorThrown = true;\n }\n else {\n hostReportError(err);\n }\n this.unsubscribe();\n }\n }\n };\n SafeSubscriber.prototype.complete = function () {\n var _this = this;\n if (!this.isStopped) {\n var _parentSubscriber = this._parentSubscriber;\n if (this._complete) {\n var wrappedComplete = function () { return _this._complete.call(_this._context); };\n if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(wrappedComplete);\n this.unsubscribe();\n }\n else {\n this.__tryOrSetError(_parentSubscriber, wrappedComplete);\n this.unsubscribe();\n }\n }\n else {\n this.unsubscribe();\n }\n }\n };\n SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) {\n try {\n fn.call(this._context, value);\n }\n catch (err) {\n this.unsubscribe();\n if (config.useDeprecatedSynchronousErrorHandling) {\n throw err;\n }\n else {\n hostReportError(err);\n }\n }\n };\n SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) {\n if (!config.useDeprecatedSynchronousErrorHandling) {\n throw new Error('bad call');\n }\n try {\n fn.call(this._context, value);\n }\n catch (err) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n parent.syncErrorValue = err;\n parent.syncErrorThrown = true;\n return true;\n }\n else {\n hostReportError(err);\n return true;\n }\n }\n return false;\n };\n SafeSubscriber.prototype._unsubscribe = function () {\n var _parentSubscriber = this._parentSubscriber;\n this._context = null;\n this._parentSubscriber = null;\n _parentSubscriber.unsubscribe();\n };\n return SafeSubscriber;\n}(Subscriber));\nexport { SafeSubscriber };\n//# sourceMappingURL=Subscriber.js.map\n","/**\n * @fileoverview This file was generated by the Angular template compiler. Do not edit.\n *\n * @suppress {suspiciousCode,uselessCode,missingProperties,missingOverride,checkTypes}\n * tslint:disable\n */ \nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"@progress/kendo-angular-common\";\nimport * as i2 from \"@angular/common\";\nvar DraggableModuleNgFactory = i0.ɵcmf(i1.DraggableModule, [], function (_l) { return i0.ɵmod([i0.ɵmpd(512, i0.ComponentFactoryResolver, i0.ɵCodegenComponentFactoryResolver, [[8, []], [3, i0.ComponentFactoryResolver], i0.NgModuleRef]), i0.ɵmpd(4608, i2.NgLocalization, i2.NgLocaleLocalization, [i0.LOCALE_ID, [2, i2.ɵangular_packages_common_common_a]]), i0.ɵmpd(1073742336, i2.CommonModule, i2.CommonModule, []), i0.ɵmpd(1073742336, i1.DraggableModule, i1.DraggableModule, [])]); });\nexport { DraggableModuleNgFactory as DraggableModuleNgFactory };\nvar EventsModuleNgFactory = i0.ɵcmf(i1.EventsModule, [], function (_l) { return i0.ɵmod([i0.ɵmpd(512, i0.ComponentFactoryResolver, i0.ɵCodegenComponentFactoryResolver, [[8, []], [3, i0.ComponentFactoryResolver], i0.NgModuleRef]), i0.ɵmpd(1073742336, i1.EventsModule, i1.EventsModule, [])]); });\nexport { EventsModuleNgFactory as EventsModuleNgFactory };\nvar ResizeSensorModuleNgFactory = i0.ɵcmf(i1.ResizeSensorModule, [], function (_l) { return i0.ɵmod([i0.ɵmpd(512, i0.ComponentFactoryResolver, i0.ɵCodegenComponentFactoryResolver, [[8, []], [3, i0.ComponentFactoryResolver], i0.NgModuleRef]), i0.ɵmpd(135680, i1.ResizeBatchService, i1.ResizeBatchService, [i0.NgZone]), i0.ɵmpd(1073742336, i1.ResizeSensorModule, i1.ResizeSensorModule, [])]); });\nexport { ResizeSensorModuleNgFactory as ResizeSensorModuleNgFactory };\nvar styles_ResizeSensorComponent = [];\nvar RenderType_ResizeSensorComponent = i0.ɵcrt({ encapsulation: 2, styles: styles_ResizeSensorComponent, data: {} });\nexport { RenderType_ResizeSensorComponent as RenderType_ResizeSensorComponent };\nexport function View_ResizeSensorComponent_0(_l) { return i0.ɵvid(0, [], null, null); }\nexport function View_ResizeSensorComponent_Host_0(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 1, \"kendo-resize-sensor\", [], null, null, null, View_ResizeSensorComponent_0, RenderType_ResizeSensorComponent)), i0.ɵdid(1, 8568832, null, 0, i1.ResizeSensorComponent, [i1.ResizeBatchService, i0.ElementRef, i0.NgZone], null, null)], null, null); }\nvar ResizeSensorComponentNgFactory = i0.ɵccf(\"kendo-resize-sensor\", i1.ResizeSensorComponent, View_ResizeSensorComponent_Host_0, { rateLimit: \"rateLimit\" }, { resize: \"resize\" }, []);\nexport { ResizeSensorComponentNgFactory as ResizeSensorComponentNgFactory };\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nvar UnsubscriptionErrorImpl = /*@__PURE__*/ (function () {\n function UnsubscriptionErrorImpl(errors) {\n Error.call(this);\n this.message = errors ?\n errors.length + \" errors occurred during unsubscription:\\n\" + errors.map(function (err, i) { return i + 1 + \") \" + err.toString(); }).join('\\n ') : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n return this;\n }\n UnsubscriptionErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);\n return UnsubscriptionErrorImpl;\n})();\nexport var UnsubscriptionError = UnsubscriptionErrorImpl;\n//# sourceMappingURL=UnsubscriptionError.js.map\n","/** PURE_IMPORTS_START PURE_IMPORTS_END */\nexport function isObject(x) {\n return x !== null && typeof x === 'object';\n}\n//# sourceMappingURL=isObject.js.map\n","/** PURE_IMPORTS_START _subscribeToArray,_subscribeToPromise,_subscribeToIterable,_subscribeToObservable,_isArrayLike,_isPromise,_isObject,_symbol_iterator,_symbol_observable PURE_IMPORTS_END */\nimport { subscribeToArray } from './subscribeToArray';\nimport { subscribeToPromise } from './subscribeToPromise';\nimport { subscribeToIterable } from './subscribeToIterable';\nimport { subscribeToObservable } from './subscribeToObservable';\nimport { isArrayLike } from './isArrayLike';\nimport { isPromise } from './isPromise';\nimport { isObject } from './isObject';\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { observable as Symbol_observable } from '../symbol/observable';\nexport var subscribeTo = function (result) {\n if (!!result && typeof result[Symbol_observable] === 'function') {\n return subscribeToObservable(result);\n }\n else if (isArrayLike(result)) {\n return subscribeToArray(result);\n }\n else if (isPromise(result)) {\n return subscribeToPromise(result);\n }\n else if (!!result && typeof result[Symbol_iterator] === 'function') {\n return subscribeToIterable(result);\n }\n else {\n var value = isObject(result) ? 'an invalid object' : \"'\" + result + \"'\";\n var msg = \"You provided \" + value + \" where a stream was expected.\"\n + ' You can provide an Observable, Promise, Array, or Iterable.';\n throw new TypeError(msg);\n }\n};\n//# sourceMappingURL=subscribeTo.js.map\n","/** PURE_IMPORTS_START _symbol_observable PURE_IMPORTS_END */\nimport { observable as Symbol_observable } from '../symbol/observable';\nexport var subscribeToObservable = function (obj) {\n return function (subscriber) {\n var obs = obj[Symbol_observable]();\n if (typeof obs.subscribe !== 'function') {\n throw new TypeError('Provided object does not correctly implement Symbol.observable');\n }\n else {\n return obs.subscribe(subscriber);\n }\n };\n};\n//# sourceMappingURL=subscribeToObservable.js.map\n","/** PURE_IMPORTS_START _hostReportError PURE_IMPORTS_END */\nimport { hostReportError } from './hostReportError';\nexport var subscribeToPromise = function (promise) {\n return function (subscriber) {\n promise.then(function (value) {\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n }, function (err) { return subscriber.error(err); })\n .then(null, hostReportError);\n return subscriber;\n };\n};\n//# sourceMappingURL=subscribeToPromise.js.map\n","/** PURE_IMPORTS_START _symbol_iterator PURE_IMPORTS_END */\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\nexport var subscribeToIterable = function (iterable) {\n return function (subscriber) {\n var iterator = iterable[Symbol_iterator]();\n do {\n var item = iterator.next();\n if (item.done) {\n subscriber.complete();\n break;\n }\n subscriber.next(item.value);\n if (subscriber.closed) {\n break;\n }\n } while (true);\n if (typeof iterator.return === 'function') {\n subscriber.add(function () {\n if (iterator.return) {\n iterator.return();\n }\n });\n }\n return subscriber;\n };\n};\n//# sourceMappingURL=subscribeToIterable.js.map\n","module.exports = function isBuffer(arg) {\n return arg && typeof arg === 'object'\n && typeof arg.copy === 'function'\n && typeof arg.fill === 'function'\n && typeof arg.readUInt8 === 'function';\n}","/** PURE_IMPORTS_START tslib,_fromArray,_util_isArray,_Subscriber,_OuterSubscriber,_util_subscribeToResult,_.._internal_symbol_iterator PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { fromArray } from './fromArray';\nimport { isArray } from '../util/isArray';\nimport { Subscriber } from '../Subscriber';\nimport { OuterSubscriber } from '../OuterSubscriber';\nimport { subscribeToResult } from '../util/subscribeToResult';\nimport { iterator as Symbol_iterator } from '../../internal/symbol/iterator';\nexport function zip() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n var resultSelector = observables[observables.length - 1];\n if (typeof resultSelector === 'function') {\n observables.pop();\n }\n return fromArray(observables, undefined).lift(new ZipOperator(resultSelector));\n}\nvar ZipOperator = /*@__PURE__*/ (function () {\n function ZipOperator(resultSelector) {\n this.resultSelector = resultSelector;\n }\n ZipOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new ZipSubscriber(subscriber, this.resultSelector));\n };\n return ZipOperator;\n}());\nexport { ZipOperator };\nvar ZipSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(ZipSubscriber, _super);\n function ZipSubscriber(destination, resultSelector, values) {\n if (values === void 0) {\n values = Object.create(null);\n }\n var _this = _super.call(this, destination) || this;\n _this.iterators = [];\n _this.active = 0;\n _this.resultSelector = (typeof resultSelector === 'function') ? resultSelector : null;\n _this.values = values;\n return _this;\n }\n ZipSubscriber.prototype._next = function (value) {\n var iterators = this.iterators;\n if (isArray(value)) {\n iterators.push(new StaticArrayIterator(value));\n }\n else if (typeof value[Symbol_iterator] === 'function') {\n iterators.push(new StaticIterator(value[Symbol_iterator]()));\n }\n else {\n iterators.push(new ZipBufferIterator(this.destination, this, value));\n }\n };\n ZipSubscriber.prototype._complete = function () {\n var iterators = this.iterators;\n var len = iterators.length;\n this.unsubscribe();\n if (len === 0) {\n this.destination.complete();\n return;\n }\n this.active = len;\n for (var i = 0; i < len; i++) {\n var iterator = iterators[i];\n if (iterator.stillUnsubscribed) {\n var destination = this.destination;\n destination.add(iterator.subscribe(iterator, i));\n }\n else {\n this.active--;\n }\n }\n };\n ZipSubscriber.prototype.notifyInactive = function () {\n this.active--;\n if (this.active === 0) {\n this.destination.complete();\n }\n };\n ZipSubscriber.prototype.checkIterators = function () {\n var iterators = this.iterators;\n var len = iterators.length;\n var destination = this.destination;\n for (var i = 0; i < len; i++) {\n var iterator = iterators[i];\n if (typeof iterator.hasValue === 'function' && !iterator.hasValue()) {\n return;\n }\n }\n var shouldComplete = false;\n var args = [];\n for (var i = 0; i < len; i++) {\n var iterator = iterators[i];\n var result = iterator.next();\n if (iterator.hasCompleted()) {\n shouldComplete = true;\n }\n if (result.done) {\n destination.complete();\n return;\n }\n args.push(result.value);\n }\n if (this.resultSelector) {\n this._tryresultSelector(args);\n }\n else {\n destination.next(args);\n }\n if (shouldComplete) {\n destination.complete();\n }\n };\n ZipSubscriber.prototype._tryresultSelector = function (args) {\n var result;\n try {\n result = this.resultSelector.apply(this, args);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n };\n return ZipSubscriber;\n}(Subscriber));\nexport { ZipSubscriber };\nvar StaticIterator = /*@__PURE__*/ (function () {\n function StaticIterator(iterator) {\n this.iterator = iterator;\n this.nextResult = iterator.next();\n }\n StaticIterator.prototype.hasValue = function () {\n return true;\n };\n StaticIterator.prototype.next = function () {\n var result = this.nextResult;\n this.nextResult = this.iterator.next();\n return result;\n };\n StaticIterator.prototype.hasCompleted = function () {\n var nextResult = this.nextResult;\n return nextResult && nextResult.done;\n };\n return StaticIterator;\n}());\nvar StaticArrayIterator = /*@__PURE__*/ (function () {\n function StaticArrayIterator(array) {\n this.array = array;\n this.index = 0;\n this.length = 0;\n this.length = array.length;\n }\n StaticArrayIterator.prototype[Symbol_iterator] = function () {\n return this;\n };\n StaticArrayIterator.prototype.next = function (value) {\n var i = this.index++;\n var array = this.array;\n return i < this.length ? { value: array[i], done: false } : { value: null, done: true };\n };\n StaticArrayIterator.prototype.hasValue = function () {\n return this.array.length > this.index;\n };\n StaticArrayIterator.prototype.hasCompleted = function () {\n return this.array.length === this.index;\n };\n return StaticArrayIterator;\n}());\nvar ZipBufferIterator = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(ZipBufferIterator, _super);\n function ZipBufferIterator(destination, parent, observable) {\n var _this = _super.call(this, destination) || this;\n _this.parent = parent;\n _this.observable = observable;\n _this.stillUnsubscribed = true;\n _this.buffer = [];\n _this.isComplete = false;\n return _this;\n }\n ZipBufferIterator.prototype[Symbol_iterator] = function () {\n return this;\n };\n ZipBufferIterator.prototype.next = function () {\n var buffer = this.buffer;\n if (buffer.length === 0 && this.isComplete) {\n return { value: null, done: true };\n }\n else {\n return { value: buffer.shift(), done: false };\n }\n };\n ZipBufferIterator.prototype.hasValue = function () {\n return this.buffer.length > 0;\n };\n ZipBufferIterator.prototype.hasCompleted = function () {\n return this.buffer.length === 0 && this.isComplete;\n };\n ZipBufferIterator.prototype.notifyComplete = function () {\n if (this.buffer.length > 0) {\n this.isComplete = true;\n this.parent.notifyInactive();\n }\n else {\n this.destination.complete();\n }\n };\n ZipBufferIterator.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n this.buffer.push(innerValue);\n this.parent.checkIterators();\n };\n ZipBufferIterator.prototype.subscribe = function (value, index) {\n return subscribeToResult(this, this.observable, this, index);\n };\n return ZipBufferIterator;\n}(OuterSubscriber));\n//# sourceMappingURL=zip.js.map\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nexport default isSymbol;\n","/** PURE_IMPORTS_START tslib,_Subscriber,_util_ArgumentOutOfRangeError,_observable_empty PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nimport { ArgumentOutOfRangeError } from '../util/ArgumentOutOfRangeError';\nimport { empty } from '../observable/empty';\nexport function take(count) {\n return function (source) {\n if (count === 0) {\n return empty();\n }\n else {\n return source.lift(new TakeOperator(count));\n }\n };\n}\nvar TakeOperator = /*@__PURE__*/ (function () {\n function TakeOperator(total) {\n this.total = total;\n if (this.total < 0) {\n throw new ArgumentOutOfRangeError;\n }\n }\n TakeOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new TakeSubscriber(subscriber, this.total));\n };\n return TakeOperator;\n}());\nvar TakeSubscriber = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(TakeSubscriber, _super);\n function TakeSubscriber(destination, total) {\n var _this = _super.call(this, destination) || this;\n _this.total = total;\n _this.count = 0;\n return _this;\n }\n TakeSubscriber.prototype._next = function (value) {\n var total = this.total;\n var count = ++this.count;\n if (count <= total) {\n this.destination.next(value);\n if (count === total) {\n this.destination.complete();\n this.unsubscribe();\n }\n }\n };\n return TakeSubscriber;\n}(Subscriber));\n//# sourceMappingURL=take.js.map\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n","/**-----------------------------------------------------------------------------------------\n* Copyright © 2019 Progress Software Corporation. All rights reserved.\n* Licensed under commercial license. See LICENSE.md in the project root for more information\n*-------------------------------------------------------------------------------------------*/\nimport { Inject, Injectable, InjectionToken, Optional } from '@angular/core';\nimport { BehaviorSubject, Subject } from 'rxjs';\nimport { map, skip, tap } from 'rxjs/operators';\n\n/* tslint:disable:max-line-length */\n/**\n * A base class for a service that returns localized messages.\n *\n * For more information, refer to the section on [using the message service]({% slug messages_l10n %}#toc-using-the-message-service).\n */\nvar MessageService = /** @class */ (function () {\n function MessageService() {\n /**\n * @hidden\n */\n this.changes = new Subject();\n }\n /**\n * Notifies the components that the messages were changed.\n *\n * @param rtl - (Optional) A new value for the [text direction token]({% slug api_l10n_rtl %}).\n */\n MessageService.prototype.notify = function (rtl) {\n this.changes.next({ rtl: rtl });\n };\n /**\n * Returns a localized message for the supplied key.\n *\n * @param key - The message key. For example, `\"kendo.grid.noRecords\"`.\n * @return - The localized message for this key or `undefined` if not found.\n */\n MessageService.prototype.get = function (key) {\n return undefined;\n };\n MessageService.decorators = [\n { type: Injectable },\n ];\n return MessageService;\n}());\n\n/**\n * Base class that acts as a component messages container.\n *\n * For internal use.\n * @hidden\n */\nvar ComponentMessages = /** @class */ (function () {\n function ComponentMessages() {\n }\n Object.defineProperty(ComponentMessages.prototype, \"override\", {\n get: function () {\n return false;\n },\n enumerable: true,\n configurable: true\n });\n ComponentMessages.prototype.ngOnChanges = function (changes) {\n this.register(changes);\n if (Object.keys(changes).some(function (field) { return !changes[field].isFirstChange(); })) {\n this.service.notifyChanges();\n }\n };\n ComponentMessages.prototype.ngOnInit = function () {\n var _this = this;\n this.subscription = this.service.changes.pipe(skip(1)).subscribe(function () { return _this.register(_this); });\n };\n ComponentMessages.prototype.register = function (changes) {\n var _this = this;\n var keys = Object.keys(changes);\n keys.forEach(function (key) { return _this.service.register(key, _this[key], _this.override); });\n };\n ComponentMessages.prototype.ngOnDestroy = function () {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n };\n return ComponentMessages;\n}());\n\n/**\n * A token that specifies the text direction of Kendo UI for Angular components.\n *\n * @example\n * {% embed_file rtl/app.module.ts preview %}\n * {% embed_file rtl/app.component.ts %}\n * {% embed_file shared/main.ts hidden %}\n *\n */\nvar RTL = new InjectionToken(\"Kendo UI Right-to-Left token\");\n\n/**\n * Localization prefix for the component messages.\n *\n * For internal use.\n * @hidden\n */\nvar L10N_PREFIX = new InjectionToken('Localization key prefix');\n/**\n * Component localization service.\n *\n * For internal use.\n * @hidden\n */\nvar LocalizationService = /** @class */ (function () {\n function LocalizationService(prefix, messageService, _rtl) {\n var _this = this;\n this.prefix = prefix;\n this.messageService = messageService;\n this._rtl = _rtl;\n this.changes = new BehaviorSubject({ rtl: this._rtl });\n this.dictionary = {};\n if (messageService) {\n this.subscription = messageService.changes\n .pipe(map(function (_a) {\n var rtl = _a.rtl;\n return rtl !== undefined ? rtl : _this._rtl;\n }), tap(function (rtl) { return _this._rtl = rtl; }))\n .subscribe(function (rtl) {\n _this.dictionary = {};\n _this.changes.next({ rtl: rtl });\n });\n }\n }\n Object.defineProperty(LocalizationService.prototype, \"rtl\", {\n get: function () {\n return this._rtl;\n },\n enumerable: true,\n configurable: true\n });\n LocalizationService.prototype.ngOnDestroy = function () {\n if (this.subscription) {\n this.subscription.unsubscribe();\n }\n };\n LocalizationService.prototype.get = function (shortKey) {\n var key = this.key(shortKey);\n return this.dictionary[key];\n };\n LocalizationService.prototype.register = function (shortKey, value, override) {\n if (override === void 0) { override = false; }\n var key = this.key(shortKey);\n var message = value;\n if (!override) {\n if (this.dictionary.hasOwnProperty(key)) {\n return;\n }\n message = this.defaultValue(key, value);\n }\n this.dictionary[key] = message;\n };\n LocalizationService.prototype.notifyChanges = function () {\n this.changes.next({ rtl: this.rtl });\n };\n LocalizationService.prototype.key = function (shortKey) {\n return this.prefix + '.' + shortKey;\n };\n LocalizationService.prototype.defaultValue = function (key, value) {\n if (!this.messageService) {\n return value;\n }\n var alt = this.messageService.get(key);\n return (alt === undefined) ? value : alt;\n };\n LocalizationService.decorators = [\n { type: Injectable },\n ];\n /** @nocollapse */\n LocalizationService.ctorParameters = function () { return [\n { type: String, decorators: [{ type: Inject, args: [L10N_PREFIX,] }] },\n { type: MessageService, decorators: [{ type: Optional }] },\n { type: Boolean, decorators: [{ type: Optional }, { type: Inject, args: [RTL,] }] }\n ]; };\n return LocalizationService;\n}());\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { MessageService, ComponentMessages, L10N_PREFIX, LocalizationService, RTL };\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { __extends } from 'tslib';\nimport { FocusMonitor } from '@angular/cdk/a11y';\nimport { ChangeDetectionStrategy, Component, ElementRef, ViewChild, ViewEncapsulation, Optional, Inject, Input, NgModule } from '@angular/core';\nimport { MatRipple, mixinColor, mixinDisabled, mixinDisableRipple, MatCommonModule, MatRippleModule } from '@angular/material/core';\nimport { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';\nimport { CommonModule } from '@angular/common';\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n/**\n * Default color palette for round buttons (mat-fab and mat-mini-fab)\n * @type {?}\n */\nvar DEFAULT_ROUND_BUTTON_COLOR = 'accent';\n/**\n * List of classes to add to MatButton instances based on host attributes to\n * style as different variants.\n * @type {?}\n */\nvar BUTTON_HOST_ATTRIBUTES = [\n 'mat-button',\n 'mat-flat-button',\n 'mat-icon-button',\n 'mat-raised-button',\n 'mat-stroked-button',\n 'mat-mini-fab',\n 'mat-fab',\n];\n// Boilerplate for applying mixins to MatButton.\n/**\n * \\@docs-private\n */\nvar \n// Boilerplate for applying mixins to MatButton.\n/**\n * \\@docs-private\n */\nMatButtonBase = /** @class */ (function () {\n function MatButtonBase(_elementRef) {\n this._elementRef = _elementRef;\n }\n return MatButtonBase;\n}());\n/** @type {?} */\nvar _MatButtonMixinBase = mixinColor(mixinDisabled(mixinDisableRipple(MatButtonBase)));\n/**\n * Material design button.\n */\nvar MatButton = /** @class */ (function (_super) {\n __extends(MatButton, _super);\n function MatButton(elementRef, _focusMonitor, _animationMode) {\n var _this = _super.call(this, elementRef) || this;\n _this._focusMonitor = _focusMonitor;\n _this._animationMode = _animationMode;\n /**\n * Whether the button is round.\n */\n _this.isRoundButton = _this._hasHostAttributes('mat-fab', 'mat-mini-fab');\n /**\n * Whether the button is icon button.\n */\n _this.isIconButton = _this._hasHostAttributes('mat-icon-button');\n // For each of the variant selectors that is present in the button's host\n // attributes, add the correct corresponding class.\n for (var _i = 0, BUTTON_HOST_ATTRIBUTES_1 = BUTTON_HOST_ATTRIBUTES; _i < BUTTON_HOST_ATTRIBUTES_1.length; _i++) {\n var attr = BUTTON_HOST_ATTRIBUTES_1[_i];\n if (_this._hasHostAttributes(attr)) {\n ((/** @type {?} */ (_this._getHostElement()))).classList.add(attr);\n }\n }\n // Add a class that applies to all buttons. This makes it easier to target if somebody\n // wants to target all Material buttons. We do it here rather than `host` to ensure that\n // the class is applied to derived classes.\n elementRef.nativeElement.classList.add('mat-button-base');\n _this._focusMonitor.monitor(_this._elementRef, true);\n if (_this.isRoundButton) {\n _this.color = DEFAULT_ROUND_BUTTON_COLOR;\n }\n return _this;\n }\n /**\n * @return {?}\n */\n MatButton.prototype.ngOnDestroy = /**\n * @return {?}\n */\n function () {\n this._focusMonitor.stopMonitoring(this._elementRef);\n };\n /** Focuses the button. */\n /**\n * Focuses the button.\n * @param {?=} origin\n * @param {?=} options\n * @return {?}\n */\n MatButton.prototype.focus = /**\n * Focuses the button.\n * @param {?=} origin\n * @param {?=} options\n * @return {?}\n */\n function (origin, options) {\n if (origin === void 0) { origin = 'program'; }\n this._focusMonitor.focusVia(this._getHostElement(), origin, options);\n };\n /**\n * @return {?}\n */\n MatButton.prototype._getHostElement = /**\n * @return {?}\n */\n function () {\n return this._elementRef.nativeElement;\n };\n /**\n * @return {?}\n */\n MatButton.prototype._isRippleDisabled = /**\n * @return {?}\n */\n function () {\n return this.disableRipple || this.disabled;\n };\n /** Gets whether the button has one of the given attributes. */\n /**\n * Gets whether the button has one of the given attributes.\n * @param {...?} attributes\n * @return {?}\n */\n MatButton.prototype._hasHostAttributes = /**\n * Gets whether the button has one of the given attributes.\n * @param {...?} attributes\n * @return {?}\n */\n function () {\n var _this = this;\n var attributes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n attributes[_i] = arguments[_i];\n }\n return attributes.some((/**\n * @param {?} attribute\n * @return {?}\n */\n function (attribute) { return _this._getHostElement().hasAttribute(attribute); }));\n };\n MatButton.decorators = [\n { type: Component, args: [{selector: \"button[mat-button], button[mat-raised-button], button[mat-icon-button],\\n button[mat-fab], button[mat-mini-fab], button[mat-stroked-button],\\n button[mat-flat-button]\",\n exportAs: 'matButton',\n host: {\n '[attr.disabled]': 'disabled || null',\n '[class._mat-animation-noopable]': '_animationMode === \"NoopAnimations\"',\n },\n template: \"\",\n styles: [\".mat-button .mat-button-focus-overlay,.mat-icon-button .mat-button-focus-overlay{opacity:0}.mat-button:hover .mat-button-focus-overlay,.mat-stroked-button:hover .mat-button-focus-overlay{opacity:.04}@media (hover:none){.mat-button:hover .mat-button-focus-overlay,.mat-stroked-button:hover .mat-button-focus-overlay{opacity:0}}.mat-button,.mat-flat-button,.mat-icon-button,.mat-stroked-button{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:0;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible}.mat-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner{border:0}.mat-button[disabled],.mat-flat-button[disabled],.mat-icon-button[disabled],.mat-stroked-button[disabled]{cursor:default}.mat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-button.cdk-program-focused .mat-button-focus-overlay,.mat-flat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-flat-button.cdk-program-focused .mat-button-focus-overlay,.mat-icon-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-icon-button.cdk-program-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner{border:0}.mat-raised-button{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:0;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0,0,0);transition:background .4s cubic-bezier(.25,.8,.25,1),box-shadow 280ms cubic-bezier(.4,0,.2,1)}.mat-raised-button::-moz-focus-inner{border:0}.mat-raised-button[disabled]{cursor:default}.mat-raised-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-raised-button.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-raised-button::-moz-focus-inner{border:0}._mat-animation-noopable.mat-raised-button{transition:none;animation:none}.mat-stroked-button{border:1px solid currentColor;padding:0 15px;line-height:34px}.mat-stroked-button .mat-button-focus-overlay,.mat-stroked-button .mat-button-ripple.mat-ripple{top:-1px;left:-1px;right:-1px;bottom:-1px}.mat-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:0;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0,0,0);transition:background .4s cubic-bezier(.25,.8,.25,1),box-shadow 280ms cubic-bezier(.4,0,.2,1);min-width:0;border-radius:50%;width:56px;height:56px;padding:0;flex-shrink:0}.mat-fab::-moz-focus-inner{border:0}.mat-fab[disabled]{cursor:default}.mat-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-fab.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-fab::-moz-focus-inner{border:0}._mat-animation-noopable.mat-fab{transition:none;animation:none}.mat-fab .mat-button-wrapper{padding:16px 0;display:inline-block;line-height:24px}.mat-mini-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:0;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0,0,0);transition:background .4s cubic-bezier(.25,.8,.25,1),box-shadow 280ms cubic-bezier(.4,0,.2,1);min-width:0;border-radius:50%;width:40px;height:40px;padding:0;flex-shrink:0}.mat-mini-fab::-moz-focus-inner{border:0}.mat-mini-fab[disabled]{cursor:default}.mat-mini-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-mini-fab.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-mini-fab::-moz-focus-inner{border:0}._mat-animation-noopable.mat-mini-fab{transition:none;animation:none}.mat-mini-fab .mat-button-wrapper{padding:8px 0;display:inline-block;line-height:24px}.mat-icon-button{padding:0;min-width:0;width:40px;height:40px;flex-shrink:0;line-height:40px;border-radius:50%}.mat-icon-button .mat-icon,.mat-icon-button i{line-height:24px}.mat-button-focus-overlay,.mat-button-ripple.mat-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-button-ripple.mat-ripple:not(:empty){transform:translateZ(0)}.mat-button-focus-overlay{opacity:0;transition:opacity .2s cubic-bezier(.35,0,.25,1),background-color .2s cubic-bezier(.35,0,.25,1)}._mat-animation-noopable .mat-button-focus-overlay{transition:none}@media (-ms-high-contrast:active){.mat-button-focus-overlay{background-color:#fff}}@media (-ms-high-contrast:black-on-white){.mat-button-focus-overlay{background-color:#000}}.mat-button-ripple-round{border-radius:50%;z-index:1}.mat-button .mat-button-wrapper>*,.mat-fab .mat-button-wrapper>*,.mat-flat-button .mat-button-wrapper>*,.mat-icon-button .mat-button-wrapper>*,.mat-mini-fab .mat-button-wrapper>*,.mat-raised-button .mat-button-wrapper>*,.mat-stroked-button .mat-button-wrapper>*{vertical-align:middle}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button{display:block;font-size:inherit;width:2.5em;height:2.5em}@media (-ms-high-contrast:active){.mat-button,.mat-fab,.mat-flat-button,.mat-icon-button,.mat-mini-fab,.mat-raised-button{outline:solid 1px}}\"],\n inputs: ['disabled', 'disableRipple', 'color'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n },] },\n ];\n /** @nocollapse */\n MatButton.ctorParameters = function () { return [\n { type: ElementRef },\n { type: FocusMonitor },\n { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }\n ]; };\n MatButton.propDecorators = {\n ripple: [{ type: ViewChild, args: [MatRipple, { static: false },] }]\n };\n return MatButton;\n}(_MatButtonMixinBase));\n/**\n * Material design anchor button.\n */\nvar MatAnchor = /** @class */ (function (_super) {\n __extends(MatAnchor, _super);\n function MatAnchor(focusMonitor, elementRef, animationMode) {\n return _super.call(this, elementRef, focusMonitor, animationMode) || this;\n }\n /**\n * @param {?} event\n * @return {?}\n */\n MatAnchor.prototype._haltDisabledEvents = /**\n * @param {?} event\n * @return {?}\n */\n function (event) {\n // A disabled button shouldn't apply any actions\n if (this.disabled) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n };\n MatAnchor.decorators = [\n { type: Component, args: [{selector: \"a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab],\\n a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]\",\n exportAs: 'matButton, matAnchor',\n host: {\n // Note that we ignore the user-specified tabindex when it's disabled for\n // consistency with the `mat-button` applied on native buttons where even\n // though they have an index, they're not tabbable.\n '[attr.tabindex]': 'disabled ? -1 : (tabIndex || 0)',\n '[attr.disabled]': 'disabled || null',\n '[attr.aria-disabled]': 'disabled.toString()',\n '(click)': '_haltDisabledEvents($event)',\n '[class._mat-animation-noopable]': '_animationMode === \"NoopAnimations\"',\n },\n inputs: ['disabled', 'disableRipple', 'color'],\n template: \"\",\n styles: [\".mat-button .mat-button-focus-overlay,.mat-icon-button .mat-button-focus-overlay{opacity:0}.mat-button:hover .mat-button-focus-overlay,.mat-stroked-button:hover .mat-button-focus-overlay{opacity:.04}@media (hover:none){.mat-button:hover .mat-button-focus-overlay,.mat-stroked-button:hover .mat-button-focus-overlay{opacity:0}}.mat-button,.mat-flat-button,.mat-icon-button,.mat-stroked-button{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:0;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible}.mat-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner{border:0}.mat-button[disabled],.mat-flat-button[disabled],.mat-icon-button[disabled],.mat-stroked-button[disabled]{cursor:default}.mat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-button.cdk-program-focused .mat-button-focus-overlay,.mat-flat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-flat-button.cdk-program-focused .mat-button-focus-overlay,.mat-icon-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-icon-button.cdk-program-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner{border:0}.mat-raised-button{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:0;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0,0,0);transition:background .4s cubic-bezier(.25,.8,.25,1),box-shadow 280ms cubic-bezier(.4,0,.2,1)}.mat-raised-button::-moz-focus-inner{border:0}.mat-raised-button[disabled]{cursor:default}.mat-raised-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-raised-button.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-raised-button::-moz-focus-inner{border:0}._mat-animation-noopable.mat-raised-button{transition:none;animation:none}.mat-stroked-button{border:1px solid currentColor;padding:0 15px;line-height:34px}.mat-stroked-button .mat-button-focus-overlay,.mat-stroked-button .mat-button-ripple.mat-ripple{top:-1px;left:-1px;right:-1px;bottom:-1px}.mat-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:0;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0,0,0);transition:background .4s cubic-bezier(.25,.8,.25,1),box-shadow 280ms cubic-bezier(.4,0,.2,1);min-width:0;border-radius:50%;width:56px;height:56px;padding:0;flex-shrink:0}.mat-fab::-moz-focus-inner{border:0}.mat-fab[disabled]{cursor:default}.mat-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-fab.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-fab::-moz-focus-inner{border:0}._mat-animation-noopable.mat-fab{transition:none;animation:none}.mat-fab .mat-button-wrapper{padding:16px 0;display:inline-block;line-height:24px}.mat-mini-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:0;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0,0,0);transition:background .4s cubic-bezier(.25,.8,.25,1),box-shadow 280ms cubic-bezier(.4,0,.2,1);min-width:0;border-radius:50%;width:40px;height:40px;padding:0;flex-shrink:0}.mat-mini-fab::-moz-focus-inner{border:0}.mat-mini-fab[disabled]{cursor:default}.mat-mini-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-mini-fab.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-mini-fab::-moz-focus-inner{border:0}._mat-animation-noopable.mat-mini-fab{transition:none;animation:none}.mat-mini-fab .mat-button-wrapper{padding:8px 0;display:inline-block;line-height:24px}.mat-icon-button{padding:0;min-width:0;width:40px;height:40px;flex-shrink:0;line-height:40px;border-radius:50%}.mat-icon-button .mat-icon,.mat-icon-button i{line-height:24px}.mat-button-focus-overlay,.mat-button-ripple.mat-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-button-ripple.mat-ripple:not(:empty){transform:translateZ(0)}.mat-button-focus-overlay{opacity:0;transition:opacity .2s cubic-bezier(.35,0,.25,1),background-color .2s cubic-bezier(.35,0,.25,1)}._mat-animation-noopable .mat-button-focus-overlay{transition:none}@media (-ms-high-contrast:active){.mat-button-focus-overlay{background-color:#fff}}@media (-ms-high-contrast:black-on-white){.mat-button-focus-overlay{background-color:#000}}.mat-button-ripple-round{border-radius:50%;z-index:1}.mat-button .mat-button-wrapper>*,.mat-fab .mat-button-wrapper>*,.mat-flat-button .mat-button-wrapper>*,.mat-icon-button .mat-button-wrapper>*,.mat-mini-fab .mat-button-wrapper>*,.mat-raised-button .mat-button-wrapper>*,.mat-stroked-button .mat-button-wrapper>*{vertical-align:middle}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button{display:block;font-size:inherit;width:2.5em;height:2.5em}@media (-ms-high-contrast:active){.mat-button,.mat-fab,.mat-flat-button,.mat-icon-button,.mat-mini-fab,.mat-raised-button{outline:solid 1px}}\"],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n },] },\n ];\n /** @nocollapse */\n MatAnchor.ctorParameters = function () { return [\n { type: FocusMonitor },\n { type: ElementRef },\n { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }\n ]; };\n MatAnchor.propDecorators = {\n tabIndex: [{ type: Input }]\n };\n return MatAnchor;\n}(MatButton));\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\nvar MatButtonModule = /** @class */ (function () {\n function MatButtonModule() {\n }\n MatButtonModule.decorators = [\n { type: NgModule, args: [{\n imports: [\n CommonModule,\n MatRippleModule,\n MatCommonModule,\n ],\n exports: [\n MatButton,\n MatAnchor,\n MatCommonModule,\n ],\n declarations: [\n MatButton,\n MatAnchor,\n ],\n },] },\n ];\n return MatButtonModule;\n}());\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n\n/**\n * @fileoverview added by tsickle\n * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc\n */\n\nexport { MatButtonModule, MatButton, MatAnchor };\n//# sourceMappingURL=button.es5.js.map\n","/**\n * @license Angular v8.2.14\n * (c) 2010-2019 Google LLC. https://angular.io/\n * License: MIT\n */\n\nimport { __spread, __read, __extends, __decorate, __metadata, __param } from 'tslib';\nimport { Injectable, InjectionToken, Inject, PLATFORM_ID, Injector, NgModule } from '@angular/core';\nimport { of, Observable } from 'rxjs';\nimport { concatMap, filter, map } from 'rxjs/operators';\nimport { DOCUMENT, ɵparseCookieValue } from '@angular/common';\n\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Transforms an `HttpRequest` into a stream of `HttpEvent`s, one of which will likely be a\n * `HttpResponse`.\n *\n * `HttpHandler` is injectable. When injected, the handler instance dispatches requests to the\n * first interceptor in the chain, which dispatches to the second, etc, eventually reaching the\n * `HttpBackend`.\n *\n * In an `HttpInterceptor`, the `HttpHandler` parameter is the next interceptor in the chain.\n *\n * @publicApi\n */\nvar HttpHandler = /** @class */ (function () {\n function HttpHandler() {\n }\n return HttpHandler;\n}());\n/**\n * A final `HttpHandler` which will dispatch the request via browser HTTP APIs to a backend.\n *\n * Interceptors sit between the `HttpClient` interface and the `HttpBackend`.\n *\n * When injected, `HttpBackend` dispatches requests directly to the backend, without going\n * through the interceptor chain.\n *\n * @publicApi\n */\nvar HttpBackend = /** @class */ (function () {\n function HttpBackend() {\n }\n return HttpBackend;\n}());\n\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Represents the header configuration options for an HTTP request.\n * Instances are immutable. Modifying methods return a cloned\n * instance with the change. The original object is never changed.\n *\n * @publicApi\n */\nvar HttpHeaders = /** @class */ (function () {\n /** Constructs a new HTTP header object with the given values.*/\n function HttpHeaders(headers) {\n var _this = this;\n /**\n * Internal map of lowercased header names to the normalized\n * form of the name (the form seen first).\n */\n this.normalizedNames = new Map();\n /**\n * Queued updates to be materialized the next initialization.\n */\n this.lazyUpdate = null;\n if (!headers) {\n this.headers = new Map();\n }\n else if (typeof headers === 'string') {\n this.lazyInit = function () {\n _this.headers = new Map();\n headers.split('\\n').forEach(function (line) {\n var index = line.indexOf(':');\n if (index > 0) {\n var name_1 = line.slice(0, index);\n var key = name_1.toLowerCase();\n var value = line.slice(index + 1).trim();\n _this.maybeSetNormalizedName(name_1, key);\n if (_this.headers.has(key)) {\n _this.headers.get(key).push(value);\n }\n else {\n _this.headers.set(key, [value]);\n }\n }\n });\n };\n }\n else {\n this.lazyInit = function () {\n _this.headers = new Map();\n Object.keys(headers).forEach(function (name) {\n var values = headers[name];\n var key = name.toLowerCase();\n if (typeof values === 'string') {\n values = [values];\n }\n if (values.length > 0) {\n _this.headers.set(key, values);\n _this.maybeSetNormalizedName(name, key);\n }\n });\n };\n }\n }\n /**\n * Checks for existence of a given header.\n *\n * @param name The header name to check for existence.\n *\n * @returns True if the header exists, false otherwise.\n */\n HttpHeaders.prototype.has = function (name) {\n this.init();\n return this.headers.has(name.toLowerCase());\n };\n /**\n * Retrieves the first value of a given header.\n *\n * @param name The header name.\n *\n * @returns The value string if the header exists, null otherwise\n */\n HttpHeaders.prototype.get = function (name) {\n this.init();\n var values = this.headers.get(name.toLowerCase());\n return values && values.length > 0 ? values[0] : null;\n };\n /**\n * Retrieves the names of the headers.\n *\n * @returns A list of header names.\n */\n HttpHeaders.prototype.keys = function () {\n this.init();\n return Array.from(this.normalizedNames.values());\n };\n /**\n * Retrieves a list of values for a given header.\n *\n * @param name The header name from which to retrieve values.\n *\n * @returns A string of values if the header exists, null otherwise.\n */\n HttpHeaders.prototype.getAll = function (name) {\n this.init();\n return this.headers.get(name.toLowerCase()) || null;\n };\n /**\n * Appends a new value to the existing set of values for a header\n * and returns them in a clone of the original instance.\n *\n * @param name The header name for which to append the value or values.\n * @param value The new value or array of values.\n *\n * @returns A clone of the HTTP headers object with the value appended to the given header.\n */\n HttpHeaders.prototype.append = function (name, value) {\n return this.clone({ name: name, value: value, op: 'a' });\n };\n /**\n * Sets or modifies a value for a given header in a clone of the original instance.\n * If the header already exists, its value is replaced with the given value\n * in the returned object.\n *\n * @param name The header name.\n * @param value The value or values to set or overide for the given header.\n *\n * @returns A clone of the HTTP headers object with the newly set header value.\n */\n HttpHeaders.prototype.set = function (name, value) {\n return this.clone({ name: name, value: value, op: 's' });\n };\n /**\n * Deletes values for a given header in a clone of the original instance.\n *\n * @param name The header name.\n * @param value The value or values to delete for the given header.\n *\n * @returns A clone of the HTTP headers object with the given value deleted.\n */\n HttpHeaders.prototype.delete = function (name, value) {\n return this.clone({ name: name, value: value, op: 'd' });\n };\n HttpHeaders.prototype.maybeSetNormalizedName = function (name, lcName) {\n if (!this.normalizedNames.has(lcName)) {\n this.normalizedNames.set(lcName, name);\n }\n };\n HttpHeaders.prototype.init = function () {\n var _this = this;\n if (!!this.lazyInit) {\n if (this.lazyInit instanceof HttpHeaders) {\n this.copyFrom(this.lazyInit);\n }\n else {\n this.lazyInit();\n }\n this.lazyInit = null;\n if (!!this.lazyUpdate) {\n this.lazyUpdate.forEach(function (update) { return _this.applyUpdate(update); });\n this.lazyUpdate = null;\n }\n }\n };\n HttpHeaders.prototype.copyFrom = function (other) {\n var _this = this;\n other.init();\n Array.from(other.headers.keys()).forEach(function (key) {\n _this.headers.set(key, other.headers.get(key));\n _this.normalizedNames.set(key, other.normalizedNames.get(key));\n });\n };\n HttpHeaders.prototype.clone = function (update) {\n var clone = new HttpHeaders();\n clone.lazyInit =\n (!!this.lazyInit && this.lazyInit instanceof HttpHeaders) ? this.lazyInit : this;\n clone.lazyUpdate = (this.lazyUpdate || []).concat([update]);\n return clone;\n };\n HttpHeaders.prototype.applyUpdate = function (update) {\n var key = update.name.toLowerCase();\n switch (update.op) {\n case 'a':\n case 's':\n var value = update.value;\n if (typeof value === 'string') {\n value = [value];\n }\n if (value.length === 0) {\n return;\n }\n this.maybeSetNormalizedName(update.name, key);\n var base = (update.op === 'a' ? this.headers.get(key) : undefined) || [];\n base.push.apply(base, __spread(value));\n this.headers.set(key, base);\n break;\n case 'd':\n var toDelete_1 = update.value;\n if (!toDelete_1) {\n this.headers.delete(key);\n this.normalizedNames.delete(key);\n }\n else {\n var existing = this.headers.get(key);\n if (!existing) {\n return;\n }\n existing = existing.filter(function (value) { return toDelete_1.indexOf(value) === -1; });\n if (existing.length === 0) {\n this.headers.delete(key);\n this.normalizedNames.delete(key);\n }\n else {\n this.headers.set(key, existing);\n }\n }\n break;\n }\n };\n /**\n * @internal\n */\n HttpHeaders.prototype.forEach = function (fn) {\n var _this = this;\n this.init();\n Array.from(this.normalizedNames.keys())\n .forEach(function (key) { return fn(_this.normalizedNames.get(key), _this.headers.get(key)); });\n };\n return HttpHeaders;\n}());\n\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Provides encoding and decoding of URL parameter and query-string values.\n *\n * Serializes and parses URL parameter keys and values to encode and decode them.\n * If you pass URL query parameters without encoding,\n * the query parameters can be misinterpreted at the receiving end.\n *\n *\n * @publicApi\n */\nvar HttpUrlEncodingCodec = /** @class */ (function () {\n function HttpUrlEncodingCodec() {\n }\n /**\n * Encodes a key name for a URL parameter or query-string.\n * @param key The key name.\n * @returns The encoded key name.\n */\n HttpUrlEncodingCodec.prototype.encodeKey = function (key) { return standardEncoding(key); };\n /**\n * Encodes the value of a URL parameter or query-string.\n * @param value The value.\n * @returns The encoded value.\n */\n HttpUrlEncodingCodec.prototype.encodeValue = function (value) { return standardEncoding(value); };\n /**\n * Decodes an encoded URL parameter or query-string key.\n * @param key The encoded key name.\n * @returns The decoded key name.\n */\n HttpUrlEncodingCodec.prototype.decodeKey = function (key) { return decodeURIComponent(key); };\n /**\n * Decodes an encoded URL parameter or query-string value.\n * @param value The encoded value.\n * @returns The decoded value.\n */\n HttpUrlEncodingCodec.prototype.decodeValue = function (value) { return decodeURIComponent(value); };\n return HttpUrlEncodingCodec;\n}());\nfunction paramParser(rawParams, codec) {\n var map = new Map();\n if (rawParams.length > 0) {\n var params = rawParams.split('&');\n params.forEach(function (param) {\n var eqIdx = param.indexOf('=');\n var _a = __read(eqIdx == -1 ?\n [codec.decodeKey(param), ''] :\n [codec.decodeKey(param.slice(0, eqIdx)), codec.decodeValue(param.slice(eqIdx + 1))], 2), key = _a[0], val = _a[1];\n var list = map.get(key) || [];\n list.push(val);\n map.set(key, list);\n });\n }\n return map;\n}\nfunction standardEncoding(v) {\n return encodeURIComponent(v)\n .replace(/%40/gi, '@')\n .replace(/%3A/gi, ':')\n .replace(/%24/gi, '$')\n .replace(/%2C/gi, ',')\n .replace(/%3B/gi, ';')\n .replace(/%2B/gi, '+')\n .replace(/%3D/gi, '=')\n .replace(/%3F/gi, '?')\n .replace(/%2F/gi, '/');\n}\n/**\n * An HTTP request/response body that represents serialized parameters,\n * per the MIME type `application/x-www-form-urlencoded`.\n *\n * This class is immutable; all mutation operations return a new instance.\n *\n * @publicApi\n */\nvar HttpParams = /** @class */ (function () {\n function HttpParams(options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n this.updates = null;\n this.cloneFrom = null;\n this.encoder = options.encoder || new HttpUrlEncodingCodec();\n if (!!options.fromString) {\n if (!!options.fromObject) {\n throw new Error(\"Cannot specify both fromString and fromObject.\");\n }\n this.map = paramParser(options.fromString, this.encoder);\n }\n else if (!!options.fromObject) {\n this.map = new Map();\n Object.keys(options.fromObject).forEach(function (key) {\n var value = options.fromObject[key];\n _this.map.set(key, Array.isArray(value) ? value : [value]);\n });\n }\n else {\n this.map = null;\n }\n }\n /**\n * Reports whether the body includes one or more values for a given parameter.\n * @param param The parameter name.\n * @returns True if the parameter has one or more values,\n * false if it has no value or is not present.\n */\n HttpParams.prototype.has = function (param) {\n this.init();\n return this.map.has(param);\n };\n /**\n * Retrieves the first value for a parameter.\n * @param param The parameter name.\n * @returns The first value of the given parameter,\n * or `null` if the parameter is not present.\n */\n HttpParams.prototype.get = function (param) {\n this.init();\n var res = this.map.get(param);\n return !!res ? res[0] : null;\n };\n /**\n * Retrieves all values for a parameter.\n * @param param The parameter name.\n * @returns All values in a string array,\n * or `null` if the parameter not present.\n */\n HttpParams.prototype.getAll = function (param) {\n this.init();\n return this.map.get(param) || null;\n };\n /**\n * Retrieves all the parameters for this body.\n * @returns The parameter names in a string array.\n */\n HttpParams.prototype.keys = function () {\n this.init();\n return Array.from(this.map.keys());\n };\n /**\n * Appends a new value to existing values for a parameter.\n * @param param The parameter name.\n * @param value The new value to add.\n * @return A new body with the appended value.\n */\n HttpParams.prototype.append = function (param, value) { return this.clone({ param: param, value: value, op: 'a' }); };\n /**\n * Replaces the value for a parameter.\n * @param param The parameter name.\n * @param value The new value.\n * @return A new body with the new value.\n */\n HttpParams.prototype.set = function (param, value) { return this.clone({ param: param, value: value, op: 's' }); };\n /**\n * Removes a given value or all values from a parameter.\n * @param param The parameter name.\n * @param value The value to remove, if provided.\n * @return A new body with the given value removed, or with all values\n * removed if no value is specified.\n */\n HttpParams.prototype.delete = function (param, value) { return this.clone({ param: param, value: value, op: 'd' }); };\n /**\n * Serializes the body to an encoded string, where key-value pairs (separated by `=`) are\n * separated by `&`s.\n */\n HttpParams.prototype.toString = function () {\n var _this = this;\n this.init();\n return this.keys()\n .map(function (key) {\n var eKey = _this.encoder.encodeKey(key);\n return _this.map.get(key).map(function (value) { return eKey + '=' + _this.encoder.encodeValue(value); })\n .join('&');\n })\n .join('&');\n };\n HttpParams.prototype.clone = function (update) {\n var clone = new HttpParams({ encoder: this.encoder });\n clone.cloneFrom = this.cloneFrom || this;\n clone.updates = (this.updates || []).concat([update]);\n return clone;\n };\n HttpParams.prototype.init = function () {\n var _this = this;\n if (this.map === null) {\n this.map = new Map();\n }\n if (this.cloneFrom !== null) {\n this.cloneFrom.init();\n this.cloneFrom.keys().forEach(function (key) { return _this.map.set(key, _this.cloneFrom.map.get(key)); });\n this.updates.forEach(function (update) {\n switch (update.op) {\n case 'a':\n case 's':\n var base = (update.op === 'a' ? _this.map.get(update.param) : undefined) || [];\n base.push(update.value);\n _this.map.set(update.param, base);\n break;\n case 'd':\n if (update.value !== undefined) {\n var base_1 = _this.map.get(update.param) || [];\n var idx = base_1.indexOf(update.value);\n if (idx !== -1) {\n base_1.splice(idx, 1);\n }\n if (base_1.length > 0) {\n _this.map.set(update.param, base_1);\n }\n else {\n _this.map.delete(update.param);\n }\n }\n else {\n _this.map.delete(update.param);\n break;\n }\n }\n });\n this.cloneFrom = this.updates = null;\n }\n };\n return HttpParams;\n}());\n\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Determine whether the given HTTP method may include a body.\n */\nfunction mightHaveBody(method) {\n switch (method) {\n case 'DELETE':\n case 'GET':\n case 'HEAD':\n case 'OPTIONS':\n case 'JSONP':\n return false;\n default:\n return true;\n }\n}\n/**\n * Safely assert whether the given value is an ArrayBuffer.\n *\n * In some execution environments ArrayBuffer is not defined.\n */\nfunction isArrayBuffer(value) {\n return typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer;\n}\n/**\n * Safely assert whether the given value is a Blob.\n *\n * In some execution environments Blob is not defined.\n */\nfunction isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}\n/**\n * Safely assert whether the given value is a FormData instance.\n *\n * In some execution environments FormData is not defined.\n */\nfunction isFormData(value) {\n return typeof FormData !== 'undefined' && value instanceof FormData;\n}\n/**\n * An outgoing HTTP request with an optional typed body.\n *\n * `HttpRequest` represents an outgoing request, including URL, method,\n * headers, body, and other request configuration options. Instances should be\n * assumed to be immutable. To modify a `HttpRequest`, the `clone`\n * method should be used.\n *\n * @publicApi\n */\nvar HttpRequest = /** @class */ (function () {\n function HttpRequest(method, url, third, fourth) {\n this.url = url;\n /**\n * The request body, or `null` if one isn't set.\n *\n * Bodies are not enforced to be immutable, as they can include a reference to any\n * user-defined data type. However, interceptors should take care to preserve\n * idempotence by treating them as such.\n */\n this.body = null;\n /**\n * Whether this request should be made in a way that exposes progress events.\n *\n * Progress events are expensive (change detection runs on each event) and so\n * they should only be requested if the consumer intends to monitor them.\n */\n this.reportProgress = false;\n /**\n * Whether this request should be sent with outgoing credentials (cookies).\n */\n this.withCredentials = false;\n /**\n * The expected response type of the server.\n *\n * This is used to parse the response appropriately before returning it to\n * the requestee.\n */\n this.responseType = 'json';\n this.method = method.toUpperCase();\n // Next, need to figure out which argument holds the HttpRequestInit\n // options, if any.\n var options;\n // Check whether a body argument is expected. The only valid way to omit\n // the body argument is to use a known no-body method like GET.\n if (mightHaveBody(this.method) || !!fourth) {\n // Body is the third argument, options are the fourth.\n this.body = (third !== undefined) ? third : null;\n options = fourth;\n }\n else {\n // No body required, options are the third argument. The body stays null.\n options = third;\n }\n // If options have been passed, interpret them.\n if (options) {\n // Normalize reportProgress and withCredentials.\n this.reportProgress = !!options.reportProgress;\n this.withCredentials = !!options.withCredentials;\n // Override default response type of 'json' if one is provided.\n if (!!options.responseType) {\n this.responseType = options.responseType;\n }\n // Override headers if they're provided.\n if (!!options.headers) {\n this.headers = options.headers;\n }\n if (!!options.params) {\n this.params = options.params;\n }\n }\n // If no headers have been passed in, construct a new HttpHeaders instance.\n if (!this.headers) {\n this.headers = new HttpHeaders();\n }\n // If no parameters have been passed in, construct a new HttpUrlEncodedParams instance.\n if (!this.params) {\n this.params = new HttpParams();\n this.urlWithParams = url;\n }\n else {\n // Encode the parameters to a string in preparation for inclusion in the URL.\n var params = this.params.toString();\n if (params.length === 0) {\n // No parameters, the visible URL is just the URL given at creation time.\n this.urlWithParams = url;\n }\n else {\n // Does the URL already have query parameters? Look for '?'.\n var qIdx = url.indexOf('?');\n // There are 3 cases to handle:\n // 1) No existing parameters -> append '?' followed by params.\n // 2) '?' exists and is followed by existing query string ->\n // append '&' followed by params.\n // 3) '?' exists at the end of the url -> append params directly.\n // This basically amounts to determining the character, if any, with\n // which to join the URL and parameters.\n var sep = qIdx === -1 ? '?' : (qIdx < url.length - 1 ? '&' : '');\n this.urlWithParams = url + sep + params;\n }\n }\n }\n /**\n * Transform the free-form body into a serialized format suitable for\n * transmission to the server.\n */\n HttpRequest.prototype.serializeBody = function () {\n // If no body is present, no need to serialize it.\n if (this.body === null) {\n return null;\n }\n // Check whether the body is already in a serialized form. If so,\n // it can just be returned directly.\n if (isArrayBuffer(this.body) || isBlob(this.body) || isFormData(this.body) ||\n typeof this.body === 'string') {\n return this.body;\n }\n // Check whether the body is an instance of HttpUrlEncodedParams.\n if (this.body instanceof HttpParams) {\n return this.body.toString();\n }\n // Check whether the body is an object or array, and serialize with JSON if so.\n if (typeof this.body === 'object' || typeof this.body === 'boolean' ||\n Array.isArray(this.body)) {\n return JSON.stringify(this.body);\n }\n // Fall back on toString() for everything else.\n return this.body.toString();\n };\n /**\n * Examine the body and attempt to infer an appropriate MIME type\n * for it.\n *\n * If no such type can be inferred, this method will return `null`.\n */\n HttpRequest.prototype.detectContentTypeHeader = function () {\n // An empty body has no content type.\n if (this.body === null) {\n return null;\n }\n // FormData bodies rely on the browser's content type assignment.\n if (isFormData(this.body)) {\n return null;\n }\n // Blobs usually have their own content type. If it doesn't, then\n // no type can be inferred.\n if (isBlob(this.body)) {\n return this.body.type || null;\n }\n // Array buffers have unknown contents and thus no type can be inferred.\n if (isArrayBuffer(this.body)) {\n return null;\n }\n // Technically, strings could be a form of JSON data, but it's safe enough\n // to assume they're plain strings.\n if (typeof this.body === 'string') {\n return 'text/plain';\n }\n // `HttpUrlEncodedParams` has its own content-type.\n if (this.body instanceof HttpParams) {\n return 'application/x-www-form-urlencoded;charset=UTF-8';\n }\n // Arrays, objects, and numbers will be encoded as JSON.\n if (typeof this.body === 'object' || typeof this.body === 'number' ||\n Array.isArray(this.body)) {\n return 'application/json';\n }\n // No type could be inferred.\n return null;\n };\n HttpRequest.prototype.clone = function (update) {\n if (update === void 0) { update = {}; }\n // For method, url, and responseType, take the current value unless\n // it is overridden in the update hash.\n var method = update.method || this.method;\n var url = update.url || this.url;\n var responseType = update.responseType || this.responseType;\n // The body is somewhat special - a `null` value in update.body means\n // whatever current body is present is being overridden with an empty\n // body, whereas an `undefined` value in update.body implies no\n // override.\n var body = (update.body !== undefined) ? update.body : this.body;\n // Carefully handle the boolean options to differentiate between\n // `false` and `undefined` in the update args.\n var withCredentials = (update.withCredentials !== undefined) ? update.withCredentials : this.withCredentials;\n var reportProgress = (update.reportProgress !== undefined) ? update.reportProgress : this.reportProgress;\n // Headers and params may be appended to if `setHeaders` or\n // `setParams` are used.\n var headers = update.headers || this.headers;\n var params = update.params || this.params;\n // Check whether the caller has asked to add headers.\n if (update.setHeaders !== undefined) {\n // Set every requested header.\n headers =\n Object.keys(update.setHeaders)\n .reduce(function (headers, name) { return headers.set(name, update.setHeaders[name]); }, headers);\n }\n // Check whether the caller has asked to set params.\n if (update.setParams) {\n // Set every requested param.\n params = Object.keys(update.setParams)\n .reduce(function (params, param) { return params.set(param, update.setParams[param]); }, params);\n }\n // Finally, construct the new HttpRequest using the pieces from above.\n return new HttpRequest(method, url, body, {\n params: params, headers: headers, reportProgress: reportProgress, responseType: responseType, withCredentials: withCredentials,\n });\n };\n return HttpRequest;\n}());\n\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Type enumeration for the different kinds of `HttpEvent`.\n *\n * @publicApi\n */\nvar HttpEventType;\n(function (HttpEventType) {\n /**\n * The request was sent out over the wire.\n */\n HttpEventType[HttpEventType[\"Sent\"] = 0] = \"Sent\";\n /**\n * An upload progress event was received.\n */\n HttpEventType[HttpEventType[\"UploadProgress\"] = 1] = \"UploadProgress\";\n /**\n * The response status code and headers were received.\n */\n HttpEventType[HttpEventType[\"ResponseHeader\"] = 2] = \"ResponseHeader\";\n /**\n * A download progress event was received.\n */\n HttpEventType[HttpEventType[\"DownloadProgress\"] = 3] = \"DownloadProgress\";\n /**\n * The full response including the body was received.\n */\n HttpEventType[HttpEventType[\"Response\"] = 4] = \"Response\";\n /**\n * A custom event from an interceptor or a backend.\n */\n HttpEventType[HttpEventType[\"User\"] = 5] = \"User\";\n})(HttpEventType || (HttpEventType = {}));\n/**\n * Base class for both `HttpResponse` and `HttpHeaderResponse`.\n *\n * @publicApi\n */\nvar HttpResponseBase = /** @class */ (function () {\n /**\n * Super-constructor for all responses.\n *\n * The single parameter accepted is an initialization hash. Any properties\n * of the response passed there will override the default values.\n */\n function HttpResponseBase(init, defaultStatus, defaultStatusText) {\n if (defaultStatus === void 0) { defaultStatus = 200; }\n if (defaultStatusText === void 0) { defaultStatusText = 'OK'; }\n // If the hash has values passed, use them to initialize the response.\n // Otherwise use the default values.\n this.headers = init.headers || new HttpHeaders();\n this.status = init.status !== undefined ? init.status : defaultStatus;\n this.statusText = init.statusText || defaultStatusText;\n this.url = init.url || null;\n // Cache the ok value to avoid defining a getter.\n this.ok = this.status >= 200 && this.status < 300;\n }\n return HttpResponseBase;\n}());\n/**\n * A partial HTTP response which only includes the status and header data,\n * but no response body.\n *\n * `HttpHeaderResponse` is a `HttpEvent` available on the response\n * event stream, only when progress events are requested.\n *\n * @publicApi\n */\nvar HttpHeaderResponse = /** @class */ (function (_super) {\n __extends(HttpHeaderResponse, _super);\n /**\n * Create a new `HttpHeaderResponse` with the given parameters.\n */\n function HttpHeaderResponse(init) {\n if (init === void 0) { init = {}; }\n var _this = _super.call(this, init) || this;\n _this.type = HttpEventType.ResponseHeader;\n return _this;\n }\n /**\n * Copy this `HttpHeaderResponse`, overriding its contents with the\n * given parameter hash.\n */\n HttpHeaderResponse.prototype.clone = function (update) {\n if (update === void 0) { update = {}; }\n // Perform a straightforward initialization of the new HttpHeaderResponse,\n // overriding the current parameters with new ones if given.\n return new HttpHeaderResponse({\n headers: update.headers || this.headers,\n status: update.status !== undefined ? update.status : this.status,\n statusText: update.statusText || this.statusText,\n url: update.url || this.url || undefined,\n });\n };\n return HttpHeaderResponse;\n}(HttpResponseBase));\n/**\n * A full HTTP response, including a typed response body (which may be `null`\n * if one was not returned).\n *\n * `HttpResponse` is a `HttpEvent` available on the response event\n * stream.\n *\n * @publicApi\n */\nvar HttpResponse = /** @class */ (function (_super) {\n __extends(HttpResponse, _super);\n /**\n * Construct a new `HttpResponse`.\n */\n function HttpResponse(init) {\n if (init === void 0) { init = {}; }\n var _this = _super.call(this, init) || this;\n _this.type = HttpEventType.Response;\n _this.body = init.body !== undefined ? init.body : null;\n return _this;\n }\n HttpResponse.prototype.clone = function (update) {\n if (update === void 0) { update = {}; }\n return new HttpResponse({\n body: (update.body !== undefined) ? update.body : this.body,\n headers: update.headers || this.headers,\n status: (update.status !== undefined) ? update.status : this.status,\n statusText: update.statusText || this.statusText,\n url: update.url || this.url || undefined,\n });\n };\n return HttpResponse;\n}(HttpResponseBase));\n/**\n * A response that represents an error or failure, either from a\n * non-successful HTTP status, an error while executing the request,\n * or some other failure which occurred during the parsing of the response.\n *\n * Any error returned on the `Observable` response stream will be\n * wrapped in an `HttpErrorResponse` to provide additional context about\n * the state of the HTTP layer when the error occurred. The error property\n * will contain either a wrapped Error object or the error response returned\n * from the server.\n *\n * @publicApi\n */\nvar HttpErrorResponse = /** @class */ (function (_super) {\n __extends(HttpErrorResponse, _super);\n function HttpErrorResponse(init) {\n var _this = \n // Initialize with a default status of 0 / Unknown Error.\n _super.call(this, init, 0, 'Unknown Error') || this;\n _this.name = 'HttpErrorResponse';\n /**\n * Errors are never okay, even when the status code is in the 2xx success range.\n */\n _this.ok = false;\n // If the response was successful, then this was a parse error. Otherwise, it was\n // a protocol-level failure of some sort. Either the request failed in transit\n // or the server returned an unsuccessful status code.\n if (_this.status >= 200 && _this.status < 300) {\n _this.message = \"Http failure during parsing for \" + (init.url || '(unknown url)');\n }\n else {\n _this.message =\n \"Http failure response for \" + (init.url || '(unknown url)') + \": \" + init.status + \" \" + init.statusText;\n }\n _this.error = init.error || null;\n return _this;\n }\n return HttpErrorResponse;\n}(HttpResponseBase));\n\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Constructs an instance of `HttpRequestOptions` from a source `HttpMethodOptions` and\n * the given `body`. This function clones the object and adds the body.\n *\n * Note that the `responseType` *options* value is a String that identifies the\n * single data type of the response.\n * A single overload version of the method handles each response type.\n * The value of `responseType` cannot be a union, as the combined signature could imply.\n *\n */\nfunction addBody(options, body) {\n return {\n body: body,\n headers: options.headers,\n observe: options.observe,\n params: options.params,\n reportProgress: options.reportProgress,\n responseType: options.responseType,\n withCredentials: options.withCredentials,\n };\n}\n/**\n * Performs HTTP requests.\n * This service is available as an injectable class, with methods to perform HTTP requests.\n * Each request method has multiple signatures, and the return type varies based on\n * the signature that is called (mainly the values of `observe` and `responseType`).\n *\n * Note that the `responseType` *options* value is a String that identifies the\n * single data type of the response.\n * A single overload version of the method handles each response type.\n * The value of `responseType` cannot be a union, as the combined signature could imply.\n\n *\n * @usageNotes\n * Sample HTTP requests for the [Tour of Heroes](/tutorial/toh-pt0) application.\n *\n * ### HTTP Request Example\n *\n * ```\n * // GET heroes whose name contains search term\n * searchHeroes(term: string): observable{\n *\n * const params = new HttpParams({fromString: 'name=term'});\n * return this.httpClient.request('GET', this.heroesUrl, {responseType:'json', params});\n * }\n * ```\n * ### JSONP Example\n * ```\n * requestJsonp(url, callback = 'callback') {\n * return this.httpClient.jsonp(this.heroesURL, callback);\n * }\n * ```\n *\n * ### PATCH Example\n * ```\n * // PATCH one of the heroes' name\n * patchHero (id: number, heroName: string): Observable<{}> {\n * const url = `${this.heroesUrl}/${id}`; // PATCH api/heroes/42\n * return this.httpClient.patch(url, {name: heroName}, httpOptions)\n * .pipe(catchError(this.handleError('patchHero')));\n * }\n * ```\n *\n * @see [HTTP Guide](guide/http)\n *\n * @publicApi\n */\nvar HttpClient = /** @class */ (function () {\n function HttpClient(handler) {\n this.handler = handler;\n }\n /**\n * Constructs an observable for a generic HTTP request that, when subscribed,\n * fires the request through the chain of registered interceptors and on to the\n * server.\n *\n * You can pass an `HttpRequest` directly as the only parameter. In this case,\n * the call returns an observable of the raw `HttpEvent` stream.\n *\n * Alternatively you can pass an HTTP method as the first parameter,\n * a URL string as the second, and an options hash containing the request body as the third.\n * See `addBody()`. In this case, the specified `responseType` and `observe` options determine the\n * type of returned observable.\n * * The `responseType` value determines how a successful response body is parsed.\n * * If `responseType` is the default `json`, you can pass a type interface for the resulting\n * object as a type parameter to the call.\n *\n * The `observe` value determines the return type, according to what you are interested in\n * observing.\n * * An `observe` value of events returns an observable of the raw `HttpEvent` stream, including\n * progress events by default.\n * * An `observe` value of response returns an observable of `HttpResponse`,\n * where the `T` parameter depends on the `responseType` and any optionally provided type\n * parameter.\n * * An `observe` value of body returns an observable of `` with the same `T` body type.\n *\n */\n HttpClient.prototype.request = function (first, url, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n var req;\n // First, check whether the primary argument is an instance of `HttpRequest`.\n if (first instanceof HttpRequest) {\n // It is. The other arguments must be undefined (per the signatures) and can be\n // ignored.\n req = first;\n }\n else {\n // It's a string, so it represents a URL. Construct a request based on it,\n // and incorporate the remaining arguments (assuming `GET` unless a method is\n // provided.\n // Figure out the headers.\n var headers = undefined;\n if (options.headers instanceof HttpHeaders) {\n headers = options.headers;\n }\n else {\n headers = new HttpHeaders(options.headers);\n }\n // Sort out parameters.\n var params = undefined;\n if (!!options.params) {\n if (options.params instanceof HttpParams) {\n params = options.params;\n }\n else {\n params = new HttpParams({ fromObject: options.params });\n }\n }\n // Construct the request.\n req = new HttpRequest(first, url, (options.body !== undefined ? options.body : null), {\n headers: headers,\n params: params,\n reportProgress: options.reportProgress,\n // By default, JSON is assumed to be returned for all calls.\n responseType: options.responseType || 'json',\n withCredentials: options.withCredentials,\n });\n }\n // Start with an Observable.of() the initial request, and run the handler (which\n // includes all interceptors) inside a concatMap(). This way, the handler runs\n // inside an Observable chain, which causes interceptors to be re-run on every\n // subscription (this also makes retries re-run the handler, including interceptors).\n var events$ = of(req).pipe(concatMap(function (req) { return _this.handler.handle(req); }));\n // If coming via the API signature which accepts a previously constructed HttpRequest,\n // the only option is to get the event stream. Otherwise, return the event stream if\n // that is what was requested.\n if (first instanceof HttpRequest || options.observe === 'events') {\n return events$;\n }\n // The requested stream contains either the full response or the body. In either\n // case, the first step is to filter the event stream to extract a stream of\n // responses(s).\n var res$ = events$.pipe(filter(function (event) { return event instanceof HttpResponse; }));\n // Decide which stream to return.\n switch (options.observe || 'body') {\n case 'body':\n // The requested stream is the body. Map the response stream to the response\n // body. This could be done more simply, but a misbehaving interceptor might\n // transform the response body into a different format and ignore the requested\n // responseType. Guard against this by validating that the response is of the\n // requested type.\n switch (req.responseType) {\n case 'arraybuffer':\n return res$.pipe(map(function (res) {\n // Validate that the body is an ArrayBuffer.\n if (res.body !== null && !(res.body instanceof ArrayBuffer)) {\n throw new Error('Response is not an ArrayBuffer.');\n }\n return res.body;\n }));\n case 'blob':\n return res$.pipe(map(function (res) {\n // Validate that the body is a Blob.\n if (res.body !== null && !(res.body instanceof Blob)) {\n throw new Error('Response is not a Blob.');\n }\n return res.body;\n }));\n case 'text':\n return res$.pipe(map(function (res) {\n // Validate that the body is a string.\n if (res.body !== null && typeof res.body !== 'string') {\n throw new Error('Response is not a string.');\n }\n return res.body;\n }));\n case 'json':\n default:\n // No validation needed for JSON responses, as they can be of any type.\n return res$.pipe(map(function (res) { return res.body; }));\n }\n case 'response':\n // The response stream was requested directly, so return it.\n return res$;\n default:\n // Guard against new future observe types being added.\n throw new Error(\"Unreachable: unhandled observe type \" + options.observe + \"}\");\n }\n };\n /**\n * Constructs an observable that, when subscribed, causes the configured\n * `DELETE` request to execute on the server. See the individual overloads for\n * details on the return type.\n *\n * @param url The endpoint URL.\n * @param options The HTTP options to send with the request.\n *\n */\n HttpClient.prototype.delete = function (url, options) {\n if (options === void 0) { options = {}; }\n return this.request('DELETE', url, options);\n };\n /**\n * Constructs an observable that, when subscribed, causes the configured\n * `GET` request to execute on the server. See the individual overloads for\n * details on the return type.\n */\n HttpClient.prototype.get = function (url, options) {\n if (options === void 0) { options = {}; }\n return this.request('GET', url, options);\n };\n /**\n * Constructs an observable that, when subscribed, causes the configured\n * `HEAD` request to execute on the server. The `HEAD` method returns\n * meta information about the resource without transferring the\n * resource itself. See the individual overloads for\n * details on the return type.\n */\n HttpClient.prototype.head = function (url, options) {\n if (options === void 0) { options = {}; }\n return this.request('HEAD', url, options);\n };\n /**\n * Constructs an `Observable` that, when subscribed, causes a request with the special method\n * `JSONP` to be dispatched via the interceptor pipeline.\n * The [JSONP pattern](https://en.wikipedia.org/wiki/JSONP) works around limitations of certain\n * API endpoints that don't support newer,\n * and preferable [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) protocol.\n * JSONP treats the endpoint API as a JavaScript file and tricks the browser to process the\n * requests even if the API endpoint is not located on the same domain (origin) as the client-side\n * application making the request.\n * The endpoint API must support JSONP callback for JSONP requests to work.\n * The resource API returns the JSON response wrapped in a callback function.\n * You can pass the callback function name as one of the query parameters.\n * Note that JSONP requests can only be used with `GET` requests.\n *\n * @param url The resource URL.\n * @param callbackParam The callback function name.\n *\n */\n HttpClient.prototype.jsonp = function (url, callbackParam) {\n return this.request('JSONP', url, {\n params: new HttpParams().append(callbackParam, 'JSONP_CALLBACK'),\n observe: 'body',\n responseType: 'json',\n });\n };\n /**\n * Constructs an `Observable` that, when subscribed, causes the configured\n * `OPTIONS` request to execute on the server. This method allows the client\n * to determine the supported HTTP methods and other capabilites of an endpoint,\n * without implying a resource action. See the individual overloads for\n * details on the return type.\n */\n HttpClient.prototype.options = function (url, options) {\n if (options === void 0) { options = {}; }\n return this.request('OPTIONS', url, options);\n };\n /**\n * Constructs an observable that, when subscribed, causes the configured\n * `PATCH` request to execute on the server. See the individual overloads for\n * details on the return type.\n */\n HttpClient.prototype.patch = function (url, body, options) {\n if (options === void 0) { options = {}; }\n return this.request('PATCH', url, addBody(options, body));\n };\n /**\n * Constructs an observable that, when subscribed, causes the configured\n * `POST` request to execute on the server. The server responds with the location of\n * the replaced resource. See the individual overloads for\n * details on the return type.\n */\n HttpClient.prototype.post = function (url, body, options) {\n if (options === void 0) { options = {}; }\n return this.request('POST', url, addBody(options, body));\n };\n /**\n * Constructs an observable that, when subscribed, causes the configured\n * `PUT` request to execute on the server. The `PUT` method replaces an existing resource\n * with a new set of values.\n * See the individual overloads for details on the return type.\n */\n HttpClient.prototype.put = function (url, body, options) {\n if (options === void 0) { options = {}; }\n return this.request('PUT', url, addBody(options, body));\n };\n HttpClient = __decorate([\n Injectable(),\n __metadata(\"design:paramtypes\", [HttpHandler])\n ], HttpClient);\n return HttpClient;\n}());\n\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * `HttpHandler` which applies an `HttpInterceptor` to an `HttpRequest`.\n *\n *\n */\nvar HttpInterceptorHandler = /** @class */ (function () {\n function HttpInterceptorHandler(next, interceptor) {\n this.next = next;\n this.interceptor = interceptor;\n }\n HttpInterceptorHandler.prototype.handle = function (req) {\n return this.interceptor.intercept(req, this.next);\n };\n return HttpInterceptorHandler;\n}());\n/**\n * A multi-provider token that represents the array of registered\n * `HttpInterceptor` objects.\n *\n * @publicApi\n */\nvar HTTP_INTERCEPTORS = new InjectionToken('HTTP_INTERCEPTORS');\nvar NoopInterceptor = /** @class */ (function () {\n function NoopInterceptor() {\n }\n NoopInterceptor.prototype.intercept = function (req, next) {\n return next.handle(req);\n };\n NoopInterceptor = __decorate([\n Injectable()\n ], NoopInterceptor);\n return NoopInterceptor;\n}());\n\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n// Every request made through JSONP needs a callback name that's unique across the\n// whole page. Each request is assigned an id and the callback name is constructed\n// from that. The next id to be assigned is tracked in a global variable here that\n// is shared among all applications on the page.\nvar nextRequestId = 0;\n// Error text given when a JSONP script is injected, but doesn't invoke the callback\n// passed in its URL.\nvar JSONP_ERR_NO_CALLBACK = 'JSONP injected script did not invoke callback.';\n// Error text given when a request is passed to the JsonpClientBackend that doesn't\n// have a request method JSONP.\nvar JSONP_ERR_WRONG_METHOD = 'JSONP requests must use JSONP request method.';\nvar JSONP_ERR_WRONG_RESPONSE_TYPE = 'JSONP requests must use Json response type.';\n/**\n * DI token/abstract type representing a map of JSONP callbacks.\n *\n * In the browser, this should always be the `window` object.\n *\n *\n */\nvar JsonpCallbackContext = /** @class */ (function () {\n function JsonpCallbackContext() {\n }\n return JsonpCallbackContext;\n}());\n/**\n * Processes an `HttpRequest` with the JSONP method,\n * by performing JSONP style requests.\n * @see `HttpHandler`\n * @see `HttpXhrBackend`\n *\n * @publicApi\n */\nvar JsonpClientBackend = /** @class */ (function () {\n function JsonpClientBackend(callbackMap, document) {\n this.callbackMap = callbackMap;\n this.document = document;\n }\n /**\n * Get the name of the next callback method, by incrementing the global `nextRequestId`.\n */\n JsonpClientBackend.prototype.nextCallback = function () { return \"ng_jsonp_callback_\" + nextRequestId++; };\n /**\n * Processes a JSONP request and returns an event stream of the results.\n * @param req The request object.\n * @returns An observable of the response events.\n *\n */\n JsonpClientBackend.prototype.handle = function (req) {\n var _this = this;\n // Firstly, check both the method and response type. If either doesn't match\n // then the request was improperly routed here and cannot be handled.\n if (req.method !== 'JSONP') {\n throw new Error(JSONP_ERR_WRONG_METHOD);\n }\n else if (req.responseType !== 'json') {\n throw new Error(JSONP_ERR_WRONG_RESPONSE_TYPE);\n }\n // Everything else happens inside the Observable boundary.\n return new Observable(function (observer) {\n // The first step to make a request is to generate the callback name, and replace the\n // callback placeholder in the URL with the name. Care has to be taken here to ensure\n // a trailing &, if matched, gets inserted back into the URL in the correct place.\n var callback = _this.nextCallback();\n var url = req.urlWithParams.replace(/=JSONP_CALLBACK(&|$)/, \"=\" + callback + \"$1\");\n // Construct the