"use strict";var Multiplayer=function(){function e(){firebase.auth().signInAnonymously().catch(function(e){e.code,e.message}),firebase.auth().onAuthStateChanged(function(e){e&&(u=e.uid,t(u))})}function a(){firebase.initializeApp({apiKey:"AIzaSyBHIgdw94zjXqGSBbVJs5QvjU_X6LFxb_k",authDomain:"prague-castle.firebaseapp.com",databaseURL:"https://prague-castle.firebaseio.com",storageBucket:"prague-castle.appspot.com",messagingSenderId:"505903385814"}),e()}function t(e){s=firebase.database().ref("/players"),r=s.child(e),s.remove(),s.on("value",i),s.on("child_removed",n),r.onDisconnect().remove()}function n(e){castleScene.removeObject(e.key)}function i(e){Preferences.Multiplayer.SHOW_USERS?e.forEach(function(e){e.key!=o.key&&castleScene.updateOrAdd(e.key,e.val().position)}):e.forEach(function(e){e.key!=o.key&&castleScene.removeObject(e.key)})}function c(e){r&&r.update({position:{x:e.x,y:e.y,z:e.z},timestamp:firebase.database.ServerValue.TIMESTAMP})}var o={},s=null,r=null,u=null;return{Init:a,Update:c}}();