text: "use strict";var states=[{name:"base",state:{"abstract":!0,url:"",templateUrl:"views/base.html",data:{text:"Base",visible:!1}}},{name:"login",state:{url:"/login",parent:"base",templateUrl:"views/login.html",controller:"LoginCtrl",data:{text:"Login",visible:!1}}},{name:"dashboard",state:{url:"/dashboard",parent:"base",templateUrl:"views/dashboard.html",controller:"DashboardCtrl",data:{text:"Dashboard",visible:!1}}},{name:"overview",state:{url:"/overview",parent:"dashboard",templateUrl:"views/dashboard/overview.html",controller:"OverviewCtrl",data:{text:"Overview",visible:!0}}},{name:"reports",state:{url:"/reports/:age/:income",parent:"dashboard",templateUrl:"views/dashboard/reports.html",controller:"ReportsCtrl",data:{text:"Reports",visible:!0}}},{name:"logout",state:{url:"/login",data:{text:"Logout",visible:!0}}}];angular.module("yapp",["ui.router","snap","ngAnimate","zingchart-angularjs"]).config(["$stateProvider","$urlRouterProvider",function(e,a){a.when("/dashboard","/dashboard/reports"),a.otherwise("/login"),angular.forEach(states,function(a){e.state(a.name,a.state)})}]),angular.module("yapp").controller("LoginCtrl",["$scope","$location",function(e,a){e.submit=function(){if(e.currage<18)e.error=" You need to be at least 18 years old to start investing ";else if(e.currincome<5e3)e.error=" You annual income needs to be atleast $5000 to start investing ";else if(null==e.currincome||null==e.currage)e.error="Please enter a valid value. ";else{var s="/dashboard/reports/"+e.currage+"/"+e.currincome;a.path(s)}return!1}}]),angular.module("yapp").controller("OverviewCtrl",["$scope","$state",function(e,a){e.$state=a,e.menuItems=[],angular.forEach(a.get(),function(a){a.data&&a.data.visible&&e.menuItems.push({name:a.name,text:a.data.text}),e.myJson={gui:{contextMenu:{button:{visible:0}}},backgroundColor:"#34495E",globals:{shadow:!1,fontFamily:"Helvetica"},type:"area",legend:{layout:"x4",backgroundColor:"transparent",borderColor:"transparent",marker:{borderRadius:"50px",borderColor:"transparent"},item:{fontColor:"white"}},scaleX:{maxItems:8,transform:{type:"date"},zooming:!0,values:[14429052e5,14429088e5,14429124e5,1442916e6,14429196e5,14429232e5,14429268e5,14429304e5,1442934e6,14429376e5,14429412e5,14429448e5,14429484e5],lineColor:"white",lineWidth:"1px",tick:{lineColor:"white",lineWidth:"1px"},item:{fontColor:"white"},guide:{visible:!1}},scaleY:{lineColor:"white",lineWidth:"1px",tick:{lineColor:"white",lineWidth:"1px"},guide:{lineStyle:"solid",lineColor:"#626262"},item:{fontColor:"white"}},tooltip:{visible:!1},crosshairX:{scaleLabel:{backgroundColor:"#fff",fontColor:"black"},plotLabel:{backgroundColor:"#434343",fontColor:"#FFF",_text:"Number of hits : %v"}},plot:{lineWidth:"2px",aspect:"spline",marker:{visible:!1}},series:[{text:"All Sites",values:[2596,2626,4480,6394,7488,14510,7012,10389,20281,25597,23309,22385,25097,20813,20510],backgroundColor1:"#77d9f8",backgroundColor2:"#272822",lineColor:"#40beeb"},{text:"Site 1",values:[479,199,583,1624,2772,7899,3467,3227,12885,17873,14420,12569,17721,11569,7362],backgroundColor1:"#4AD8CC",backgroundColor2:"#272822",lineColor:"#4AD8CC"},{text:"Site 2",values:[989,1364,2161,2644,1754,2015,818,77,1260,3912,1671,1836,2589,1706,1161],backgroundColor1:"#1D8CD9",backgroundColor2:"#1D8CD9",lineColor:"#1D8CD9"},{text:"Site 3",values:[408,343,410,840,1614,3274,2092,914,5709,6317,6633,6720,6504,6821,4565],backgroundColor1:"#D8CD98",backgroundColor2:"#272822",lineColor:"#D8CD98"}]}})}]),angular.module("yapp").controller("DashboardCtrl",["$scope","$state",function(e,a){e.$state=a,e.menuItems=[],angular.forEach(a.get(),function(a){a.data&&a.data.visible&&e.menuItems.push({name:a.name,text:a.data.text})})}]),angular.module("yapp").controller("ReportsCtrl",["$scope","$state","$http","$stateParams",function(e,a,s,t){e.$state=a,e.menuItems=[],angular.forEach(a.get(),function(a){a.data&&a.data.visible&&e.menuItems.push({name:a.name,text:a.data.text})});var o=t.age,r=t.income,i="",l="",n={income:r,age:o},p="https://y7m9207v4m.execute-api.us-east-1.amazonaws.com/prod";s.post(p,n).success(function(a){e.data=a,e.pieData=e.data.plans.conservative,i=a.plans.conservative.graphDataX,l=a.plans.conservative.graphDataY,e.myJson={gui:{contextMenu:{button:{visible:0}}},backgroundColor:"#34495E",globals:{shadow:!1,fontFamily:"Helvetica"},type:"area",legend:{layout:"x4",backgroundColor:"transparent",borderColor:"transparent",marker:{borderRadius:"50px",borderColor:"transparent"},item:{fontColor:"white"}},scaleX:{zooming:!0,values:i,lineColor:"white",lineWidth:"1px",tick:{lineColor:"white",lineWidth:"1px"},item:{fontColor:"white"},guide:{visible:!1}},scaleY:{lineColor:"white",lineWidth:"1px",tick:{lineColor:"white",lineWidth:"1px"},guide:{lineStyle:"solid",lineColor:"#626262"},item:{fontColor:"white"}},tooltip:{visible:!0},crosshairX:{scaleLabel:{backgroundColor:"#fff",fontColor:"black"},plotLabel:{backgroundColor:"#434343",fontColor:"#FFF",_text:"Number of hits : %v"}},plot:{lineWidth:"2px",aspect:"spline",marker:{visible:!1}},series:[{text:"Conservative",values:a.plans.conservative.graphDataY,backgroundColor1:"#77d9f8",backgroundColor2:"#272822",lineColor:"#40beeb"},{text:"Moderately Conservative",values:a.plans.moderatelyC.graphDataY,backgroundColor1:"#4AD8CC",backgroundColor2:"#272822",lineColor:"#4AD8CC"},{text:"Aggressive",values:a.plans.moderatelyA.graphDataY,backgroundColor1:"#1D8CD9",backgroundColor2:"#1D8FF9",lineColor:"#1D8CD9"},{text:"Moderately Aggressive",values:a.plans.aggressive.graphDataY,backgroundColor1:"#D8CD98",backgroundColor2:"#272822",lineColor:"#D8CD98"}]},e.pie={globals:{shadow:!1,fontFamily:"Verdana",fontWeight:"100"},type:"pie",backgroundColor:"#34495E",legend:{layout:"x5",position:"50%",borderColor:"transparent",marker:{borderRadius:10,borderColor:"transparent"}},tooltip:{text:"%v share"},plot:{refAngle:"-90",borderWidth:"0px",valueBox:{placement:"in",text:"%npv %",fontSize:"15px",textAlpha:1}},series:[{text:"Large Stocks",values:[e.pieData.largestocks],backgroundColor:"#FA6E6E #FA9494"},{text:"Small Co Stocks",values:[e.pieData.smallcostocks],backgroundColor:"#F1C795 #feebd2"},{text:"Real Estate",values:[e.pieData.realestate],backgroundColor:"#FDAA97 #FC9B87"},{text:"Emerging Markets",values:[e.pieData.emergingmarkets],backgroundColor:"#28C2D1"},{text:"Corporate Bonds",values:[e.pieData.corporatebonds],backgroundColor:"#D2D6DE"},{text:"Goverment Bonds",values:[e.pieData.govermentbonds],backgroundColor:"#D2D6DE"}]}}),e.description="Conservative is the highest priority goal we recommend for investors. Our allocation advice for this goal is fixed at 40% stocks. Our rigorous modeling and testing has shown that investing is a reliable alternative to a cash savings account..",e.updateGraph=function(a){switch(a){case"conservative":e.description="Conservative is the highest priority goal we recommend for investors. Our allocation advice for this goal is fixed at 40% stocks. Our rigorous modeling and testing has shown that investing is a reliable alternative to a cash savings account..",e.prediction="As per out research with an monthly payment of $"+e.data.monthlyplan+" you should be able to save $"+e.data.plans.conservative.graphDataY[10]+" by the age "+e.data.plans.conservative.graphDataX[10],e.plansInfo=e.data.plans.conservative,e.pieData=e.data.plans.conservative,e.pie.series[0].values.splice(0,1),e.pie.series[0].values.push(e.pieData.largestocks),e.pie.series[1].values.splice(0,1),e.pie.series[1].values.push(e.pieData.smallcostocks),e.pie.series[2].values.splice(0,1),e.pie.series[2].values.push(e.pieData.realestate),e.pie.series[3].values.splice(0,1),e.pie.series[3].values.push(e.pieData.emergingmarkets),e.pie.series[4].values.splice(0,1),e.pie.series[4].values.push(e.pieData.corporatebonds),e.pie.series[5].values.splice(0,1),e.pie.series[5].values.push(e.pieData.govermentbonds);break;case"moderatelyC":e.description="This goal does not have a specific purchase or withdrawal date baked into the advice, which makes it an ideal goal for objectives such as long-term savings that are earmarked for generational wealth transfer, assets that may be converted into a trust account at a later date, or an unknown future major purchase.",e.prediction="As per out research with an monthly payment of "+e.data.monthlyplan+" you should be able to save $"+e.data.plans.moderatelyC.graphDataY[10]+" by the age "+e.data.plans.moderatelyC.graphDataX[10],e.plansInfo=e.data.plans.moderatelyC,e.pieData=e.data.plans.moderatelyC,e.pie.series[0].values.splice(0,1),e.pie.series[0].values.push(e.pieData.largestocks),e.pie.series[1].values.splice(0,1),e.pie.series[1].values.push(e.pieData.smallcostocks),e.pie.series[2].values.splice(0,1),e.pie.series[2].values.push(e.pieData.realestate),e.pie.series[3].values.splice(0,1),e.pie.series[3].values.push(e.pieData.emergingmarkets),e.pie.series[4].values.splice(0,1),e.pie.series[4].values.push(e.pieData.corporatebonds),e.pie.series[5].values.splice(0,1),e.pie.series[5].values.push(e.pieData.govermentbonds);break;case"aggressive":e.description="With our Aggressive portfolio we assume you’ll ease into full retirement mode—rather than needing all your money on an exact date in the future. When you have 20 or more years until your planned retirement age, we recommend 90% stocks in order to maximize growth.",e.prediction="As per out research with an monthly payment of "+e.data.monthlyplan+" you should be able to save $"+e.data.plans.aggressive.graphDataY[10]+" by the age "+e.data.plans.aggressive.graphDataX[10],e.plansInfo=e.data.plans.aggressive,e.pieData=e.data.plans.aggressive,e.pie.series[0].values.splice(0,1),e.pie.series[0].values.push(e.pieData.largestocks),e.pie.series[1].values.splice(0,1),e.pie.series[1].values.push(e.pieData.smallcostocks),e.pie.series[2].values.splice(0,1),e.pie.series[2].values.push(e.pieData.realestate),e.pie.series[3].values.splice(0,1),e.pie.series[3].values.push(e.pieData.emergingmarkets),e.pie.series[4].values.splice(0,1),e.pie.series[4].values.push(e.pieData.corporatebonds),e.pie.series[5].values.splice(0,1),e.pie.series[5].values.push(e.pieData.govermentbonds);break;default:e.description="As you save and invest over time, and your nest egg grows, our advice slowly reduces your risk. At retirement, we recommend a 56% stock allocation, then a continued reduction in risk thereafter.",e.prediction="As per out research with an monthly payment of "+e.data.monthlyplan+" you should be able to save $"+e.data.plans.moderatelyA.graphDataY[10]+" by the age "+e.data.plans.moderatelyA.graphDataX[10],e.plansInfo=e.data.plans.moderatelyA,e.pieData=e.data.plans.moderatelyA,e.pie.series[0].values.splice(0,1),e.pie.series[0].values.push(e.pieData.largestocks),e.pie.series[1].values.splice(0,1),e.pie.series[1].values.push(e.pieData.smallcostocks),e.pie.series[2].values.splice(0,1),e.pie.series[2].values.push(e.pieData.realestate),e.pie.series[3].values.splice(0,1),e.pie.series[3].values.push(e.pieData.emergingmarkets),e.pie.series[4].values.splice(0,1),e.pie.series[4].values.push(e.pieData.corporatebonds),e.pie.series[5].values.splice(0,1),e.pie.series[5].values.push(e.pieData.govermentbonds)}},e.updateDesc=function(a){switch(a){case"largestocks":e.desc="Roughly $0.13 of every dollar invested will purchase the Vanguard S&amp;P500 ETF (VOO). This ETF provides investors with exposure to 500 of the largest U.S. companies.";break;case"smallcostocks":e.desc="Roughly $0.25 of every dollar invested will purchase the Vanguard Small-Cap ETF (VB). This ETF provides investors with exposure to a broadly diversified index of stocks of smaller U.S. companies.";break;case"realestate":e.desc="Roughly $0.22 of every dollar invested will purchase the Vanguard REIT ETF (VNQ). This ETF provides investors with exposure to companies that purchase real estate properties, such as apartment complexes, hotels, and office buildings.";break;case"corporatebonds":e.desc="Roughly $0.13 of every dollar invested will purchase the iShares Corporate Bond ETF (LQD). This ETF provides investors with exposure to a wide pool of corporate bonds.";break;case"govermentbonds":e.desc="Roughly $0.13 of every dollar invested will purchase the iShares 1-3 year Treasury Bond ETF (SHY). This ETF provides investors with exposure to short term U.S. Treasury bonds.";break;default:e.desc="Roughly $0.14 of every dollar invested will purchase the Vanguard FTSE Emerging Markets (VWO). This ETF provides investors with exposure to stocks of companies in emerging markets all over the globe, such as Brazil, China, and South Africa."}}}]);