text: import {
    ComboBoxDataProviderMixin,
    ComboBoxDropdown,
    ComboBoxItem,
    ComboBoxMixin,
    ComboBoxOverlay,
    ComboBoxScroller
  } from "./chunk-KAFY6EEA.js";
  import {
    PatternMixin
  } from "./chunk-5IY3DZOH.js";
  import {
    InputControlMixin,
    inputFieldShared as inputFieldShared2
  } from "./chunk-FXDBZGKI.js";
  import {
    inputFieldShared
  } from "./chunk-4YC3PK3E.js";
  import {
    InputController
  } from "./chunk-PSOWVSIC.js";
  import {
    AriaLabelController
  } from "./chunk-2QU43T3L.js";
  import {
    ElementMixin
  } from "./chunk-6TGXYB6C.js";
  import {
    ThemableMixin,
    registerStyles
  } from "./chunk-LYMUE5P7.js";
  import {
    css
  } from "./chunk-AILCGYJH.js";
  import {
    PolymerElement,
    dashToCamelCase
  } from "./chunk-YGHRZLAU.js";
  import {
    html
  } from "./chunk-5VJMXRGB.js";
  
  // node_modules/.pnpm/@vaadin/combo-box@22.0.0-beta2/node_modules/@vaadin/combo-box/src/vaadin-combo-box-light.js
  var ComboBoxLight = class extends ComboBoxDataProviderMixin(ComboBoxMixin(ThemableMixin(PolymerElement))) {
    static get is() {
      return "vaadin-combo-box-light";
    }
    static get template() {
      return html`
        <style>
          :host([opened]) {
            pointer-events: auto;
          }
        </style>
  
        <slot></slot>
  
        <vaadin-combo-box-dropdown
          id="dropdown"
          opened="[[opened]]"
          position-target="[[inputElement]]"
          renderer="[[renderer]]"
          _focused-index="[[_focusedIndex]]"
          _item-id-path="[[itemIdPath]]"
          _item-label-path="[[itemLabelPath]]"
          loading="[[loading]]"
          theme="[[theme]]"
        ></vaadin-combo-box-dropdown>
      `;
    }
    static get properties() {
      return {
        attrForValue: {
          type: String,
          value: "value"
        }
      };
    }
    get clearElement() {
      return this.querySelector(".clear-button");
    }
    ready() {
      super.ready();
      this._toggleElement = this.querySelector(".toggle-button");
    }
    connectedCallback() {
      super.connectedCallback();
      this._setInputElement(this.querySelector("vaadin-text-field,.input"));
      this._revertInputValue();
    }
    checkValidity() {
      if (this.inputElement.validate) {
        return this.inputElement.validate();
      } else {
        return super.checkValidity();
      }
    }
    get _propertyForValue() {
      return dashToCamelCase(this.attrForValue);
    }
    _isClearButton(event) {
      return super._isClearButton(event) || event.type === "input" && !event.isTrusted || event.composedPath()[0].getAttribute("part") === "clear-button";
    }
    _onChange(event) {
      super._onChange(event);
      if (this._isClearButton(event)) {
        this._clear();
      }
    }
  };
  customElements.define(ComboBoxLight.is, ComboBoxLight);
  
  // node_modules/.pnpm/@vaadin/time-picker@22.0.0-beta2/node_modules/@vaadin/time-picker/theme/lumo/vaadin-time-picker-styles.js
  var timePicker = css`
    [part~='toggle-button']::before {
      content: var(--lumo-icons-clock);
    }
  
    :host([dir='rtl']) [part='input-field'] ::slotted(input:placeholder-shown) {
      --_lumo-text-field-overflow-mask-image: none;
    }
  
    :host([dir='rtl']) [part='input-field'] ::slotted(input) {
      --_lumo-text-field-overflow-mask-image: linear-gradient(to left, transparent, #000 1.25em);
    }
  `;
  registerStyles("vaadin-time-picker", [inputFieldShared, timePicker], { moduleId: "lumo-time-picker" });
  
  // node_modules/.pnpm/@vaadin/time-picker@22.0.0-beta2/node_modules/@vaadin/time-picker/src/vaadin-time-picker-item.js
  var TimePickerItem = class extends ComboBoxItem {
    static get is() {
      return "vaadin-time-picker-item";
    }
  };
  customElements.define(TimePickerItem.is, TimePickerItem);
  
  // node_modules/.pnpm/@vaadin/time-picker@22.0.0-beta2/node_modules/@vaadin/time-picker/src/vaadin-time-picker-overlay.js
  registerStyles("vaadin-time-picker-overlay", css`
      #overlay {
        width: var(--vaadin-time-picker-overlay-width, var(--_vaadin-time-picker-overlay-default-width, auto));
      }
    `, { moduleId: "vaadin-time-picker-overlay-styles" });
  var TimePickerOverlay = class extends ComboBoxOverlay {
    static get is() {
      return "vaadin-time-picker-overlay";
    }
  };
  customElements.define(TimePickerOverlay.is, TimePickerOverlay);
  
  // node_modules/.pnpm/@vaadin/time-picker@22.0.0-beta2/node_modules/@vaadin/time-picker/src/vaadin-time-picker-scroller.js
  var TimePickerScroller = class extends ComboBoxScroller {
    static get is() {
      return "vaadin-time-picker-scroller";
    }
  };
  customElements.define(TimePickerScroller.is, TimePickerScroller);
  
  // node_modules/.pnpm/@vaadin/time-picker@22.0.0-beta2/node_modules/@vaadin/time-picker/src/vaadin-time-picker-dropdown.js
  var TimePickerDropdown = class extends ComboBoxDropdown {
    static get is() {
      return "vaadin-time-picker-dropdown";
    }
    static get template() {
      return html`
        <vaadin-time-picker-overlay
          id="overlay"
          hidden$="[[_isOverlayHidden(_items.*, loading)]]"
          loading$="[[loading]]"
          opened="{{_overlayOpened}}"
          theme$="[[theme]]"
          position-target="[[positionTarget]]"
          no-vertical-overlap
        ></vaadin-time-picker-overlay>
      `;
    }
  };
  customElements.define(TimePickerDropdown.is, TimePickerDropdown);
  
  // node_modules/.pnpm/@vaadin/time-picker@22.0.0-beta2/node_modules/@vaadin/time-picker/src/vaadin-time-picker-combo-box.js
  var TimePickerComboBox = class extends ComboBoxMixin(ThemableMixin(PolymerElement)) {
    static get is() {
      return "vaadin-time-picker-combo-box";
    }
    static get template() {
      return html`
        <style>
          :host([opened]) {
            pointer-events: auto;
          }
        </style>
  
        <slot></slot>
  
        <vaadin-time-picker-dropdown
          id="dropdown"
          opened="[[opened]]"
          position-target="[[positionTarget]]"
          renderer="[[renderer]]"
          _focused-index="[[_focusedIndex]]"
          _item-id-path="[[itemIdPath]]"
          _item-label-path="[[itemLabelPath]]"
          loading="[[loading]]"
          theme="[[theme]]"
        ></vaadin-time-picker-dropdown>
      `;
    }
    static get properties() {
      return {
        positionTarget: {
          type: Object
        }
      };
    }
    get clearElement() {
      return this.querySelector('[part="clear-button"]');
    }
    _getItemElements() {
      return Array.from(this.$.dropdown._scroller.querySelectorAll("vaadin-time-picker-item"));
    }
    ready() {
      super.ready();
      this.allowCustomValue = true;
      this._toggleElement = this.querySelector(".toggle-button");
      this.setAttribute("dir", "ltr");
    }
    _isClearButton(event) {
      return super._isClearButton(event) || event.type === "input" && !event.isTrusted || event.composedPath()[0].getAttribute("part") === "clear-button";
    }
    _onChange(event) {
      super._onChange(event);
      if (this._isClearButton(event)) {
        this._clear();
      }
    }
  };
  customElements.define(TimePickerComboBox.is, TimePickerComboBox);
  
  // node_modules/.pnpm/@vaadin/time-picker@22.0.0-beta2/node_modules/@vaadin/time-picker/src/vaadin-time-picker.js
  registerStyles("vaadin-time-picker", inputFieldShared2, { moduleId: "vaadin-time-picker-styles" });
  var TimePicker = class extends PatternMixin(InputControlMixin(ThemableMixin(ElementMixin(PolymerElement)))) {
    static get is() {
      return "vaadin-time-picker";
    }
    static get template() {
      return html`
        <style>
          /* See https://github.com/vaadin/vaadin-time-picker/issues/145 */
          :host([dir='rtl']) [part='input-field'] {
            direction: ltr;
          }
  
          :host([dir='rtl']) [part='input-field'] ::slotted(input)::placeholder {
            direction: rtl;
            text-align: left;
          }
  
          [part~='toggle-button'] {
            cursor: pointer;
          }
        </style>
  
        <div class="vaadin-time-picker-container">
          <div part="label">
            <slot name="label"></slot>
            <span part="required-indicator" aria-hidden="true" on-click="focus"></span>
          </div>
  
          <vaadin-time-picker-combo-box
            id="comboBox"
            filtered-items="[[__dropdownItems]]"
            value="{{_comboBoxValue}}"
            disabled="[[disabled]]"
            readonly="[[readonly]]"
            auto-open-disabled="[[autoOpenDisabled]]"
            position-target="[[_inputContainer]]"
            theme$="[[theme]]"
            on-change="__onChange"
          >
            <vaadin-input-container
              part="input-field"
              readonly="[[readonly]]"
              disabled="[[disabled]]"
              invalid="[[invalid]]"
              theme$="[[theme]]"
            >
              <slot name="prefix" slot="prefix"></slot>
              <slot name="input"></slot>
              <div id="clearButton" part="clear-button" slot="suffix"></div>
              <div id="toggleButton" class="toggle-button" part="toggle-button" slot="suffix"></div>
            </vaadin-input-container>
          </vaadin-time-picker-combo-box>
  
          <div part="helper-text">
            <slot name="helper"></slot>
          </div>
  
          <div part="error-message">
            <slot name="error-message"></slot>
          </div>
        </div>
      `;
    }
    static get properties() {
      return {
        value: {
          type: String,
          notify: true,
          value: ""
        },
        min: {
          type: String,
          value: "00:00:00.000"
        },
        max: {
          type: String,
          value: "23:59:59.999"
        },
        step: {
          type: Number
        },
        autoOpenDisabled: Boolean,
        __dropdownItems: {
          type: Array
        },
        i18n: {
          type: Object,
          value: () => {
            return {
              formatTime: (time) => {
                if (!time) {
                  return;
                }
                const pad = (num = 0, fmt = "00") => (fmt + num).substr((fmt + num).length - fmt.length);
                let timeString = `${pad(time.hours)}:${pad(time.minutes)}`;
                time.seconds !== void 0 && (timeString += `:${pad(time.seconds)}`);
                time.milliseconds !== void 0 && (timeString += `.${pad(time.milliseconds, "000")}`);
                return timeString;
              },
              parseTime: (text) => {
                const MATCH_HOURS = "(\\d|[0-1]\\d|2[0-3])";
                const MATCH_MINUTES = "(\\d|[0-5]\\d)";
                const MATCH_SECONDS = MATCH_MINUTES;
                const MATCH_MILLISECONDS = "(\\d{1,3})";
                const re = new RegExp(`^${MATCH_HOURS}(?::${MATCH_MINUTES}(?::${MATCH_SECONDS}(?:\\.${MATCH_MILLISECONDS})?)?)?$`);
                const parts = re.exec(text);
                if (parts) {
                  if (parts[4]) {
                    while (parts[4].length < 3) {
                      parts[4] += "0";
                    }
                  }
                  return { hours: parts[1], minutes: parts[2], seconds: parts[3], milliseconds: parts[4] };
                }
              }
            };
          }
        },
        _comboBoxValue: {
          type: String,
          observer: "__comboBoxValueChanged"
        },
        _inputContainer: Object
      };
    }
    static get observers() {
      return ["__updateDropdownItems(i18n.*, min, max, step)"];
    }
    get clearElement() {
      return this.$.clearButton;
    }
    ready() {
      super.ready();
      this.addController(new InputController(this, (input) => {
        this._setInputElement(input);
        this._setFocusElement(input);
        this.stateTarget = input;
        this.ariaTarget = input;
      }));
      this.addController(new AriaLabelController(this, this.inputElement, this._labelNode));
      this._inputContainer = this.shadowRoot.querySelector('[part~="input-field"]');
    }
    _inputElementChanged(input) {
      super._inputElementChanged(input);
      if (input) {
        this.$.comboBox._setInputElement(input);
      }
    }
    checkValidity() {
      return !!(this.inputElement.checkValidity() && (!this.value || this._timeAllowed(this.i18n.parseTime(this.value))) && (!this._comboBoxValue || this.i18n.parseTime(this._comboBoxValue)));
    }
    _setFocused(focused) {
      super._setFocused(focused);
      if (!focused) {
        this.validate();
      }
    }
    __validDayDivisor(step) {
      return !step || 24 * 3600 % step === 0 || step < 1 && step % 1 * 1e3 % 1 === 0;
    }
    _onKeyDown(e) {
      if (this.readonly || this.disabled || this.__dropdownItems.length) {
        return;
      }
      const stepResolution = this.__validDayDivisor(this.step) && this.step || 60;
      if (e.keyCode === 40) {
        this.__onArrowPressWithStep(-stepResolution);
      } else if (e.keyCode === 38) {
        this.__onArrowPressWithStep(stepResolution);
      }
    }
    __onArrowPressWithStep(step) {
      const objWithStep = this.__addStep(this.__getMsec(this.__memoValue), step, true);
      this.__memoValue = objWithStep;
      this.inputElement.value = this.i18n.formatTime(this.__validateTime(objWithStep));
      this.__dispatchChange();
    }
    __dispatchChange() {
      this.dispatchEvent(new CustomEvent("change", { bubbles: true }));
    }
    __getMsec(obj) {
      let result = (obj && obj.hours || 0) * 60 * 60 * 1e3;
      result += (obj && obj.minutes || 0) * 60 * 1e3;
      result += (obj && obj.seconds || 0) * 1e3;
      result += obj && parseInt(obj.milliseconds) || 0;
      return result;
    }
    __getSec(obj) {
      let result = (obj && obj.hours || 0) * 60 * 60;
      result += (obj && obj.minutes || 0) * 60;
      result += obj && obj.seconds || 0;
      result += obj && obj.milliseconds / 1e3 || 0;
      return result;
    }
    __addStep(msec, step, precision) {
      if (msec === 0 && step < 0) {
        msec = 24 * 60 * 60 * 1e3;
      }
      const stepMsec = step * 1e3;
      const diffToNext = msec % stepMsec;
      if (stepMsec < 0 && diffToNext && precision) {
        msec -= diffToNext;
      } else if (stepMsec > 0 && diffToNext && precision) {
        msec -= diffToNext - stepMsec;
      } else {
        msec += stepMsec;
      }
      var hh = Math.floor(msec / 1e3 / 60 / 60);
      msec -= hh * 1e3 * 60 * 60;
      var mm = Math.floor(msec / 1e3 / 60);
      msec -= mm * 1e3 * 60;
      var ss = Math.floor(msec / 1e3);
      msec -= ss * 1e3;
      return { hours: hh < 24 ? hh : 0, minutes: mm, seconds: ss, milliseconds: msec };
    }
    __updateDropdownItems(i8n, min, max, step) {
      const minTimeObj = this.__validateTime(this.__parseISO(min));
      const minSec = this.__getSec(minTimeObj);
      const maxTimeObj = this.__validateTime(this.__parseISO(max));
      const maxSec = this.__getSec(maxTimeObj);
      this.__adjustValue(minSec, maxSec, minTimeObj, maxTimeObj);
      this.__dropdownItems = this.__generateDropdownList(minSec, maxSec, step);
      if (step !== this.__oldStep) {
        this.__oldStep = step;
        const parsedObj = this.__validateTime(this.__parseISO(this.value));
        this.__updateValue(parsedObj);
      }
      if (this.value) {
        this._comboBoxValue = this.i18n.formatTime(this.i18n.parseTime(this.value));
      }
    }
    __generateDropdownList(minSec, maxSec, step) {
      if (step < 15 * 60 || !this.__validDayDivisor(step)) {
        return [];
      }
      const generatedList = [];
      step = step || 3600;
      let time = -step + minSec;
      while (time + step >= minSec && time + step <= maxSec) {
        const timeObj = this.__validateTime(this.__addStep(time * 1e3, step));
        time += step;
        const formatted = this.i18n.formatTime(timeObj);
        generatedList.push({ label: formatted, value: formatted });
      }
      return generatedList;
    }
    __adjustValue(minSec, maxSec, minTimeObj, maxTimeObj) {
      if (!this.__memoValue) {
        return;
      }
      const valSec = this.__getSec(this.__memoValue);
      if (valSec < minSec) {
        this.__updateValue(minTimeObj);
      } else if (valSec > maxSec) {
        this.__updateValue(maxTimeObj);
      }
    }
    _valueChanged(value, oldValue) {
      const parsedObj = this.__memoValue = this.__parseISO(value);
      const newValue = this.__formatISO(parsedObj) || "";
      if (this.value !== "" && this.value !== null && !parsedObj) {
        this.value = oldValue;
      } else if (this.value !== newValue) {
        this.value = newValue;
      } else {
        this.__updateInputValue(parsedObj);
      }
      this._toggleHasValue(!!this.value);
    }
    __comboBoxValueChanged(value, oldValue) {
      if (value === "" && oldValue === void 0) {
        return;
      }
      const parsedObj = this.i18n.parseTime(value);
      const newValue = this.i18n.formatTime(parsedObj) || "";
      if (parsedObj) {
        if (value !== newValue) {
          this._comboBoxValue = newValue;
        } else {
          this.__updateValue(parsedObj);
        }
      } else {
        this.value = "";
      }
    }
    __onChange(event) {
      event.stopPropagation();
      this.validate();
      this.__dispatchChange();
    }
    __updateValue(obj) {
      const timeString = this.__formatISO(this.__validateTime(obj)) || "";
      this.value = timeString;
    }
    __updateInputValue(obj) {
      const timeString = this.i18n.formatTime(this.__validateTime(obj)) || "";
      this._comboBoxValue = timeString;
    }
    __validateTime(timeObject) {
      if (timeObject) {
        timeObject.hours = parseInt(timeObject.hours);
        timeObject.minutes = parseInt(timeObject.minutes || 0);
        timeObject.seconds = this.__stepSegment < 3 ? void 0 : parseInt(timeObject.seconds || 0);
        timeObject.milliseconds = this.__stepSegment < 4 ? void 0 : parseInt(timeObject.milliseconds || 0);
      }
      return timeObject;
    }
    get __stepSegment() {
      if (this.step % 3600 === 0) {
        return 1;
      } else if (this.step % 60 === 0 || !this.step) {
        return 2;
      } else if (this.step % 1 === 0) {
        return 3;
      } else if (this.step < 1) {
        return 4;
      }
      return void 0;
    }
    __formatISO(time) {
      return TimePicker.properties.i18n.value().formatTime(time);
    }
    __parseISO(text) {
      return TimePicker.properties.i18n.value().parseTime(text);
    }
    _timeAllowed(time) {
      const parsedMin = this.i18n.parseTime(this.min);
      const parsedMax = this.i18n.parseTime(this.max);
      return (!this.__getMsec(parsedMin) || this.__getMsec(time) >= this.__getMsec(parsedMin)) && (!this.__getMsec(parsedMax) || this.__getMsec(time) <= this.__getMsec(parsedMax));
    }
    _onClearButtonClick() {
    }
    _onChange() {
    }
    _onInput() {
      this._checkInputValue();
    }
  };
  customElements.define(TimePicker.is, TimePicker);
  
  export {
    TimePicker
  };
  /**
   * @license
   * Copyright (c) 2021 Vaadin Ltd.
   * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
   */
  //# sourceMappingURL=chunk-Q4ADGUHB.js.map
  