import { r as registerInstance, c as createEvent } from './index-442cf464.js';
import { B as BREAKPOINT_CONFIG } from './media-f352cbeb.js';

const sleep = milliseconds => new Promise(resolve => setTimeout(resolve, milliseconds));

const breakpointsCss = "";

const Breakpoints = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.luBreakpointDataUpdated = createEvent(this, "luBreakpointDataUpdated", 7);
    this.sm = BREAKPOINT_CONFIG.sm;
    this.md = BREAKPOINT_CONFIG.md;
    this.lg = BREAKPOINT_CONFIG.lg;
    this.xl = BREAKPOINT_CONFIG.xl;
  }
  widthChange(newSize) {
    let newBreakpoint = "xs";
    if (newSize >= this.sm) {
      newBreakpoint = "sm";
    }
    if (newSize >= this.md) {
      newBreakpoint = "md";
    }
    if (newSize >= this.lg) {
      newBreakpoint = "lg";
    }
    if (newSize >= this.xl) {
      newBreakpoint = "xl";
    }
    this.currentBreakpoint = newBreakpoint;
    this.luBreakpointDataUpdated.emit({
      breakpoint: newBreakpoint,
      height: this.currentHeight,
      width: this.currentWidth
    });
  }
  onResize() {
    this.currentWidth = document.body.clientWidth;
    this.currentHeight = document.body.clientHeight;
  }
  componentDidLoad() {
    // todo: Remove timeout once solution for Firefox timing issue is found.
    sleep(100).then(() => {
      this.onResize();
    });
  }
  static get watchers() { return {
    "currentWidth": ["widthChange"]
  }; }
};
Breakpoints.style = breakpointsCss;

export { Breakpoints as lu_breakpoints };

//# sourceMappingURL=lu-breakpoints.entry.js.map