var CscopeInfo=window.CscopeInfo||{};try{var isClient="undefined"!=typeof window&&window.document}catch(e){isClient=!1}try{var isLambda="undefined"!=typeof process&&!!process.env.LAMBDA_TASK_ROOT}catch(e){isLambda=!1}try{var isWebview="undefined"!=typeof Ti}catch(e){isWebview=!1}if(isWebview)log={logInfo:function(e){Ti.API.info("CScope Info: "+e)},logError:function(e){Ti.API.error("CScope Error: "+e)},logWarn:function(e){Ti.API.warn("CScope Warn: "+e)}};else var log={logInfo:function(e){console.log("CScope Info:",e)},logError:function(e){console.log("CScope Error:",e)},logWarn:function(e){console.log("CScope Warn:",e)}};var cscopereport=function(p){var i,d,l,s,o=!1,u=[],v=environmentVariables.envVariables().environment,g=0;function t(){document.getElementById("navbar").addEventListener("navbarNewSelection",function(e){log.logInfo("navbarNewSelection "+JSON.stringify(e.detail)),D(),c(e.detail.loa,e.detail.startDate,!1)}),document.getElementById("navbar").addEventListener("navbarClose",function(e){log.logInfo("navbarClose "+JSON.stringify(e.detail)),D()}),document.getElementById("navbar").addEventListener("navbarNoDevicesFound",function(e){log.logInfo("navbarNoDevicesFound "+JSON.stringify(e.detail)),alert("No data uploaded yet, taking you to the upload page."),D(),window.location="./upload.html"}),cscopenavbar.checkForExistingSelection(),cscopenavbar.setNavBar(),_config[v].api.invokeUrl||p("#noApiMessage").show(),p("#loader").hide(),p("#reportIframe").attr("src",function(e,o){return o}),p("#reportIframe").on("load",function(){var e,o;log.logInfo("Onload event 1"),e="app:updateFromReport",o=function(e,o){log.logInfo("app:updateFromReport "+JSON.stringify(o)),"destination"in o?cscopenavbar.setReportKey(o.destination):o.decreaseLOA&&cscopenavbar.decreaseLOA(o)},isLambda?log.logInfo("lambda"):isWebview?Ti.App.addEventListener(e,o):(log.logInfo("Create listener "+e),p("#reportIframe")[0].contentWindow.$("#reportBody").on(e,o))})}function c(e,o,t){if(log.logInfo("getReportWithSystemInputs Selected Date "+o+" loa "+e),null!=o&&!isNaN(o)){log.logInfo("LOA "+e+"s");var n,a,r,i,l,s=[],g=cscopenavbar.getSelectedDevices();log.logInfo("GetReportWithSystemInputs deviceList "+JSON.stringify(g));for(var c=0;c