import { reactive } from '@wix/bex-utils';
import { makeObservable, observable } from 'mobx';
import { isMobileDevice } from '../util/mobileDetection';
// CAIRO-3582: modify mobile detection to use user agent
// export const MOBILE_BREAKPOINT = 768;
export class PageState {
    constructor() {
        this._sidePanelOpen = reactive(false);
        this._isMobile = false;
        this.modalsContainerRef = makeObservable({ current: null }, { current: observable.ref });
        this.stackingRootRef = { current: null };
        this.scrollableContentRef = { current: null };
        makeObservable(this, {
            _isMobile: observable.ref,
            // CAIRO-3582: modify mobile detection to use user agent
            // _updateIsMobile: action.bound,
        });
        this._isMobile = isMobileDevice();
    }
    // CAIRO-3582: modify mobile detection to use user agent
    // _updateIsMobile() {
    //   if (typeof window !== 'undefined') {
    //     this._isMobile = window.innerWidth <= MOBILE_BREAKPOINT;
    //   }
    // }
    get isMobile() {
        return this._isMobile;
    }
    set sidePanelOpen(value) {
        this._sidePanelOpen.value = value;
    }
}
//# sourceMappingURL=PageState.js.map