1(function () { 2 "use strict"; 3 4 window.DSC = window.DSC || {}; 5 const root = window.DSC.Core = window.DSC.Core || window.DSC_CORE || {}; 6 window.DSC_CORE = root; 7 8 const firebaseConfig = { 9 apiKey: "AIzaSyBi0vbs3iPGMw3AWmtPaCh8RFZ-wwS4moc", 10 authDomain: "droneskycheck-d0136.firebaseapp.com", 11 projectId: "droneskycheck-d0136", 12 storageBucket: "droneskycheck-d0136.firebasestorage.app" 13 }; 14 15 function getSdk() { 16 return window.firebase || null; 17 } 18 19 function getDefaultApp() { 20 const sdk = getSdk(); 21 if (!sdk) return null; 22 23 // The L4 local shell must initialize a demo app and bind every emulator 24 // before this shared bootstrap runs. Never fall through to the real config. 25 if (window.__DSC_L4_LOCAL_MODE__ === true && 26 (!Array.isArray(sdk.apps) || sdk.apps.length !== 1 || 27 !/^demo-[a-z0-9-]+$/.test(sdk.app().options?.projectId || "") || 28 window.DSCLocalMonitoringLegalEmulator?.projectId !== sdk.app().options.projectId)) { 29 throw new Error("LOCAL_EMULATOR_BOOTSTRAP_REQUIRED"); 30 } 31 32 if (Array.isArray(sdk.apps) && sdk.apps.length) { 33 return sdk.app(); 34 } 35 36 if (typeof sdk.initializeApp === "function") { 37 return sdk.initializeApp(firebaseConfig); 38 } 39 40 return null; 41 } 42 43 function getFirestore() { 44 const app = getDefaultApp(); 45 return app && typeof app.firestore === "function" ? app.firestore() : null; 46 } 47 48 function getFunctions(region) { 49 const app = getDefaultApp(); 50 if (!app || typeof app.functions !== "function") return null; 51 return region ? app.functions(region) : app.functions(); 52 } 53 54 function getAuth() { 55 const app = getDefaultApp(); 56 return app && typeof app.auth === "function" ? app.auth() : null; 57 } 58 59 function getStorage() { 60 const app = getDefaultApp(); 61 return app && typeof app.storage === "function" ? app.storage() : null; 62 } 63 64 function getTimestamp() { 65 const sdk = getSdk(); 66 return sdk?.firestore?.Timestamp || null; 67 } 68 69 const service = { 70 config: { ...firebaseConfig }, 71 get sdk() { 72 return getSdk(); 73 }, 74 get app() { 75 return getDefaultApp(); 76 }, 77 get App() { 78 return getDefaultApp(); 79 }, 80 get db() { 81 return getFirestore(); 82 }, 83 get firestoreService() { 84 return getFirestore(); 85 }, 86 get functionsService() { 87 return getFunctions(); 88 }, 89 get authService() { 90 return getAuth(); 91 }, 92 get storageService() { 93 return getStorage(); 94 }, 95 get Timestamp() { 96 return getTimestamp(); 97 }, 98 init: getDefaultApp, 99 firestore: getFirestore, 100 functions: getFunctions, 101 auth: getAuth, 102 storage: getStorage, 103 timestamp: getTimestamp 104 }; 105 106 root.firebase = root.firebase || service; 107 root.Firebase = root.firebase; 108 root.firebase.init(); 109})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.