/**
 *
 * @ai-apps/angular v2.147.1-next.0 | ai-apps-angular-date-time-picker.umd.js
 *
 * Copyright 2014, 2022 IBM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0

 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('carbon-components-angular'), require('date-fns'), require('@angular/forms'), require('flatpickr/dist/l10n/index'), require('carbon-components-angular/i18n')) :
    typeof define === 'function' && define.amd ? define('@ai-apps/angular/date-time-picker', ['exports', '@angular/common', '@angular/core', 'carbon-components-angular', 'date-fns', '@angular/forms', 'flatpickr/dist/l10n/index', 'carbon-components-angular/i18n'], factory) :
    (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['ai-apps'] = global['ai-apps'] || {}, global['ai-apps'].angular = global['ai-apps'].angular || {}, global['ai-apps'].angular['date-time-picker'] = {}), global.ng.common, global.ng.core, global.i1, global.dateFns, global.ng.forms, global.languages, global.i1$2));
}(this, (function (exports, i1$1, i0, i1, dateFns, i2, languages, i1$2) { 'use strict';

    function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

    var languages__default = /*#__PURE__*/_interopDefaultLegacy(languages);

    /*! *****************************************************************************
    Copyright (c) Microsoft Corporation. All rights reserved.
    Licensed under the Apache License, Version 2.0 (the "License"); you may not use
    this file except in compliance with the License. You may obtain a copy of the
    License at http://www.apache.org/licenses/LICENSE-2.0

    THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
    WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
    MERCHANTABLITY OR NON-INFRINGEMENT.

    See the Apache Version 2.0 License for specific language governing permissions
    and limitations under the License.
    ***************************************************************************** */
    /* global Reflect, Promise */
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b)
                if (b.hasOwnProperty(p))
                    d[p] = b[p]; };
        return extendStatics(d, b);
    };
    function __extends(d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    }
    var __assign = function () {
        __assign = Object.assign || function __assign(t) {
            for (var s, i = 1, n = arguments.length; i < n; i++) {
                s = arguments[i];
                for (var p in s)
                    if (Object.prototype.hasOwnProperty.call(s, p))
                        t[p] = s[p];
            }
            return t;
        };
        return __assign.apply(this, arguments);
    };
    function __rest(s, e) {
        var t = {};
        for (var p in s)
            if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
                t[p] = s[p];
        if (s != null && typeof Object.getOwnPropertySymbols === "function")
            for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
                if (e.indexOf(p[i]) < 0)
                    t[p[i]] = s[p[i]];
        return t;
    }
    function __decorate(decorators, target, key, desc) {
        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
        if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
            r = Reflect.decorate(decorators, target, key, desc);
        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;
        return c > 3 && r && Object.defineProperty(target, key, r), r;
    }
    function __param(paramIndex, decorator) {
        return function (target, key) { decorator(target, key, paramIndex); };
    }
    function __metadata(metadataKey, metadataValue) {
        if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
            return Reflect.metadata(metadataKey, metadataValue);
    }
    function __awaiter(thisArg, _arguments, P, generator) {
        return new (P || (P = Promise))(function (resolve, reject) {
            function fulfilled(value) { try {
                step(generator.next(value));
            }
            catch (e) {
                reject(e);
            } }
            function rejected(value) { try {
                step(generator["throw"](value));
            }
            catch (e) {
                reject(e);
            } }
            function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
            step((generator = generator.apply(thisArg, _arguments || [])).next());
        });
    }
    function __generator(thisArg, body) {
        var _ = { label: 0, sent: function () { if (t[0] & 1)
                throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
        return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
        function verb(n) { return function (v) { return step([n, v]); }; }
        function step(op) {
            if (f)
                throw new TypeError("Generator is already executing.");
            while (_)
                try {
                    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;
                    if (y = 0, t)
                        op = [op[0] & 2, t.value];
                    switch (op[0]) {
                        case 0:
                        case 1:
                            t = op;
                            break;
                        case 4:
                            _.label++;
                            return { value: op[1], done: false };
                        case 5:
                            _.label++;
                            y = op[1];
                            op = [0];
                            continue;
                        case 7:
                            op = _.ops.pop();
                            _.trys.pop();
                            continue;
                        default:
                            if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
                                _ = 0;
                                continue;
                            }
                            if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
                                _.label = op[1];
                                break;
                            }
                            if (op[0] === 6 && _.label < t[1]) {
                                _.label = t[1];
                                t = op;
                                break;
                            }
                            if (t && _.label < t[2]) {
                                _.label = t[2];
                                _.ops.push(op);
                                break;
                            }
                            if (t[2])
                                _.ops.pop();
                            _.trys.pop();
                            continue;
                    }
                    op = body.call(thisArg, _);
                }
                catch (e) {
                    op = [6, e];
                    y = 0;
                }
                finally {
                    f = t = 0;
                }
            if (op[0] & 5)
                throw op[1];
            return { value: op[0] ? op[1] : void 0, done: true };
        }
    }
    function __exportStar(m, exports) {
        for (var p in m)
            if (!exports.hasOwnProperty(p))
                exports[p] = m[p];
    }
    function __values(o) {
        var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
        if (m)
            return m.call(o);
        return {
            next: function () {
                if (o && i >= o.length)
                    o = void 0;
                return { value: o && o[i++], done: !o };
            }
        };
    }
    function __read(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m)
            return o;
        var i = m.call(o), r, ar = [], e;
        try {
            while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
                ar.push(r.value);
        }
        catch (error) {
            e = { error: error };
        }
        finally {
            try {
                if (r && !r.done && (m = i["return"]))
                    m.call(i);
            }
            finally {
                if (e)
                    throw e.error;
            }
        }
        return ar;
    }
    function __spread() {
        for (var ar = [], i = 0; i < arguments.length; i++)
            ar = ar.concat(__read(arguments[i]));
        return ar;
    }
    function __await(v) {
        return this instanceof __await ? (this.v = v, this) : new __await(v);
    }
    function __asyncGenerator(thisArg, _arguments, generator) {
        if (!Symbol.asyncIterator)
            throw new TypeError("Symbol.asyncIterator is not defined.");
        var g = generator.apply(thisArg, _arguments || []), i, q = [];
        return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
        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); }); }; }
        function resume(n, v) { try {
            step(g[n](v));
        }
        catch (e) {
            settle(q[0][3], e);
        } }
        function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
        function fulfill(value) { resume("next", value); }
        function reject(value) { resume("throw", value); }
        function settle(f, v) { if (f(v), q.shift(), q.length)
            resume(q[0][0], q[0][1]); }
    }
    function __asyncDelegator(o) {
        var i, p;
        return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
        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; }
    }
    function __asyncValues(o) {
        if (!Symbol.asyncIterator)
            throw new TypeError("Symbol.asyncIterator is not defined.");
        var m = o[Symbol.asyncIterator], i;
        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);
        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); }); }; }
        function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
    }
    function __makeTemplateObject(cooked, raw) {
        if (Object.defineProperty) {
            Object.defineProperty(cooked, "raw", { value: raw });
        }
        else {
            cooked.raw = raw;
        }
        return cooked;
    }
    ;
    function __importStar(mod) {
        if (mod && mod.__esModule)
            return mod;
        var result = {};
        if (mod != null)
            for (var k in mod)
                if (Object.hasOwnProperty.call(mod, k))
                    result[k] = mod[k];
        result.default = mod;
        return result;
    }
    function __importDefault(mod) {
        return (mod && mod.__esModule) ? mod : { default: mod };
    }

    function DateTimeRelativeComponent_option_23_Template(rf, ctx) {
        if (rf & 1) {
            i0.ɵɵelementStart(0, "option", 15);
            i0.ɵɵtext(1);
            i0.ɵɵelementEnd();
        }
        if (rf & 2) {
            var option_r1 = ctx.$implicit;
            var i_r2 = ctx.index;
            i0.ɵɵproperty("value", option_r1.key)("selected", i_r2 === 0);
            i0.ɵɵadvance(1);
            i0.ɵɵtextInterpolate1(" ", option_r1.label, " ");
        }
    }
    var getEndDate = function (relativeTo, relativeToOptions) {
        var _b = __read(relativeTo, 2), relativeToLabel = _b[0], relativeTime = _b[1];
        var _c = __read(relativeTime.split(':'), 2), hourStr = _c[0], minStr = _c[1];
        var hour = parseInt(hourStr, 10);
        var min = parseInt(minStr, 10);
        var numOfDays = relativeToOptions.filter(function (option) { return option.key === relativeToLabel; })[0].value;
        // numOfDays < 0 for past, numOfDays == 0 for today, numOfDays > 0 for future
        if (numOfDays < 0) {
            var pastDays = Math.abs(numOfDays);
            return dateFns.setMinutes(dateFns.setHours(dateFns.subDays(new Date(), pastDays), hour), min);
        }
        return dateFns.setMinutes(dateFns.setHours(dateFns.addDays(new Date(), numOfDays), hour), min);
    };
    var getRangeFromRelative = function (relativeConfig, relativeToOptions) {
        var _b = __read(relativeConfig.last, 2), valueToSubtract = _b[0], valueRange = _b[1];
        var endDate = getEndDate(relativeConfig.relativeTo, relativeToOptions);
        var timeToSub = {
            years: 0,
            months: 0,
            weeks: 0,
            days: 0,
            hours: 0,
            minutes: 0,
            seconds: 0,
        };
        timeToSub[valueRange.toLowerCase()] = valueToSubtract;
        var startDate = dateFns.sub(endDate, timeToSub);
        return [startDate, endDate];
    };
    var DateTimeRelativeComponent = /** @class */ (function () {
        function DateTimeRelativeComponent() {
            this.value = null;
            this.valueChange = new i0.EventEmitter();
            this.timeToSubtract = 0;
            this.timeRange = 'MINUTES';
            this.relativeTo = 'YESTERDAY';
            this.relativeTime = '00:00';
        }
        DateTimeRelativeComponent.prototype.ngOnChanges = function (changes) {
            var _a;
            if ((_a = changes === null || changes === void 0 ? void 0 : changes.value) === null || _a === void 0 ? void 0 : _a.currentValue) {
                var _b = __read(changes.value.currentValue, 3), start = _b[0], end = _b[1], relativeConfig = _b[2];
                if (!relativeConfig) {
                    return;
                }
                var _c = __read(relativeConfig.last, 2), value = _c[0], valueRange = _c[1];
                var _d = __read(relativeConfig.relativeTo, 2), relativeTo = _d[0], time = _d[1];
                this.timeRange = valueRange;
                this.timeToSubtract = value;
                this.relativeTo = relativeTo;
                this.relativeTime = time;
            }
        };
        DateTimeRelativeComponent.prototype.onChange = function () {
            var _this = this;
            setTimeout(function () {
                var relativeConfig = {
                    last: [_this.timeToSubtract, _this.timeRange],
                    relativeTo: [_this.relativeTo, _this.relativeTime],
                };
                var dates = getRangeFromRelative(relativeConfig, _this.relativeToOptions);
                var range = __spread(dates, [relativeConfig]);
                _this.valueChange.emit(range);
            });
        };
        return DateTimeRelativeComponent;
    }());
    DateTimeRelativeComponent.ɵfac = function DateTimeRelativeComponent_Factory(t) { return new (t || DateTimeRelativeComponent)(); };
    DateTimeRelativeComponent.ɵcmp = i0.ɵɵdefineComponent({ type: DateTimeRelativeComponent, selectors: [["ai-date-time-relative"]], inputs: { value: "value", batchText: "batchText", relativeToOptions: "relativeToOptions" }, outputs: { valueChange: "valueChange" }, features: [i0.ɵɵNgOnChangesFeature], decls: 26, vars: 15, consts: [[1, "bx--fieldset", "iot--date-time-picker__menu-formgroup"], [1, "bx--label"], [1, "iot--date-time-picker__fields-wrapper"], ["theme", "light", 3, "min", "step", "ngModel", "ngModelChange", "change"], ["theme", "light", 1, "bx--form-item", 3, "ngModel", "ngModelChange", "valueChange"], ["value", "MINUTES"], ["value", "HOURS"], ["value", "DAYS"], ["value", "WEEKS"], ["value", "MONTHS"], ["value", "YEARS"], ["theme", "light", 1, "bx--form-item", "iot--date-time-relative-to__select", 3, "ngModel", "ngModelChange", "valueChange"], [3, "value", "selected", 4, "ngFor", "ngForOf"], [1, "bx--form-item"], ["ibmText", "", "type", "time", "theme", "light", 3, "ngModel", "ngModelChange", "change"], [3, "value", "selected"]], template: function DateTimeRelativeComponent_Template(rf, ctx) {
            if (rf & 1) {
                i0.ɵɵelementStart(0, "fieldset", 0);
                i0.ɵɵelementStart(1, "legend", 1);
                i0.ɵɵtext(2);
                i0.ɵɵelementEnd();
                i0.ɵɵelementStart(3, "div", 2);
                i0.ɵɵelementStart(4, "ibm-number", 3);
                i0.ɵɵlistener("ngModelChange", function DateTimeRelativeComponent_Template_ibm_number_ngModelChange_4_listener($event) { return ctx.timeToSubtract = $event; })("change", function DateTimeRelativeComponent_Template_ibm_number_change_4_listener() { return ctx.onChange(); });
                i0.ɵɵelementEnd();
                i0.ɵɵelementStart(5, "ibm-select", 4);
                i0.ɵɵlistener("ngModelChange", function DateTimeRelativeComponent_Template_ibm_select_ngModelChange_5_listener($event) { return ctx.timeRange = $event; })("valueChange", function DateTimeRelativeComponent_Template_ibm_select_valueChange_5_listener() { return ctx.onChange(); });
                i0.ɵɵelementStart(6, "option", 5);
                i0.ɵɵtext(7);
                i0.ɵɵelementEnd();
                i0.ɵɵelementStart(8, "option", 6);
                i0.ɵɵtext(9);
                i0.ɵɵelementEnd();
                i0.ɵɵelementStart(10, "option", 7);
                i0.ɵɵtext(11);
                i0.ɵɵelementEnd();
                i0.ɵɵelementStart(12, "option", 8);
                i0.ɵɵtext(13);
                i0.ɵɵelementEnd();
                i0.ɵɵelementStart(14, "option", 9);
                i0.ɵɵtext(15);
                i0.ɵɵelementEnd();
                i0.ɵɵelementStart(16, "option", 10);
                i0.ɵɵtext(17);
                i0.ɵɵelementEnd();
                i0.ɵɵelementEnd();
                i0.ɵɵelementEnd();
                i0.ɵɵelementEnd();
                i0.ɵɵelementStart(18, "fieldset", 0);
                i0.ɵɵelementStart(19, "legend", 1);
                i0.ɵɵtext(20);
                i0.ɵɵelementEnd();
                i0.ɵɵelementStart(21, "div", 2);
                i0.ɵɵelementStart(22, "ibm-select", 11);
                i0.ɵɵlistener("ngModelChange", function DateTimeRelativeComponent_Template_ibm_select_ngModelChange_22_listener($event) { return ctx.relativeTo = $event; })("valueChange", function DateTimeRelativeComponent_Template_ibm_select_valueChange_22_listener() { return ctx.onChange(); });
                i0.ɵɵtemplate(23, DateTimeRelativeComponent_option_23_Template, 2, 3, "option", 12);
                i0.ɵɵelementEnd();
                i0.ɵɵelementStart(24, "div", 13);
                i0.ɵɵelementStart(25, "input", 14);
                i0.ɵɵlistener("ngModelChange", function DateTimeRelativeComponent_Template_input_ngModelChange_25_listener($event) { return ctx.relativeTime = $event; })("change", function DateTimeRelativeComponent_Template_input_change_25_listener() { return ctx.onChange(); });
                i0.ɵɵelementEnd();
                i0.ɵɵelementEnd();
                i0.ɵɵelementEnd();
                i0.ɵɵelementEnd();
            }
            if (rf & 2) {
                i0.ɵɵadvance(2);
                i0.ɵɵtextInterpolate(ctx.batchText.LAST);
                i0.ɵɵadvance(2);
                i0.ɵɵproperty("min", 0)("step", 1)("ngModel", ctx.timeToSubtract);
                i0.ɵɵadvance(1);
                i0.ɵɵproperty("ngModel", ctx.timeRange);
                i0.ɵɵadvance(2);
                i0.ɵɵtextInterpolate(ctx.batchText.MINUTES);
                i0.ɵɵadvance(2);
                i0.ɵɵtextInterpolate(ctx.batchText.HOURS);
                i0.ɵɵadvance(2);
                i0.ɵɵtextInterpolate(ctx.batchText.DAYS);
                i0.ɵɵadvance(2);
                i0.ɵɵtextInterpolate(ctx.batchText.WEEKS);
                i0.ɵɵadvance(2);
                i0.ɵɵtextInterpolate(ctx.batchText.MONTHS);
                i0.ɵɵadvance(2);
                i0.ɵɵtextInterpolate(ctx.batchText.YEARS);
                i0.ɵɵadvance(3);
                i0.ɵɵtextInterpolate(ctx.batchText.RELATIVE_TO);
                i0.ɵɵadvance(2);
                i0.ɵɵproperty("ngModel", ctx.relativeTo);
                i0.ɵɵadvance(1);
                i0.ɵɵproperty("ngForOf", ctx.relativeToOptions);
                i0.ɵɵadvance(2);
                i0.ɵɵproperty("ngModel", ctx.relativeTime);
            }
        }, directives: [i1.NumberComponent, i2.NgControlStatus, i2.NgModel, i1.Select, i2.NgSelectOption, i2.ɵangular_packages_forms_forms_x, i1.Option, i1$1.NgForOf, i2.DefaultValueAccessor, i1.TextInput], styles: [".bx--number__input-wrapper input {\n        min-width: 0px !important;\n        padding-right: 0px !important;\n      }"] });
    (function () {
        (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DateTimeRelativeComponent, [{
                type: i0.Component,
                args: [{
                        selector: 'ai-date-time-relative',
                        template: "\n    <fieldset class=\"bx--fieldset iot--date-time-picker__menu-formgroup\">\n      <legend class=\"bx--label\">{{ batchText.LAST }}</legend>\n      <div class=\"iot--date-time-picker__fields-wrapper\">\n        <ibm-number\n          [min]=\"0\"\n          [step]=\"1\"\n          [(ngModel)]=\"timeToSubtract\"\n          (change)=\"onChange()\"\n          theme=\"light\"\n        ></ibm-number>\n        <ibm-select\n          class=\"bx--form-item\"\n          [(ngModel)]=\"timeRange\"\n          (valueChange)=\"onChange()\"\n          theme=\"light\"\n        >\n          <option value=\"MINUTES\">{{ batchText.MINUTES }}</option>\n          <option value=\"HOURS\">{{ batchText.HOURS }}</option>\n          <option value=\"DAYS\">{{ batchText.DAYS }}</option>\n          <option value=\"WEEKS\">{{ batchText.WEEKS }}</option>\n          <option value=\"MONTHS\">{{ batchText.MONTHS }}</option>\n          <option value=\"YEARS\">{{ batchText.YEARS }}</option>\n        </ibm-select>\n      </div>\n    </fieldset>\n    <fieldset class=\"bx--fieldset iot--date-time-picker__menu-formgroup\">\n      <legend class=\"bx--label\">{{ batchText.RELATIVE_TO }}</legend>\n      <div class=\"iot--date-time-picker__fields-wrapper\">\n        <ibm-select\n          class=\"bx--form-item iot--date-time-relative-to__select\"\n          [(ngModel)]=\"relativeTo\"\n          (valueChange)=\"onChange()\"\n          theme=\"light\"\n        >\n          <option\n            *ngFor=\"let option of relativeToOptions; let i = index\"\n            [value]=\"option.key\"\n            [selected]=\"i === 0\"\n          >\n            {{ option.label }}\n          </option>\n        </ibm-select>\n        <!-- tmp until we can implement a better time selector -->\n        <div class=\"bx--form-item\">\n          <input\n            ibmText\n            type=\"time\"\n            [(ngModel)]=\"relativeTime\"\n            (change)=\"onChange()\"\n            theme=\"light\"\n          />\n        </div>\n      </div>\n    </fieldset>\n  ",
                        styles: [
                            "\n      /* tmp hack until carbon-components-angular has the updated number input */\n      ::ng-deep .bx--number__input-wrapper input {\n        min-width: 0px !important;\n        padding-right: 0px !important;\n      }\n    ",
                        ],
                    }]
            }], null, { value: [{
                    type: i0.Input
                }], batchText: [{
                    type: i0.Input
                }], relativeToOptions: [{
                    type: i0.Input
                }], valueChange: [{
                    type: i0.Output
                }] });
    })();

    function DateTimePickerComponent_ol_7_li_3_Template(rf, ctx) {
        if (rf & 1) {
            var _r7_1 = i0.ɵɵgetCurrentView();
            i0.ɵɵelementStart(0, "li", 15);
            i0.ɵɵlistener("click", function DateTimePickerComponent_ol_7_li_3_Template_li_click_0_listener() { i0.ɵɵrestoreView(_r7_1); var ctx_r6 = i0.ɵɵnextContext(2); return ctx_r6.selectingCustomRange = true; });
            i0.ɵɵtext(1);
            i0.ɵɵelementEnd();
        }
        if (rf & 2) {
            var ctx_r4 = i0.ɵɵnextContext(2);
            i0.ɵɵadvance(1);
            i0.ɵɵtextInterpolate1(" ", ctx_r4.batchText.CUSTOM_RANGE, " ");
        }
    }
    var _c0 = function (a0) { return { "iot--date-time-picker__listitem--preset-selected": a0 }; };
    function DateTimePickerComponent_ol_7_li_4_Template(rf, ctx) {
        if (rf & 1) {
            var _r10_1 = i0.ɵɵgetCurrentView();
            i0.ɵɵelementStart(0, "li", 16);
            i0.ɵɵlistener("click", function DateTimePickerComponent_ol_7_li_4_Template_li_click_0_listener() { i0.ɵɵrestoreView(_r10_1); var range_r8 = ctx.$implicit; var ctx_r9 = i0.ɵɵnextContext(2); return ctx_r9.selectPresetRange(range_r8); })("keyup.space", function DateTimePickerComponent_ol_7_li_4_Template_li_keyup_space_0_listener() { i0.ɵɵrestoreView(_r10_1); var range_r8 = ctx.$implicit; var ctx_r11 = i0.ɵɵnextContext(2); return ctx_r11.selectPresetRange(range_r8); })("keyup.enter", function DateTimePickerComponent_ol_7_li_4_Template_li_keyup_enter_0_listener() { i0.ɵɵrestoreView(_r10_1); var range_r8 = ctx.$implicit; var ctx_r12 = i0.ɵɵnextContext(2); return ctx_r12.selectPresetRange(range_r8); });
            i0.ɵɵtext(1);
            i0.ɵɵelementEnd();
        }
        if (rf & 2) {
            var range_r8 = ctx.$implicit;
            var ctx_r5 = i0.ɵɵnextContext(2);
            i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(3, _c0, ctx_r5.selected[0] === range_r8.key));
            i0.ɵɵattribute("tabindex", ctx_r5.selected[0] === range_r8.key ? 0 : -1);
            i0.ɵɵadvance(1);
            i0.ɵɵtextInterpolate1(" ", range_r8.description, " ");
        }
    }
    function DateTimePickerComponent_ol_7_Template(rf, ctx) {
        if (rf & 1) {
            var _r14_1 = i0.ɵɵgetCurrentView();
            i0.ɵɵelementStart(0, "ol", 11);
            i0.ɵɵlistener("keyup", function DateTimePickerComponent_ol_7_Template_ol_keyup_0_listener($event) { i0.ɵɵrestoreView(_r14_1); var ctx_r13 = i0.ɵɵnextContext(); return ctx_r13.navigateList($event); });
            i0.ɵɵelementStart(1, "li", 12);
            i0.ɵɵtext(2);
            i0.ɵɵelementEnd();
            i0.ɵɵtemplate(3, DateTimePickerComponent_ol_7_li_3_Template, 2, 1, "li", 13);
            i0.ɵɵtemplate(4, DateTimePickerComponent_ol_7_li_4_Template, 2, 5, "li", 14);
            i0.ɵɵelementEnd();
        }
        if (rf & 2) {
            var ctx_r0 = i0.ɵɵnextContext();
            i0.ɵɵadvance(2);
            i0.ɵɵtextInterpolate1(" ", ctx_r0.formatCurrentRange(), " ");
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", ctx_r0.hasRelative || ctx_r0.hasAbsolute);
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngForOf", ctx_r0.dateTimeRanges);
        }
    }
    function DateTimePickerComponent_ai_custom_date_time_8_Template(rf, ctx) {
        if (rf & 1) {
            var _r16_1 = i0.ɵɵgetCurrentView();
            i0.ɵɵelementStart(0, "ai-custom-date-time", 17);
            i0.ɵɵlistener("rangeChange", function DateTimePickerComponent_ai_custom_date_time_8_Template_ai_custom_date_time_rangeChange_0_listener($event) { i0.ɵɵrestoreView(_r16_1); var ctx_r15 = i0.ɵɵnextContext(); return ctx_r15.rangeChange($event); });
            i0.ɵɵelementEnd();
        }
        if (rf & 2) {
            var ctx_r1 = i0.ɵɵnextContext();
            i0.ɵɵproperty("range", ctx_r1.selected)("hasRelative", ctx_r1.hasRelative)("hasAbsolute", ctx_r1.hasAbsolute)("dateFormat", ctx_r1.absoluteDateFormat)("placeholder", ctx_r1.dateFormat.toLowerCase())("flatpickrOptions", ctx_r1.flatpickrOptions)("batchText", ctx_r1.batchText)("relativeToOptions", ctx_r1.relativeToOptions);
        }
    }
    function DateTimePickerComponent_button_10_Template(rf, ctx) {
        if (rf & 1) {
            var _r18_1 = i0.ɵɵgetCurrentView();
            i0.ɵɵelementStart(0, "button", 18);
            i0.ɵɵlistener("click", function DateTimePickerComponent_button_10_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r18_1); var ctx_r17 = i0.ɵɵnextContext(); return ctx_r17.onBack(); });
            i0.ɵɵtext(1);
            i0.ɵɵelementEnd();
        }
        if (rf & 2) {
            var ctx_r2 = i0.ɵɵnextContext();
            i0.ɵɵadvance(1);
            i0.ɵɵtextInterpolate1(" ", ctx_r2.batchText.BACK, " ");
        }
    }
    function DateTimePickerComponent_button_11_Template(rf, ctx) {
        if (rf & 1) {
            var _r20_1 = i0.ɵɵgetCurrentView();
            i0.ɵɵelementStart(0, "button", 18);
            i0.ɵɵlistener("click", function DateTimePickerComponent_button_11_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r20_1); var ctx_r19 = i0.ɵɵnextContext(); return ctx_r19.onCancel(); });
            i0.ɵɵtext(1);
            i0.ɵɵelementEnd();
        }
        if (rf & 2) {
            var ctx_r3 = i0.ɵɵnextContext();
            i0.ɵɵadvance(1);
            i0.ɵɵtextInterpolate1(" ", ctx_r3.batchText.CANCEL, " ");
        }
    }
    var _c1 = function (a0) { return { "iot--date-time-picker__box--light": a0 }; };
    var _c2 = function (a0) { return { "iot--date-time-picker__menu-expanded": a0 }; };
    var DateTimePickerComponent = /** @class */ (function () {
        function DateTimePickerComponent(elementRef, i18n) {
            this.elementRef = elementRef;
            this.i18n = i18n;
            this.wrapper = true;
            this.dateTimeRanges = [
                {
                    key: 'LAST_30_MINUTES',
                    description: 'Last 30 minutes',
                    getRange: function () {
                        var now = new Date();
                        var previous = dateFns.subMinutes(now, 30);
                        return [previous, now];
                    },
                },
                {
                    key: 'LAST_1_HOUR',
                    description: 'Last 1 hour',
                    getRange: function () {
                        var now = new Date();
                        var previous = dateFns.subHours(now, 1);
                        return [previous, now];
                    },
                },
                {
                    key: 'LAST_6_HOURS',
                    description: 'Last 6 hours',
                    getRange: function () {
                        var now = new Date();
                        var previous = dateFns.subHours(now, 6);
                        return [previous, now];
                    },
                },
                {
                    key: 'LAST_12_HOURS',
                    description: 'Last 12 hours',
                    getRange: function () {
                        var now = new Date();
                        var previous = dateFns.subHours(now, 12);
                        return [previous, now];
                    },
                },
                {
                    key: 'LAST_24_HOURS',
                    description: 'Last 24 hours',
                    getRange: function () {
                        var now = new Date();
                        var previous = dateFns.subHours(now, 24);
                        return [previous, now];
                    },
                },
            ];
            /**
             * Language of the flatpickr calendar.
             *
             * For reference of the possible locales:
             * https://github.com/flatpickr/flatpickr/blob/master/src/l10n/index.ts
             */
            this.language = 'en';
            this.selected = null;
            this.hasRelative = true;
            this.hasAbsolute = true;
            this.theme = null;
            this.placeholder = 'yyyy-mm-dd HH:mm';
            this.dateFormat = 'yyyy-MM-dd';
            this.batchText = {
                ABSOLUTE: 'Absolute',
                RELATIVE: 'Relative',
                CUSTOM_RANGE: 'Custom Range',
                RELATIVE_TO: 'Relative to',
                START_DATE: 'Start date',
                END_DATE: 'End date',
                START_TIME: 'Start time',
                END_TIME: 'End time',
                LAST: 'Last',
                CANCEL: 'Cancel',
                APPLY: 'Apply',
                BACK: 'back',
                NOW: 'Now',
                YESTERDAY: 'Yesterday',
                YEARS: 'years',
                MONTHS: 'months',
                WEEKS: 'weeks',
                DAYS: 'days',
                HOURS: 'hours',
                MINUTES: 'minutes',
                RANGE_SEPARATOR: 'to',
            };
            this.relativeToOptions = [
                {
                    key: 'YESTERDAY',
                    label: 'Yesterday',
                    value: -1,
                },
                {
                    key: 'TODAY',
                    label: 'Today',
                    value: 0,
                },
            ];
            this.selectedChange = new i0.EventEmitter();
            this.apply = new i0.EventEmitter();
            this.cancel = new i0.EventEmitter();
            // contains the selection from before a custom selection was made (to handle the "back" case)
            this.previousSelection = null;
            this.selectingCustomRange = false;
            this.expanded = false;
            this.disabled = false;
            this.timeFormat = 'HH:mm';
            this.absoluteDateFormat = 'Y-m-d';
        }
        Object.defineProperty(DateTimePickerComponent.prototype, "tooltipOffset", {
            get: function () {
                return { x: 0, y: 4 };
            },
            enumerable: false,
            configurable: true
        });
        DateTimePickerComponent.prototype.ngOnChanges = function (changes) {
            var _a;
            if ((_a = changes === null || changes === void 0 ? void 0 : changes.selected) === null || _a === void 0 ? void 0 : _a.currentValue) {
                var _b = __read(changes.selected.currentValue, 1), type = _b[0];
                if (type === 'RELATIVE' || type === 'ABSOLUTE') {
                    this.selectingCustomRange = true;
                }
            }
        };
        DateTimePickerComponent.prototype.ngOnInit = function () {
            if (!this.selected) {
                this.selected = [null];
                this.disabled = true;
            }
            this.previousSelection = this.selected;
            this.updateI18nTranslationString();
            this.updateAbsoluteDateFormat();
        };
        DateTimePickerComponent.prototype.updateAbsoluteDateFormat = function () {
            // convert current dateFormat to proper format for absolute date picker
            var formatCharacters = this.dateFormat.split('');
            var newDateFormat = formatCharacters
                .filter(function (char, i) { return i === 0 || formatCharacters[i] !== formatCharacters[i - 1]; })
                .join('');
            this.absoluteDateFormat = newDateFormat.replace('y', 'Y').replace('M', 'm');
        };
        DateTimePickerComponent.prototype.updateI18nTranslationString = function () {
            this.i18n.setLocale(this.language, languages__default['default'][this.language]);
        };
        DateTimePickerComponent.prototype.formatCurrentRangeTitle = function () {
            var _b = __read(this.selected, 1), rangeOrType = _b[0];
            if (!rangeOrType) {
                return this.placeholder;
            }
            else if (rangeOrType === 'RELATIVE' || rangeOrType === 'ABSOLUTE') {
                return this.formatCustomRange();
            }
            var range = this.dateTimeRanges.find(function (range) { return range.key === rangeOrType; });
            return range.description;
        };
        DateTimePickerComponent.prototype.formatCurrentRange = function () {
            var _b = __read(this.selected, 1), rangeOrType = _b[0];
            if (!rangeOrType) {
                return this.placeholder;
            }
            else if (rangeOrType === 'RELATIVE' || rangeOrType === 'ABSOLUTE') {
                return this.formatCustomRange();
            }
            var range = this.dateTimeRanges.find(function (range) { return range.key === rangeOrType; });
            var _c = __read(range.getRange(), 2), start = _c[0], end = _c[1];
            // TODO: provide a way to customize this for g11n
            var formatString = this.dateFormat + " " + this.timeFormat;
            var endFormatted = dateFns.format(end, formatString);
            if (dateFns.isThisMinute(end)) {
                endFormatted = this.batchText.NOW;
            }
            return dateFns.format(start, formatString) + " " + this.batchText.RANGE_SEPARATOR + " " + endFormatted;
        };
        DateTimePickerComponent.prototype.formatCustomRange = function () {
            // TODO: provide a way to customize this for g11n
            var formatString = this.dateFormat + " " + this.timeFormat;
            var _b = __read(this.selected, 4), type = _b[0], start = _b[1], end = _b[2], relativeConfig = _b[3];
            if (type === 'ABSOLUTE') {
                return dateFns.format(start, formatString) + " " + this.batchText.RANGE_SEPARATOR + " " + dateFns.format(end, formatString);
            }
            else if (type === 'RELATIVE') {
                var _c = __read(getRangeFromRelative(relativeConfig, this.relativeToOptions), 2), start_1 = _c[0], end_1 = _c[1];
                return dateFns.format(start_1, formatString) + " " + this.batchText.RANGE_SEPARATOR + " " + dateFns.format(end_1, formatString);
            }
        };
        DateTimePickerComponent.prototype.selectPresetRange = function (range) {
            // set the selected value so the view updates
            this.selected = [range.key];
        };
        DateTimePickerComponent.prototype.rangeChange = function (change) {
            // store the previous selection if we don't have one yet
            if (!this.previousSelection) {
                this.previousSelection = this.selected;
            }
            this.selected = change;
        };
        DateTimePickerComponent.prototype.onBack = function () {
            this.selectingCustomRange = false;
        };
        DateTimePickerComponent.prototype.onApply = function () {
            var _b = __read(this.selected, 3), rangeOrType = _b[0], start = _b[1], end = _b[2];
            if (this.selectingCustomRange) {
                this.apply.emit([start, end]);
                this.selectedChange.emit(this.selected);
            }
            else {
                // emit the date range
                var range = this.dateTimeRanges.find(function (range) { return range.key === rangeOrType; });
                this.selected = __spread([range.key], range.getRange());
                this.selectedChange.emit(this.selected);
                this.apply.emit(range.getRange());
            }
            this.previousSelection = this.selected;
            this.expanded = false;
            this.disabled = false;
        };
        DateTimePickerComponent.prototype.onCancel = function () {
            this.selected = this.previousSelection;
            this.cancel.emit();
            this.expanded = false;
        };
        DateTimePickerComponent.prototype.navigateList = function (event) {
            var target = event.target;
            switch (event.key) {
                case 'ArrowUp': {
                    var prev = target.previousElementSibling;
                    if (prev === null || prev === void 0 ? void 0 : prev.hasAttribute('tabindex')) {
                        target.tabIndex = -1;
                        prev.tabIndex = 0;
                        prev.focus();
                    }
                    break;
                }
                case 'ArrowDown': {
                    var next = target.nextElementSibling;
                    if (next === null || next === void 0 ? void 0 : next.hasAttribute('tabindex')) {
                        target.tabIndex = -1;
                        next.tabIndex = 0;
                        next.focus();
                    }
                    break;
                }
            }
        };
        DateTimePickerComponent.prototype.togglePicker = function () {
            this.expanded = !this.expanded;
            if (this.expanded) {
                var nativeElement = this.elementRef.nativeElement;
                var selected_1 = nativeElement.querySelector('.iot--date-time-picker__listitem--preset-selected');
                if (selected_1) {
                    setTimeout(function () { return selected_1.focus(); });
                }
            }
        };
        return DateTimePickerComponent;
    }());
    DateTimePickerComponent.ɵfac = function DateTimePickerComponent_Factory(t) { return new (t || DateTimePickerComponent)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i1$2.I18n)); };
    DateTimePickerComponent.ɵcmp = i0.ɵɵdefineComponent({ type: DateTimePickerComponent, selectors: [["ai-date-time-picker"]], hostVars: 2, hostBindings: function DateTimePickerComponent_HostBindings(rf, ctx) {
            if (rf & 2) {
                i0.ɵɵclassProp("iot--date-time-picker__wrapper", ctx.wrapper);
            }
        }, inputs: { dateTimeRanges: "dateTimeRanges", language: "language", selected: "selected", hasRelative: "hasRelative", hasAbsolute: "hasAbsolute", theme: "theme", placeholder: "placeholder", dateFormat: "dateFormat", flatpickrOptions: "flatpickrOptions", batchText: "batchText", relativeToOptions: "relativeToOptions" }, outputs: { selectedChange: "selectedChange", apply: "apply", cancel: "cancel" }, features: [i0.ɵɵNgOnChangesFeature], decls: 14, vars: 16, consts: [[1, "iot--date-time-picker__box", 3, "ngClass"], ["trigger", "hover", "placement", "bottom", "role", "button", "tabindex", "0", 1, "iot--date-time-picker__field", 3, "ibmTooltip", "offset", "disabled", "click", "keydown.enter", "keydown.space"], [3, "title"], ["ibmIcon", "calendar", "size", "16", 1, "iot--date-time-picker__icon"], ["role", "listbox", 1, "iot--date-time-picker__menu", 3, "ngClass"], [1, "iot--date-time-picker__menu-scroll"], ["class", "bx--list--ordered", 3, "keyup", 4, "ngIf"], [3, "range", "hasRelative", "hasAbsolute", "dateFormat", "placeholder", "flatpickrOptions", "batchText", "relativeToOptions", "rangeChange", 4, "ngIf"], [1, "iot--date-time-picker__menu-btn-set"], ["ibmButton", "secondary", "class", "iot--date-time-picker__menu-btn iot--date-time-picker__menu-btn-cancel", "type", "button", "size", "field", 3, "click", 4, "ngIf"], ["ibmButton", "primary", "type", "button", "size", "field", 1, "iot--date-time-picker__menu-btn", "iot--date-time-picker__menu-btn-apply", 3, "click"], [1, "bx--list--ordered", 3, "keyup"], [1, "bx--list__item", "iot--date-time-picker__listitem", "iot--date-time-picker__listitem--current"], ["class", "bx--list__item iot--date-time-picker__listitem iot--date-time-picker__listitem--custom", "tabindex", "-1", 3, "click", 4, "ngIf"], ["class", "bx--list__item iot--date-time-picker__listitem iot--date-time-picker__listitem--preset", 3, "ngClass", "click", "keyup.space", "keyup.enter", 4, "ngFor", "ngForOf"], ["tabindex", "-1", 1, "bx--list__item", "iot--date-time-picker__listitem", "iot--date-time-picker__listitem--custom", 3, "click"], [1, "bx--list__item", "iot--date-time-picker__listitem", "iot--date-time-picker__listitem--preset", 3, "ngClass", "click", "keyup.space", "keyup.enter"], [3, "range", "hasRelative", "hasAbsolute", "dateFormat", "placeholder", "flatpickrOptions", "batchText", "relativeToOptions", "rangeChange"], ["ibmButton", "secondary", "type", "button", "size", "field", 1, "iot--date-time-picker__menu-btn", "iot--date-time-picker__menu-btn-cancel", 3, "click"]], template: function DateTimePickerComponent_Template(rf, ctx) {
            if (rf & 1) {
                i0.ɵɵelementStart(0, "div", 0);
                i0.ɵɵelementStart(1, "div", 1);
                i0.ɵɵlistener("click", function DateTimePickerComponent_Template_div_click_1_listener() { return ctx.togglePicker(); })("keydown.enter", function DateTimePickerComponent_Template_div_keydown_enter_1_listener() { return ctx.togglePicker(); })("keydown.space", function DateTimePickerComponent_Template_div_keydown_space_1_listener() { return ctx.togglePicker(); });
                i0.ɵɵelementStart(2, "span", 2);
                i0.ɵɵtext(3);
                i0.ɵɵelementEnd();
                i0.ɵɵnamespaceSVG();
                i0.ɵɵelement(4, "svg", 3);
                i0.ɵɵelementEnd();
                i0.ɵɵnamespaceHTML();
                i0.ɵɵelementStart(5, "div", 4);
                i0.ɵɵelementStart(6, "div", 5);
                i0.ɵɵtemplate(7, DateTimePickerComponent_ol_7_Template, 5, 3, "ol", 6);
                i0.ɵɵtemplate(8, DateTimePickerComponent_ai_custom_date_time_8_Template, 1, 8, "ai-custom-date-time", 7);
                i0.ɵɵelementEnd();
                i0.ɵɵelementStart(9, "div", 8);
                i0.ɵɵtemplate(10, DateTimePickerComponent_button_10_Template, 2, 1, "button", 9);
                i0.ɵɵtemplate(11, DateTimePickerComponent_button_11_Template, 2, 1, "button", 9);
                i0.ɵɵelementStart(12, "button", 10);
                i0.ɵɵlistener("click", function DateTimePickerComponent_Template_button_click_12_listener() { return ctx.onApply(); });
                i0.ɵɵtext(13);
                i0.ɵɵelementEnd();
                i0.ɵɵelementEnd();
                i0.ɵɵelementEnd();
                i0.ɵɵelementEnd();
            }
            if (rf & 2) {
                i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(12, _c1, ctx.theme === "light"));
                i0.ɵɵadvance(1);
                i0.ɵɵproperty("ibmTooltip", ctx.formatCurrentRange())("offset", ctx.tooltipOffset)("disabled", ctx.disabled);
                i0.ɵɵadvance(1);
                i0.ɵɵproperty("title", ctx.formatCurrentRangeTitle());
                i0.ɵɵadvance(1);
                i0.ɵɵtextInterpolate(ctx.formatCurrentRangeTitle());
                i0.ɵɵadvance(2);
                i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(14, _c2, ctx.expanded));
                i0.ɵɵadvance(2);
                i0.ɵɵproperty("ngIf", !ctx.selectingCustomRange);
                i0.ɵɵadvance(1);
                i0.ɵɵproperty("ngIf", ctx.selectingCustomRange);
                i0.ɵɵadvance(2);
                i0.ɵɵproperty("ngIf", ctx.selectingCustomRange);
                i0.ɵɵadvance(1);
                i0.ɵɵproperty("ngIf", !ctx.selectingCustomRange);
                i0.ɵɵadvance(2);
                i0.ɵɵtextInterpolate1(" ", ctx.batchText.APPLY, " ");
            }
        }, styles: ["[_nghost-%COMP%] {\n        display: block;\n      }\n\n      \n      .iot--date-time-picker__box[_ngcontent-%COMP%] {\n        font-size: inherit;\n      }"] });
    (function () {
        (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DateTimePickerComponent, [{
                type: i0.Component,
                args: [{
                        selector: 'ai-date-time-picker',
                        template: "\n    <div\n      class=\"iot--date-time-picker__box\"\n      [ngClass]=\"{\n        'iot--date-time-picker__box--light': theme === 'light'\n      }\"\n    >\n      <div\n        class=\"iot--date-time-picker__field\"\n        (click)=\"togglePicker()\"\n        (keydown.enter)=\"togglePicker()\"\n        (keydown.space)=\"togglePicker()\"\n        [ibmTooltip]=\"formatCurrentRange()\"\n        [offset]=\"tooltipOffset\"\n        [disabled]=\"disabled\"\n        trigger=\"hover\"\n        placement=\"bottom\"\n        role=\"button\"\n        tabindex=\"0\"\n      >\n        <span [title]=\"formatCurrentRangeTitle()\">{{ formatCurrentRangeTitle() }}</span>\n        <svg ibmIcon=\"calendar\" size=\"16\" class=\"iot--date-time-picker__icon\"></svg>\n      </div>\n      <div\n        class=\"iot--date-time-picker__menu\"\n        [ngClass]=\"{\n          'iot--date-time-picker__menu-expanded': expanded\n        }\"\n        role=\"listbox\"\n      >\n        <div class=\"iot--date-time-picker__menu-scroll\">\n          <!-- root view -->\n          <ol\n            *ngIf=\"!selectingCustomRange\"\n            (keyup)=\"navigateList($event)\"\n            class=\"bx--list--ordered\"\n          >\n            <li\n              class=\"bx--list__item iot--date-time-picker__listitem iot--date-time-picker__listitem--current\"\n            >\n              {{ formatCurrentRange() }}\n            </li>\n            <li\n              *ngIf=\"hasRelative || hasAbsolute\"\n              (click)=\"selectingCustomRange = true\"\n              class=\"bx--list__item iot--date-time-picker__listitem iot--date-time-picker__listitem--custom\"\n              tabindex=\"-1\"\n            >\n              {{ batchText.CUSTOM_RANGE }}\n            </li>\n            <li\n              *ngFor=\"let range of dateTimeRanges\"\n              class=\"bx--list__item iot--date-time-picker__listitem iot--date-time-picker__listitem--preset\"\n              (click)=\"selectPresetRange(range)\"\n              (keyup.space)=\"selectPresetRange(range)\"\n              (keyup.enter)=\"selectPresetRange(range)\"\n              [attr.tabindex]=\"selected[0] === range.key ? 0 : -1\"\n              [ngClass]=\"{\n                'iot--date-time-picker__listitem--preset-selected': selected[0] === range.key\n              }\"\n            >\n              {{ range.description }}\n            </li>\n          </ol>\n          <!-- custom relative/absolute -->\n          <ai-custom-date-time\n            *ngIf=\"selectingCustomRange\"\n            (rangeChange)=\"rangeChange($event)\"\n            [range]=\"selected\"\n            [hasRelative]=\"hasRelative\"\n            [hasAbsolute]=\"hasAbsolute\"\n            [dateFormat]=\"absoluteDateFormat\"\n            [placeholder]=\"dateFormat.toLowerCase()\"\n            [flatpickrOptions]=\"flatpickrOptions\"\n            [batchText]=\"batchText\"\n            [relativeToOptions]=\"relativeToOptions\"\n          ></ai-custom-date-time>\n        </div>\n        <div class=\"iot--date-time-picker__menu-btn-set\">\n          <button\n            *ngIf=\"selectingCustomRange\"\n            (click)=\"onBack()\"\n            ibmButton=\"secondary\"\n            class=\"iot--date-time-picker__menu-btn iot--date-time-picker__menu-btn-cancel\"\n            type=\"button\"\n            size=\"field\"\n          >\n            {{ batchText.BACK }}\n          </button>\n          <button\n            *ngIf=\"!selectingCustomRange\"\n            ibmButton=\"secondary\"\n            (click)=\"onCancel()\"\n            class=\"iot--date-time-picker__menu-btn iot--date-time-picker__menu-btn-cancel\"\n            type=\"button\"\n            size=\"field\"\n          >\n            {{ batchText.CANCEL }}\n          </button>\n          <button\n            ibmButton=\"primary\"\n            (click)=\"onApply()\"\n            class=\"iot--date-time-picker__menu-btn iot--date-time-picker__menu-btn-apply\"\n            type=\"button\"\n            size=\"field\"\n          >\n            {{ batchText.APPLY }}\n          </button>\n        </div>\n      </div>\n    </div>\n  ",
                        styles: [
                            "\n      :host {\n        display: block;\n      }\n\n      /* fix for tooltip trigger styles forcing a 1rem font size (???) */\n      .iot--date-time-picker__box {\n        font-size: inherit;\n      }\n    ",
                        ],
                    }]
            }], function () { return [{ type: i0.ElementRef }, { type: i1$2.I18n }]; }, { wrapper: [{
                    type: i0.HostBinding,
                    args: ['class.iot--date-time-picker__wrapper']
                }], dateTimeRanges: [{
                    type: i0.Input
                }], language: [{
                    type: i0.Input
                }], selected: [{
                    type: i0.Input
                }], hasRelative: [{
                    type: i0.Input
                }], hasAbsolute: [{
                    type: i0.Input
                }], theme: [{
                    type: i0.Input
                }], placeholder: [{
                    type: i0.Input
                }], dateFormat: [{
                    type: i0.Input
                }], flatpickrOptions: [{
                    type: i0.Input
                }], batchText: [{
                    type: i0.Input
                }], relativeToOptions: [{
                    type: i0.Input
                }], selectedChange: [{
                    type: i0.Output
                }], apply: [{
                    type: i0.Output
                }], cancel: [{
                    type: i0.Output
                }] });
    })();

    var DateTimeAbsoluteComponent = /** @class */ (function () {
        function DateTimeAbsoluteComponent() {
            this.startTime = '00:00';
            this.endTime = '23:59';
            this.dateRange = null;
            this.value = [];
            this.dateFormat = 'Y-m-d';
            this.placeholder = 'yyyy-mm-dd';
            this.valueChange = new i0.EventEmitter();
        }
        DateTimeAbsoluteComponent.prototype.ngOnChanges = function (changes) {
            var _a;
            if ((_a = changes === null || changes === void 0 ? void 0 : changes.value) === null || _a === void 0 ? void 0 : _a.currentValue) {
                var _b = __read(changes.value.currentValue, 2), start = _b[0], end = _b[1];
                if (!start || !end) {
                    return;
                }
                this.dateRange = [start, end];
                var formatString = 'HH:mm';
                this.startTime = dateFns.format(start, formatString);
                this.endTime = dateFns.format(end, formatString);
            }
        };
        DateTimeAbsoluteComponent.prototype.onChange = function () {
            if (!this.dateRange) {
                return;
            }
            var _b = __read(this.startTime.split(':'), 2), startHourStr = _b[0], startMinStr = _b[1];
            var _c = __read(this.endTime.split(':'), 2), endHourStr = _c[0], endMinStr = _c[1];
            var startHour = parseInt(startHourStr, 10);
            var startMin = parseInt(startMinStr, 10);
            var endHour = parseInt(endHourStr, 10);
            var endMin = parseInt(endMinStr, 10);
            var _d = __read(this.dateRange, 2), startDate = _d[0], endDate = _d[1];
            var startDateTime = dateFns.setMinutes(dateFns.setHours(startDate, startHour), startMin);
            var endDateTime = dateFns.setMinutes(dateFns.setHours(endDate, endHour), endMin);
            this.valueChange.emit([startDateTime, endDateTime]);
        };
        return DateTimeAbsoluteComponent;
    }());
    DateTimeAbsoluteComponent.ɵfac = function DateTimeAbsoluteComponent_Factory(t) { return new (t || DateTimeAbsoluteComponent)(); };
    DateTimeAbsoluteComponent.ɵcmp = i0.ɵɵdefineComponent({ type: DateTimeAbsoluteComponent, selectors: [["ai-date-time-absolute"]], inputs: { value: "value", batchText: "batchText", dateFormat: "dateFormat", placeholder: "placeholder", flatpickrOptions: "flatpickrOptions" }, outputs: { valueChange: "valueChange" }, features: [i0.ɵɵNgOnChangesFeature], decls: 13, vars: 11, consts: [[1, "bx--fieldset", "iot--date-time-picker__menu-formgroup", 2, "padding", "0 0.9rem"], [1, "bx--form-item"], ["theme", "light", 3, "range", "label", "rangeLabel", "dateFormat", "ngModel", "placeholder", "flatpickrOptions", "ngModelChange", "valueChange"], [1, "bx--fieldset", "iot--date-time-picker__menu-formgroup"], [1, "iot--date-time-picker__fields-wrapper"], [1, "bx--form-item", 2, "margin-right", "1rem"], [1, "bx--label"], ["ibmText", "", "type", "time", "theme", "light", 3, "ngModel", "ngModelChange", "change"]], template: function DateTimeAbsoluteComponent_Template(rf, ctx) {
            if (rf & 1) {
                i0.ɵɵelementStart(0, "fieldset", 0);
                i0.ɵɵelementStart(1, "div", 1);
                i0.ɵɵelementStart(2, "ibm-date-picker", 2);
                i0.ɵɵlistener("ngModelChange", function DateTimeAbsoluteComponent_Template_ibm_date_picker_ngModelChange_2_listener($event) { return ctx.dateRange = $event; })("valueChange", function DateTimeAbsoluteComponent_Template_ibm_date_picker_valueChange_2_listener() { return ctx.onChange(); });
                i0.ɵɵelementEnd();
                i0.ɵɵelementEnd();
                i0.ɵɵelementEnd();
                i0.ɵɵelementStart(3, "fieldset", 3);
                i0.ɵɵelementStart(4, "div", 4);
                i0.ɵɵelementStart(5, "div", 5);
                i0.ɵɵelementStart(6, "label", 6);
                i0.ɵɵtext(7);
                i0.ɵɵelementEnd();
                i0.ɵɵelementStart(8, "input", 7);
                i0.ɵɵlistener("ngModelChange", function DateTimeAbsoluteComponent_Template_input_ngModelChange_8_listener($event) { return ctx.startTime = $event; })("change", function DateTimeAbsoluteComponent_Template_input_change_8_listener() { return ctx.onChange(); });
                i0.ɵɵelementEnd();
                i0.ɵɵelementEnd();
                i0.ɵɵelementStart(9, "div", 1);
                i0.ɵɵelementStart(10, "label", 6);
                i0.ɵɵtext(11);
                i0.ɵɵelementEnd();
                i0.ɵɵelementStart(12, "input", 7);
                i0.ɵɵlistener("ngModelChange", function DateTimeAbsoluteComponent_Template_input_ngModelChange_12_listener($event) { return ctx.endTime = $event; })("change", function DateTimeAbsoluteComponent_Template_input_change_12_listener() { return ctx.onChange(); });
                i0.ɵɵelementEnd();
                i0.ɵɵelementEnd();
                i0.ɵɵelementEnd();
                i0.ɵɵelementEnd();
            }
            if (rf & 2) {
                i0.ɵɵadvance(2);
                i0.ɵɵproperty("range", true)("label", ctx.batchText.START_DATE)("rangeLabel", ctx.batchText.END_DATE)("dateFormat", ctx.dateFormat)("ngModel", ctx.dateRange)("placeholder", ctx.placeholder)("flatpickrOptions", ctx.flatpickrOptions);
                i0.ɵɵadvance(5);
                i0.ɵɵtextInterpolate(ctx.batchText.START_TIME);
                i0.ɵɵadvance(1);
                i0.ɵɵproperty("ngModel", ctx.startTime);
                i0.ɵɵadvance(3);
                i0.ɵɵtextInterpolate(ctx.batchText.END_TIME);
                i0.ɵɵadvance(1);
                i0.ɵɵproperty("ngModel", ctx.endTime);
            }
        }, directives: [i1.DatePicker, i2.NgControlStatus, i2.NgModel, i2.DefaultValueAccessor, i1.TextInput], styles: [".iot--date-time-picker__wrapper .bx--date-picker-container {\n        opacity: 1;\n      }\n\n       \n        .iot--date-time-picker__wrapper\n        .bx--date-picker--range\n        > .bx--date-picker-container:first-child {\n        margin-right: 0;\n      }\n\n        .iot--date-time-picker__wrapper .bx--date-picker--range {\n        position: initial;\n      }\n\n        .iot--date-time-picker__wrapper .bx--date-picker-input__wrapper {\n        max-width: 137px;\n      }\n\n        .iot--date-time-picker__wrapper .bx--date-picker__input {\n        width: 100%;\n      }\n\n      \n       \n        .iot--date-time-picker__wrapper\n        .bx--date-picker--range\n        .bx--date-picker-container:first-child\n        ibm-date-picker-input {\n        margin-right: 16px;\n        width: 137px;\n      }"] });
    (function () {
        (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DateTimeAbsoluteComponent, [{
                type: i0.Component,
                args: [{
                        selector: 'ai-date-time-absolute',
                        template: "\n    <fieldset class=\"bx--fieldset iot--date-time-picker__menu-formgroup\" style=\"padding: 0 0.9rem;\">\n      <div class=\"bx--form-item\">\n        <ibm-date-picker\n          [range]=\"true\"\n          [label]=\"batchText.START_DATE\"\n          [rangeLabel]=\"batchText.END_DATE\"\n          [dateFormat]=\"dateFormat\"\n          [(ngModel)]=\"dateRange\"\n          [placeholder]=\"placeholder\"\n          [flatpickrOptions]=\"flatpickrOptions\"\n          (valueChange)=\"onChange()\"\n          theme=\"light\"\n        >\n        </ibm-date-picker>\n      </div>\n    </fieldset>\n    <fieldset class=\"bx--fieldset iot--date-time-picker__menu-formgroup\">\n      <div class=\"iot--date-time-picker__fields-wrapper\">\n        <!-- tmp until we can implement a better time selector -->\n        <div class=\"bx--form-item\" style=\"margin-right: 1rem\">\n          <label class=\"bx--label\">{{ batchText.START_TIME }}</label>\n          <input ibmText type=\"time\" [(ngModel)]=\"startTime\" (change)=\"onChange()\" theme=\"light\" />\n        </div>\n        <!-- tmp until we can implement a better time selector -->\n        <div class=\"bx--form-item\">\n          <label class=\"bx--label\">{{ batchText.END_TIME }}</label>\n          <input ibmText type=\"time\" [(ngModel)]=\"endTime\" (change)=\"onChange()\" theme=\"light\" />\n        </div>\n      </div>\n    </fieldset>\n  ",
                        styles: [
                            "\n      /*\n        all of this is a bunch of gross styling hacks until we can settle on a reasonable\n        UX decision for the range picker. By default react forces the picker open, which\n        totally breaks the interaction for re-selecting dates. We also need to fix the HTML\n        structure upstream as we can't apply the right spacing (easily) due to the duplication\n        of classes at multiple levels of the underlying datepicker.\n      */\n      ::ng-deep .iot--date-time-picker__wrapper .bx--date-picker-container {\n        opacity: 1;\n      }\n\n      ::ng-deep\n        .iot--date-time-picker__wrapper\n        .bx--date-picker--range\n        > .bx--date-picker-container:first-child {\n        margin-right: 0;\n      }\n\n      ::ng-deep .iot--date-time-picker__wrapper .bx--date-picker--range {\n        position: initial;\n      }\n\n      ::ng-deep .iot--date-time-picker__wrapper .bx--date-picker-input__wrapper {\n        max-width: 137px;\n      }\n\n      ::ng-deep .iot--date-time-picker__wrapper .bx--date-picker__input {\n        width: 100%;\n      }\n\n      /* we do this since there's only one level of ibm-date-picker-input. the other wrapper classes are duplicated */\n      ::ng-deep\n        .iot--date-time-picker__wrapper\n        .bx--date-picker--range\n        .bx--date-picker-container:first-child\n        ibm-date-picker-input {\n        margin-right: 16px;\n        width: 137px;\n      }\n    ",
                        ],
                    }]
            }], null, { value: [{
                    type: i0.Input
                }], batchText: [{
                    type: i0.Input
                }], dateFormat: [{
                    type: i0.Input
                }], placeholder: [{
                    type: i0.Input
                }], flatpickrOptions: [{
                    type: i0.Input
                }], valueChange: [{
                    type: i0.Output
                }] });
    })();

    function CustomDateTimeComponent_div_0_Template(rf, ctx) {
        if (rf & 1) {
            var _r4_1 = i0.ɵɵgetCurrentView();
            i0.ɵɵelementStart(0, "div", 3);
            i0.ɵɵelementStart(1, "fieldset", 4);
            i0.ɵɵelementStart(2, "legend", 5);
            i0.ɵɵtext(3);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(4, "ibm-radio-group", 6);
            i0.ɵɵlistener("ngModelChange", function CustomDateTimeComponent_div_0_Template_ibm_radio_group_ngModelChange_4_listener($event) { i0.ɵɵrestoreView(_r4_1); var ctx_r3 = i0.ɵɵnextContext(); return ctx_r3.mode = $event; });
            i0.ɵɵelementStart(5, "ibm-radio", 7);
            i0.ɵɵtext(6);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(7, "ibm-radio", 8);
            i0.ɵɵtext(8);
            i0.ɵɵelementEnd();
            i0.ɵɵelementEnd();
            i0.ɵɵelementEnd();
            i0.ɵɵelementEnd();
        }
        if (rf & 2) {
            var ctx_r0 = i0.ɵɵnextContext();
            i0.ɵɵadvance(3);
            i0.ɵɵtextInterpolate(ctx_r0.batchText.CUSTOM_RANGE);
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngModel", ctx_r0.mode);
            i0.ɵɵadvance(2);
            i0.ɵɵtextInterpolate(ctx_r0.batchText.RELATIVE);
            i0.ɵɵadvance(2);
            i0.ɵɵtextInterpolate(ctx_r0.batchText.ABSOLUTE);
        }
    }
    function CustomDateTimeComponent_ai_date_time_relative_1_Template(rf, ctx) {
        if (rf & 1) {
            var _r6_1 = i0.ɵɵgetCurrentView();
            i0.ɵɵelementStart(0, "ai-date-time-relative", 9);
            i0.ɵɵlistener("valueChange", function CustomDateTimeComponent_ai_date_time_relative_1_Template_ai_date_time_relative_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r6_1); var ctx_r5 = i0.ɵɵnextContext(); return ctx_r5.relativeChange($event); });
            i0.ɵɵelementEnd();
        }
        if (rf & 2) {
            var ctx_r1 = i0.ɵɵnextContext();
            i0.ɵɵproperty("value", ctx_r1.value)("batchText", ctx_r1.batchText)("relativeToOptions", ctx_r1.relativeToOptions);
        }
    }
    function CustomDateTimeComponent_ai_date_time_absolute_2_Template(rf, ctx) {
        if (rf & 1) {
            var _r8_1 = i0.ɵɵgetCurrentView();
            i0.ɵɵelementStart(0, "ai-date-time-absolute", 10);
            i0.ɵɵlistener("valueChange", function CustomDateTimeComponent_ai_date_time_absolute_2_Template_ai_date_time_absolute_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r8_1); var ctx_r7 = i0.ɵɵnextContext(); return ctx_r7.absoluteChange($event); });
            i0.ɵɵelementEnd();
        }
        if (rf & 2) {
            var ctx_r2 = i0.ɵɵnextContext();
            i0.ɵɵproperty("value", ctx_r2.value)("batchText", ctx_r2.batchText)("dateFormat", ctx_r2.dateFormat)("placeholder", ctx_r2.placeholder)("flatpickrOptions", ctx_r2.flatpickrOptions);
        }
    }
    var CustomDateTimeComponent = /** @class */ (function () {
        function CustomDateTimeComponent() {
            this.mode = 'relative';
            this.value = [];
            this.range = null;
            this.hasRelative = true;
            this.hasAbsolute = true;
            /**
             * Format of date
             *
             * For reference: https://flatpickr.js.org/formatting/
             */
            this.dateFormat = 'Y-m-d';
            this.placeholder = 'yyyy-mm-dd';
            this.rangeChange = new i0.EventEmitter();
            this.wrapperClass = true;
        }
        CustomDateTimeComponent.prototype.ngOnChanges = function (changes) {
            var _a, _b, _c;
            if ((_a = changes === null || changes === void 0 ? void 0 : changes.range) === null || _a === void 0 ? void 0 : _a.currentValue) {
                var _d = __read(changes.range.currentValue, 4), type = _d[0], start = _d[1], end = _d[2], relativeConfig = _d[3];
                if (type === 'RELATIVE') {
                    this.mode = 'relative';
                    this.value = [start, end, relativeConfig];
                }
                if (type === 'ABSOLUTE') {
                    this.mode = 'absolute';
                    this.value = [start, end];
                }
            }
            if (((_b = changes === null || changes === void 0 ? void 0 : changes.hasRelative) === null || _b === void 0 ? void 0 : _b.currentValue) === false) {
                this.mode = 'absolute';
            }
            if (((_c = changes === null || changes === void 0 ? void 0 : changes.hasAbsolute) === null || _c === void 0 ? void 0 : _c.currentValue) === false) {
                this.mode = 'relative';
            }
        };
        CustomDateTimeComponent.prototype.relativeChange = function (change) {
            this.rangeChange.emit(__spread(['RELATIVE'], change));
        };
        CustomDateTimeComponent.prototype.absoluteChange = function (change) {
            this.rangeChange.emit(__spread(['ABSOLUTE'], change));
        };
        return CustomDateTimeComponent;
    }());
    CustomDateTimeComponent.ɵfac = function CustomDateTimeComponent_Factory(t) { return new (t || CustomDateTimeComponent)(); };
    CustomDateTimeComponent.ɵcmp = i0.ɵɵdefineComponent({ type: CustomDateTimeComponent, selectors: [["ai-custom-date-time"]], hostVars: 2, hostBindings: function CustomDateTimeComponent_HostBindings(rf, ctx) {
            if (rf & 2) {
                i0.ɵɵclassProp("iot--date-time-picker__custom-wrapper", ctx.wrapperClass);
            }
        }, inputs: { range: "range", hasRelative: "hasRelative", hasAbsolute: "hasAbsolute", batchText: "batchText", dateFormat: "dateFormat", placeholder: "placeholder", relativeToOptions: "relativeToOptions", flatpickrOptions: "flatpickrOptions" }, outputs: { rangeChange: "rangeChange" }, features: [i0.ɵɵNgOnChangesFeature], decls: 3, vars: 3, consts: [["class", "bx--form-item", 4, "ngIf"], [3, "value", "batchText", "relativeToOptions", "valueChange", 4, "ngIf"], [3, "value", "batchText", "dateFormat", "placeholder", "flatpickrOptions", "valueChange", 4, "ngIf"], [1, "bx--form-item"], [1, "bx--fieldset"], [1, "bx--label"], [3, "ngModel", "ngModelChange"], ["value", "relative"], ["value", "absolute"], [3, "value", "batchText", "relativeToOptions", "valueChange"], [3, "value", "batchText", "dateFormat", "placeholder", "flatpickrOptions", "valueChange"]], template: function CustomDateTimeComponent_Template(rf, ctx) {
            if (rf & 1) {
                i0.ɵɵtemplate(0, CustomDateTimeComponent_div_0_Template, 9, 4, "div", 0);
                i0.ɵɵtemplate(1, CustomDateTimeComponent_ai_date_time_relative_1_Template, 1, 3, "ai-date-time-relative", 1);
                i0.ɵɵtemplate(2, CustomDateTimeComponent_ai_date_time_absolute_2_Template, 1, 5, "ai-date-time-absolute", 2);
            }
            if (rf & 2) {
                i0.ɵɵproperty("ngIf", ctx.hasRelative && ctx.hasAbsolute);
                i0.ɵɵadvance(1);
                i0.ɵɵproperty("ngIf", ctx.mode === "relative" && ctx.hasRelative);
                i0.ɵɵadvance(1);
                i0.ɵɵproperty("ngIf", ctx.mode === "absolute" && ctx.hasAbsolute);
            }
        }, directives: [i1$1.NgIf, i1.RadioGroup, i2.NgControlStatus, i2.NgModel, i1.Radio, DateTimeRelativeComponent, DateTimeAbsoluteComponent], styles: ["[_nghost-%COMP%] {\n        display: block;\n      }"] });
    (function () {
        (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CustomDateTimeComponent, [{
                type: i0.Component,
                args: [{
                        selector: 'ai-custom-date-time',
                        template: "\n    <div class=\"bx--form-item\" *ngIf=\"hasRelative && hasAbsolute\">\n      <fieldset class=\"bx--fieldset\">\n        <legend class=\"bx--label\">{{ batchText.CUSTOM_RANGE }}</legend>\n        <ibm-radio-group [(ngModel)]=\"mode\">\n          <ibm-radio value=\"relative\">{{ batchText.RELATIVE }}</ibm-radio>\n          <ibm-radio value=\"absolute\">{{ batchText.ABSOLUTE }}</ibm-radio>\n        </ibm-radio-group>\n      </fieldset>\n    </div>\n    <!-- relative picker -->\n    <ai-date-time-relative\n      *ngIf=\"mode === 'relative' && hasRelative\"\n      (valueChange)=\"relativeChange($event)\"\n      [value]=\"value\"\n      [batchText]=\"batchText\"\n      [relativeToOptions]=\"relativeToOptions\"\n    >\n    </ai-date-time-relative>\n    <ai-date-time-absolute\n      *ngIf=\"mode === 'absolute' && hasAbsolute\"\n      (valueChange)=\"absoluteChange($event)\"\n      [value]=\"value\"\n      [batchText]=\"batchText\"\n      [dateFormat]=\"dateFormat\"\n      [placeholder]=\"placeholder\"\n      [flatpickrOptions]=\"flatpickrOptions\"\n    >\n    </ai-date-time-absolute>\n  ",
                        styles: [
                            "\n      :host {\n        display: block;\n      }\n    ",
                        ],
                    }]
            }], null, { range: [{
                    type: i0.Input
                }], hasRelative: [{
                    type: i0.Input
                }], hasAbsolute: [{
                    type: i0.Input
                }], batchText: [{
                    type: i0.Input
                }], dateFormat: [{
                    type: i0.Input
                }], placeholder: [{
                    type: i0.Input
                }], relativeToOptions: [{
                    type: i0.Input
                }], flatpickrOptions: [{
                    type: i0.Input
                }], rangeChange: [{
                    type: i0.Output
                }], wrapperClass: [{
                    type: i0.HostBinding,
                    args: ['class.iot--date-time-picker__custom-wrapper']
                }] });
    })();

    var DateTimePickerModule = /** @class */ (function () {
        function DateTimePickerModule() {
        }
        return DateTimePickerModule;
    }());
    DateTimePickerModule.ɵmod = i0.ɵɵdefineNgModule({ type: DateTimePickerModule });
    DateTimePickerModule.ɵinj = i0.ɵɵdefineInjector({ factory: function DateTimePickerModule_Factory(t) { return new (t || DateTimePickerModule)(); }, imports: [[
                i1$1.CommonModule,
                i2.FormsModule,
                i1.ButtonModule,
                i1.RadioModule,
                i1.SelectModule,
                i1.NumberModule,
                i1.TimePickerModule,
                i1.TimePickerSelectModule,
                i1.InputModule,
                i1.DatePickerModule,
                i1.I18nModule,
                i1.IconModule,
                i1.DialogModule,
            ]] });
    (function () {
        (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(DateTimePickerModule, { declarations: [DateTimePickerComponent,
                CustomDateTimeComponent,
                DateTimeAbsoluteComponent,
                DateTimeRelativeComponent], imports: [i1$1.CommonModule,
                i2.FormsModule,
                i1.ButtonModule,
                i1.RadioModule,
                i1.SelectModule,
                i1.NumberModule,
                i1.TimePickerModule,
                i1.TimePickerSelectModule,
                i1.InputModule,
                i1.DatePickerModule,
                i1.I18nModule,
                i1.IconModule,
                i1.DialogModule], exports: [DateTimePickerComponent,
                CustomDateTimeComponent,
                DateTimeAbsoluteComponent,
                DateTimeRelativeComponent] });
    })();
    (function () {
        (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DateTimePickerModule, [{
                type: i0.NgModule,
                args: [{
                        declarations: [
                            DateTimePickerComponent,
                            CustomDateTimeComponent,
                            DateTimeAbsoluteComponent,
                            DateTimeRelativeComponent,
                        ],
                        exports: [
                            DateTimePickerComponent,
                            CustomDateTimeComponent,
                            DateTimeAbsoluteComponent,
                            DateTimeRelativeComponent,
                        ],
                        imports: [
                            i1$1.CommonModule,
                            i2.FormsModule,
                            i1.ButtonModule,
                            i1.RadioModule,
                            i1.SelectModule,
                            i1.NumberModule,
                            i1.TimePickerModule,
                            i1.TimePickerSelectModule,
                            i1.InputModule,
                            i1.DatePickerModule,
                            i1.I18nModule,
                            i1.IconModule,
                            i1.DialogModule,
                        ],
                    }]
            }], null, null);
    })();
    i0.ɵɵsetComponentScope(DateTimePickerComponent, [i1$1.NgClass, i1.TooltipDirective, i1.IconDirective, i1$1.NgIf, i1$1.NgForOf, CustomDateTimeComponent, i1.Button], []);

    /**
     * Generated bundle index. Do not edit.
     */

    exports.CustomDateTimeComponent = CustomDateTimeComponent;
    exports.DateTimeAbsoluteComponent = DateTimeAbsoluteComponent;
    exports.DateTimePickerComponent = DateTimePickerComponent;
    exports.DateTimePickerModule = DateTimePickerModule;
    exports.DateTimeRelativeComponent = DateTimeRelativeComponent;

    Object.defineProperty(exports, '__esModule', { value: true });

})));
//# sourceMappingURL=ai-apps-angular-date-time-picker.umd.js.map
