var __decorate = (this && this.__decorate) || function (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;
};
import { h, Host, } from "@stencil/core";
import { isSpaceKey } from "@baloise/web-app-utils";
import { autoUpdate, computePosition, flip, offset } from "@floating-ui/dom";
import { i18nBalDate } from "./bal-date.i18n";
import { BEM } from "../../utils/bem";
import { Logger } from "../../utils/log";
import { BalDate } from "../../utils/date";
import { inheritAttributes } from "../../utils/attributes";
import { stopEventBubbling } from "../../utils/form-input";
import { ListenToConfig, defaultConfig } from "../../utils/config";
import { debounceEvent } from "../../utils/helpers";
import { defaultBalAriaForm } from "../../utils/form";
export class Date {
  constructor() {
    this.inputId = `bal-da-${dateIds++}`;
    this.inheritedAttributes = {};
    this.onIconClick = async (_ev) => {
      if (this.triggerIcon) {
        await this.toggle();
      }
      else {
        await this.open();
      }
    };
    this.onInputClick = async (_ev) => {
      if (!this.triggerIcon) {
        await this.open();
      }
    };
    this.onCalendarChange = (ev) => {
      stopEventBubbling(ev);
      this.value = ev.detail;
      this.balChange.emit(this.value);
      if (this.closeOnSelect) {
        this.close();
      }
    };
    this.onInputInput = (ev) => {
      stopEventBubbling(ev);
      this.balInput.emit(ev.detail);
      if (ev.detail) {
        const date = BalDate.fromAnyFormat(ev.detail);
        if (date.isValid) {
          this.calendarValue = date.toISODate();
        }
      }
    };
    this.onInputChange = (ev) => {
      stopEventBubbling(ev);
      this.value = ev.detail;
      this.balChange.emit(this.value);
    };
    this.onInputFocus = (ev) => {
      stopEventBubbling(ev);
      this.balFocus.emit(ev.detail);
    };
    this.onInputBlur = (ev) => {
      stopEventBubbling(ev);
      this.balBlur.emit(ev.detail);
    };
    this.onKeyPress = async ({ detail }) => {
      if (isSpaceKey(detail) && !this.triggerIcon) {
        if (this.isExpanded) {
          await this.close();
        }
        else {
          await this.open();
        }
      }
    };
    this.isExpanded = false;
    this.language = defaultConfig.language;
    this.calendarValue = undefined;
    this.ariaForm = defaultBalAriaForm;
    this.name = this.inputId;
    this.invalid = false;
    this.required = false;
    this.disabled = false;
    this.readonly = false;
    this.freeSolo = false;
    this.placeholder = undefined;
    this.triggerIcon = false;
    this.closeOnSelect = true;
    this.value = undefined;
    this.min = undefined;
    this.max = undefined;
    this.minYearProp = undefined;
    this.maxYearProp = undefined;
    this.defaultDate = undefined;
    this.allowedDates = undefined;
    this.debounce = 0;
  }
  createLogger(log) {
    this.log = log;
  }
  valueChanged() {
    this.calendarValue = this.value;
  }
  debounceChanged() {
    this.balChange = debounceEvent(this.balChange, this.debounce);
  }
  connectedCallback() {
    this.valueChanged();
  }
  componentWillLoad() {
    this.inheritedAttributes = inheritAttributes(this.el, ['aria-label', 'tabindex', 'title']);
  }
  async listenToKeydown(ev) {
    if (this.isExpanded && (ev.key === 'Escape' || ev.key === 'Esc')) {
      ev.preventDefault();
      await this.close();
    }
  }
  async listenOnKeyup(ev) {
    if (ev.key === 'Tab' && !this.el.contains(document.activeElement) && this.isExpanded) {
      await this.close();
    }
  }
  async listenOnclick(ev) {
    if (this.isExpanded && !this.el.contains(ev.target)) {
      await this.close();
    }
  }
  async listenOnPopoverPrepare(ev) {
    if (this.inputId !== ev.detail) {
      await this.close();
    }
  }
  async configChanged(state) {
    this.language = state.language;
  }
  async open() {
    return this.expand();
  }
  async close() {
    return this.collapse();
  }
  async toggle() {
    if (this.isExpanded) {
      return this.collapse();
    }
    else {
      return this.expand();
    }
  }
  async select(dateString) {
    const date = BalDate.fromISO(dateString);
    if (date.isValid) {
      this.value = date.toISODate();
      this.calendarValue = this.value;
    }
  }
  async setFocus() {
    var _a;
    (_a = this.inputEl) === null || _a === void 0 ? void 0 : _a.setFocus();
  }
  async setBlur() {
    var _a;
    (_a = this.inputEl) === null || _a === void 0 ? void 0 : _a.setBlur();
  }
  async getInputElement() {
    var _a;
    return (_a = this.inputEl) === null || _a === void 0 ? void 0 : _a.getInputElement();
  }
  async setAriaForm(ariaForm) {
    var _a;
    this.ariaForm = Object.assign({}, ariaForm);
    (_a = this.inputEl) === null || _a === void 0 ? void 0 : _a.setAriaForm(ariaForm);
  }
  async expand() {
    if (this.referenceEl && this.floatingEl) {
      this.balPopoverPrepare.emit(this.inputId);
      this.balWillAnimate.emit();
      this.isExpanded = true;
      this.popupCleanup = autoUpdate(this.referenceEl, this.floatingEl, () => {
        this.updatePosition(this.referenceEl, this.floatingEl);
      });
    }
    return this.isExpanded;
  }
  async collapse() {
    if (this.floatingEl) {
      this.balWillAnimate.emit();
      this.isExpanded = false;
      if (this.popupCleanup) {
        this.popupCleanup();
      }
      this.balDidAnimate.emit();
    }
    return this.isExpanded;
  }
  updatePosition(referenceEl, floatingEl) {
    computePosition(referenceEl, floatingEl, {
      placement: 'bottom-start',
      middleware: [offset(4), flip({ crossAxis: false })],
    }).then(({ x, y }) => {
      Object.assign(floatingEl.style, {
        left: `${x}px`,
        top: `${y}px`,
      });
      this.balDidAnimate.emit();
    });
  }
  render() {
    const block = BEM.block('date');
    const blockIcon = block.element('icon');
    const blockPopup = block.element('popup');
    return (h(Host, { id: this.inputId, class: Object.assign({}, block.class()) }, h("bal-input-group", { invalid: this.invalid, readonly: this.readonly, disabled: this.disabled, ref: el => (this.referenceEl = el) }, h("bal-input-date", Object.assign({ name: this.name, required: this.required, placeholder: this.placeholder, value: this.value, min: this.min, max: this.max, invalid: this.invalid, readonly: this.readonly, disabled: this.disabled, onClick: this.onInputClick, onBalInput: this.onInputInput, onBalChange: this.onInputChange, onBalFocus: this.onInputFocus, onBalBlur: this.onInputBlur, onBalKeyPress: this.onKeyPress, ref: el => (this.inputEl = el) }, this.inheritedAttributes)), !this.freeSolo ? (h("bal-icon", { name: "date", role: "button", tabindex: -1, class: Object.assign(Object.assign({}, blockIcon.class()), blockIcon.modifier('clickable').class(!this.disabled && !this.readonly)), "is-right": true, color: this.disabled || this.readonly ? 'grey' : this.invalid ? 'danger' : 'primary', onClick: this.onIconClick, "aria-label": i18nBalDate[this.language].toggleDatepicker, "aria-haspopup": "true", "aria-expanded": this.isExpanded ? 'true' : 'false' })) : ('')), h("div", { role: "dialog", class: Object.assign(Object.assign({}, blockPopup.class()), blockPopup.modifier('visible').class(this.isExpanded)), ref: el => (this.floatingEl = el), "aria-hidden": `${this.isExpanded !== true}`, "aria-presented": `${this.isExpanded === true}` }, h("bal-date-calendar", { value: this.calendarValue, min: this.min, max: this.max, minYearProp: this.minYearProp, maxYearProp: this.maxYearProp, defaultDate: this.defaultDate, allowedDates: this.allowedDates, onBalChange: this.onCalendarChange }))));
  }
  static get is() { return "bal-date"; }
  static get originalStyleUrls() {
    return {
      "$": ["bal-date.sass"]
    };
  }
  static get styleUrls() {
    return {
      "$": ["bal-date.css"]
    };
  }
  static get properties() {
    return {
      "name": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "The name of the control, which is submitted with the form data."
        },
        "attribute": "name",
        "reflect": false,
        "defaultValue": "this.inputId"
      },
      "invalid": {
        "type": "boolean",
        "mutable": false,
        "complexType": {
          "original": "boolean",
          "resolved": "boolean",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "If `true` the component gets a invalid style."
        },
        "attribute": "invalid",
        "reflect": false,
        "defaultValue": "false"
      },
      "required": {
        "type": "boolean",
        "mutable": false,
        "complexType": {
          "original": "boolean",
          "resolved": "boolean",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "If `true` the attribute required is added to the native input."
        },
        "attribute": "required",
        "reflect": false,
        "defaultValue": "false"
      },
      "disabled": {
        "type": "boolean",
        "mutable": false,
        "complexType": {
          "original": "boolean",
          "resolved": "boolean",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "If `true`, the element is not mutable, focusable, or even submitted with the form. The user can neither edit nor focus on the control, nor its form control descendants."
        },
        "attribute": "disabled",
        "reflect": false,
        "defaultValue": "false"
      },
      "readonly": {
        "type": "boolean",
        "mutable": false,
        "complexType": {
          "original": "boolean",
          "resolved": "boolean",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "If `true` the element can not mutated, meaning the user can not edit the control."
        },
        "attribute": "readonly",
        "reflect": false,
        "defaultValue": "false"
      },
      "freeSolo": {
        "type": "boolean",
        "mutable": false,
        "complexType": {
          "original": "boolean",
          "resolved": "boolean",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "If `true` there will be on trigger icon visible"
        },
        "attribute": "free-solo",
        "reflect": false,
        "defaultValue": "false"
      },
      "placeholder": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string | undefined",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "The text to display when the select is empty."
        },
        "attribute": "placeholder",
        "reflect": false
      },
      "triggerIcon": {
        "type": "boolean",
        "mutable": false,
        "complexType": {
          "original": "boolean",
          "resolved": "boolean",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "If `true` the datepicker only open on click of the icon"
        },
        "attribute": "trigger-icon",
        "reflect": false,
        "defaultValue": "false"
      },
      "closeOnSelect": {
        "type": "boolean",
        "mutable": false,
        "complexType": {
          "original": "boolean",
          "resolved": "boolean",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "Closes the datepicker popover after selection"
        },
        "attribute": "close-on-select",
        "reflect": false,
        "defaultValue": "true"
      },
      "value": {
        "type": "string",
        "mutable": true,
        "complexType": {
          "original": "string | undefined",
          "resolved": "string | undefined",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "The value of the form field, which accepts ISO 8601 date strings (YYYY-MM-DD)."
        },
        "attribute": "value",
        "reflect": false,
        "defaultValue": "undefined"
      },
      "min": {
        "type": "string",
        "mutable": true,
        "complexType": {
          "original": "string",
          "resolved": "string | undefined",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "The minimum datetime allowed. Value must be a date string\nfollowing the\n[ISO 8601 datetime format standard](https://www.w3.org/TR/NOTE-datetime),\nsuch as `1996-12-19`. The format does not have to be specific to an exact\ndatetime. For example, the minimum could just be the year, such as `1994`.\nDefaults to the beginning of the year, 100 years ago from today."
        },
        "attribute": "min",
        "reflect": false
      },
      "max": {
        "type": "string",
        "mutable": true,
        "complexType": {
          "original": "string",
          "resolved": "string | undefined",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "The maximum datetime allowed. Value must be a date string\nfollowing the\n[ISO 8601 datetime format standard](https://www.w3.org/TR/NOTE-datetime),\n`1996-12-19`. The format does not have to be specific to an exact\ndatetime. For example, the maximum could just be the year, such as `1994`.\nDefaults to the end of this year."
        },
        "attribute": "max",
        "reflect": false
      },
      "minYearProp": {
        "type": "number",
        "mutable": false,
        "complexType": {
          "original": "number",
          "resolved": "number | undefined",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "Earliest year available for selection"
        },
        "attribute": "min-year",
        "reflect": false
      },
      "maxYearProp": {
        "type": "number",
        "mutable": false,
        "complexType": {
          "original": "number",
          "resolved": "number | undefined",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "Latest year available for selection"
        },
        "attribute": "max-year",
        "reflect": false
      },
      "defaultDate": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string | undefined",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "The date to defines where the datepicker popup starts. The prop accepts ISO 8601 date strings (YYYY-MM-DD)."
        },
        "attribute": "default-date",
        "reflect": false
      },
      "allowedDates": {
        "type": "unknown",
        "mutable": false,
        "complexType": {
          "original": "BalProps.BalDateCallback | undefined",
          "resolved": "((dateString: string) => boolean) | undefined",
          "references": {
            "BalProps": {
              "location": "global",
              "id": "global::BalProps"
            }
          }
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "Callback to determine which date in the datepicker should be selectable."
        },
        "defaultValue": "undefined"
      },
      "debounce": {
        "type": "number",
        "mutable": false,
        "complexType": {
          "original": "number",
          "resolved": "number",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "Set the amount of time, in milliseconds, to wait to trigger the `ionChange` event after each keystroke. This also impacts form bindings such as `ngModel` or `v-model`."
        },
        "attribute": "debounce",
        "reflect": false,
        "defaultValue": "0"
      }
    };
  }
  static get states() {
    return {
      "isExpanded": {},
      "language": {},
      "calendarValue": {},
      "ariaForm": {}
    };
  }
  static get events() {
    return [{
        "method": "balInput",
        "name": "balInput",
        "bubbles": true,
        "cancelable": true,
        "composed": true,
        "docs": {
          "tags": [],
          "text": "Emitted when a keyboard input occurred."
        },
        "complexType": {
          "original": "BalEvents.BalDateInputDetail",
          "resolved": "string | undefined",
          "references": {
            "BalEvents": {
              "location": "global",
              "id": "global::BalEvents"
            }
          }
        }
      }, {
        "method": "balChange",
        "name": "balChange",
        "bubbles": true,
        "cancelable": true,
        "composed": true,
        "docs": {
          "tags": [],
          "text": "Emitted when a option got selected."
        },
        "complexType": {
          "original": "BalEvents.BalDateChangeDetail",
          "resolved": "string | undefined",
          "references": {
            "BalEvents": {
              "location": "global",
              "id": "global::BalEvents"
            }
          }
        }
      }, {
        "method": "balWillAnimate",
        "name": "balWillAnimate",
        "bubbles": true,
        "cancelable": true,
        "composed": true,
        "docs": {
          "tags": [],
          "text": "Emitted before the animation starts"
        },
        "complexType": {
          "original": "BalEvents.BalDateWillAnimateDetail",
          "resolved": "boolean",
          "references": {
            "BalEvents": {
              "location": "global",
              "id": "global::BalEvents"
            }
          }
        }
      }, {
        "method": "balDidAnimate",
        "name": "balDidAnimate",
        "bubbles": true,
        "cancelable": true,
        "composed": true,
        "docs": {
          "tags": [],
          "text": "Emitted after the animation has finished"
        },
        "complexType": {
          "original": "BalEvents.BalDateDidAnimateDetail",
          "resolved": "boolean",
          "references": {
            "BalEvents": {
              "location": "global",
              "id": "global::BalEvents"
            }
          }
        }
      }, {
        "method": "balBlur",
        "name": "balBlur",
        "bubbles": true,
        "cancelable": true,
        "composed": true,
        "docs": {
          "tags": [],
          "text": "Emitted when the input loses focus."
        },
        "complexType": {
          "original": "BalEvents.BalDateBlurDetail",
          "resolved": "FocusEvent",
          "references": {
            "BalEvents": {
              "location": "global",
              "id": "global::BalEvents"
            }
          }
        }
      }, {
        "method": "balFocus",
        "name": "balFocus",
        "bubbles": true,
        "cancelable": true,
        "composed": true,
        "docs": {
          "tags": [],
          "text": "Emitted when the input has focus."
        },
        "complexType": {
          "original": "BalEvents.BalDateFocusDetail",
          "resolved": "FocusEvent",
          "references": {
            "BalEvents": {
              "location": "global",
              "id": "global::BalEvents"
            }
          }
        }
      }, {
        "method": "balInputClick",
        "name": "balInputClick",
        "bubbles": true,
        "cancelable": true,
        "composed": true,
        "docs": {
          "tags": [],
          "text": "Emitted when the input has clicked."
        },
        "complexType": {
          "original": "BalEvents.BalDateInputClickDetail",
          "resolved": "MouseEvent",
          "references": {
            "BalEvents": {
              "location": "global",
              "id": "global::BalEvents"
            }
          }
        }
      }, {
        "method": "balIconClick",
        "name": "balIconClick",
        "bubbles": true,
        "cancelable": true,
        "composed": true,
        "docs": {
          "tags": [],
          "text": "Emitted when the icon has clicked."
        },
        "complexType": {
          "original": "BalEvents.BalDateIconClickDetail",
          "resolved": "MouseEvent",
          "references": {
            "BalEvents": {
              "location": "global",
              "id": "global::BalEvents"
            }
          }
        }
      }, {
        "method": "balPopoverPrepare",
        "name": "balPopoverPrepare",
        "bubbles": true,
        "cancelable": true,
        "composed": true,
        "docs": {
          "tags": [{
              "name": "internal",
              "text": "- Use this to close unused popovers."
            }],
          "text": ""
        },
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        }
      }];
  }
  static get methods() {
    return {
      "configChanged": {
        "complexType": {
          "signature": "(state: BalConfigState) => Promise<void>",
          "parameters": [{
              "tags": [],
              "text": ""
            }],
          "references": {
            "Promise": {
              "location": "global",
              "id": "global::Promise"
            },
            "BalConfigState": {
              "location": "import",
              "path": "../../utils/config",
              "id": "src/utils/config/index.ts::BalConfigState"
            }
          },
          "return": "Promise<void>"
        },
        "docs": {
          "text": "",
          "tags": [{
              "name": "internal",
              "text": "define config for the component"
            }]
        }
      },
      "open": {
        "complexType": {
          "signature": "() => Promise<boolean>",
          "parameters": [],
          "references": {
            "Promise": {
              "location": "global",
              "id": "global::Promise"
            }
          },
          "return": "Promise<boolean>"
        },
        "docs": {
          "text": "Opens the accordion",
          "tags": []
        }
      },
      "close": {
        "complexType": {
          "signature": "() => Promise<boolean>",
          "parameters": [],
          "references": {
            "Promise": {
              "location": "global",
              "id": "global::Promise"
            }
          },
          "return": "Promise<boolean>"
        },
        "docs": {
          "text": "Closes the accordion",
          "tags": []
        }
      },
      "toggle": {
        "complexType": {
          "signature": "() => Promise<boolean>",
          "parameters": [],
          "references": {
            "Promise": {
              "location": "global",
              "id": "global::Promise"
            }
          },
          "return": "Promise<boolean>"
        },
        "docs": {
          "text": "Triggers the accordion",
          "tags": []
        }
      },
      "select": {
        "complexType": {
          "signature": "(dateString: string) => Promise<void>",
          "parameters": [{
              "tags": [],
              "text": ""
            }],
          "references": {
            "Promise": {
              "location": "global",
              "id": "global::Promise"
            }
          },
          "return": "Promise<void>"
        },
        "docs": {
          "text": "Selects an option",
          "tags": []
        }
      },
      "setFocus": {
        "complexType": {
          "signature": "() => Promise<void>",
          "parameters": [],
          "references": {
            "Promise": {
              "location": "global",
              "id": "global::Promise"
            }
          },
          "return": "Promise<void>"
        },
        "docs": {
          "text": "Sets focus on the native `input` in `bal-input`. Use this method instead of the global\n`input.focus()`.",
          "tags": []
        }
      },
      "setBlur": {
        "complexType": {
          "signature": "() => Promise<void>",
          "parameters": [],
          "references": {
            "Promise": {
              "location": "global",
              "id": "global::Promise"
            }
          },
          "return": "Promise<void>"
        },
        "docs": {
          "text": "Sets blur on the native `input` in `bal-input`. Use this method instead of the global\n`input.blur()`.",
          "tags": [{
              "name": "internal",
              "text": undefined
            }]
        }
      },
      "getInputElement": {
        "complexType": {
          "signature": "() => Promise<HTMLInputElement | undefined>",
          "parameters": [],
          "references": {
            "Promise": {
              "location": "global",
              "id": "global::Promise"
            },
            "HTMLInputElement": {
              "location": "global",
              "id": "global::HTMLInputElement"
            }
          },
          "return": "Promise<HTMLInputElement | undefined>"
        },
        "docs": {
          "text": "Returns the native `<input>` element used under the hood.",
          "tags": []
        }
      },
      "setAriaForm": {
        "complexType": {
          "signature": "(ariaForm: BalAriaForm) => Promise<void>",
          "parameters": [{
              "tags": [],
              "text": ""
            }],
          "references": {
            "Promise": {
              "location": "global",
              "id": "global::Promise"
            },
            "BalAriaForm": {
              "location": "import",
              "path": "../../interfaces",
              "id": "src/interfaces.d.ts::BalAriaForm"
            }
          },
          "return": "Promise<void>"
        },
        "docs": {
          "text": "",
          "tags": [{
              "name": "internal",
              "text": undefined
            }]
        }
      }
    };
  }
  static get elementRef() { return "el"; }
  static get watchers() {
    return [{
        "propName": "value",
        "methodName": "valueChanged"
      }, {
        "propName": "debounce",
        "methodName": "debounceChanged"
      }];
  }
  static get listeners() {
    return [{
        "name": "keydown",
        "method": "listenToKeydown",
        "target": "window",
        "capture": false,
        "passive": false
      }, {
        "name": "keyup",
        "method": "listenOnKeyup",
        "target": "window",
        "capture": false,
        "passive": false
      }, {
        "name": "click",
        "method": "listenOnclick",
        "target": "document",
        "capture": false,
        "passive": false
      }, {
        "name": "balPopoverPrepare",
        "method": "listenOnPopoverPrepare",
        "target": "body",
        "capture": false,
        "passive": false
      }];
  }
}
__decorate([
  Logger('bal-date')
], Date.prototype, "createLogger", null);
__decorate([
  ListenToConfig()
], Date.prototype, "configChanged", null);
let dateIds = 0;
