(function(){"use strict";page.using={types:["Analysis"]};var e={showSettings:1,showGrid:2,showChart:4};page.onLoad=function(){var t=this.url,a=t.getBoolean(["autoStart","autoRun"]),o=t.get("name")||t.get("statName"),s=t.get("fixedChartType"),r=t.get("chartType"),i=t.getBoolean("hideSelector",false),l=t.getLinkUid(),n=t.get("scope","ConfigurationHierarchy"),g=t.getEnumMap(["autoLoadSettings","mergeMode"],u8.Crm.AnalysisMergeFlags,"all"),h=t.getBoolean("showSettings",true),u=t.getBoolean("showGrid",true),d=t.getBoolean("showChart",true),w=t.get("menuCallback"),c=t.get("pageSize");var f;if(t.has("headerName")){var p=t.get("headerName");if(p===""){f=null}else{f={headerName:p}}}if(t.has("displayMode")){var C=t.getEnumMap("displayMode",e,"showGrid,showChart");h=!C.showSettings;u=!C.showGrid;d=!C.showChart}var y=t.getInt("global",null);if(y!==null){n=y<0?"ConfigurationHierarchy":y==0?"Private":"Public"}if(!l){l=t.getUid();if(l){var v=t.get("linkId",-1);if(v>=0){l.linkId=v}}}if(!h){a=true}if(s){var S=s.indexOf(",false");if(S>0){s=undefined;r=s.substr(0,S)}}var m=u8.services.analyses.createExecutionModel({name:o,unitLookupScope:n,link:l,autoLoadSettings:g});var B={model:m,grid:{pageSize:c},parent:this,collapseSettingsEditor:t.getBoolean("collapseSettingsEditor",false),showSettingsEditor:h,showGrid:u,showChart:d,showCaption:true,header:f,chart:{chartView:{options:{fixedChartType:s,chartType:r,hideSelector:!!i,showValues:t.getBoolean("showChartValues",true),showLegend:t.getBoolean("showChartLegend",true)}}},settings:{showCategory:t.getBoolean("showCategory",true),showValues:t.getBoolean("showValues",true),showCurrency:t.getBoolean("showCurrency",true),showFilters:t.getBoolean("showFilters",true)},isDefault:true,view:t.get("view")};if(w){B.onCreateDrillMenu=evalValue(w)}if(!page.process&&l){B.headerSelector="#header";B.usePageHeader=true}$("#analysisResult").widget("AnalysisResult",B);if(a){m.execute()}else{m.load()}}})();