1var ui,voidAfterSignIn=!1,googleAssistant=readGaParams(urlParams),redirect=null;googleAssistant||((redirect=urlParams.get("r"))||(redirect="/"+getLanguage()+"/index.html"));$(document).ready((function(){$.getScript("https://www.gstatic.com/firebasejs/ui/6.1.0/firebase-ui-auth__"+getLanguage()+".js").done((function(e,r){initLanguage(!0,afterSignIn,afterSignOut).catch((e=>{showMessage(2,"Error loading the language")}))})).fail((function(e,r,s){console.error(s)}))}));var afterSignIn=googleAssistant?signedInAssistant:signedInNormal;function afterSignOut(){var e={signInOptions:[firebase.auth.GoogleAuthProvider.PROVIDER_ID,{provider:firebase.auth.EmailAuthProvider.PROVIDER_ID,requireDisplayName:!0},firebase.auth.FacebookAuthProvider.PROVIDER_ID],callbacks:{signInSuccessWithAuthResult:(e,r)=>(voidAfterSignIn=!0,googleAssistant?signSuccessAssistant(e):signSuccessUser(e),!1)},tosUrl:"terms_of_service.html",privacyPolicyUrl:"privacy_policy.html"};ui||(ui=new firebaseui.auth.AuthUI(firebase.auth())),ui.start("#firebaseui-auth-container",e),urlParams.has("ev")?showMessage(0,language.emailJustVerified):googleAssistant&&showMessage(1,language.signInGa)}function signSuccessUser(e){var r=e.user,s=e.additionalUserInfo.providerId;return e.additionalUserInfo.isNewUser?registerNewUser(s,r):db.collection("users").doc(r.uid).get().then((e=>e.exists?s==firebase.auth.EmailAuthProvider.PROVIDER_ID?r.emailVerified?storeNewMonitor(r):e.data().emailVerify?sendVerificationEmail(r):storeNewMonitor(r):storeNewMonitor(r):registerNewUser(s,r)))}function registerNewUser(e,r){return e==firebase.auth.EmailAuthProvider.PROVIDER_ID?storeNewUser(r,!0).then((()=>sendVerificationEmail(r))):storeNewUser(r,!1).then((()=>storeNewMonitor(r)))}function storeNewUser(e,r){var s={email:e.email};return e.displayName&&(s.displayName=e.displayName),e.photoURL&&(s.photoUrl=e.photoURL),r&&(s.emailVerify=!0),db.collection("users").doc(e.uid).set(s)}function storeNewMonitor(e){return db.collection("users").doc(e.uid).get().then((r=>{var s=bowser.getParser(window.navigator.userAgent),t={userId:e.uid,created:firebase.firestore.FieldValue.serverTimestamp(),manufacturer:s.getBrowserName(),model:s.getBrowserVersion(),androidVer:s.getOSName()+" "+s.getOSVersion(),appCode:999,lastRun:firebase.firestore.Timestamp.now(),sharings:r.get("sharings")||null},i=localStorage.getItem("fcmToken");return i&&(t.fbToken=i),db.collection("monitors").add(t)})).then((e=>{localStorage.setItem("monitorId",e.id),urlParams.delete("r"),window.location.replace(redirect+url.search)})).catch((e=>{console.error("Error storing new monitor: "+e.message)}))}function signSuccessAssistant(e){console.log("+++ signSuccessAssistant");var r=e.user,s=e.additionalUserInfo.providerId;return e.additionalUserInfo.isNewUser?assistantRegisterNewUser(s,r):db.collection("users").doc(r.uid).get().then((e=>e.exists?s==firebase.auth.EmailAuthProvider.PROVIDER_ID?r.emailVerified?assistantRedirectBack(r):e.data().emailVerify?sendVerificationEmail(r):assistantRedirectBack(r):assistantRedirectBack(r):assistantRegisterNewUser(s,r)))}function assistantRegisterNewUser(e,r){return e==firebase.auth.EmailAuthProvider.PROVIDER_ID?storeNewUser(r,!0).then((()=>sendVerificationEmail(r))):storeNewUser(r,!1).then((()=>{assistantRedirectBack(r)}))}function readGaParams(){var e={};return e.clientId=urlParams.get("client_id"),"securitycameracz-153318"!=e.clientId?null:(e.redirectUri=urlParams.get("redirect_uri"),!e.redirectUri||"https://oauth-redirect.googleusercontent.com/r/securitycameracz-153318"!=e.redirectUri.split("?")[0]&&"https://oauth-redirect-sandbox.googleusercontent.com/r/securitycameracz-153318"!=e.redirectUri.split("?")[0]?null:(e.state=urlParams.get("state"),e.responseType=urlParams.get("response_type"),e.state&&e.responseType?(e.userLocal=urlParams.get("user_locale"),e.scope=urlParams.get("scope"),e):null))}function assistantRedirectBack(e){googleAssistant&&e.getIdToken().then((e=>{var r=googleAssistant.redirectUri.split("?")[0];const s=new URL(r);s.searchParams.append("code",e),s.searchParams.append("state",googleAssistant.state),window.location.href=s.toString()}))}function signedInNormal(){voidAfterSignIn||(urlParams.delete("r"),urlParam
1s.delete("ev"),window.location.replace(redirect+url.search))}function signedInAssistant(){voidAfterSignIn||signOut()}function sendVerificationEmail(e){var r="https://securitycamera.cz/signin.html?r="+redirect+"&ev=1";urlParams.forEach(((e,s)=>{r+="&"+s+"="+e}));var s={url:r,handleCodeInApp:!1};return e.sendEmailVerification(s).then((()=>firebase.auth().signOut())).then((()=>{showMessage(1,language.verifyEmail)}))}function showMessage(e,r){var s="#fff";switch(e){case 0:s="rgba(76,175,80, 0.3)";break;case 1:s="rgba(255,193,7, 0.3)";break;case 2:s="rgba(213,0,0, 0.3)"}$("#signin-msg").text(r).css("background-color",s).show()}function hideMessage(){$("#signin-msg").hide()}
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.