import { initializeApp } from "firebase/app";
import { getAuth } from "firebase/auth";
const firebaseConfig = {
    apiKey: "AIzaSyC54HqlGrkyANVFKGDQi3LobO5moDOuafk",
    authDomain: "tilework-e18c5.firebaseapp.com",
    projectId: "tilework-e18c5",
    storageBucket: "tilework-e18c5.firebasestorage.app",
    messagingSenderId: "199991289749",
    appId: "1:199991289749:web:d7ac38af24e1f29251f89c",
    measurementId: "G-3YXYKJK38T",
};
export class FirebaseProvider {
    static instance;
    _app = null;
    _auth = null;
    static getInstance() {
        if (!FirebaseProvider.instance) {
            FirebaseProvider.instance = new FirebaseProvider();
        }
        return FirebaseProvider.instance;
    }
    get app() {
        if (!this._app) {
            throw new Error("Firebase app not initialized. Call configure() first.");
        }
        return this._app;
    }
    get auth() {
        if (!this._auth) {
            throw new Error("Firebase auth not initialized. Call configure() first.");
        }
        return this._auth;
    }
    configure() {
        if (!this._app) {
            this._app = initializeApp(firebaseConfig);
            this._auth = getAuth(this._app);
        }
    }
}
export const configureFirebase = () => {
    FirebaseProvider.getInstance().configure();
};
export const getFirebase = () => {
    return FirebaseProvider.getInstance();
};
//# sourceMappingURL=firebase.js.map