mirror of
https://gitlab.silvrtree.co.uk/martind2000/ft-webplatform.git
synced 2025-01-26 21:26:17 +00:00
1 line
364 KiB
Plaintext
1 line
364 KiB
Plaintext
{"version":3,"sources":["configuration/en-gb/main.js","configuration/gw/beans.js","configuration/gw/components.js","configuration/gw/main.js","configuration/gw/reducers.js","configuration/gw/state.js","components/products/overview/ft-fund-information/gw/ft-fund-information.js","components/products/portfolio/ft-asset-allocation/gw/ft-asset-allocation.js","components/products/portfolio/ft-asset-class-exposure/gw/ft-asset-class-exposure.js","components/products/portfolio/ft-average-portfolio-exposure/gw/ft-average-portfolio-exposure.js","components/products/portfolio/ft-currency-breakdown/gw/ft-currency-breakdown.js","components/products/portfolio/ft-fund-measures/gw/ft-fund-measures.js","components/products/portfolio/ft-geographic-breakdown/gw/ft-geographic-breakdown.js","components/products/portfolio/ft-geographic-exposure/gw/ft-geographic-exposure.js","components/products/portfolio/ft-manager-roster/gw/ft-manager-roster.js","components/products/portfolio/ft-portfolio-exposure/gw/ft-portfolio-exposure.js","components/products/portfolio/ft-portfolio-risk-and-return-analysis/gw/ft-portfolio-risk-and-return-analysis.js","components/products/portfolio/ft-portfolio-statistics-and-positions/gw/ft-portfolio-statistics-and-positions.js","components/products/portfolio/ft-risk-contribution/gw/ft-risk-contribution-actual.js","components/products/portfolio/ft-risk-contribution/gw/ft-risk-contribution-forecast.js","components/products/portfolio/ft-sector-allocation/gw/ft-sector-allocation.js","components/products/portfolio/ft-sector-exposure/gw/ft-sector-exposure.js","components/products/portfolio/ft-security-type-exposure/gw/ft-security-type-exposure.js","components/products/portfolio/ft-top-risk-allocation-by-asset-class/gw/ft-top-risk-allocation-by-asset-class.js","components/products/portfolio/ft-top-ten-holdings/gw/ft-top-ten-holdings.js","components/products/portfolio/ft-value-at-risk/gw/ft-value-at-risk.js","components/products/portfolio/lib/gw/portfolio-chart.reducer.js","components/products/portfolio/ft-strategy-breakdown/gw/ft-strategy-breakdown.js","components/marketing/lists/ft-document-lister/lib/gw/ft-document-lister.reducer.js","components/marketing/lists/ft-report-archive-a/lib/gw/report-archive-a.reducer.js","components/marketing/lists/ft-report-archive-b/lib/gw/report-archive-b.reducer.js","components/marketing/video/ft-video-switch/lib/gw/ft-video-switch.reducer.js","components/products/overview/ft-fund-information/lib/en-gb/fund-information.reducer.js","components/products/overview/ft-fund-information/lib/gw/fund-information.reducer.js","components/products/overview/ft-fund-ratings/lib/gw/fund-ratings.reducer.js","components/products/performance/ft-calendar-year-returns/lib/gw/calendar-year-returns.reducer.js","components/products/performance/ft-discrete-returns/lib/gw/discrete-returns.reducer.js","components/products/performance/ft-performance-annualised/lib/gw/performance-annualised.reducer.js","components/products/performance/ft-performance-cumulative/lib/gw/performance-cumulative.reducer.js","components/products/performance/ft-performance-risk-statistics/lib/gw/performance-risk-statistics.reducer.js","components/products/portfolio/ft-fund-measures/gw/lib/fund-measures.reducer.js","components/products/portfolio/ft-portfolio-statistics-and-positions/lib/gw/portfolio-statistics-and-positions.reducer.js","components/products/portfolio/ft-risk-contribution/lib/gw/risk-contribution.reducer.js","components/products/portfolio/ft-security-type-exposure/lib/gw/security-type-exposure.reducer.js","components/products/portfolio/ft-top-risk-allocation-by-asset-class/gw/lib/top-risk-allocation-by-asset-class.reducer.js","components/products/portfolio/ft-value-at-risk/gw/lib/value-at-risk.reducer.js","components/products/ppss/ft-ppss/lib/gw/ppss.reducer.js","components/products/pricing-distribution/ft-pricing-distribution/lib/gw/pricing-distribution.reducer.js","components/products/tax/ft-german-tax/lib/gw/german-tax.reducer.js","components/marketing/common/elements/ft-multi-select-bar/lib/gw/ft-multi-select-bar.reducer.js","components/marketing/common/elements/ft-type-ahead-search/lib/gw/ft-type-ahead-search.reducer.js","components/products/common/elements/ft-fund-alert/lib/gw/fund-alert.reducer.js","components/products/portfolio/ft-manager-roster/gw/lib/gw/manager-roster.reducer.js","components/products/portfolio/ft-sector-exposure/gw/lib/gw/sector-exposure.reducer.js"],"names":["configure","aurelia","state","products","specific","splice","indexOf","reducers","beans","components","dataServiceConf","component","caveats","caveatsFund","configuration","findAFund","fundDetails","fundAlert","labels","labelsMarketing","ppss","portfolioFundMeasures","portfolioStatisticsAndPositions","portfolioCharting","portfolioRiskContribution","portfolioSecurityTypeExposure","portfolioSectorExposure","valueAtRisk","topRiskAllocationByAssetClass","managerRosterAndAllocation","performance","performanceSimply","pricingDistribution","priceHistory","distributionHistory","fundInformation","fundRatings","fundStaticBar","tax","bean","parameters","Map","general","marketing","getState","app","searchProperties","name","dataKey","config","showFundIdentifiersTab","showKeywordsFilter","filters","favorites","dropdowns","keywords","searchKeys","map","prop","searchString","FtFundInformation","Element","store","element","isPopulated","fundId","getAttribute","currentState","currentShareClass","segment","currentShareClassChanged","dispatch","type","shareClassKey","mapState","newState","fundState","label","vo","salesCharges","identifiers","distributions","tradingCharacteristics","e","logger","error","FtAssetAllocation","init","CHART_TYPE_ID","COMPONENT_ID","DATA_COLUMN_LABEL_ID","FtAssetClassExposure","cid","portfolioBeans","slice","push","chartType","portfolioComponent","chartState","data","visible","FtAveragePortfolioExposure","FtCurrencyBreakdown","FtFundMeasures","populateAction","shareClassKeyChanged","riskStats","forecastRiskStats","FtGeographicBreakdown","FtGeographicExposure","populated","FtManagerRoster","debug","managerAllocations","FtPortfolioExposure","FtPortfolioRiskAndReturnAnalysis","FtPortfolioStatisticsAndPositions","cmsTypeId","refreshRate","isValid","asOfDate","holdingsPdf","nbrOfIssuers","nbrOfHoldings","showIssuers","statistics","halfWayPoint","Math","ceil","length","statisticsPart1","statisticsPart2","FtRiskContributionActual","assetClass","riskContribution","chartData","table","item","portAvg","colorByPoint","FtRiskContributionForecast","portForeCntr","FtSectorAllocation","FtSectorExposure","FtSecurityTypeExposure","securityTypeExposure","series","getValue","id","rVal","orderId","undefined","ordering","getCustomLabel","mappedLabels","get","FtTopRiskAllocationByAssetClass","compState","FtTopTenHoldings","chart","color","FtValueAtRisk","portfolioChartReducer","getLogger","DATA_STORE_ENUM","BREAKDOWN","key","HOLDINGS","HOLDINGS_TOP_TEN","RISK_CONTROL","OUTPUT_STYLE_ENUM","STANDARD_BREAKDOWN","KEYVALUE_BREAKDOWN","HIERARCHY_BREAKDOWN","CHART_TYPES_ENUM","labelId","caveatId","options","suppressionCondition","rawPortfolioFeed","currentBreakdown","rawBreakdowns","assetExposureBreakdown","sorted","forceChart","outputStyle","nameKey","kv_keyField","kv_valueField","hardcodedCalcLabelId","hasCalNameInRows","rows","filterCondition","o","buildChart","nameFunc","isParent","rangeKey","tableMappingKeys","val","valOfTotal","dataStore","monthPeriod","performanceContribution","riskContributionForecast","startDate","nameStd","specialRiskConfigRules","filter","chartValKey","isParentRow","is1MonthData","strategy","action","json","rawFundDetails","rawConfig","rawPageJsonConfig","Object","assign","subKey","chartObj","chartDataFactory","getBreakdown","chartTypeConfig","rawTopTenHoldings","breakDownKey","rawHoldings","decoratedConfig","fundCategory","getFundCategory","isSuppressed","isPortfolioComponentSuppressed","isSuppressedRiskConfig","isSuppressedByLackOfData","isSuppressedByCondition","refreshRateFromConfig","convertRefreshFrequencyIntoLabelId","obj","caveatFootnote","caveatProximal","showChart","spanRow","tempBreakdown","getIntlSimplifiedBreakdown","appendTableData","appendBreakdown","pageJsonConfig","parsePageJsonConfig","FtStrategyBreakdown","ftDocumentLister","labelData","beanLabelData","otherLabel","ftDocumentListerLabels","columnsObj","forEach","column","value","columns","reportArchiveA","searchFundKeyword","onOffToggle","onState","offState","reportArchiveALabels","beanData","cols","noresults","footnote","fundtitle","row","otherColumns","rowCols","col","document","documents","doc","url","path","title","size","extension","reportArchiveB","reportArchiveBLabels","reportArchiveBData","message","ftVideoSwitch","transcriptLabel","brightcoveVideoDirectLink","brightcoveVideoEmbedCode","brightcoveVideoFacebookAlt","brightcoveVideoLinkedinAlt","brightcoveVideoModalCloseAlt","brightcoveVideoPlayAlt","brightcoveVideoShareLink","brightcoveVideoTwitterAlt","rawPrice","priceShareClasses","dividendYeild","shClsCD","ukDistributionYeild","navDet","dvndYldUK","SALES_CHARGE_FIELDS","PERCENTAGE","addendumData","CONSTANT","STRING","INFORMATION_FIELDS","keepUnavailableValue","CURRENCY","asOf","updateFreq","DISTRIBUTION_FIELDS","_infoBuilder","rawOverview","fundOverview","priceDetails","shareClasses","normalised","currentClass","getCurrentShareClass","hasDistributions","toUpperCase","currentShareClassCode","currentPriceClass","salesChargesAsOf","distributionsAsOf","distributionsHasData","baseCurrency","getFundCurrency","shareClassCurrency","getShareClassCurrency","getAssetClass","keyedBenchMrks","benchmarkByKey","concattedHtmlBenchmarkNames","getConcattedHtmlBenchmarkNames","dataRepo","fundVehicle","vehicleConfig","desiredSaleChargeFieldIds","desiredIdentifierFieldIds","desiredInformationFieldIds","fields","salesChargeFields","identifierFields","informationFields","distributionFields","stateOBJ","investmentVehicle","getInvestmentVehicle","ratingsConfig","intlFundOverviewValue","fundDet","fndRating","ratings","showMorningStar","includes","msNumberOfStars","Number","ms_rating_ovrl","msCategory","ms_category","as_of_date","showLipper","lipperTotalReturn","lipperConsistentReturn","lipperPreservation","lipperTaxEfficiency","lipperExpense","showObsr","showAnalizy","globalProductsValue","fundDetailIntl","fundUmbrella","calendarYearReturns","rawPerformance","useDynamicLabels","showYTD","shareClassCode","allShareClassDetails","benchMarks","sortedBenchmarkOrder","getSortedBenchmarkOrder","monthlyData","quarterlyData","peersRankList","peerRnksListQtly","displayOEIC","thisMonthlyCalendar","thisQuarterlyCalendar","monthEnd","quarterEnd","_getThisCalendar","calData","tableData","graphData","dateGroup","dynamicLabel","hideChart","showData","fundName","siteVehicle","getSiteVehicle","showFundNumber","isValueInConfigKey","showCurrency","MONTH_END","QUARTER_END","performances","thisPerformanceObj","shClsCde","inceptionDate","inceptionDateLoc","perfIncDt","informationLinkMain","mdash","showMDash","mustHidePerformanceData","dynamicPerformanceLabels","asOfFormat","lastYear","calendarYears","yearAry","link","getSHTableRow","bm","bmrkID","getBMTableRow","IASector","hasIASector","getIATableRow","allRows","allRowsSorted","chartColumns","tableDataToChartData","years","discreteReturns","rawPerformanceFeed","compConfig","hideDiscreteBMOlderThanMainClass","thisMonthlyDiscrete","thisQuarterlyDiscrete","_getThisDiscrete","shareClassDetails","shCls","allYears","countYears","yearsSinceStartDate","countYearsChart","hasIAorBm","chartCols","performanceAnnualised","fundKey","thisMonthlyTable","thisQuarterlyTable","_performanceBuilder","hideAverageAnnualChartFundList","performanceCumulative","performanceGraph","show1M3M6M","graphNames","PC_1YR","processPerformanceChartData","PC_3YR","PC_5YR","PC_10YR","PC_15YR","PC_LIFE","shRow","bmRow","performanceRiskStatistics","fundID","performanceConfig","displayedFundId","showAlpha","_checkConfigForGivenFund","showRSquared","showCorrelation","showUpsideCapture","showDownsideCapture","defaultParam","showStatistics","showBeta","showInfoRatio","showTrackingError","showFundNr","riskStatistics","RSL","riskStatsLists","_riskStatsListBuilder","tables","calcNameStd","_getCalcNameStd","statisticsTable","alphaRow","oneYr","alpha","threeYr","fiveYr","betaRow","beta","infRatioRow","infRatio","histTrackRow","histTrack","correlationRow","correlation","rSquaredRow","rSquared","standardDeviationTable","fundRow","fundNr","stdDev","benchMrkName","bmStdDev","sharpeRatioTable","shRatio","bmShRatio","shareClassName","paramToCheck","param","returnParam","hasFund","fundMeasuresReducer","componentObj","buildInitialState","rawPortfolioDetails","rawPerformanceDetails","performanceDetails","riskStatsList","riskStatsClassData","portfolioDetails","forecastRiskStatsClassData","columnConfig","stdDevRow","bmStdDevRow","betaVsName","forecastStdDevRow","forecastBmStdDevRow","forecastBetaRow","STATISTICS_PORTFOLIO_SUPPRESSION_ID","HOLDINGS_PORTFOLIO_SUPPRESSION_ID","ISSUERS_PORTFOLIO_SUPPRESSION_ID","STATISTIC_FIELDS","statPositionsData","_populateStatPositions","rawPortfolio","rawFundDetail","portfolio","fundInfo","stats","assets","Array","isArray","asset","monthAgoMoment","subtract","fundIncpMoment","isStatsSuppressedByPerfInception","isBefore","issuersList","isStatsSuppressed","isIssuersSuppressed","isHoldingsSuppressed","isSuppressedByPerfInception","_riskContributionBuilder","getROData","riskData","filteredItems","sortBreakdown","getRiskOverview","hasOwnProperty","lstDtls","date","currency","useSuppression","rawRisk","caveatSecName","tableID","riskOverview","_securityExposureBuilder","processSecurityTypeLst","workLstDtls","customLabels","tempOrder","itemCategory","itemCategoryName","itemType","itemTypeName","itemVal","itemRank","itemPrimary","splitter","split","index","newItem","rank","values","existItem","keys","buildSeries","primary","secondary","seriesObj","seriesA","buildCategories","getSecurityType","breakdown","interSecurityTypeData","categories","calType","rawLabels","set","findObjInArray","_dataBuilder","portfolioData","holdings","holding","dates","valuePairsGroupedByAssetClass","valuePairsSortedByPrimaryFlag","tablesByAssetClass","pair","_buildAssetClassTableData","allocationsByAssetClass","tableOrder","primaryHoldings","secondaryHoldings","hldingDetails","rolUp","primaryCalculationName","calName","calNameStd","secondaryCalculationName","primaryElement","secondaryElement","rowOrder","primaryDataPct","secondaryDataPct","stateObj","risk","isSuppressedByLackOfDate","ppssData","ppssConfig","alertData","ppssComponentConfig","fundAlerts","tabsets","baseLink","ts","hideSite","site","funds","softLaunchList","activeList","ppsListIntl","_createFundMapper","_createFundFilter","_createFundLinks","selectedDropdowns","allDropdowns","urlParam","params","dd","selected","parseInt","rating","filterOptions","_createFilterOptions","performanceViewOptions","labelKey","periodEnds","pvo","defaultPerformanceView","periodEnd","performanceView","find","allIdentifiers","allFundIdentifiers","selectedIdentifiers","idObj","showMorningStarColumn","discreteMonthlyLabels","_createLabels","performanceAsOfDateMonthly","discreteQuarterlyLabels","performanceAsOfDateQuarterly","calendarYearMonthlyLabels","calendarYearQuarterlyLabels","ytdAsOfDate","navAsOfDateMonth","navAsOfDateQuarter","fundIdentifiers","display","perfView","asOfMoment","labelObj","thisYear","year","defineProperty","yearsAgo","enumerable","clone","format","endDate","dateRange","fund","currencyList","shareClassList","shareClassFeeStructure","investmentVehicleList","reduce","pass","isActive","isSoftLaunch","tabset","toString","fundLegalName","sixMonthsAgo","oneYearAgo","fundNumber","nav","navChange","mStarRatingOverall","shareClassInceptionDate","performanceInceptionDate","showMDashForUnder1Year","isAfter","showMDashForUnder6Months","alerts","alert","fundObj","legalName","fundShortName","fundNameFull","shareClass","performanceInceptionDateLocal","assetClassTaxonomy","assetClassTaxonomyStd","classGeography","classGeographyStd","classStrategy","classStrategyStd","msFundCategory","isSoftClosure","isHardClosure","navChangeDirection","navAsOfDate","distribution","reportingStatus","taId","isin","cusip","reuters","bloomberg","wkn","sedol","mexid","merrillLynchId","vln","rfi","apri","arsn","fundCode","frontEnd","lowLoad","dsc","dbCode","avgAnn1YearReturnMonthly","avgAnn3YearReturnMonthly","avgAnn5YearReturnMonthly","avgAnn10YearReturnMonthly","avgAnnSinceIncReturnMonthly","avgAnn1YearReturnQuarterly","avgAnn3YearReturnQuarterly","avgAnn5YearReturnQuarterly","avgAnn10YearReturnQuarterly","avgAnnSinceIncReturnQuarterly","calendarYear1yrReturnMonthly","calendarYear2yrReturnMonthly","calendarYear3yrReturnMonthly","calendarYear4yrReturnMonthly","calendarYear5yrReturnMonthly","calendarYear6yrReturnMonthly","calendarYear1yrReturnQuarterly","calendarYear2yrReturnQuarterly","calendarYear3yrReturnQuarterly","calendarYear4yrReturnQuarterly","calendarYear5yrReturnQuarterly","calendarYear6yrReturnQuarterly","cumulativeRetYtdMonthly","cumulativeRet1yrMonthly","cumulativeRet3yrMonthly","cumulativeRet5yrMonthly","cumulativeRet10yrMonthly","cumulativeRetIncMonthly","cumulativeRetYtdQuarterly","cumulativeRet1yrQuarterly","cumulativeRet3yrQuarterly","cumulativeRet5yrQuarterly","cumulativeRet10yrQuarterly","cumulativeRetIncQuarterly","discreteAnnual1yrMonthly","discreteAnnual2yrMonthly","discreteAnnual3yrMonthly","discreteAnnual4yrMonthly","discreteAnnual5yrMonthly","discreteAnnual1yrQuarterly","discreteAnnual2yrQuarterly","discreteAnnual3yrQuarterly","discreteAnnual4yrQuarterly","discreteAnnual5yrQuarterly","ASSET_CLASS","ASSET_CLASS_TAXONOMY","CLASS_GEOGRAPHY","CLASS_STRATEGY","DISTRIBUTION","MS_FUND_CATEGORY","INVESTMENT_VEHICLE","MORNINGSTAR_RATING","REPORTING_STATUS","SHARE_CLASS","decoratoredConfig","pdData","_getNewState","_createAppendPDData","prceDistbIntl","shClsPriceDet","priceHist","fundDetails2","rawConfig2","_appendPriceHistData","fromDate","toDate","divHist","fundDetails3","rawConfig3","_appendDivHistData","_createParseBasicClassData","sort","a","b","className","localeCompare","hasDistributionClasses","some","sc","isDistributionClass","primaryShareClass","cls","toDateStd","shareClassInceptionDateStd","performanceInceptionDateStd","inceptionDateMoment","showPerformanceData","entries","ph","fromDateMoment","downloadKey","dataFullyLoaded","fromDateStd","toDateLoadedStd","fromDateLoadedStd","toDateActualStd","fromDateActualStd","dataExists","dividendHistory","dividendHistoryByYear","dividendYears","pdClasses","matchingClass","pdc","dividend","_parseDividend","highLowNav","hl","highNav","lowNav","navArray","_createParseNavHistory","navDate","isBetween","toDateMoment","isSameOrAfter","isSameOrBefore","min","max","dividendData","dvd","asOfDateStd","asOfDateMoment","asOfDateYear","recordDate","exDividendDate","distributionDate","dividendsPerShare","dh","navObj","navDateFormatted","navChangePercent","navFormatted","navChangeFormatted","navChangePercentFormatted","germanTax","taxData","taxComponentConfig","showTaxColumns","showTaId","showIsin","filterFunds","includeOrExcludeFunds","investmentVehicleCode","classes","concat","interimProfitStd","parseFloat","showCurrencyFootnote","showPositiveProfitFootnote","showNegativeProfitFootnote","fundShareClassName","redemptionPrice","interimProfit","equityGainEstG","equityGainKstG","realEstateProfit","accumulatedDividendIncome","FUND_NAME","ftMultiSelectBar","selectMultiple","selectedPdfs","editLabel","emailSelectedLabel","downloadLink","editSelectedDocumentsText","emailSelectedDocumentsText","downloadSelectedDocumentsText","fromNameText","removeRecipientText","recipientNameText","recipientEmailText","addRecipientText","messageLabel","yourDocumentsSentText","backLabel","continueLabel","sendLink","validFromName","validToName","validEmail","ftTypeAheadSearch","classLabel","emptyResults","searchInput","parseFundAlerts","arrayConvertListOfFields","_alertMapper","f","content","managerRoster","rawFundData","managerRosterData","managerRosterFundData","managerData","rosterContent","showAllocations","showManagerAllocations","allocations","allocationsGroupedByName","brkDwnLst","group","allocationGroup","total","managers","manager","displayName","name2","detail","image","fullDesc","shortDesc","sectorExposure","seObj","val2","val3","dateObj","getDateAndCalType","calTypeStd","tableTwoLevel","hasNestedChildren","missingBenchmarkData","bmrkId"],"mappings":";;;;;;UAmBgBA,YAAAA;AAAT,WAASA,SAAT,CAAmBC,OAAnB,EAA4B;AAEjC,QAAIC,QAAQ,sBAAZ;;AAEA,uBAASC,QAAT,CAAkBC,QAAlB,CAA2BC,MAA3B,CAAkC,CAAlC,EAAqC,mBAASF,QAAT,CAAkBC,QAAlB,CAA2BE,OAA3B,mCAArC;;AAEA,oCAAgBL,OAAhB,EAAyB;AACvBM,kCADuB;AAEvBL,kBAFuB;AAGvBM,yBAHuB;AAIvBC,wCAJuB;AAKvBC,uBAAiB;AALM,KAAzB;AAOD;;;;;;;;AC5BM,MAAMF,wBAAQ;AAEnBG,eAAW;AACTC,eAAS,CACP,YADO,CADA;AAITC,mBAAa,CACX,YADW,EAEX,iBAFW,CAJJ;AAQTC,qBAAe,CACb,gBADa,CARN;AAWTC,iBAAW,CACT,SADS,EAET,gBAFS,EAGT,eAHS,CAXF;AAgBTC,mBAAa,CACX,iBADW,CAhBJ;AAmBTC,iBAAW,CACT,eADS,CAnBF;AAsBTC,cAAQ,CACN,gBADM,CAtBC;AAyBTC,uBAAiB,CACf,+BADe,EAEf,6BAFe,CAzBR;AA6BTC,YAAM,CACJ,SADI,EAEJ,gBAFI,EAGJ,eAHI,CA7BG;AAkCTC,6BAAuB,CACrB,cADqB,EAGrB,gBAHqB,EAIrB,iBAJqB,EAKrB,gBALqB,CAlCd;AAyCTC,uCAAiC,CAC/B,cAD+B,EAE/B,iBAF+B,EAG/B,gBAH+B,EAI/B,0BAJ+B,CAzCxB;AA+CTC,yBAAmB,CACjB,cADiB,EAEjB,iBAFiB,EAGjB,gBAHiB,CA/CV;AAoDTC,iCAA2B,CACz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AA0B5uB,cAAc4uB,iBAAxC;AACAP,YAAMQ,oBAAN,GAA6BR,MAAMS,MAAN,KAAiB10B,SAA9C;AACD;AACD,WAAOi0B,KAAP;AACD","file":"web-platform-gw.js","sourcesContent":["import {commonConfigure} from '../common/configure';\n\n// gw beans\nimport {beans} from '../gw/beans';\n// gw components\nimport {components} from '../gw/components';\n// gw reducers\nimport {reducers} from '../gw/reducers';\n// gw initial state\nimport {getState} from '../gw/state';\n// uk specific reducers\nimport {fundInformation as ukFundInformation} from '../../components/products/overview/ft-fund-information/lib/en-gb/fund-information.reducer';\n// reducers to replace\nimport {fundInformation} from '../../components/products/overview/ft-fund-information/lib/gw/fund-information.reducer';\n\n/**\n * generic configuration for gw\n * @param aurelia\n */\nexport function configure(aurelia) {\n // get initial state of redux store\n let state = getState();\n // replace fundInformation from gw with uk specific version\n reducers.products.specific.splice(1, reducers.products.specific.indexOf(fundInformation), ukFundInformation);\n\n commonConfigure(aurelia, {\n reducers,\n state,\n beans,\n components,\n dataServiceConf: 'gw'\n });\n}\n","/**\n * bean configuration for FT.com\n */\n\nexport const beans = {\n // list of beans for each component\n component: {\n caveats: [\n 'gw.caveats'\n ],\n caveatsFund: [\n 'gw.caveats',\n 'gw.fund-details'\n ],\n configuration: [\n 'gw.fund-config'\n ],\n findAFund: [\n 'gw.ppss', //COREWEB-2168 change this to 'gw.fund-list' when new feed exists\n 'gw.fund-config',\n 'gw.fund-alert'\n ],\n fundDetails: [\n 'gw.fund-details'\n ],\n fundAlert: [\n 'gw.fund-alert'\n ],\n labels: [\n 'gw.fund-labels'\n ],\n labelsMarketing: [\n 'gw.marketing-component-labels',\n 'gw.json-content-type-labels'\n ],\n ppss: [\n 'gw.ppss',\n 'gw.fund-config',\n 'gw.fund-alert'\n ],\n portfolioFundMeasures: [\n 'gw.portfolio',\n // FIXME: Remove gw.performance once COREWEB-2045 complete, and get data from gw.portfolio instead\n 'gw.performance',\n 'gw.fund-details',\n 'gw.fund-config'\n ],\n portfolioStatisticsAndPositions: [\n 'gw.portfolio',\n 'gw.fund-details',\n 'gw.fund-config',\n 'gw.single-fund-lscs-data'\n ],\n portfolioCharting: [\n 'gw.portfolio',\n 'gw.fund-details',\n 'gw.fund-config'\n ],\n portfolioRiskContribution: [\n 'gw.portfolio',\n 'gw.fund-config'\n ],\n portfolioSecurityTypeExposure: [\n 'gw.portfolio',\n 'gw.fund-details',\n 'gw.fund-config',\n 'gw.fund-labels'\n ],\n portfolioSectorExposure: [\n 'gw.portfolio',\n 'gw.fund-details',\n 'gw.fund-config'\n ],\n valueAtRisk: [\n 'gw.portfolio',\n 'gw.fund-details',\n 'gw.fund-config'\n ],\n topRiskAllocationByAssetClass: [\n 'gw.portfolio',\n 'gw.fund-details',\n 'gw.fund-config'\n ],\n managerRosterAndAllocation: [\n 'gw.portfolio',\n 'gw.fund-details',\n 'gw.fund-config',\n 'gw.manager-roster.shared',\n 'gw.manager-roster.fund'\n ],\n performance: [\n 'gw.performance',\n 'gw.performance-history',\n 'gw.fund-config',\n 'gw.fund-details'\n ],\n performanceSimply: [\n 'gw.performance',\n 'gw.fund-config',\n 'gw.fund-details'\n ],\n pricingDistribution: [\n 'gw.price-distribution',\n // TODO: add once feeds working\n // 'gw.nav-history',\n // 'gw.distribution-history',\n 'gw.fund-details',\n 'gw.fund-config'\n ],\n priceHistory: [\n 'gw.price-history',\n 'gw.fund-details',\n 'gw.fund-config'\n ],\n distributionHistory: [\n 'gw.distribution-history',\n 'gw.fund-details',\n 'gw.fund-config'\n ],\n fundInformation: [\n 'gw.overview',\n 'gw.fund-details',\n 'gw.price-distribution',\n 'gw.fund-config'\n ],\n fundRatings: [\n 'gw.overview',\n 'gw.fund-details',\n 'gw.fund-config'\n ],\n fundStaticBar: [\n 'gw.overview',\n 'gw.fund-details',\n 'gw.fund-config'\n ],\n tax: [\n 'gw.price-tax'\n ]\n },\n // parameter map to set in request - key is attribute in action and value is url request key (Map rather than Object as order matters).\n // KEEP in alphabetical order!\n // See Bean configuration in Java here\n // GW-Maintenance\\teamsite-customisation\\livesite-customer-src\\etc\\classes\\conf\\international\\international-funds-services-application-context.xml\n bean: {\n 'gw.fund-details': {\n parameters: new Map([['fundId', 'FundID']])\n },\n 'gw.fund-labels': {\n parameters: new Map([['debug', 'debug']])\n },\n 'gw.manager-roster.fund': {\n parameters: new Map([['fundId', 'FundID']])\n },\n 'gw.nav-history': {\n parameters: new Map([['fundId', 'FundID']])\n },\n 'gw.overview': {\n parameters: new Map([['fundId', 'FundID']])\n },\n 'gw.performance': {\n parameters: new Map([['fundId', 'FundID']])\n },\n 'gw.performance-history': {\n parameters: new Map([['fundId', 'FundID']])\n },\n 'gw.portfolio': {\n parameters: new Map([['fundId', 'FundID']])\n },\n 'gw.price': {\n parameters: new Map([['fundId', 'FundID']])\n },\n 'gw.price-distribution': {\n parameters: new Map([['fundId', 'FundID']])\n },\n 'gw.distribution-history': {\n parameters: new Map([['fundId', 'FundID'], ['shareClassCode', 'ShareClass']])\n },\n 'gw.price-history': {\n parameters: new Map([['fundId', 'FundID'], ['shareClassCode', 'ShareClass'], ['toDate', 'toDate'], ['fromDate', 'fromDate']])\n },\n 'gw.single-fund-lscs-data': {\n parameters: new Map([['fundId', 'FundID'], ['cmsTypeId', 'cmsTypeID']])\n }\n }\n};\n","/**\n * Component configuration for International sites\n *\n * KEEP in alphabetical order!\n * if gets messy --> JSON.stringify(xxx.sort(), null, ' ')\n */\nexport const components = [\n 'components/products/overview/ft-fund-information/gw/ft-fund-information',\n 'components/products/overview/ft-fund-ratings/ft-fund-ratings',\n 'components/products/overview/ft-fund-static-bar/ft-fund-static-bar',\n 'components/products/overview/ft-performance-snapshot/ft-performance-snapshot',\n 'components/products/performance/ft-calendar-year-returns/ft-calendar-year-returns',\n 'components/products/performance/ft-calendar-year-returns/ft-calendar-year-tab',\n 'components/products/performance/ft-discrete-returns/ft-discrete-returns',\n 'components/products/performance/ft-performance-annualised/ft-performance-annualised',\n 'components/products/performance/ft-performance-cumulative/ft-performance-cumulative',\n 'components/products/performance/ft-performance-risk-statistics/ft-performance-risk-statistics',\n 'components/products/portfolio/ft-asset-allocation/gw/ft-asset-allocation',\n 'components/products/portfolio/ft-asset-class-exposure/gw/ft-asset-class-exposure',\n 'components/products/portfolio/ft-average-portfolio-exposure/gw/ft-average-portfolio-exposure',\n 'components/products/portfolio/ft-currency-breakdown/gw/ft-currency-breakdown',\n 'components/products/portfolio/ft-fund-measures/gw/ft-fund-measures',\n 'components/products/portfolio/ft-geographic-breakdown/gw/ft-geographic-breakdown',\n 'components/products/portfolio/ft-geographic-exposure/gw/ft-geographic-exposure',\n 'components/products/portfolio/ft-manager-roster/gw/ft-manager-roster',\n 'components/products/portfolio/ft-market-capitalisation/ft-market-capitalisation',\n 'components/products/portfolio/ft-portfolio-allocation/ft-portfolio-allocation',\n 'components/products/portfolio/ft-portfolio-exposure/gw/ft-portfolio-exposure',\n 'components/products/portfolio/ft-portfolio-no-data-message/ft-portfolio-no-data-message',\n 'components/products/portfolio/ft-portfolio-risk-and-return-analysis/gw/ft-portfolio-risk-and-return-analysis',\n 'components/products/portfolio/ft-portfolio-statistics-and-positions/gw/ft-portfolio-statistics-and-positions',\n 'components/products/portfolio/ft-sector-allocation/gw/ft-sector-allocation',\n 'components/products/portfolio/ft-sector-exposure/gw/ft-sector-exposure',\n 'components/products/portfolio/ft-security-type-exposure/gw/ft-security-type-exposure',\n 'components/products/portfolio/ft-strategy-breakdown/gw/ft-strategy-breakdown',\n 'components/products/portfolio/ft-top-exposures/ft-top-exposures',\n 'components/products/portfolio/ft-top-risk-allocation-by-asset-class/gw/ft-top-risk-allocation-by-asset-class',\n 'components/products/portfolio/ft-top-ten-holdings/gw/ft-top-ten-holdings',\n 'components/products/portfolio/ft-value-at-risk/gw/ft-value-at-risk',\n 'components/products/portfolio/ft-risk-contribution/gw/ft-risk-contribution-actual',\n 'components/products/portfolio/ft-risk-contribution/gw/ft-risk-contribution-forecast',\n 'components/products/ppss/ft-find-a-fund/ft-find-a-fund',\n 'components/products/ppss/ft-find-a-fund-btn/ft-find-a-fund-btn',\n 'components/products/ppss/ft-ppss-favorite/ft-ppss-favorite',\n 'components/products/ppss/ft-ppss-fund-filter/ft-ppss-fund-filter',\n 'components/products/ppss/ft-ppss-fund-identifiers/ft-ppss-fund-identifiers',\n 'components/products/ppss/ft-ppss-fund-name/ft-ppss-fund-name',\n 'components/products/ppss/ft-ppss-performance/ft-ppss-performance',\n 'components/products/ppss/ft-ppss-performance/ft-ppss-performance-cell',\n 'components/products/ppss/ft-ppss-search-box/ft-ppss-search-box',\n 'components/products/ppss/ft-ppss-tab-header/ft-ppss-tab-header',\n 'components/products/ppss/ft-ppss-table-toolbar/ft-ppss-table-toolbar',\n 'components/products/ppss/ft-ppss/ft-ppss',\n 'components/products/pricing-distribution/ft-dividends-historical/ft-dividends-historical',\n 'components/products/pricing-distribution/ft-dividends/ft-dividends',\n 'components/products/pricing-distribution/ft-nav-high-low/ft-nav-high-low',\n 'components/products/pricing-distribution/ft-price-chart/ft-price-chart',\n 'components/products/pricing-distribution/ft-pricing-distribution/ft-pricing-distribution',\n 'components/products/pricing-distribution/ft-share-prices/ft-share-prices',\n 'components/products/tax/ft-german-tax/ft-german-tax'\n];\n","import {commonConfigure} from '../common/configure';\n\n// gw beans\nimport {beans} from './beans';\n// gw components\nimport {components} from './components';\n// gw reducers\nimport {reducers} from './reducers';\n// gw initial state\nimport {getState} from './state';\n\n/**\n * generic configuration for gw\n * @param aurelia\n */\nexport function configure(aurelia) {\n // get initial state of redux store\n let state = getState();\n\n commonConfigure(aurelia, {\n reducers,\n state,\n beans,\n components,\n dataServiceConf: 'gw'\n });\n}\n","import {combineProductsReducers} from '../../components/products/lib/combine-products-reducers';\nimport {marketingReducers} from '../common/marketing-reducers';\n\n// reducers\nimport {general as generalReducer} from '../../lib/general.reducer';\nimport {labelLoader} from '../../components/products/lib/reducers/labels/label-loader.reducer';\nimport {fundDetailsReducer} from '../../components/products/lib/reducers/fund-details/fund-details.reducer';\nimport {configurationLoader} from '../../components/products/lib/reducers/fund-config/config-loader.reducer';\nimport {caveatsReducer} from '../../components/products/common/elements/ft-caveats/lib/caveats.reducer';\nimport {caveatsReducer as caveatsDataReducer} from '../../components/products/lib/reducers/caveats/caveats.reducer';\nimport {modalReducer} from '../../components/common/elements/ft-modal/lib/ft-modal.reducer';\nimport {ppss} from '../../components/products/ppss/ft-ppss/lib/ppss.reducer';\nimport {findAFund} from '../../components/products/ppss/ft-find-a-fund/lib/find-a-fund.reducer';\n// gw reducers\nimport {fundAlert} from '../../components/products/common/elements/ft-fund-alert/lib/gw/fund-alert.reducer';\nimport {ppss as ppssGW} from '../../components/products/ppss/ft-ppss/lib/gw/ppss.reducer';\nimport {pricingDistribution as pricingDistributionApp} from '../../components/products/pricing-distribution/ft-pricing-distribution/lib/pricing-distribution.reducer';\nimport {pricingDistribution as pricingDistributionGW} from '../../components/products/pricing-distribution/ft-pricing-distribution/lib/gw/pricing-distribution.reducer';\nimport {performanceCumulative as performanceCumulativeTabs} from '../../components/products/performance/ft-performance-cumulative/lib/performance-cumulative.reducer';\nimport {performanceCumulative as performanceCumulativeGW} from '../../components/products/performance/ft-performance-cumulative/lib/gw/performance-cumulative.reducer';\nimport {performanceAnnualised as performanceAnnualisedTabs} from '../../components/products/performance/ft-performance-annualised/lib/performance-annualised.reducer';\nimport {performanceAnnualised as performanceAnnualisedGW} from '../../components/products/performance/ft-performance-annualised/lib/gw/performance-annualised.reducer';\nimport {calendarYearReturns as calendarYearTabs} from '../../components/products/performance/ft-calendar-year-returns/lib/calendar-year-returns.reducer';\nimport {calendarYearReturns as calendarYearReturnsGW} from '../../components/products/performance/ft-calendar-year-returns/lib/gw/calendar-year-returns.reducer';\nimport {fundInformation} from '../../components/products/overview/ft-fund-information/lib/gw/fund-information.reducer';\nimport {fundRatings} from '../../components/products/overview/ft-fund-ratings/lib/gw/fund-ratings.reducer';\nimport {discreteReturns as discreteTabs} from '../../components/products/performance/ft-discrete-returns/lib/discrete-returns.reducer';\nimport {discreteReturns} from '../../components/products/performance/ft-discrete-returns/lib/gw/discrete-returns.reducer';\nimport {shareClassFilterReducer} from '../../components/products/common/elements/ft-share-class-filter/lib/share-class-filter.reducer';\nimport {performanceRiskStatistics} from '../../components/products/performance/ft-performance-risk-statistics/lib/gw/performance-risk-statistics.reducer';\nimport {germanTax} from '../../components/products/tax/ft-german-tax/lib/gw/german-tax.reducer';\nimport {tax} from '../../components/products/tax/ft-german-tax/lib/tax.reducer';\nimport {fundStaticBar} from '../../components/products/overview/ft-fund-static-bar/lib/gw-etf/fund-static-bar.reducer';\n\n// ** Portfolio components\nimport {portfolioChartReducer} from '../../components/products/portfolio/lib/gw/portfolio-chart.reducer';\nimport {portfolioStatisticsAndPositions as portfolioStatisticsAndPositionsGW} from '../../components/products/portfolio/ft-portfolio-statistics-and-positions/lib/gw/portfolio-statistics-and-positions.reducer';\nimport {sectorExposure} from '../../components/products/portfolio/ft-sector-exposure/gw/lib/gw/sector-exposure.reducer';\nimport {securityTypeExposure} from '../../components/products/portfolio/ft-security-type-exposure/lib/gw/security-type-exposure.reducer';\nimport {valueAtRisk} from '../../components/products/portfolio/ft-value-at-risk/gw/lib/value-at-risk.reducer';\nimport {topRiskAllocationByAssetClass} from '../../components/products/portfolio/ft-top-risk-allocation-by-asset-class/gw/lib/top-risk-allocation-by-asset-class.reducer';\nimport {managerRoster} from '../../components/products/portfolio/ft-manager-roster/gw/lib/gw/manager-roster.reducer';\nimport {riskContribution} from '../../components/products/portfolio/ft-risk-contribution/lib/gw/risk-contribution.reducer';\nimport {fundMeasuresReducer} from '../../components/products/portfolio/ft-fund-measures/gw/lib/fund-measures.reducer';\nimport {portfolioNoDataMessageReducer} from '../../components/products/portfolio/ft-portfolio-no-data-message/lib/portfolio-no-data-message.reducer';\n\n// **\nexport const reducers = {\n products: combineProductsReducers({\n general: [ // for all funds\n shareClassFilterReducer,\n fundDetailsReducer,\n labelLoader,\n caveatsDataReducer,\n caveatsReducer,\n configurationLoader,\n modalReducer,\n fundAlert,\n ppss,\n ppssGW,\n findAFund,\n pricingDistributionApp,\n performanceCumulativeTabs,\n performanceAnnualisedTabs,\n portfolioChartReducer,\n calendarYearTabs,\n discreteTabs,\n germanTax,\n tax\n ],\n specific: [ // fund specific\n portfolioStatisticsAndPositionsGW,\n portfolioNoDataMessageReducer,\n performanceCumulativeGW,\n performanceAnnualisedGW,\n calendarYearReturnsGW,\n performanceRiskStatistics,\n fundInformation,\n fundRatings,\n fundStaticBar,\n discreteReturns,\n pricingDistributionGW,\n sectorExposure,\n securityTypeExposure,\n valueAtRisk,\n topRiskAllocationByAssetClass,\n managerRoster,\n riskContribution,\n fundMeasuresReducer\n ]\n }),\n marketing: marketingReducers,\n general: generalReducer\n};\n","import {getInitialState} from '../common/configure';\r\n\r\nexport function getState() {\r\n let state = getInitialState();\r\n\r\n // define GW find-a-fund options\r\n state.products.app.ppss.findAFund.searchProperties = [\r\n {name: 'FUND_NAME_FULL', dataKey: 'fundNameFull'},\r\n {name: 'TA_ID', dataKey: 'taId'},\r\n {name: 'ISIN', dataKey: 'isin'},\r\n {name: 'CUSIP', dataKey: 'cusip'},\r\n {name: 'REUTERS', dataKey: 'reuters'},\r\n {name: 'BLOOMBERG', dataKey: 'bloomberg'},\r\n {name: 'WKN', dataKey: 'wkn'},\r\n {name: 'SEDOL', dataKey: 'sedol'},\r\n {name: 'VLN', dataKey: 'vln'},\r\n {name: 'MEXID', dataKey: 'mexid'},\r\n {name: 'APRI', dataKey: 'apri'},\r\n {name: 'ARSN', dataKey: 'arsn'},\r\n {name: 'FUND_CODE', dataKey: 'fundCode'},\r\n {name: 'FRONT_END', dataKey: 'frontEnd'},\r\n {name: 'LOW_LOAD', dataKey: 'lowLoad'},\r\n {name: 'DSC', dataKey: 'dsc'},\r\n {name: 'DB_CODE', dataKey: 'dbCode'}\r\n ];\r\n\r\n // define GW ppss options\r\n state.products.app.ppss.config.showFundIdentifiersTab = true;\r\n state.products.app.ppss.config.showKeywordsFilter = true;\r\n\r\n // define ppss filters available\r\n state.products.app.ppss.filters = {\r\n favorites: false,\r\n dropdowns: [],\r\n keywords: {\r\n // TODO: refactor to use findAFund.searchProperties directly\r\n searchKeys: state.products.app.ppss.findAFund.searchProperties.map(prop => prop.dataKey),\r\n searchString: ''\r\n }\r\n };\r\n\r\n return state;\r\n}\r\n","import {inject, observable} from 'aurelia-framework';\nimport {ReduxComponentBase} from '../../../../../lib/redux-component-base';\nimport {getFundState} from '../../../lib/map-state-utils';\nimport get from 'lodash/get';\n\n@inject('Store', 'Beans', Element)\nexport class FtFundInformation extends ReduxComponentBase {\n /**\n * @type {boolean}\n */\n isPopulated = false;\n\n @observable currentShareClass;\n\n constructor(store, beans, element) {\n // add logging and integration with the data store\n super(store);\n this.store = store;\n this.fundId = this.fundId = element.getAttribute('fund-id');\n this.beans = beans.component.fundInformation;\n let currentState = this.store.getState();\n this.currentShareClass = get(currentState, 'products.app.currentShareClass', false);\n this.segment = get(currentState, 'general.segment');\n // This is a top level component so we need to initiate the population\n this.currentShareClassChanged();\n }\n\n currentShareClassChanged() {\n this.dispatch({\n type: 'POPULATE_FUND_INFORMATION',\n beans: this.beans,\n fundId: this.fundId,\n segment: this.segment,\n shareClassKey: this.currentShareClass\n });\n }\n\n /**\n * Called when the state changes.\n */\n mapState(newState) {\n try {\n let fundState = getFundState(newState, this.fundId);\n this.currentShareClass = get(newState, 'products.app.currentShareClass', false);\n this.label = get(newState, 'products.label');\n if (!fundState ||\n !fundState.fundInformation ||\n !this.label) {\n this.isPopulated = false;\n return;\n }\n let vo = fundState.fundInformation;\n\n this.fundInformation = vo.fundInformation;\n this.salesCharges = vo.salesCharges;\n this.identifiers = vo.identifiers;\n this.distributions = vo.distributions;\n this.tradingCharacteristics = vo.tradingCharacteristics;\n\n this.isPopulated = true;\n } catch (e) {\n this.logger.error(e);\n this.isPopulated = false;\n }\n }\n}\n","import {inject, useView} from 'aurelia-framework';\nimport {FtGenericChartComponentBase} from '../../common/ft-generic-chart-component-base';\n\n@useView('../../common/ft-generic-chart-component-base.html')\n@inject('Store', 'Beans', Element)\nexport class FtAssetAllocation extends FtGenericChartComponentBase {\n init() {\n this.CHART_TYPE_ID = 'ASSET_ALLOCATION';\n this.COMPONENT_ID = 'asset-allocation';\n this.DATA_COLUMN_LABEL_ID = 'asset-allocation-fund';\n }\n}\n","import {useView, inject} from 'aurelia-framework';\nimport {ReduxComponentBase} from '../../../../../lib/redux-component-base';\nimport get from 'lodash/get';\n\n@useView('../../common/ft-generic-exposure-component.html')\n@inject('Store', 'Beans', Element)\nexport class FtAssetClassExposure extends ReduxComponentBase {\n /**\n * @type {boolean}\n */\n isPopulated = false;\n\n constructor(store, beans, element) {\n super(store);\n\n this.fundId = element.getAttribute('fund-id');\n this.cid = element.getAttribute('cid');\n\n this.portfolioBeans = beans.component.portfolioCharting.slice(0);\n this.portfolioBeans.push(this.cid);\n\n const currentState = store.getState();\n this.dispatch({\n type: 'POPULATE_PORTFOLIO_CHART',\n beans: this.portfolioBeans,\n fundId: this.fundId,\n cid: this.cid,\n chartType: 'ASSET_EXPOSURE',\n portfolioComponent: 'asset-class-exposure',\n segment: currentState.general.segment\n });\n }\n\n /**\n * Called when the state changes.\n */\n mapState(newState) {\n try {\n let chartState = get(newState, `products.app.portfolio.chart[${this.cid}]`, false);\n this.label = get(newState, 'products.label');\n this.data = chartState;\n if (!this.label ||\n !chartState ||\n !chartState.visible) {\n this.isPopulated = false;\n return;\n }\n\n this.isPopulated = true;\n } catch (e) {\n this.logger.error(e);\n this.isPopulated = false;\n }\n }\n}\n","import {inject, useView} from 'aurelia-framework';\nimport {FtGenericChartComponentBase} from '../../common/ft-generic-chart-component-base';\n\n@useView('../../common/ft-generic-chart-component-base.html')\n@inject('Store', 'Beans', Element)\nexport class FtAveragePortfolioExposure extends FtGenericChartComponentBase {\n init() {\n this.CHART_TYPE_ID = 'AVERAGE_PORTFOLIO_EXPOSURE';\n this.COMPONENT_ID = 'average-portfolio-exposure';\n this.DATA_COLUMN_LABEL_ID = 'average-portfolio-exposure';\n }\n}\n","import {inject, useView} from 'aurelia-framework';\nimport {FtGenericChartComponentBase} from '../../common/ft-generic-chart-component-base';\n\n@useView('../../common/ft-generic-chart-component-base.html')\n@inject('Store', 'Beans', Element)\nexport class FtCurrencyBreakdown extends FtGenericChartComponentBase {\n init() {\n this.CHART_TYPE_ID = 'CURRENCY_ALLOCATION';\n this.COMPONENT_ID = 'currency-breakdown';\n this.DATA_COLUMN_LABEL_ID = 'currency-breakdown-fund';\n }\n}\n","import {inject, observable} from 'aurelia-framework';\nimport {ReduxComponentBase} from '../../../../../lib/redux-component-base';\nimport get from 'lodash/get';\n\n@inject('Store', 'Beans', Element)\nexport class FtFundMeasures extends ReduxComponentBase {\n /**\n * @type {boolean}\n */\n isPopulated = false;\n @observable shareClassKey;\n\n constructor(store, beans, element) {\n super(store);\n const currentState = store.getState();\n this.fundId = element.getAttribute('fund-id');\n this.cid = element.getAttribute('cid');\n this.portfolioBeans = beans.component.portfolioFundMeasures;\n this.portfolioBeans.push(this.cid);\n\n this.populateAction = {\n type: 'POPULATE_FUND_MEASURES',\n beans: this.portfolioBeans,\n fundId: this.fundId,\n cid: this.cid,\n portfolioComponent: 'fund-measure-actual-and-forecast',\n segment: currentState.general.segment\n };\n\n this.shareClassKey = get(currentState, 'products.app.currentShareClass', false);\n }\n\n /**\n * called when share class is changed\n */\n shareClassKeyChanged() {\n this.populateAction.shareClassKey = this.shareClassKey;\n if (this.fundId) {\n this.dispatch(this.populateAction);\n }\n }\n\n /**\n * Called when the state changes.\n */\n mapState(newState) {\n try {\n this.shareClassKey = get(newState, 'products.app.currentShareClass', false);\n let fundState = get(newState, `products.funds[${this.fundId}]`, null);\n this.data = get(fundState, 'portfolio.fundMeasures');\n this.label = get(newState, 'products.label');\n if (!this.label || !this.data || !this.data.riskStats.visible || !this.data.forecastRiskStats.visible) {\n this.isPopulated = false;\n return;\n }\n\n this.isPopulated = true;\n } catch (e) {\n this.logger.error(e);\n this.isPopulated = false;\n }\n }\n}\n","import {inject, useView} from 'aurelia-framework';\nimport {FtGenericChartComponentBase} from '../../common/ft-generic-chart-component-base';\n\n@useView('../../common/ft-generic-chart-component-base.html')\n@inject('Store', 'Beans', Element)\nexport class FtGeographicBreakdown extends FtGenericChartComponentBase {\n init() {\n this.CHART_TYPE_ID = 'GEOGRAPHIC_BREAKDOWN';\n this.COMPONENT_ID = 'geographic-breakdown';\n this.DATA_COLUMN_LABEL_ID = 'geographic-breakdown-fund';\n }\n}\n","import {useView, inject} from 'aurelia-framework';\nimport {ReduxComponentBase} from '../../../../../lib/redux-component-base';\nimport get from 'lodash/get';\n\n@useView('../../common/ft-generic-exposure-component.html')\n@inject('Store', 'Beans', Element)\nexport class FtGeographicExposure extends ReduxComponentBase {\n populated = false;\n\n constructor(store, beans, element) {\n super(store);\n this.fundId = element.getAttribute('fund-id');\n this.cid = element.getAttribute('cid');\n\n this.portfolioBeans = beans.component.portfolioCharting.slice(0);\n this.portfolioBeans.push(this.cid);\n\n const currentState = store.getState();\n this.dispatch({\n type: 'POPULATE_PORTFOLIO_CHART',\n beans: this.portfolioBeans,\n fundId: this.fundId,\n chartType: 'GEOGRAPHIC_EXPOSURE',\n cid: this.cid,\n portfolioComponent: 'geographic-exposure',\n segment: currentState.general.segment\n });\n }\n\n /**\n * Called when the state changes.\n */\n mapState(newState) {\n try {\n let chartState = get(newState, `products.app.portfolio.chart[${this.cid}]`, false);\n this.label = get(newState, 'products.label');\n this.data = chartState;\n if (!this.label ||\n !chartState ||\n !chartState.visible) {\n this.isPopulated = false;\n return;\n }\n\n this.isPopulated = true;\n } catch (e) {\n this.logger.error(e);\n this.isPopulated = false;\n }\n }\n}\n","import { inject } from 'aurelia-framework';\nimport { ReduxComponentBase } from '../../../../../lib/redux-component-base';\nimport { getFundState } from '../../../lib/map-state-utils';\nimport get from 'lodash/get';\n\n@inject('Store', 'Beans', Element)\nexport class FtManagerRoster extends ReduxComponentBase {\n isPopulated = false;\n\n constructor(store, beans, element) {\n super(store);\n this.fundId = element.getAttribute('fund-id');\n this.cid = element.getAttribute('cid');\n this.portfolioBeans = beans.component.managerRosterAndAllocation;\n this.portfolioBeans.push(this.cid);\n\n const currentState = store.getState();\n this.dispatch({\n type: 'POPULATE_MANAGER_ROSTER_AND_ALLOCATION',\n beans: beans.component.managerRosterAndAllocation,\n fundId: this.fundId,\n cid: this.cid,\n portfolioComponent: 'manager-roster-manager-allocation',\n segment: currentState.general.segment\n });\n }\n\n /**\n * Called when the state changes.\n */\n mapState(newState) {\n try {\n this.logger.debug('mapState()');\n let fundState = getFundState(newState, this.fundId);\n this.label = get(newState, 'products.label');\n\n if (!this.label ||\n !fundState ||\n !fundState.managerRosterAndAllocation ||\n !fundState.managerRosterAndAllocation.data.managerAllocations) {\n this.isPopulated = false;\n return;\n }\n\n this.data = fundState.managerRosterAndAllocation.data;\n this.caveats = fundState.managerRosterAndAllocation.caveats;\n\n this.isPopulated = true;\n } catch (e) {\n this.logger.error(e);\n this.isPopulated = false;\n }\n }\n}\n","import {inject, useView} from 'aurelia-framework';\nimport {FtGenericChartComponentBase} from '../../common/ft-generic-chart-component-base';\n\n@useView('../../common/ft-generic-chart-component-base.html')\n@inject('Store', 'Beans', Element)\nexport class FtPortfolioExposure extends FtGenericChartComponentBase {\n init() {\n this.CHART_TYPE_ID = 'PORTFOLIO_EXPOSURE';\n this.COMPONENT_ID = 'portfolio-exposure';\n this.DATA_COLUMN_LABEL_ID = 'portfolio-exposure';\n }\n}\n","import {inject} from 'aurelia-framework';\nimport {FtGenericHierarchicalComponentBase} from '../../common/ft-generic-hierarchical-component-base';\nimport get from 'lodash/get';\n\n@inject('Store', 'Beans', Element)\nexport class FtPortfolioRiskAndReturnAnalysis extends FtGenericHierarchicalComponentBase {\n /**\n * @type {boolean}\n */\n isPopulated = false;\n\n constructor(store, beans, element) {\n // add logging and integration with the data store\n super(store);\n this.fundId = element.getAttribute('fund-id');\n this.cid = element.getAttribute('cid');\n\n this.portfolioBeans = beans.component.portfolioCharting.slice(0);\n this.portfolioBeans.push(this.cid);\n\n const currentState = store.getState();\n this.dispatch({\n type: 'POPULATE_PORTFOLIO_CHART',\n beans: this.portfolioBeans,\n fundId: this.fundId,\n chartType: 'RISK_AND_RETURN_ANALYSIS',\n cid: this.cid,\n portfolioComponent: 'portfolio-risk-and-return-analysis',\n segment: currentState.general.segment\n });\n }\n\n /**\n * Called when the state changes.\n */\n mapState(newState) {\n try {\n let chartState = get(newState, `products.app.portfolio.chart[${this.cid}]`, false);\n this.label = get(newState, 'products.label');\n this.data = chartState;\n if (!this.label ||\n !chartState ||\n !chartState.visible) {\n this.isPopulated = false;\n return;\n }\n\n this.isPopulated = true;\n } catch (e) {\n this.logger.error(e);\n this.isPopulated = false;\n }\n }\n}\n","import {inject} from 'aurelia-framework';\nimport {ReduxComponentBase} from '../../../../../lib/redux-component-base';\nimport {getFundState} from '../../../lib/map-state-utils';\nimport get from 'lodash/get';\n\n@inject('Store', 'Beans', Element)\nexport class FtPortfolioStatisticsAndPositions extends ReduxComponentBase {\n isPopulated = false;\n\n constructor(store, beans, element) {\n super(store);\n this.fundId = element.getAttribute('fund-id');\n this.cmsTypeId = 'PORTFOLIO-HOLDINGS';\n this.cid = element.getAttribute('cid');\n this.portfolioBeans = beans.component.portfolioStatisticsAndPositions;\n this.portfolioBeans.push(this.cid);\n this.portfolioBeans.push(this.cmsTypeId);\n\n const currentState = store.getState();\n this.dispatch({\n type: 'POPULATE_PORTFOLIO_STATISTICS_AND_POSITIONS',\n beans: this.portfolioBeans,\n fundId: this.fundId,\n cmsTypeId: this.cmsTypeId,\n cid: this.cid,\n segment: currentState.general.segment\n });\n }\n\n /**\n * Called when the state changes.\n *\n * @param {Object} newState\n */\n mapState(newState) {\n try {\n this.logger.debug('mapState()');\n let fundState = getFundState(newState, this.fundId);\n this.label = get(newState, 'products.label');\n if (!this.label ||\n !fundState ||\n !fundState.portfolioStatisticsAndPositions) {\n this.isPopulated = false;\n return;\n }\n let vo = fundState.portfolioStatisticsAndPositions;\n this.refreshRate = vo.refreshRate;\n this.isValid = vo.isValid;\n this.asOfDate = vo.asOfDate;\n\n this.holdingsPdf = vo.holdingsPdf;\n this.nbrOfIssuers = vo.nbrOfIssuers;\n this.nbrOfHoldings = vo.nbrOfHoldings;\n // COREWEB-333 - Show issuers if defined else show holdings\n this.showIssuers = vo.showIssuers;\n\n this.statistics = vo.statistics;\n let halfWayPoint = Math.ceil(vo.statistics.data.length / 2);\n this.statisticsPart1 = vo.statistics.data.slice(0, halfWayPoint);\n this.statisticsPart2 = vo.statistics.data.slice(halfWayPoint, vo.statistics.data.length);\n\n this.isPopulated = true;\n } catch (e) {\n this.logger.error(e);\n this.isPopulated = false;\n }\n }\n}\n","import {inject} from 'aurelia-framework';\nimport {ReduxComponentBase} from '../../../../../lib/redux-component-base';\nimport {getFundState} from '../../../lib/map-state-utils';\nimport {parseNumber} from '../../../lib/reducer-utils';\n@inject('Store', 'Beans', Element)\nexport class FtRiskContributionActual extends ReduxComponentBase {\n populated = false;\n\n constructor(store, beans, element) {\n // add logging and integration with the data store\n super(store);\n // get the configuration from the store and pass it into the component here\n this.fundId = element.getAttribute('fund-id');\n this.cid = element.getAttribute('cid');\n this.portfolioComponent = 'risk-contribution-actual';\n this.assetClass = 'Equity';\n this.portfolioBeans = beans.component.portfolioRiskContribution;\n this.portfolioBeans.push(this.cid);\n\n\n // This is a top level component so we need to initiate the population\n this.dispatch({\n type: 'POPULATE_RISK_CONTRIBUTION',\n beans: this.portfolioBeans,\n fundId: this.fundId,\n cid: this.cid,\n portfolioComponent: this.portfolioComponent,\n assetClass: this.assetClass\n });\n }\n\n /**\n * Called when the state changes.\n */\n mapState(newState) {\n // console.log('newState', newState);\n try {\n let fundState = getFundState(newState, this.fundId);\n // console.log('>> newState', JSON.stringify(newState.products.funds));\n\n this.label = newState.products.label;\n this.data = fundState.riskContribution.data;\n this.caveats = fundState.riskContribution.caveats;\n // we only want the actual values from the shared data\n let chartData = this.data.table.map((item) => {\n return [item.name, parseNumber(item.portAvg)];\n });\n\n this.chartData = [{\n data: chartData,\n type: 'bar',\n colorByPoint: true\n }];\n // console.log('>>', JSON.stringify(newState));\n this.populated = true;\n } catch (e) {\n // state not populated yet\n this.populated = false;\n }\n }\n}\n","import {inject} from 'aurelia-framework';\nimport {ReduxComponentBase} from '../../../../../lib/redux-component-base';\nimport {getFundState} from '../../../lib/map-state-utils';\nimport {parseNumber} from '../../../lib/reducer-utils';\n@inject('Store', 'Beans', Element)\nexport class FtRiskContributionForecast extends ReduxComponentBase {\n populated = false;\n\n constructor(store, beans, element) {\n // add logging and integration with the data store\n super(store);\n // get the configuration from the store and pass it into the component here\n this.fundId = element.getAttribute('fund-id');\n this.cid = element.getAttribute('cid');\n this.portfolioComponent = 'risk-contribution-forecast';\n this.assetClass = 'Equity';\n this.portfolioBeans = beans.component.portfolioRiskContribution;\n this.portfolioBeans.push(this.cid);\n\n\n // This is a top level component so we need to initiate the population\n this.dispatch({\n type: 'POPULATE_RISK_CONTRIBUTION',\n beans: this.portfolioBeans,\n fundId: this.fundId,\n cid: this.cid,\n portfolioComponent: this.portfolioComponent,\n assetClass: this.assetClass\n });\n }\n\n /**\n * Called when the state changes.\n */\n mapState(newState) {\n // console.log('newState', newState);\n try {\n let fundState = getFundState(newState, this.fundId);\n this.label = newState.products.label;\n this.data = fundState.riskContribution.data;\n this.caveats = fundState.riskContribution.caveats;\n // we only want the forcast values from the shared data\n let chartData = this.data.table.map((item) => {\n return [item.name, parseNumber(item.portForeCntr)];\n });\n\n this.chartData = [{\n data: chartData,\n type: 'bar',\n colorByPoint: true\n }];\n // console.log('>>', JSON.stringify(newState));\n this.populated = true;\n } catch (e) {\n // state not populated yet\n this.populated = false;\n }\n }\n}\n","import {inject, useView} from 'aurelia-framework';\nimport {FtGenericChartComponentBase} from '../../common/ft-generic-chart-component-base';\n\n@useView('../../common/ft-generic-chart-component-base.html')\n@inject('Store', 'Beans', Element)\nexport class FtSectorAllocation extends FtGenericChartComponentBase {\n init() {\n this.CHART_TYPE_ID = 'SECTOR_ALLOCATION';\n this.COMPONENT_ID = 'sector-allocation';\n this.DATA_COLUMN_LABEL_ID = 'sector-allocation-fund';\n }\n}\n","import {inject} from 'aurelia-framework';\nimport {FtGenericHierarchicalComponentBase} from '../../common/ft-generic-hierarchical-component-base';\nimport {getFundState} from '../../../lib/map-state-utils';\nimport get from 'lodash/get';\n\n@inject('Store', 'Beans', Element)\nexport class FtSectorExposure extends FtGenericHierarchicalComponentBase {\n isPopulated = false;\n\n constructor(store, beans, element) {\n super(store);\n this.fundId = element.getAttribute('fund-id');\n this.cid = element.getAttribute('cid');\n this.portfolioBeans = beans.component.portfolioSectorExposure;\n this.portfolioBeans.push(this.cid);\n\n const currentState = store.getState();\n this.dispatch({\n type: 'POPULATE_SECTOR_EXPOSURE',\n beans: this.portfolioBeans,\n fundId: this.fundId,\n cid: this.cid,\n portfolioComponent: 'sector-exposure',\n segment: currentState.general.segment\n });\n }\n\n /**\n * Called when the state changes.\n */\n mapState(newState) {\n try {\n let fundState = getFundState(newState, this.fundId);\n this.label = get(newState, 'products.label');\n this.data = get(fundState, 'sectorExposure.data');\n if (!this.label ||\n !this.data ||\n !this.data.visible) {\n this.isPopulated = false;\n return;\n }\n\n this.isPopulated = true;\n } catch (e) {\n this.logger.error(e);\n this.isPopulated = false;\n }\n }\n}\n","import {inject} from 'aurelia-framework';\nimport {ReduxComponentBase} from '../../../../../lib/redux-component-base';\nimport {getFundState} from '../../../lib/map-state-utils';\nimport get from 'lodash/get';\n\n@inject('Store', 'Beans', Element)\nexport class FtSecurityTypeExposure extends ReduxComponentBase {\n /**\n * @type {boolean}\n */\n isPopulated = false;\n\n constructor(store, beans, element) {\n super(store);\n this.fundId = element.getAttribute('fund-id');\n this.cid = element.getAttribute('cid');\n this.portfolioBeans = beans.component.portfolioSecurityTypeExposure;\n this.portfolioBeans.push(this.cid);\n\n const currentState = store.getState();\n this.dispatch({\n type: 'POPULATE_SECURITY_TYPE_EXPOSURE',\n beans: this.portfolioBeans,\n fundId: this.fundId,\n cid: this.cid,\n portfolioComponent: 'security-type-exposure',\n segment: currentState.general.segment\n });\n }\n\n /**\n * Called when the state changes.\n */\n mapState(newState) {\n try {\n let fundState = getFundState(newState, this.fundId);\n this.label = get(newState, 'products.label');\n this.data = get(fundState, 'securityTypeExposure.data');\n if (!this.label ||\n !this.data ||\n !this.data.visible) {\n this.isPopulated = false;\n return;\n }\n\n this.chartData = fundState.securityTypeExposure.data.series;\n this.isPopulated = true;\n } catch (e) {\n this.logger.error(e);\n this.isPopulated = false;\n }\n }\n\n // TODO: this should be done in the reducer\n getValue(data, id) {\n let rVal;\n let orderId;\n if (this.data !== undefined) {\n orderId = this.data.ordering[id];\n rVal = data[orderId];\n }\n return rVal;\n }\n getCustomLabel(id) {\n let rVal;\n if (this.data !== undefined) {\n rVal = this.data.mappedLabels.get(id) || `[!${id}!]`;\n }\n return rVal;\n }\n\n}\n","import { inject } from 'aurelia-framework';\nimport { ReduxComponentBase } from '../../../../../lib/redux-component-base';\nimport { getFundState } from '../../../lib/map-state-utils';\nimport get from 'lodash/get';\n\n@inject('Store', 'Beans', Element)\nexport class FtTopRiskAllocationByAssetClass extends ReduxComponentBase {\n isPopulated = false;\n\n constructor(store, beans, element) {\n super(store);\n this.fundId = element.getAttribute('fund-id');\n this.cid = element.getAttribute('cid');\n this.portfolioBeans = beans.component.topRiskAllocationByAssetClass;\n this.portfolioBeans.push(this.cid);\n\n const currentState = store.getState();\n this.dispatch({\n type: 'POPULATE_TOP_RISK_ALLOCATION_BY_ASSET_CLASS',\n beans: beans.component.topRiskAllocationByAssetClass,\n fundId: this.fundId,\n cid: this.cid,\n portfolioComponent: 'top-risk-allocation-by-asset-class',\n segment: currentState.general.segment\n });\n }\n\n /**\n * Called when the state changes.\n */\n mapState(newState) {\n try {\n this.logger.debug('mapState()');\n let fundState = getFundState(newState, this.fundId);\n let compState = get(fundState, 'topRiskAllocationByAssetClass.data');\n this.label = get(newState, 'products.label');\n this.data = compState;\n\n if (!this.label ||\n !compState ||\n !compState.visible) {\n this.isPopulated = false;\n return;\n }\n\n this.isPopulated = true;\n } catch (e) {\n this.logger.error(e);\n this.isPopulated = false;\n }\n }\n}\n","import { inject } from 'aurelia-framework';\nimport { ReduxComponentBase } from '../../../../../lib/redux-component-base';\nimport get from 'lodash/get';\nimport { GENERIC_CHART_COLOUR } from '../../../../common/elements/charting/ft-charts-configs';\n\n@inject('Store', 'Beans', Element)\nexport class FtTopTenHoldings extends ReduxComponentBase {\n isPopulated = false;\n\n constructor(store, beans, element) {\n super(store);\n this.fundId = element.getAttribute('fund-id');\n this.cid = element.getAttribute('cid');\n this.portfolioBeans = beans.component.portfolioCharting.slice(0);\n this.portfolioBeans.push(this.cid);\n\n const currentState = store.getState();\n this.dispatch({\n type: 'POPULATE_PORTFOLIO_CHART',\n beans: this.portfolioBeans,\n fundId: this.fundId,\n cid: this.cid,\n chartType: 'TOP_TEN_HOLDINGS',\n portfolioComponent: 'top-ten-holdings',\n segment: currentState.general.segment\n });\n }\n\n /**\n * Called when the state changes.\n */\n mapState(newState) {\n try {\n let chartState = get(newState, `products.app.portfolio.chart[${this.cid}]`, false);\n this.label = get(newState, 'products.label');\n this.data = chartState;\n if (!this.label ||\n !chartState ||\n !chartState.visible) {\n this.isPopulated = false;\n return;\n }\n\n this.chartData = [{\n data: this.data.chart,\n type: 'bar',\n colorByPoint: false,\n color: GENERIC_CHART_COLOUR\n }];\n this.isPopulated = true;\n } catch (e) {\n this.logger.error(e);\n this.isPopulated = false;\n }\n }\n}\n","import {inject} from 'aurelia-framework';\nimport {ReduxComponentBase} from '../../../../../lib/redux-component-base';\nimport {getFundState} from '../../../lib/map-state-utils';\nimport get from 'lodash/get';\n\n@inject('Store', 'Beans', Element)\nexport class FtValueAtRisk extends ReduxComponentBase {\n isPopulated = false;\n\n constructor(store, beans, element) {\n super(store);\n this.fundId = element.getAttribute('fund-id');\n this.cid = element.getAttribute('cid');\n this.portfolioBeans = beans.component.valueAtRisk;\n this.portfolioBeans.push(this.cid);\n\n const currentState = store.getState();\n this.dispatch({\n type: 'POPULATE_VALUE_AT_RISK',\n beans: beans.component.valueAtRisk,\n fundId: this.fundId,\n cid: this.cid,\n portfolioComponent: 'value-at-risk',\n segment: currentState.general.segment\n });\n }\n\n /**\n * Called when the state changes.\n */\n mapState(newState) {\n try {\n this.logger.debug('mapState()');\n let fundState = getFundState(newState, this.fundId);\n let compState = get(fundState, 'valueAtRisk.data');\n this.label = get(newState, 'products.label');\n this.data = compState;\n\n if (!this.label ||\n !compState ||\n !compState.visible) {\n this.isPopulated = false;\n return;\n }\n\n this.isPopulated = true;\n } catch (e) {\n this.logger.error(e);\n this.isPopulated = false;\n }\n }\n}\n","/**\n * Data Reducer for portfolioBarChartReducer\n * Takes site specific json data and creates model for components\n * after applying business and presentation logic and data mapping\n */\nimport set from 'lodash/set';\nimport get from 'lodash/get';\nimport find from 'lodash/find';\nimport map from 'lodash/map';\nimport uniq from 'lodash/uniq';\n\nimport { portfolioUtils } from '../../util/util';\nimport { getHierarchicalBreakdown } from '../../util/hierarchical-utils';\nimport { getKVBreakdown } from '../../util/key-value-row-utils';\nimport { utilsConfig } from '../../../common/util/utils-config';\nimport {utilsFundDetails} from '../../../common/util/utils-fund-details';\nimport { configDecorator } from '../../../lib/decorators/config-decorator';\nimport {\n isPortfolioComponentSuppressedByRiskConfig,\n isRiskContributionParent,\n getRiskContributionRowName\n} from '../../util/risk-and-analysis-special-utils';\n\nimport { LogManager } from 'aurelia-framework';\nconst logger = LogManager.getLogger('portfolio-chart-reducer');\n\n/**\n * @typedef {Object} DataStoreConfig\n * @property {string} key 'BREAKDOWN'\n */\n\n/**\n * @typedef {Object} ChartTypeConfig\n * @property {string} labelId 'top-short-exposure'\n * @property {string} caveatId 'TopShortExposures'\n * @property {string} dataKey 'LONG_EQUITY_AS_PCT_OF_EQUITY'\n * @property {PortfolioBreakdownOptions} options\n * @property {DataStoreConfig} dataStore eg DATA_STORE_ENUM.HOLDINGS\n * @property {DataStoreConfig} outputStyle eg OUTPUT_STYLE_ENUM.STANDARD_BREAKDOWN\n * @property {PortfolioAppendOptions} appendTableData\n * @property {DataStoreConfig} outputStyle eg OUTPUT_STYLE_ENUM.STANDARD_BREAKDOWN\n */\nexport const DATA_STORE_ENUM = {\n // DEFAULT\n BREAKDOWN: {\n key: 'BREAKDOWN'\n },\n HOLDINGS: {\n key: 'HOLDINGS'\n },\n HOLDINGS_TOP_TEN: {\n key: 'HOLDINGS_TOP_TEN'\n },\n RISK_CONTROL: {\n key: 'RISK_CONTROL'\n }\n};\nexport const OUTPUT_STYLE_ENUM = {\n // DEFAULT: FIELDS MAPPED TO SINGLE ROW\n STANDARD_BREAKDOWN: {\n key: 'STANDARD_BREAKDOWN'\n },\n // KEY VALUE ROWS: INDIVIDUAL FIELDS TO DIFFERENT ROWS\n KEYVALUE_BREAKDOWN: {\n key: 'KEYVALUE_BREAKDOWN'\n },\n // HIERARCHICAL ROWS: EACH ROW IS A MEMBER OF A TWO LEVEL TREE\n HIERARCHY_BREAKDOWN: {\n key: 'HIERARCHY_BREAKDOWN'\n }\n};\n\n// TODO: investigate forceChart think it can be refactored away\n/**\n * List of valid Chart Types\n *\n * List of Caveat Ids for validation\n * @see http://pc.frk.com/projects/Digital_Access_and_Enablement/_layouts/15/WopiFrame.aspx?sourcedoc=/projects/Digital_Access_and_Enablement/Documents/Caveats-Matrix.xlsx&action=default\n * @type {Object.<String, ChartTypeConfig>}\n */\nexport const CHART_TYPES_ENUM = {\n 'ASSET_ALLOCATION': {\n labelId: 'asset-allocation',\n dataKey: 'ASSET_ALLOCATION',\n caveatId: 'AssetAllocation',\n options: {\n // Suppress if HAS ASSET_EXPOSURE BREAKDOWN\n // WORKAROUND: feed is broken when ASSET_EXPOSURE is available\n suppressionCondition: (config, rawPortfolioFeed, currentBreakdown) => {\n const rawBreakdowns = get(rawPortfolioFeed, 'globalProductsValue.portfolioIntlValue.breakdown.brkdwnDet');\n const assetExposureBreakdown = find(rawBreakdowns, {type: 'ASSET_EXPOSURE'}, null);\n return !!assetExposureBreakdown;\n },\n sorted: false\n },\n forceChart: true\n },\n 'ASSET_EXPOSURE': {\n labelId: 'asset-class-exposure',\n caveatId: 'AssetClassExposure',\n outputStyle: OUTPUT_STYLE_ENUM.KEYVALUE_BREAKDOWN,\n dataKey: 'ASSET_EXPOSURE',\n options: {\n nameKey: 'name2.val',\n kv_keyField: 'name.val',\n kv_valueField: 'val.val',\n hardcodedCalcLabelId: 'asset-class-exposure-calc'\n }\n },\n 'CURRENCY_ALLOCATION': {\n labelId: 'currency-breakdown-heading',\n dataKey: 'CURRENCY_ALLOCATION',\n caveatId: 'CurrencyBreakdown',\n options: {\n sorted: false,\n hasCalNameInRows: true\n },\n forceChart: true\n },\n 'GEOGRAPHIC_BREAKDOWN': {\n labelId: 'geographic-breakdown-heading',\n caveatId: 'GeographicBreakdown',\n dataKey: 'COUNTRY_ALLOCATION',\n options: {\n // Suppress if MORE THAN ONE CALC TYPE IN ROWS\n // WORKAROUND: COREWEB-2503 some funds have multiple primary columns\n suppressionCondition: (config, rawPortfolioFeed, currentBreakdown) => {\n const rows = get(currentBreakdown, 'brkDwnLst.lstDtls', []);\n return uniq(map(rows, 'calNameStd.val')).length !== 1;\n },\n // FILTER AWAY UNDESIRED ROLLUP ROWS\n // COREWEB-2423 junk rollupLevel 2's slipping through\n filterCondition: (o) => {\n return get(o, 'rollupLevel.val', '1') === '1';\n },\n hasCalNameInRows: true\n },\n forceChart: false\n },\n 'GEOGRAPHIC_EXPOSURE': {\n labelId: 'geographic-exposure-heading',\n caveatId: 'GeographicExposure',\n dataKey: 'COUNTRY_ALLOCATION',\n outputStyle: OUTPUT_STYLE_ENUM.KEYVALUE_BREAKDOWN,\n options: {\n nameKey: 'name.val',\n kv_keyField: 'calType.val',\n kv_valueField: 'val.val',\n // Suppress if ONLY ONE CALC TYPE IN ROWS\n // WORKAROUND: COREWEB-2503 some funds have multiple primary columns\n suppressionCondition: (config, rawPortfolioFeed, currentBreakdown) => {\n const rows = get(currentBreakdown, 'brkDwnLst.lstDtls', []);\n return uniq(map(rows, 'calNameStd.val')).length === 1;\n },\n // FILTER AWAY UNDESIRED ROLLUP ROWS\n // COREWEB-2423 junk rollupLevel 2's slipping through\n filterCondition: (o) => {\n return get(o, 'rollupLevel.val', '1') === '1';\n },\n hardcodedCalcLabelId: 'geographic-exposure-calc'\n },\n forceChart: false\n },\n 'SECTOR_ALLOCATION': {\n labelId: 'sector-allocation-heading',\n caveatId: 'SectorAllocation',\n dataKey: 'SECTOR_ALLOCATION',\n options: {\n // Suppress if MORE THAN ONE CALC TYPE IN ROWS\n // WORKAROUND: COREWEB-2503 some funds have multiple primary columns\n suppressionCondition: (config, rawPortfolioFeed, currentBreakdown) => {\n const rows = get(currentBreakdown, 'brkDwnLst.lstDtls', []);\n return uniq(map(rows, 'calNameStd.val')).length !== 1;\n },\n sorted: false,\n hasCalNameInRows: true\n }\n },\n // TODO : sector-exposure.reducer.js could be refactored to use this\n 'SECTOR_EXPOSURE': {\n buildChart: false,\n labelId: 'sector-exposure-heading',\n caveatId: 'SectorExposure',\n dataKey: 'K2_SECTOR_ALLOCATION',\n outputStyle: OUTPUT_STYLE_ENUM.HIERARCHY_BREAKDOWN,\n options: {\n nameFunc: (o) => {\n let isParent = get(o, 'name2.val', null) === null;\n if (isParent) {\n return get(o, 'name.val');\n }\n return get(o, 'name2.val');\n },\n rangeKey: 'name.val',\n tableMappingKeys: {\n val: 'val.val',\n valOfTotal: 'val3.val'\n }\n },\n forceChart: false\n },\n 'MARKET_CAPITAL_ALLOCATION': {\n labelId: 'market-capitalisation-heading',\n caveatId: 'MarketCapitalisation',\n dataKey: 'MARKET_CAPITAL_ALLOCATION',\n options: {\n sorted: false,\n forceChart: true\n }\n },\n 'TOP_SHORT_EXPOSURES': {\n labelId: 'top-short-exposure',\n caveatId: 'TopShortExposures',\n dataStore: DATA_STORE_ENUM.HOLDINGS,\n dataKey: 'SHORT_EQUITY_AS_PCT_OF_EQUITY',\n options: {\n sorted: false\n }\n },\n 'TOP_LONG_EXPOSURES': {\n labelId: 'top-long-exposure',\n caveatId: 'TopLongExposures',\n dataStore: DATA_STORE_ENUM.HOLDINGS,\n dataKey: 'LONG_EQUITY_AS_PCT_OF_EQUITY',\n options: {\n sorted: false\n }\n },\n 'TOP_TEN_HOLDINGS': {\n labelId: 'top-ten-holdings-heading',\n caveatId: 'TopTenHoldings',\n dataStore: DATA_STORE_ENUM.HOLDINGS_TOP_TEN,\n options: {\n sorted: true\n }\n },\n 'RISK_AND_RETURN_ANALYSIS': {\n labelId: 'risk-and-return-analysis-heading',\n caveatId: 'PortfolioRiskAndReturnAnalysis',\n dataStore: DATA_STORE_ENUM.RISK_CONTROL,\n outputStyle: OUTPUT_STYLE_ENUM.HIERARCHY_BREAKDOWN,\n options: {\n buildChart: false,\n filterCondition: (o) => {\n // Only show 1 month forecast rows (3 month is also available in data)\n let monthPeriod = get(o, 'fPeriod.val', '1');\n return monthPeriod === '1';\n },\n nameFunc: getRiskContributionRowName,\n rangeKey: 'fact1.val',\n tableMappingKeys: {\n val: 'portAvg.val',\n performanceContribution: 'portCntr.val',\n riskContribution: 'portHistCntr.val',\n riskContributionForecast: 'portForeCntr.val',\n startDate: 'startDt.val',\n nameStd: 'fact1Std.val'\n },\n specialRiskConfigRules: true,\n filter: false\n }\n },\n 'AVERAGE_PORTFOLIO_EXPOSURE': {\n labelId: 'average-portfolio-exposure-heading',\n caveatId: 'AveragePortfolioExposure',\n dataStore: DATA_STORE_ENUM.RISK_CONTROL,\n outputStyle: OUTPUT_STYLE_ENUM.HIERARCHY_BREAKDOWN,\n options: {\n nameKey: 'fact1.val',\n chartValKey: 'portCntr.val',\n filterCondition: (o) => {\n // only show top level hierarchy items\n // Only show 1 month forecast rows (3 month is also available in data)\n let isParentRow = isRiskContributionParent(o);\n let monthPeriod = get(o, 'fPeriod.val', '1');\n let is1MonthData = monthPeriod === '1';\n return isParentRow && is1MonthData;\n },\n tableMappingKeys: {\n val: 'portCntr.val',\n nameStd: 'fact1Std.val'\n },\n specialRiskConfigRules: true,\n filter: false,\n hardcodedCalcLabelId: 'average-portfolio-exposure-calc'\n }\n },\n 'PORTFOLIO_ALLOCATION': {\n labelId: 'portfolio-allocation-heading',\n caveatId: 'PortfolioAllocation',\n dataKey: 'K2_PORTFOLIO_ALLOCATION',\n outputStyle: OUTPUT_STYLE_ENUM.HIERARCHY_BREAKDOWN,\n options: {\n buildChart: false,\n nameFunc: (o) => {\n let isParent = get(o, 'name2.val', null) === null;\n if (isParent) {\n return get(o, 'name.val');\n }\n return get(o, 'name2.val');\n },\n rangeKey: 'name.val',\n tableMappingKeys: {\n val: 'val.val',\n valOfTotal: 'val3.val'\n },\n filter: false,\n hardcodedCalcLabelId: 'portfolio-allocation-calc'\n }\n },\n 'STRATEGY_BREAKDOWN': {\n labelId: 'strategy-breakdown',\n caveatId: 'StrategyBreakdown',\n dataKey: 'HEDGE_ALLOCATION',\n options: {\n nameKey: 'name2.val',\n tableMappingKeys: {\n val: 'val.val',\n strategy: 'val2.val'\n },\n sorted: false,\n filter: false,\n filterCondition: {\n 'nameStd': {\n 'val': 'STRATEGY'\n }\n },\n hardcodedCalcLabelId: 'strategy-breakdown-calc'\n }\n },\n 'PORTFOLIO_EXPOSURE': {\n labelId: 'portfolio-exposure-heading',\n caveatId: 'PortfolioExposure',\n dataKey: 'HEDGE_ALLOCATION',\n options: {\n nameKey: 'name2.val',\n sorted: false,\n filter: false,\n filterCondition: {\n 'nameStd': {\n 'val': 'EXPOSURES'\n }\n },\n hardcodedCalcLabelId: 'portfolio-exposure-calc'\n }\n },\n //\n 'COUPON_ALLOCATION': {\n dataKey: 'COUPON_ALLOCATION'\n },\n 'QUALITY_ALLOCATION': {\n dataKey: 'QUALITY_ALLOCATION'\n },\n 'PRODUCT_AUM': {\n dataKey: 'PRODUCT_AUM'\n },\n 'SECURITY_EXPOSURE': {\n dataKey: 'SECURITY_EXPOSURE'\n },\n 'ASSET_SECURITY_EXPOSURE': {\n dataKey: 'ASSET_SECURITY_EXPOSURE'\n },\n\n // TODO : component could be refactored to use this\n // COREWEB-2034 PDS Clarification of fields required\n 'RISK_CONTRIBUTION_ACTUAL': {\n labelId: 'risk-contribution-actual-heading',\n caveatId: 'RiskContributionActual',\n dataStore: DATA_STORE_ENUM.RISK_CONTROL,\n outputStyle: OUTPUT_STYLE_ENUM.HIERARCHY_BREAKDOWN,\n options: {\n nameKey: 'fact1.val',\n chartValKey: 'portHistCntr.val',\n filterCondition: (o) => {\n // only show top level hierarchy items\n // Only show 1 month forecast rows (3 month is also available in data)\n let isParentRow = isRiskContributionParent(o);\n let monthPeriod = get(o, 'fPeriod.val', '1');\n let is1MonthData = monthPeriod === '1';\n return isParentRow && is1MonthData;\n },\n tableMappingKeys: {\n val: 'portHistCntr.val',\n nameStd: 'fact1Std.val'\n },\n specialRiskConfigRules: true,\n hardcodedCalcLabelId: 'risk-contribution-actual-calc'\n }\n },\n // TODO : component could be refactored to use this\n // COREWEB-2034 PDS Clarification of fields required\n 'RISK_CONTRIBUTION_FORECAST': {\n labelId: 'risk-contribution-forecast-heading',\n caveatId: 'RiskContributionForecast',\n dataStore: DATA_STORE_ENUM.RISK_CONTROL,\n outputStyle: OUTPUT_STYLE_ENUM.HIERARCHY_BREAKDOWN,\n options: {\n nameKey: 'fact1.val',\n chartValKey: 'portForeCntr.val',\n filterCondition: (o) => {\n // only show top level hierarchy items\n // Only show 1 month forecast rows (3 month is also available in data)\n let isParentRow = isRiskContributionParent(o);\n let monthPeriod = get(o, 'fPeriod.val', '1');\n let is1MonthData = monthPeriod === '1';\n return isParentRow && is1MonthData;\n },\n tableMappingKeys: {\n val: 'portForeCntr.val',\n nameStd: 'fact1Std.val'\n },\n filter: false,\n specialRiskConfigRules: true,\n hardcodedCalcLabelId: 'risk-contribution-forecast-calc'\n }\n }\n};\n\nexport function portfolioChartReducer(state, action) {\n switch (action.type) {\n case 'POPULATE_PORTFOLIO_CHART_SUCCESS':\n if (!action.cid) {\n logger.error('no cid given');\n return state;\n }\n if (!CHART_TYPES_ENUM[action.chartType]) {\n logger.error('invalid chart type given : ' + action.chartType);\n return state;\n }\n let [rawPortfolioFeed, rawFundDetails, rawConfig, rawPageJsonConfig] = action.json;\n let newState = Object.assign({}, state);\n let cid = action.cid;\n let key = !action.subKey ? `app.portfolio.chart[${cid}]` : `app.portfolio.chart[${cid}][${action.subKey}]`;\n let chartObj = chartDataFactory(rawPortfolioFeed, rawFundDetails, rawConfig, rawPageJsonConfig, action);\n set(newState, key, chartObj);\n return newState;\n default:\n return state;\n }\n}\n\n/**\n * @param {Object} rawPortfolioFeed\n * @param {ChartTypeConfig} chartTypeConfig\n * @returns {Object[]}\n */\nfunction getBreakdown(rawPortfolioFeed, chartTypeConfig) {\n switch (chartTypeConfig.dataStore) {\n case DATA_STORE_ENUM.HOLDINGS_TOP_TEN:\n // WORKAROUND COREWEB-2429: chartTypeConfig.dataKey not required for HOLDINGS_TOP_TEN, choose first item if only one, else empty\n const rawTopTenHoldings = get(rawPortfolioFeed, 'globalProductsValue.portfolioIntlValue.holdings', []);\n chartTypeConfig.options = Object.assign({}, chartTypeConfig.options, {breakDownKey: 'hldingDetails.lstDtls'});\n return rawTopTenHoldings.length === 1 ? rawTopTenHoldings[0] : null;\n case DATA_STORE_ENUM.HOLDINGS:\n const rawHoldings = get(rawPortfolioFeed, 'globalProductsValue.portfolioIntlValue.holdings');\n chartTypeConfig.options = Object.assign({}, chartTypeConfig.options, {breakDownKey: 'hldingDetails.lstDtls'});\n return find(rawHoldings, {'calNameStd': {val: chartTypeConfig.dataKey}});\n case DATA_STORE_ENUM.RISK_CONTROL:\n // WORKAROUND: chartTypeConfig.dataKey not required for RISK_CONTROL\n chartTypeConfig.options = Object.assign({}, chartTypeConfig.options, {breakDownKey: 'RiskFactDt.lstDtls'});\n return get(rawPortfolioFeed, 'globalProductsValue.portfolioIntlValue.riskCntr');\n case DATA_STORE_ENUM.BREAKDOWN:\n default:\n const rawBreakdowns = get(rawPortfolioFeed, 'globalProductsValue.portfolioIntlValue.breakdown.brkdwnDet');\n return find(rawBreakdowns, {'type': chartTypeConfig.dataKey});\n }\n}\n\n/**\n * @param {Object} rawPortfolioFeed\n * @param {Object} rawFundDetails\n * @param {Object} rawConfig\n * @param {Object} rawPageJsonConfig\n * @param {Object} action\n * @returns {Object}\n */\nfunction chartDataFactory(rawPortfolioFeed, rawFundDetails, rawConfig, rawPageJsonConfig, action) {\n let chartType = action.chartType;\n /**\n * @type ChartTypeConfig\n */\n let chartTypeConfig = CHART_TYPES_ENUM[chartType];\n const decoratedConfig = configDecorator(rawConfig, action.segment);\n\n // Suppression Step 1a: If suppression condition is true, don't continue\n let fundCategory = utilsFundDetails.getFundCategory(rawFundDetails);\n const isSuppressed = utilsConfig.isPortfolioComponentSuppressed(decoratedConfig, action.fundId, action.portfolioComponent, fundCategory);\n if (isSuppressed) {\n return {\n visible: false,\n isSuppressed: true\n };\n }\n\n // Suppression Step 1b: If specialRiskConfigRules, check if Suppressed By RiskConfig is true, don't continue\n if (chartTypeConfig.options.specialRiskConfigRules) {\n const isSuppressedRiskConfig = isPortfolioComponentSuppressedByRiskConfig(decoratedConfig, action.fundId, action.portfolioComponent);\n if (isSuppressedRiskConfig) {\n return {\n visible: false,\n isSuppressedRiskConfig: true\n };\n }\n }\n\n // Suppression Step 2: If no data, don't continue\n let currentBreakdown = getBreakdown(rawPortfolioFeed, chartTypeConfig);\n if (!currentBreakdown) {\n return {\n visible: false,\n isSuppressedByLackOfData: true\n };\n }\n\n // Suppression Step 3: If suppression condition is true, don't continue\n let suppressionCondition = get(chartTypeConfig, 'options.suppressionCondition', null);\n if (suppressionCondition && suppressionCondition(decoratedConfig, rawPortfolioFeed, currentBreakdown)) {\n return {\n visible: false,\n isSuppressedByCondition: true\n };\n }\n\n let refreshRateFromConfig = get(decoratedConfig, 'portfolio.refreshRate');\n let refreshRate = portfolioUtils.convertRefreshFrequencyIntoLabelId(refreshRateFromConfig);\n let obj = {\n caveatFootnote: chartTypeConfig.caveatId ? chartTypeConfig.caveatId : 'Portfolio',\n caveatProximal: chartTypeConfig.caveatId ? (chartTypeConfig.caveatId + 'Proximal') : 'PortfolioProximal',\n labelId: chartTypeConfig.labelId,\n visible: true,\n showChart: null,\n spanRow: null,\n refreshRate\n };\n\n let tempBreakdown;\n switch (chartTypeConfig.outputStyle) {\n case OUTPUT_STYLE_ENUM.HIERARCHY_BREAKDOWN:\n tempBreakdown = getHierarchicalBreakdown(currentBreakdown, chartTypeConfig.options, decoratedConfig, action.fundId);\n obj = Object.assign({}, obj, tempBreakdown);\n break;\n case OUTPUT_STYLE_ENUM.KEYVALUE_BREAKDOWN:\n tempBreakdown = getKVBreakdown(currentBreakdown, chartTypeConfig.options);\n obj = Object.assign({}, obj, tempBreakdown);\n break;\n case OUTPUT_STYLE_ENUM.STANDARD_BREAKDOWN:\n default:\n tempBreakdown = portfolioUtils.getIntlSimplifiedBreakdown(currentBreakdown, chartTypeConfig.options);\n if (chartTypeConfig.appendTableData) {\n // TODO: only supports breakdown object at moment, could easily extend to holdings / riskCnt\n const rawBreakdowns = get(rawPortfolioFeed, 'globalProductsValue.portfolioIntlValue.breakdown.brkdwnDet');\n let appendBreakdown = find(rawBreakdowns, { 'type': chartTypeConfig.appendTableData.dataKey });\n portfolioUtils.appendTableData(tempBreakdown.table, appendBreakdown, chartTypeConfig.appendTableData);\n }\n obj = Object.assign({}, obj, tempBreakdown);\n break;\n }\n\n if (chartTypeConfig.forceChart) {\n obj.showChart = true;\n obj.spanRow = true;\n } else {\n const pageJsonConfig = portfolioUtils.parsePageJsonConfig(rawPageJsonConfig);\n obj.showChart = pageJsonConfig.showChart;\n obj.spanRow = pageJsonConfig.spanRow;\n }\n return obj;\n}\n","import {inject} from 'aurelia-framework';\nimport {FtGenericChartComponentBase} from '../../common/ft-generic-chart-component-base';\n\n// HAS TWO COLUMN TABLE HENCE NOT USING SINGLE COLUMN VIEW\n// @useView('../../common/ft-generic-chart-component-base.html')\n@inject('Store', 'Beans', Element)\nexport class FtStrategyBreakdown extends FtGenericChartComponentBase {\n init() {\n this.CHART_TYPE_ID = 'STRATEGY_BREAKDOWN';\n this.COMPONENT_ID = 'sector-breakdown';\n this.DATA_COLUMN_LABEL_ID = 'n/a';\n }\n}\n","import get from 'lodash/get';\n/**\n * Data Reducer for documentLister\n * Takes site specific json data and creates model for components\n * after applying business and presentation logic and data mapping\n */\n// import {LogManager} from 'aurelia-framework';\n// const logger = LogManager.getLogger('document-lister');\n\nexport function ftDocumentLister(state, action) {\n switch (action.type) {\n case 'LOAD_LABELS_MARKETING_SUCCESS':\n let [labelData] = action.json;\n let beanLabelData = get(labelData, 'labels');\n\n let otherLabel = get(beanLabelData, 'other-label');\n\n return Object.assign({}, state, {\n ftDocumentListerLabels: {\n otherLabel: otherLabel\n }\n });\n case 'DOCLISTER_CONFIG_SUCCESS':\n let data = get(action, 'data');\n let columnsObj = {};\n data.forEach((column) => {\n let key = 'showCol' + column.value;\n columnsObj[key] = true;\n });\n\n return Object.assign({}, state, {\n ftDocumentLister: {\n columns: columnsObj\n }\n });\n default:\n return state;\n }\n}\n","import get from 'lodash/get';\nimport map from 'lodash/map';\nimport isArray from 'lodash/isArray';\nimport first from 'lodash/first';\nimport takeRight from 'lodash/takeRight';\n/**\n * Data Reducer for reportArchiveA\n * Takes site specific json data and creates model for components\n * after applying business and presentation logic and data mapping\n */\n// import {LogManager} from 'aurelia-framework';\n// const logger = LogManager.getLogger('report-archive-a');\n\nexport function reportArchiveA(state, action) {\n switch (action.type) {\n case 'LOAD_LABELS_MARKETING_SUCCESS':\n let [labelData] = action.json;\n let beanLabelData = get(labelData, 'labels');\n\n let searchFundKeyword = get(beanLabelData, 'search-fund-keyword');\n let onOffToggle = get(beanLabelData, 'on-off-toggle');\n let onState = get(beanLabelData, 'on-state');\n let offState = get(beanLabelData, 'off-state');\n\n return Object.assign({}, state, {\n reportArchiveALabels: {\n searchFundKeyword: searchFundKeyword,\n onOffToggle: onOffToggle,\n onState: onState,\n offState: offState\n }\n });\n case 'POPULATE_REPORT_ARCHIVE_A_SUCCESS':\n let [data] = action.json;\n\n let beanData = get(data, 'config.providers.provider[reports-data]');\n // logger.debug('data:', beanData);\n\n let cols = get(beanData, 'documents.header.column');\n let rows = get(beanData, 'documents.row');\n let noresults = get(beanData, 'message');\n let footnote = get(beanData, 'caveat.footnote');\n let fundtitle = get(beanData, 'fundtitle');\n\n // convert to array if just single object\n if (rows) {\n rows = (isArray(rows) ? rows : [rows]);\n rows = map(rows, (row) => {\n let columns = get(row, 'column');\n let label = first(columns).label;\n let otherColumns = takeRight(columns, columns.length - 1);\n let rowCols = map(otherColumns, (col) => {\n let column = {};\n if (typeof col.document === 'string') {\n column.noresults = col.document;\n } else {\n let documents = (isArray(col.document) ? col.document : [col.document]);\n column.documents = map(documents, (doc) => {\n return {\n url: doc.path,\n title: doc.title,\n label: doc.title,\n size: doc.size,\n extension: doc.extension\n };\n });\n }\n return column;\n });\n return {\n label,\n cols: rowCols\n };\n });\n } else {\n rows = [];\n }\n\n return Object.assign({}, state, {\n reportArchiveA: {\n title: fundtitle,\n noresults,\n footnote,\n cols,\n rows\n }\n });\n default:\n return state;\n }\n}\n","import get from 'lodash/get';\nimport map from 'lodash/map';\nimport isArray from 'lodash/isArray';\nimport first from 'lodash/first';\nimport takeRight from 'lodash/takeRight';\n/**\n * Data Reducer for reportArchiveA\n * Takes site specific json data and creates model for components\n * after applying business and presentation logic and data mapping\n */\n// import {LogManager} from 'aurelia-framework';\n// const logger = LogManager.getLogger('report-archive-b');\n\nexport function reportArchiveB(state, action) {\n switch (action.type) {\n case 'LOAD_LABELS_MARKETING_SUCCESS':\n let [labelData] = action.json;\n let beanLabelData = get(labelData, 'labels');\n\n let searchFundKeyword = get(beanLabelData, 'search-fund-keyword');\n let onOffToggle = get(beanLabelData, 'on-off-toggle');\n let onState = get(beanLabelData, 'on-state');\n let offState = get(beanLabelData, 'off-state');\n\n return Object.assign({}, state, {\n reportArchiveBLabels: {\n searchFundKeyword: searchFundKeyword,\n onOffToggle: onOffToggle,\n onState: onState,\n offState: offState\n }\n });\n case 'POPULATE_REPORT_ARCHIVE_B_SUCCESS':\n let [data] = action.json;\n let reportArchiveBData = {};\n\n let beanData = get(data, 'config.providers.provider[archive-data]');\n\n let cols = get(beanData, 'documents.header.column');\n if (cols) {\n reportArchiveBData.cols = cols;\n }\n let footnote = get(beanData, 'caveat.footnote');\n if (cols) {\n reportArchiveBData.footnote = footnote;\n }\n let rows = get(beanData, 'documents.row');\n\n\n // convert to array if just single object\n if (rows) {\n rows = (isArray(rows) ? rows : [rows]);\n // rows = [rows[0], rows[0], rows[0], rows[0]];\n\n rows = map(rows, (row) => {\n // logger.debug('xxxxxxxxxxxxxxxx', row);\n let columns = get(row, 'column');\n let label = first(columns).label;\n // let label = Math.random().toString(36).replace(/[^a-z]+/g, '');\n let otherColumns = takeRight(columns, columns.length - 1);\n\n let rowCols = map(otherColumns, (col) => {\n let column = {};\n if (col.document) {\n column.documents = map((isArray(col.document) ? col.document : [col.document]), (doc) => {\n let document = {\n title: get(doc, 'title'),\n label: get(doc, 'title'),\n size: get(doc, 'size'),\n extension: get(doc, 'extension')\n };\n if (doc.path) {\n document.url = `${doc.path}`;\n }\n return document;\n });\n }\n if (typeof col.message === 'string') {\n column.noresults = col.message;\n }\n return column;\n });\n return {\n label,\n cols: rowCols\n };\n });\n reportArchiveBData.rows = rows;\n }\n return Object.assign({}, state, { reportArchiveB: reportArchiveBData });\n default:\n return state;\n }\n}\n","/**\r\n * App State Reducer for ftVideoSwitch\r\n * Takes application state data and creates model for components\r\n * rmclaughlin 25/05/17\r\n */\r\n\r\nimport get from 'lodash/get';\r\n//import {LogManager} from 'aurelia-framework';\r\n//const logger = LogManager.getLogger('ft-video-switch');\r\n\r\nexport function ftVideoSwitch(state, action) {\r\n switch (action.type) {\r\n case 'LOAD_LABELS_MARKETING_SUCCESS':\r\n let [data] = action.json;\r\n let beanData = get(data, 'labels');\r\n\r\n let transcriptLabel = get(beanData, 'transcript-label');\r\n let brightcoveVideoDirectLink = get(beanData, 'brightcove-video-direct-link');\r\n let brightcoveVideoEmbedCode = get(beanData, 'brightcove-video-embed-code');\r\n let brightcoveVideoFacebookAlt = get(beanData, 'brightcove-video-facebook-alt');\r\n let brightcoveVideoLinkedinAlt = get(beanData, 'brightcove-video-linkedin-alt');\r\n let brightcoveVideoModalCloseAlt = get(beanData, 'brightcove-video-modal-close-alt');\r\n let brightcoveVideoPlayAlt = get(beanData, 'brightcove-video-play-alt');\r\n let brightcoveVideoShareLink = get(beanData, 'brightcove-video-share-link');\r\n let brightcoveVideoTwitterAlt = get(beanData, 'brightcove-video-twitter-alt');\r\n\r\n return Object.assign({}, state, {\r\n ftVideoSwitch: {\r\n transcriptLabel: transcriptLabel,\r\n brightcoveVideoDirectLink: brightcoveVideoDirectLink,\r\n brightcoveVideoEmbedCode: brightcoveVideoEmbedCode,\r\n brightcoveVideoFacebookAlt: brightcoveVideoFacebookAlt,\r\n brightcoveVideoLinkedinAlt: brightcoveVideoLinkedinAlt,\r\n brightcoveVideoModalCloseAlt: brightcoveVideoModalCloseAlt,\r\n brightcoveVideoPlayAlt: brightcoveVideoPlayAlt,\r\n brightcoveVideoShareLink: brightcoveVideoShareLink,\r\n brightcoveVideoTwitterAlt: brightcoveVideoTwitterAlt\r\n }\r\n });\r\n default:\r\n return state;\r\n }\r\n}\r\n\r\n","/**\n * Data Reducer for fundInformation\n * Takes site specific json data and creates model for components\n * after applying business and presentation logic and data mapping\n */\nimport {LogManager} from 'aurelia-framework';\nimport {fundInformation as mainFundInformation} from '../gw/fund-information.reducer';\nimport find from 'lodash/find';\nimport get from 'lodash/get';\nimport {updateDistributionYield} from '../common/fund-information.reducer';\n\nconst logger = LogManager.getLogger('fund-information');\n\n/*\n Covered by gw unit tests\n */\n/**\n * COREWEB-1858 : UK uses different field, also additional logic to rename field\n * from distribution-yield to historic-yield when asset class == Equity, Alternatives & Multi-Asset\n * @type {Object.<string, FormattingConfig>}\n */\nexport function fundInformation(state, action) {\n switch (action.type) {\n case 'POPULATE_FUND_INFORMATION_SUCCESS':\n logger.debug('Reducing: POPULATE_FUND_INFORMATION_SUCCESS for UK');\n let newState = mainFundInformation(state, action);\n if (newState !== state && newState.fundInformation.distributions) {\n let [, rawFundDetails, rawPrice] = action.json;\n let priceShareClasses = get(rawPrice, 'globalProductsValue.prceDistbIntl.shClsPriceDet', []);\n const dividendYeild = find(priceShareClasses, {shClsCD: { val: action.shareClassKey }});\n const ukDistributionYeild = dividendYeild.navDet.dvndYldUK.val;\n const assetClass = get(rawFundDetails, 'globalProductsValue.fundDetailIntl.assetClassStd.val');\n newState = updateDistributionYield(newState, ukDistributionYeild, assetClass);\n }\n return newState;\n default:\n return state;\n }\n}\n","/**\n * Data Reducer for fundInformation\n * Takes site specific json data and creates model for components\n * after applying business and presentation logic and data mapping\n */\nimport get from 'lodash/get';\nimport find from 'lodash/find';\nimport {LogManager} from 'aurelia-framework';\nimport {buildFundInformation, IDENTIFIER_FIELDS} from '../common/fund-information.reducer';\nimport {configDecorator} from '../../../../lib/decorators/config-decorator';\nimport {utilsFundDetails} from '../../../../common/util/utils-fund-details';\nimport {extractCamelCaseIds} from '../../../../lib/reducer-utils';\nimport {FORMAT_TYPES} from '../../../../lib/reducer-utils';\n\nconst logger = LogManager.getLogger('fund-information');\n\n/**\n * @type {Object.<string, FormattingConfig>}\n */\nexport const SALES_CHARGE_FIELDS = {\n 'maximum-sales-charge': {\n dataKey: 'normalised.currentClass.maxInitChrge.val',\n type: FORMAT_TYPES.PERCENTAGE,\n addendumData: {\n caveatId: {\n dataKey: 'MaximumSalesChargeOverview',\n type: FORMAT_TYPES.CONSTANT\n }\n }\n },\n 'maintenance-charge': {\n dataKey: 'normalised.currentClass.feeCharges.mtnceChrge.val',\n type: FORMAT_TYPES.PERCENTAGE,\n addendumData: {\n caveatId: {\n dataKey: 'MaintenanceChargeOverview',\n type: FORMAT_TYPES.CONSTANT\n }\n }\n },\n 'management-charge': {\n dataKey: 'normalised.currentClass.feeCharges.mgmtChrge.val',\n type: FORMAT_TYPES.PERCENTAGE,\n addendumData: {\n caveatId: {\n dataKey: 'ManagementChargeOverview',\n type: FORMAT_TYPES.CONSTANT\n }\n }\n },\n 'total-expenses': {\n dataKey: 'normalised.currentClass.feeCharges.expRatioWthWvr.val',\n type: FORMAT_TYPES.PERCENTAGE,\n addendumData: {\n caveatId: {\n dataKey: 'TEROverview',\n type: FORMAT_TYPES.CONSTANT\n }\n }\n },\n 'ongoing-charges': {\n dataKey: 'normalised.currentClass.feeCharges.ongoingChrgeRatio.val',\n type: FORMAT_TYPES.PERCENTAGE,\n addendumData: {\n caveatId: {\n dataKey: 'OngoingChargesOverview',\n type: FORMAT_TYPES.CONSTANT\n }\n }\n },\n 'total-annual-charge': {\n dataKey: 'normalised.currentClass.feeCharges.totAnulChrge.val',\n type: FORMAT_TYPES.PERCENTAGE,\n addendumData: {\n caveatId: {\n dataKey: 'TotalAnnualChargeOverview',\n type: FORMAT_TYPES.CONSTANT\n }\n }\n },\n 'initial-sales-charge': {\n dataKey: 'normalised.currentClass.feeCharges.initSalesChrge.val',\n type: FORMAT_TYPES.PERCENTAGE\n },\n 'minimum-initial-amount': {\n dataKey: 'normalised.currentClass.invstmntMin.val',\n type: FORMAT_TYPES.STRING,\n addendumData: {\n caveatId: {\n dataKey: 'MinimumInitialAmountOverview',\n type: FORMAT_TYPES.CONSTANT\n }\n }\n },\n 'minimum-subsequent-amount': {\n dataKey: 'normalised.currentClass.minSubsequentAmt.val',\n type: FORMAT_TYPES.STRING,\n addendumData: {\n caveatId: {\n dataKey: 'MinimumSubsequentAmountOverview',\n type: FORMAT_TYPES.CONSTANT\n }\n }\n }\n};\n\n/**\n * @type {Object.<string, FormattingConfig>}\n */\nexport const INFORMATION_FIELDS = {\n 'fund-inception-date': {\n dataKey: 'fundDetails.fundIncpDt.val',\n type: FORMAT_TYPES.STRING\n },\n 'fund-based-currency': {\n dataKey: 'fundDetails.fundBaseCur.val',\n type: FORMAT_TYPES.STRING\n },\n 'share-class-currency': {\n dataKey: 'normalised.currentClass.shClsCur.val',\n type: FORMAT_TYPES.STRING\n },\n\n 'share-class-inception-date': {\n dataKey: 'normalised.currentClass.shClsIncpDt.val',\n type: FORMAT_TYPES.STRING\n },\n 'class-performance-inception-date': {\n dataKey: 'normalised.currentClass.perfIncDtLcl.val',\n type: FORMAT_TYPES.STRING\n },\n 'benchmark-name': {\n // COREWEB-2222: benchmark name should display benchmarks according to config\n dataKey: 'normalised.concattedHtmlBenchmarkNames',\n type: FORMAT_TYPES.STRING,\n addendumData: {\n caveatId: {\n dataKey: 'PrimaryBenchmarkOverview',\n type: FORMAT_TYPES.CONSTANT\n }\n },\n keepUnavailableValue: false\n },\n 'asset-class': {\n // COREWEB-2078: fundCategory is localed version of assetClassStd\n dataKey: 'fundDetails.fundCategory.val',\n type: FORMAT_TYPES.STRING\n },\n 'taxonomy-asset-class': {\n dataKey: 'fundDetails.assetClass.val',\n type: FORMAT_TYPES.STRING\n },\n 'investment-category': {\n dataKey: 'fundDetails.classStrategy.val',\n type: FORMAT_TYPES.STRING\n },\n 'region': {\n dataKey: 'fundDetails.classGeography.val',\n type: FORMAT_TYPES.STRING\n },\n 'morning-star-category': {\n dataKey: 'fundDetails.fndRating.ms_category.val',\n type: FORMAT_TYPES.STRING\n },\n 'total-net-assets': {\n dataKey: 'fundOverview.portDet.stats.totalNetAsset.val',\n type: FORMAT_TYPES.CURRENCY,\n addendumData: {\n asOf: {\n dataKey: 'fundOverview.portDet.stats.asOfDate.val',\n type: FORMAT_TYPES.STRING\n },\n caveatId: {\n dataKey: 'TotalNetAssetsOverview',\n type: FORMAT_TYPES.CONSTANT\n },\n updateFreq: {\n dataKey: 'updated-monthly',\n type: FORMAT_TYPES.CONSTANT\n }\n }\n },\n // Duplicate of total-net-assets\n 'aum': {\n dataKey: 'fundOverview.portDet.stats.totalNetAsset.val',\n type: FORMAT_TYPES.CURRENCY,\n addendumData: {\n asOf: {\n dataKey: 'fundOverview.portDet.stats.asOfDate.val',\n type: FORMAT_TYPES.STRING\n },\n caveatId: {\n dataKey: 'TotalNetAssetsOverview',\n type: FORMAT_TYPES.CONSTANT\n },\n updateFreq: {\n dataKey: 'updated-monthly',\n type: FORMAT_TYPES.CONSTANT\n }\n }\n },\n // WORKAROUND: keepUnavailableValue == false as don't display if no data\n 'fund-maturity-date': {\n dataKey: 'fundDetails.fundMaturityDate.val',\n type: FORMAT_TYPES.STRING,\n keepUnavailableValue: false,\n addendumData: {\n caveatId: {\n dataKey: 'FundMaturityDateOverview',\n type: FORMAT_TYPES.CONSTANT\n }\n }\n },\n // WORKAROUND: keepUnavailableValue == false as don't display if no data\n // example value IA North America Sector\n 'ia-sector': {\n dataKey: 'fundDetails.fndRating.ima_sector.val',\n type: FORMAT_TYPES.STRING,\n keepUnavailableValue: false,\n addendumData: {\n caveatId: {\n dataKey: 'IASectorOverview',\n type: FORMAT_TYPES.CONSTANT\n }\n }\n },\n // WORKAROUND: keepUnavailableValue == false as don't display if no data\n // example valueISA Available\n 'isa-status': {\n dataKey: 'fundDetails.isaStatusGB.val',\n type: FORMAT_TYPES.STRING,\n keepUnavailableValue: false\n }\n};\n\n\n/**\n * @type {Object.<string, FormattingConfig>}\n */\nexport const DISTRIBUTION_FIELDS = {\n 'distribution-per-unit': {\n dataKey: 'normalised.currentPriceClass.navDet.dividend.divPerUnit.val',\n type: FORMAT_TYPES.CURRENCY\n },\n 'distribution-date': {\n dataKey: 'normalised.currentPriceClass.navDet.dvndYldAsOfDate.val',\n type: FORMAT_TYPES.STRING\n },\n 'dividend-frequency': {\n dataKey: 'normalised.currentClass.dvndFreq.val',\n type: FORMAT_TYPES.STRING\n },\n 'distribution-yield': {\n dataKey: 'normalised.currentPriceClass.navDet.dvndYld.val',\n type: FORMAT_TYPES.PERCENTAGE,\n addendumData: {\n caveatId: {\n dataKey: 'DistirbutionYieldOverview',\n type: FORMAT_TYPES.CONSTANT\n },\n asOf: {\n dataKey: 'normalised.currentPriceClass.navDet.dvndYldAsOfDate.val',\n type: FORMAT_TYPES.STRING\n },\n updateFreq: {\n dataKey: 'updated-monthly',\n type: FORMAT_TYPES.CONSTANT\n }\n }\n }\n};\n\n/**\n * @param {Object} state\n * @param action\n * @returns {Object}\n */\nexport function fundInformation(state, action) {\n switch (action.type) {\n case 'POPULATE_FUND_INFORMATION_SUCCESS':\n logger.debug('Reducing: POPULATE_FUND_INFORMATION_SUCCESS');\n return Object.assign({}, state, {\n fundInformation: _infoBuilder(action)\n });\n default:\n return state;\n }\n}\n\nfunction _infoBuilder(action) {\n let [rawOverview, rawFundDetails, rawPrice, rawConfig] = action.json;\n let fundOverview = get(rawOverview, 'intlFundOverviewValue');\n let fundDetails = get(rawFundDetails, 'globalProductsValue.fundDetailIntl');\n let priceDetails = get(rawPrice, 'globalProductsValue.prceDistbIntl');\n let decoratedConfig = configDecorator(rawConfig, action.segment);\n\n const shareClasses = get(fundDetails, 'shClsDet');\n const fundId = get(fundDetails, 'fundId.val');\n let priceShareClasses = get(rawPrice, 'globalProductsValue.prceDistbIntl.shClsPriceDet', []);\n let normalised = {};\n normalised.currentClass = utilsFundDetails.getCurrentShareClass(action.shareClassKey, shareClasses);\n let hasDistributions = get(normalised.currentClass, 'shClsDistributionFlag.val', 'Y').toUpperCase() === 'Y';\n\n normalised.currentShareClassCode = get(normalised.currentClass, 'shCls.val') || get(fundDetails, 'shClassCode.val');\n normalised.currentPriceClass = find(priceShareClasses, {shClsCD: {val: normalised.currentShareClassCode}});\n // TODO: Find Data\n normalised.asOf = get(fundOverview, 'xxxx.etfDet.expAsOfDt.val', '—');\n\n normalised.salesChargesAsOf = get(normalised, 'currentClass.feeCharges.asOfDate.val', '—');\n normalised.distributionsAsOf = get(normalised, 'currentPriceClass.navDet.dividend.distDt.val', '—');\n normalised.distributionsHasData = !!get(normalised, 'currentPriceClass.navDet.dividend.divPerUnit.val', false);\n normalised.baseCurrency = utilsFundDetails.getFundCurrency(fundDetails);\n normalised.shareClassCurrency = utilsFundDetails.getShareClassCurrency(fundDetails, normalised.currentShareClassCode);\n normalised.assetClass = utilsFundDetails.getAssetClass(fundDetails);\n normalised.keyedBenchMrks = utilsFundDetails.benchmarkByKey(fundDetails, fundId, normalised.currentShareClassCode);\n\n // TODO: COREWEB-2221 update to take config into account\n normalised.concattedHtmlBenchmarkNames = utilsFundDetails.getConcattedHtmlBenchmarkNames(fundDetails, fundId, normalised.currentShareClassCode, decoratedConfig);\n\n let dataRepo = {\n fundOverview,\n fundDetails,\n priceDetails,\n normalised\n };\n\n let fundVehicle = get(fundDetails, 'fundUmbrella.val');\n let vehicleConfig = get(decoratedConfig, `overview.investmentVehicles.${fundVehicle}`);\n let desiredSaleChargeFieldIds = get(vehicleConfig, 'salesCharges', []);\n let desiredIdentifierFieldIds = get(vehicleConfig, 'fundIdentifiers', []);\n let desiredInformationFieldIds = get(vehicleConfig, 'fundInformationElements', []);\n let fields = {\n salesChargeFields: extractCamelCaseIds(SALES_CHARGE_FIELDS, desiredSaleChargeFieldIds),\n identifierFields: extractCamelCaseIds(IDENTIFIER_FIELDS, desiredIdentifierFieldIds),\n informationFields: extractCamelCaseIds(INFORMATION_FIELDS, desiredInformationFieldIds),\n distributionFields: DISTRIBUTION_FIELDS\n };\n\n return buildFundInformation(\n hasDistributions,\n false,\n dataRepo,\n fields\n );\n}\n","/**\n * Data Reducer for fundRatings\n * Takes site specific json data and creates model for components\n * after applying business and presentation logic and data mapping\n */\nimport {LogManager} from 'aurelia-framework';\nimport {configDecorator} from '../../../../lib/decorators/config-decorator';\nimport get from 'lodash/get';\n\nconst logger = LogManager.getLogger('fund-ratings');\n\nexport function fundRatings(state, action) {\n let stateOBJ;\n if (action.type === 'POPULATE_FUND_RATINGS_SUCCESS') {\n logger.debug('Reducing: POPULATE_FUND_RATINGS_SUCCESS');\n const [rawOverview, rawFundDetails, rawConfig] = action.json;\n const config = configDecorator(rawConfig, action.segment);\n const investmentVehicle = getInvestmentVehicle(rawFundDetails);\n const ratingsConfig = get(config, `overview.investmentVehicles.${investmentVehicle}.ratings`, []);\n const data = rawOverview.intlFundOverviewValue.fundDet.fndRating;\n let ratings = {\n showMorningStar: ratingsConfig.includes('morningStar'),\n msNumberOfStars: Number(data.ms_rating_ovrl.val),\n msCategory: data.ms_category.val,\n asOfDate: data.as_of_date.val,\n showLipper: ratingsConfig.includes('lipper'),\n lipperTotalReturn: get(data, 'ovrl_tot_rtn.val'),\n lipperConsistentReturn: get(data, 'ovrl_constnt_rtn.val'),\n lipperPreservation: get(data, 'ovrl_prsvtn.val'),\n lipperTaxEfficiency: get(data, 'ovrl_tax_eff.val'),\n lipperExpense: get(data, 'ovrl_expns.val'),\n showObsr: ratingsConfig.includes('obsr'),\n showAnalizy: ratingsConfig.includes('analizy')\n };\n stateOBJ = Object.assign({}, state, {\n fundRatings: ratings\n });\n } else {\n stateOBJ = state;\n }\n return stateOBJ;\n}\n\nfunction getInvestmentVehicle(fundDetails) {\n return fundDetails.globalProductsValue.fundDetailIntl.fundUmbrella.val;\n}\n\n","/**\n * Data Reducer for calendarYearReturns\n * Takes site specific json data and creates model for components\n * after applying business and presentation logic and data mapping\n */\nimport get from 'lodash/get';\nimport find from 'lodash/find';\nimport orderBy from 'lodash/orderBy';\nimport moment from 'moment';\nimport parseFormat from 'moment-parseformat';\nimport {LogManager} from 'aurelia-framework';\nimport {calendarUtils} from '../calendar-utils';\nimport {performanceUtils} from '../../../util/util';\nimport {configDecorator} from '../../../../lib/decorators/config-decorator';\nimport {utilsFundDetails} from '../../../../common/util/utils-fund-details';\nimport {utilsConfig} from '../../../../common/util/utils-config';\n\nconst logger = LogManager.getLogger('calendar-year-returns');\n/**\n * Populates objects to component\n * @param {Object} state\n * @param {Object} action\n * @returns {Object}\n */\nexport function calendarYearReturns(state, action) {\n let stateOBJ;\n if (action.type === 'POPULATE_CALENDAR_YEAR_RETURNS_SUCCESS') {\n logger.debug('Reducing: POPULATE_CALENDAR_YEAR_RETURNS_SUCCESS');\n\n let [rawPerformance, rawConfig, rawFundDetails] = action.json;\n\n let config = configDecorator(rawConfig, action.segment);\n let useDynamicLabels = !!get(config, 'performance.dynamicLabels');\n let showYTD = !get(config, 'performance.hideYTDForCumulativeAndCalendarYear', true);\n\n const fundDetails = get(rawFundDetails, 'globalProductsValue.fundDetailIntl');\n const performance = get(rawPerformance, 'globalProductsValue.performanceIntl');\n const shareClasses = get(fundDetails, 'shClsDet');\n const currentClass = utilsFundDetails.getCurrentShareClass(action.shareClassKey, shareClasses);\n const shareClassCode = get(currentClass, 'shCls.val') || get(fundDetails, 'shClassCode.val');\n const fundId = get(fundDetails, 'fundId.val');\n const allShareClassDetails = get(rawFundDetails, 'globalProductsValue.fundDetailIntl.shClsDet');\n\n const benchMarks = utilsFundDetails.benchmarkByKey(fundDetails, fundId, shareClassCode);\n const sortedBenchmarkOrder = performanceUtils.getSortedBenchmarkOrder(benchMarks, fundDetails, fundId, shareClassCode, config);\n\n let monthlyData = get(performance, 'monthlyPerfDetailsList');\n let quarterlyData = get(performance, 'quarterlyPerfDetailsList');\n let peersRankList = get(performance, 'peerRnksList');\n let peerRnksListQtly = get(performance, 'peerRnksListQtly');\n const displayOEIC = performanceUtils.displayOEIC(config, fundDetails);\n\n let thisMonthlyCalendar;\n let thisQuarterlyCalendar;\n let monthEnd;\n let quarterEnd;\n\n if (typeof monthlyData !== 'undefined') {\n thisMonthlyCalendar = _getThisCalendar(monthlyData, peersRankList, shareClassCode, allShareClassDetails, benchMarks, sortedBenchmarkOrder, config, fundId, displayOEIC);\n }\n\n if (typeof quarterlyData !== 'undefined') {\n thisQuarterlyCalendar = _getThisCalendar(quarterlyData, peerRnksListQtly, shareClassCode, allShareClassDetails, benchMarks, sortedBenchmarkOrder, config, fundId, displayOEIC);\n }\n\n if (typeof thisMonthlyCalendar !== 'undefined') {\n monthEnd = {\n calData: thisMonthlyCalendar.tableData,\n chartData: thisMonthlyCalendar.graphData,\n dateGroup: 'month-end',\n dynamicLabel: thisMonthlyCalendar.dynamicLabel,\n hideChart: thisMonthlyCalendar.hideChart,\n showData: thisMonthlyCalendar.showData,\n fundName: thisMonthlyCalendar.fundName\n };\n }\n\n if (typeof thisQuarterlyCalendar !== 'undefined') {\n quarterEnd = {\n calData: thisQuarterlyCalendar.tableData,\n chartData: thisQuarterlyCalendar.graphData,\n dateGroup: 'quarter-end',\n dynamicLabel: thisQuarterlyCalendar.dynamicLabel,\n hideChart: thisQuarterlyCalendar.hideChart,\n showData: thisQuarterlyCalendar.showData,\n fundName: thisQuarterlyCalendar.fundName\n };\n }\n\n let siteVehicle = utilsFundDetails.getSiteVehicle(rawFundDetails);\n let showFundNumber = !utilsConfig.isValueInConfigKey(config, 'performance.hideFundNumber', siteVehicle);\n let showCurrency = !utilsConfig.isValueInConfigKey(config, 'performance.hideCurrency', siteVehicle);\n\n stateOBJ = Object.assign({}, state, {\n calendarYearReturns: {\n MONTH_END: monthEnd,\n QUARTER_END: quarterEnd,\n options: {\n showFundNumber,\n showCurrency,\n useDynamicLabels,\n showYTD\n }\n }\n });\n } else {\n stateOBJ = state;\n }\n return stateOBJ;\n}\n/**\n * Returns object with data for chart and table\n * @param performances\n * @param peersRankList\n * @param shareClassCode\n * @param allShareClassDetails\n * @param benchMarks\n * @param sortedBenchmarkOrder\n * @param config\n * @param fundId\n * @returns {{tableData: {asOfDate: *, rows: Array, allRows: Array, years: Array}, graphData: (*|*[]), inceptionDate: *, dynamicLabel: *, hideChart: *, fundName: *, showData: boolean}}\n * @private\n */\nfunction _getThisCalendar(performances, peersRankList, shareClassCode, allShareClassDetails, benchMarks, sortedBenchmarkOrder, config, fundId, displayOEIC) {\n let thisPerformanceObj = find(performances, {shClsCde: {val: shareClassCode} } );\n let asOfDate = get(thisPerformanceObj, 'asOfDate.val');\n let inceptionDate = get(thisPerformanceObj, 'fundIncDt.val');\n let inceptionDateLoc = get(thisPerformanceObj, 'fundIncDtLoc.val');\n let perfIncDt = get(thisPerformanceObj, 'perfIncDt.val');\n let fundName = get(thisPerformanceObj, 'name.val');\n let informationLinkMain = get(config, 'performance.informationLinkMain');\n\n const mdash = '—';\n let showMDash = performanceUtils.mustHidePerformanceData(config, inceptionDate);\n let dynamicLabel = performanceUtils.dynamicPerformanceLabels(asOfDate, perfIncDt);\n\n const hideChart = performanceUtils.hideChart(config, fundId, 'hideCalendarYearChartFundList', showMDash, perfIncDt);\n\n let asOfFormat = parseFormat(asOfDate);\n let lastYear = moment(asOfDate, asOfFormat).get('year');\n let calendarYears = calendarUtils.calendarYears(lastYear, true);\n let yearAry = calendarYears.yearAry;\n\n let rows = [];\n\n // add the main shareclas to the table\n if (thisPerformanceObj) {\n thisPerformanceObj.link = informationLinkMain;\n rows.push(calendarUtils.getSHTableRow(thisPerformanceObj, showMDash, mdash, allShareClassDetails));\n }\n\n // benchmarks\n sortedBenchmarkOrder.forEach(item => {\n let bm = find(performances, {bmrkID: { val: get(benchMarks, `${item}.bmrkId.val`)}});\n if (bm) {\n bm.link = informationLinkMain;\n rows.push(calendarUtils.getBMTableRow(bm, false, mdash));\n }\n });\n\n if (displayOEIC) {\n let IASector = performanceUtils.hasIASector(peersRankList, shareClassCode);\n if (IASector) {\n IASector.link = informationLinkMain;\n rows.push(calendarUtils.getIATableRow(IASector, mdash));\n }\n }\n\n let allRows = [];\n performances.forEach(item => {\n if (item !== thisPerformanceObj) {\n item.link = informationLinkMain;\n allRows.push(calendarUtils.getSHTableRow(item, showMDash, mdash, allShareClassDetails));\n }\n });\n let allRowsSorted = orderBy(allRows, ['name'], ['asc']);\n\n let chartColumns = calendarYears.chartColumns;\n let graphData = performanceUtils.tableDataToChartData(rows, chartColumns);\n\n let showData = true;\n if ((rows.length === 0) && (allRows.length === 0)) { showData = false; }\n if (!thisPerformanceObj) { showData = false; }\n if (thisPerformanceObj && !get(thisPerformanceObj, 'cumulativeDetail.sinceIncp.val')) { showData = false; }\n\n return {\n tableData: {\n allRows: allRowsSorted,\n years: yearAry,\n asOfDate,\n rows\n },\n inceptionDate: inceptionDateLoc,\n graphData,\n dynamicLabel,\n hideChart,\n fundName,\n showData\n };\n}\n","/**\n * Data Reducer for discreteReturns\n * Takes site specific json data and creates model for components\n * after applying business and presentation logic and data mapping\n */\nimport get from 'lodash/get';\nimport take from 'lodash/take';\nimport find from 'lodash/find';\nimport orderBy from 'lodash/orderBy';\nimport {discreteUtils} from '../discrete-returns-utils';\nimport {performanceUtils} from '../../../util/util';\nimport {utilsConfig} from '../../../../common/util/utils-config';\nimport {configDecorator} from '../../../../lib/decorators/config-decorator';\nimport {utilsFundDetails} from '../../../../common/util/utils-fund-details';\n\nimport {LogManager} from 'aurelia-framework';\nconst logger = LogManager.getLogger('discrete-returns');\n/**\n * Populates objects to component\n * @param {object} state\n * @param {object} action\n * @returns {object}\n */\nexport function discreteReturns(state, action) {\n let stateOBJ;\n if (action.type === 'POPULATE_DISCRETE_RETURNS_SUCCESS') {\n logger.debug('Reducing: POPULATE_DISCRETE_RETURNS_SUCCESS', action);\n\n let [rawPerformanceFeed, rawConfig, rawFundDetails, compConfig] = action.json;\n const config = configDecorator(rawConfig, action.segment);\n\n let useDynamicLabels = !!get(config, 'performance.dynamicLabels');\n\n // check share class for fund vehicle, then compare to this might be array\n let fundVehicle = utilsFundDetails.getSiteVehicle(rawFundDetails);\n let showFundNumber = !utilsConfig.isValueInConfigKey(config, 'performance.hideFundNumber', fundVehicle);\n let showCurrency = !utilsConfig.isValueInConfigKey(config, 'performance.hideCurrency', fundVehicle);\n\n // let data = discreteUtils.getDiscreteReturnData(action);\n\n const fundDetails = get(rawFundDetails, 'globalProductsValue.fundDetailIntl');\n const performance = get(rawPerformanceFeed, 'globalProductsValue.performanceIntl');\n const shareClasses = get(fundDetails, 'shClsDet');\n const currentClass = utilsFundDetails.getCurrentShareClass(action.shareClassKey, shareClasses);\n const shareClassCode = get(currentClass, 'shCls.val') || get(fundDetails, 'shClassCode.val');\n const fundId = get(fundDetails, 'fundId.val');\n\n const benchMarks = utilsFundDetails.benchmarkByKey(fundDetails, fundId, shareClassCode);\n const sortedBenchmarkOrder = performanceUtils.getSortedBenchmarkOrder(benchMarks, fundDetails, fundId, shareClassCode, config);\n const hideDiscreteBMOlderThanMainClass = get(compConfig, 'SuppressOldBenchmarkData.0', '') === 'YES';\n\n let monthlyData = get(performance, 'monthlyPerfDetailsList');\n let quarterlyData = get(performance, 'quarterlyPerfDetailsList');\n let peersRankList = get(performance, 'peerRnksList');\n let peerRnksListQtly = get(performance, 'peerRnksListQtly');\n\n // cross-referenced to find taID numbers\n let allShareClassDetails = get(rawFundDetails, 'globalProductsValue.fundDetailIntl.shClsDet');\n const displayOEIC = performanceUtils.displayOEIC(config, fundDetails);\n\n let thisMonthlyDiscrete;\n let thisQuarterlyDiscrete;\n // let thisMonthlyDiscreteRev;\n // let thisQuarterlyDiscreteRev;\n let monthEnd;\n let quarterEnd;\n\n if (typeof monthlyData !== 'undefined') {\n thisMonthlyDiscrete = _getThisDiscrete(monthlyData, peersRankList, shareClassCode, allShareClassDetails, benchMarks, sortedBenchmarkOrder, config, fundId, hideDiscreteBMOlderThanMainClass, displayOEIC);\n // thisMonthlyDiscreteRev = _getThisDiscrete(monthlyData, peersRankList, shareClassCode, allShareClassDetails, false, true);\n }\n\n if (typeof quarterlyData !== 'undefined') {\n thisQuarterlyDiscrete = _getThisDiscrete(quarterlyData, peerRnksListQtly, shareClassCode, allShareClassDetails, benchMarks, sortedBenchmarkOrder, config, fundId, hideDiscreteBMOlderThanMainClass, displayOEIC);\n // thisQuarterlyDiscreteRev = _getThisDiscrete(quarterlyData, peersRankList, shareClassCode, allShareClassDetails, true, true);\n }\n\n if (typeof thisMonthlyDiscrete !== 'undefined') {\n monthEnd = {\n tableData: thisMonthlyDiscrete.tableData,\n chartData: thisMonthlyDiscrete.graphData,\n fundName: thisMonthlyDiscrete.fundName,\n dynamicLabel: thisMonthlyDiscrete.dynamicLabel,\n dateGroup: 'month-end',\n hideChart: thisMonthlyDiscrete.hideChart,\n showData: thisMonthlyDiscrete.showData\n };\n }\n\n if (typeof thisQuarterlyDiscrete !== 'undefined') {\n quarterEnd = {\n tableData: thisQuarterlyDiscrete.tableData,\n chartData: thisQuarterlyDiscrete.graphData,\n dynamicLabel: thisQuarterlyDiscrete.dynamicLabel,\n fundName: thisQuarterlyDiscrete.fundName,\n dateGroup: 'quarter-end',\n hideChart: thisQuarterlyDiscrete.hideChart,\n showData: thisQuarterlyDiscrete.showData\n };\n }\n\n stateOBJ = Object.assign({}, state, {\n discreteReturns: {\n MONTH_END: monthEnd,\n QUARTER_END: quarterEnd,\n options: {\n showFundNumber,\n showCurrency,\n useDynamicLabels\n }\n }\n });\n } else {\n stateOBJ = state;\n }\n return stateOBJ;\n}\n\n/**\n * Returns object with data for chart and table\n * @param {object} performances\n * @param {object} peersRankList\n * @param {object} shareClassCode\n * @param {object} allShareClassDetails\n * @param {object} benchMarks\n * @param {object} sortedBenchmarkOrder\n * @param {object} config\n * @param {string} fundId\n * @param {boolean} hideDiscreteBMOlderThanMainClass\n * @returns {object} dataObj\n * @private\n */\nfunction _getThisDiscrete(performances, peersRankList, shareClassCode, allShareClassDetails, benchMarks, sortedBenchmarkOrder, config, fundId, hideDiscreteBMOlderThanMainClass, displayOEIC) {\n let thisPerformanceObj = find(performances, {shClsCde: {val: shareClassCode} } );\n let asOfDate = get(thisPerformanceObj, 'asOfDate.val');\n let shareClassDetails = find(allShareClassDetails, {shCls: {val: shareClassCode} } );\n // let taID = get(shareClassDetails, 'taID.val');\n //\n // // WARNING: inceptionDate == performanceInceptionDate in performance page\n let inceptionDate = get(shareClassDetails, 'perfIncpDt.val');\n let inceptionDateLoc = get(shareClassDetails, 'perfIncDtLcl.val');\n let perfIncDt = get(thisPerformanceObj, 'perfIncDt.val');\n let allYears = discreteUtils.countYears(asOfDate, inceptionDate, true);\n let yearsSinceStartDate = discreteUtils.countYearsChart(asOfDate, inceptionDate, true);\n let fundName = get(thisPerformanceObj, 'name.val');\n\n const mdash = '—';\n let showMDash = performanceUtils.mustHidePerformanceData(config, inceptionDate);\n\n const hideChart = performanceUtils.hideChart(config, fundId, 'hideDiscreteAnnualChartFundList', showMDash, perfIncDt);\n\n let chartColumns = ['oneYr', 'twoYr', 'threeYr', 'fourYr', 'fiveYr'];\n let dynamicLabel = performanceUtils.dynamicPerformanceLabels(asOfDate, perfIncDt);\n\n let rows = [];\n let hasIAorBm = false;\n\n // add the main shareclas to the table\n if (thisPerformanceObj) {\n rows.push(discreteUtils.getSHTableRow(thisPerformanceObj, showMDash, mdash, allShareClassDetails));\n }\n\n // benchmarks\n sortedBenchmarkOrder.forEach(item => {\n let bm = find(performances, {bmrkID: { val: get(benchMarks, `${item}.bmrkId.val`)}});\n if (bm) {\n rows.push(discreteUtils.getBMTableRow(bm, false, mdash, yearsSinceStartDate.length, hideDiscreteBMOlderThanMainClass));\n }\n hasIAorBm = true;\n });\n\n if (displayOEIC) {\n let IASector = performanceUtils.hasIASector(peersRankList, shareClassCode);\n if (IASector) {\n rows.push(discreteUtils.getIATableRow(IASector, mdash));\n hasIAorBm = true;\n }\n }\n let allRows = [];\n performances.forEach(item => {\n if (item !== thisPerformanceObj) {\n allRows.push(discreteUtils.getSHTableRow(item, showMDash, mdash, allShareClassDetails));\n }\n });\n let allRowsSorted = orderBy(allRows, ['name'], ['asc']);\n\n let chartCols = [];\n let graphData = [];\n\n\n if (!hideChart) {\n if (hasIAorBm) {\n chartCols = allYears;\n } else {\n chartCols = yearsSinceStartDate;\n }\n graphData = performanceUtils.tableDataToChartData(rows, chartColumns);\n\n if (chartCols.length < 5) {\n graphData = graphData.map((row) => take(row, chartCols.length));\n }\n }\n\n let showData = true;\n if ((rows.length === 0) && (allRows.length === 0)) { showData = false; }\n if (!thisPerformanceObj) { showData = false; }\n if (thisPerformanceObj && !get(thisPerformanceObj, 'discreteDetail.oneYr.val')) { showData = false; }\n\n return {\n tableData: {\n asOfDate,\n rows,\n allRows: allRowsSorted,\n years: allYears,\n chartCols\n },\n graphData,\n inceptionDate: inceptionDateLoc,\n dynamicLabel,\n hideChart,\n fundName,\n showData\n };\n}\n","/**\n * Data Reducer for performanceAnnualised\n * Takes site specific json data and creates model for components\n * after applying business and presentation logic and data mapping\n */\nimport {LogManager} from 'aurelia-framework';\nimport {configDecorator} from '../../../../lib/decorators/config-decorator';\nimport {performanceUtils} from '../../../util/util';\nimport {utilsFundDetails} from '../../../../common/util/utils-fund-details';\nimport {utilsConfig} from '../../../../common/util/utils-config';\nimport {annualisedUtils} from '../performance-annualised-utils';\nimport get from 'lodash/get';\nimport find from 'lodash/find';\nimport orderBy from 'lodash/orderBy';\nconst logger = LogManager.getLogger('performance-annualised');\n\nexport function performanceAnnualised(state, action) {\n let stateOBJ;\n stateOBJ = state;\n if (action.type === 'POPULATE_PERFORMANCE_ANNUALISED_SUCCESS') {\n logger.debug('Reducing: POPULATE_PERFORMANCE_ANNUALISED_SUCCESS', action);\n\n let [rawPerformance, rawConfig, rawFundDetails] = action.json;\n\n const fundDetails = get(rawFundDetails, 'globalProductsValue.fundDetailIntl');\n const performance = get(rawPerformance, 'globalProductsValue.performanceIntl');\n const shareClasses = get(fundDetails, 'shClsDet');\n const fundId = get(fundDetails, 'fundId.val');\n const currentClass = utilsFundDetails.getCurrentShareClass(action.shareClassKey, shareClasses);\n const shareClassCode = get(currentClass, 'shCls.val') || get(fundDetails, 'shClassCode.val');\n const allShareClassDetails = get(rawFundDetails, 'globalProductsValue.fundDetailIntl.shClsDet');\n\n const config = configDecorator(rawConfig, action.segment);\n const useDynamicLabels = !!get(config, 'performance.dynamicLabels');\n const fundKey = action.fundId + '-' + shareClassCode;\n\n // Benchmarks\n const benchMarks = utilsFundDetails.benchmarkByKey(fundDetails, fundId, shareClassCode);\n const sortedBenchmarkOrder = performanceUtils.getSortedBenchmarkOrder(benchMarks, fundDetails, fundId, shareClassCode, config);\n\n let monthlyData = get(performance, 'monthlyPerfDetailsList');\n let quarterlyData = get(performance, 'quarterlyPerfDetailsList');\n let peersRankList = get(performance, 'peerRnksList');\n let peerRnksListQtly = get(performance, 'peerRnksListQtly');\n const displayOEIC = performanceUtils.displayOEIC(config, fundDetails);\n\n let thisMonthlyTable;\n let thisQuarterlyTable;\n\n if (typeof monthlyData !== 'undefined') {\n thisMonthlyTable = _performanceBuilder(monthlyData, peersRankList, shareClassCode, config, benchMarks, sortedBenchmarkOrder, fundKey, allShareClassDetails, fundId, displayOEIC);\n }\n\n if (typeof quarterlyData !== 'undefined') {\n thisQuarterlyTable = _performanceBuilder(quarterlyData, peerRnksListQtly, shareClassCode, config, benchMarks, sortedBenchmarkOrder, fundKey, allShareClassDetails, fundId, displayOEIC);\n }\n\n let siteVehicle = utilsFundDetails.getSiteVehicle(rawFundDetails);\n let showFundNumber = !utilsConfig.isValueInConfigKey(config, 'performance.hideFundNumber', siteVehicle);\n let showCurrency = !utilsConfig.isValueInConfigKey(config, 'performance.hideCurrency', siteVehicle);\n\n stateOBJ = Object.assign({}, state, {\n performanceAnnualised: {\n MONTH_END: {\n performances: thisMonthlyTable,\n label: 'month-end'\n },\n QUARTER_END: {\n performances: thisQuarterlyTable,\n label: 'quarter-end'\n },\n options: {\n showFundNumber,\n showCurrency,\n useDynamicLabels\n }\n }\n });\n }\n\n return stateOBJ;\n}\n\n/**\n * Returns data object for avgAnnual\n * @param performances\n * @param peersRankList\n * @param shareClassCode\n * @param config\n * @param benchMarks\n * @param sortedBenchmarkOrder\n * @param fundKey\n * @param allShareClassDetails\n * @param fundId\n * @return {{tableData: {asOfDate: (*|any), rows: Array, allRows: (Array|any[])}, inceptionDate: (*|any), graphData: *, dynamicLabel: *, fundName: (*|any), hideChart: (*|boolean), showData: boolean}}\n * @private\n */\nfunction _performanceBuilder(performances, peersRankList, shareClassCode, config, benchMarks, sortedBenchmarkOrder, fundKey, allShareClassDetails, fundId, displayOEIC) {\n let thisPerformanceObj = find(performances, {shClsCde: {val: shareClassCode}});\n\n let asOfDate = get(thisPerformanceObj, 'asOfDate.val');\n let inceptionDate = get(thisPerformanceObj, 'shClsIncDt.val'); //COREWEB-2264 changed to shareclass inception date\n let perfIncDt = get(thisPerformanceObj, 'perfIncDt.val');\n let inceptionDateLoc = get(thisPerformanceObj, 'shClsIncDtLoc.val');\n let fundName = get(thisPerformanceObj, 'name.val');\n let informationLinkMain = get(config, 'performance.informationLinkMain');\n\n const mdash = '—';\n let showMDash = performanceUtils.mustHidePerformanceData(config, inceptionDate);\n\n const hideChart = performanceUtils.hideChart(config, fundId, 'hideAverageAnnualChartFundList', showMDash, perfIncDt);\n\n let rows = [];\n\n // add the main shareclass to the table\n if (thisPerformanceObj) {\n thisPerformanceObj.link = informationLinkMain;\n rows.push(annualisedUtils.getSHTableRow(thisPerformanceObj, showMDash, mdash, allShareClassDetails));\n }\n\n // benchmarks\n sortedBenchmarkOrder.forEach(item => {\n let bm = find(performances, {bmrkID: { val: get(benchMarks, `${item}.bmrkId.val`)}});\n if (bm) {\n bm.link = informationLinkMain;\n rows.push(annualisedUtils.getBMTableRow(bm, false, mdash));\n }\n });\n\n if (displayOEIC) {\n let IASector = performanceUtils.hasIASector(peersRankList, shareClassCode);\n if (IASector) {\n IASector.link = informationLinkMain;\n rows.push(annualisedUtils.getIATableRow(IASector, mdash));\n }\n }\n\n let dynamicLabel = performanceUtils.dynamicPerformanceLabels(asOfDate, perfIncDt);\n\n let allRows = [];\n performances.forEach(item => {\n if (item !== thisPerformanceObj) {\n item.link = informationLinkMain;\n allRows.push(annualisedUtils.getSHTableRow(item, showMDash, mdash, allShareClassDetails));\n }\n });\n let allRowsSorted = orderBy(allRows, ['name'], ['asc']);\n\n let graphData;\n if (!hideChart) {\n if (showMDash || config.performance.hideAverageAnnualChartFundList.includes(fundKey)) {\n graphData = null;\n } else {\n let chartColumns = ['oneY', 'threeY', 'fiveY', 'tenY', 'fiftnY', 'life'];\n graphData = performanceUtils.tableDataToChartData(rows, chartColumns);\n }\n }\n\n let showData = true;\n if ((rows.length === 0) && (allRows.length === 0)) { showData = false; }\n if (!thisPerformanceObj) { showData = false; }\n if (thisPerformanceObj && !get(thisPerformanceObj, 'avgAnnual.sinceIncp.val')) { showData = false; }\n\n return {\n tableData: {\n asOfDate,\n rows,\n allRows: allRowsSorted\n },\n inceptionDate: inceptionDateLoc,\n graphData,\n dynamicLabel,\n fundName,\n hideChart,\n showData\n };\n}\n","/**\n * Data Reducer for performanceCumulative\n * Takes site specific json data and creates model for components\n * after applying business and presentation logic and data mapping\n */\nimport get from 'lodash/get';\nimport find from 'lodash/find';\nimport orderBy from 'lodash/orderBy';\nimport {performanceUtils} from '../../../util/util';\nimport {utilsFundDetails} from '../../../../common/util/utils-fund-details';\nimport {configDecorator} from '../../../../lib/decorators/config-decorator';\nimport {utilsConfig} from '../../../../common/util/utils-config';\nimport {cumulativeUtils} from '../performance-cumulative-utils';\nimport {isNotEmptyDeep} from '../../../../common/util/utils';\n\nimport {LogManager} from 'aurelia-framework';\nconst logger = LogManager.getLogger('performance-cumulative');\n\nexport function performanceCumulative(state, action) {\n let stateOBJ;\n if (action.type === 'POPULATE_PERFORMANCE_CUMULATIVE_SUCCESS') {\n logger.debug('Reducing: POPULATE_PERFORMANCE_CUMULATIVE_SUCCESS', action);\n\n const [rawPerformance, performanceGraph, rawConfig, rawFundDetails] = action.json;\n const config = configDecorator(rawConfig, action.segment);\n const useDynamicLabels = !!get(config, 'performance.dynamicLabels');\n const show1M3M6M = get(config, 'performance.showYtd1M3M6M', true);\n const showYTD = !get(config, 'performance.hideYTDForCumulativeAndCalendarYear', true);\n\n const fundDetails = get(rawFundDetails, 'globalProductsValue.fundDetailIntl');\n const performance = get(rawPerformance, 'globalProductsValue.performanceIntl');\n const shareClasses = get(fundDetails, 'shClsDet');\n const currentClass = utilsFundDetails.getCurrentShareClass(action.shareClassKey, shareClasses);\n const shareClassCode = get(currentClass, 'shCls.val') || get(fundDetails, 'shClassCode.val');\n const fundId = get(fundDetails, 'fundId.val');\n const allShareClassDetails = get(rawFundDetails, 'globalProductsValue.fundDetailIntl.shClsDet');\n // benchmarks\n const benchMarks = utilsFundDetails.benchmarkByKey(fundDetails, fundId, shareClassCode);\n const sortedBenchmarkOrder = performanceUtils.getSortedBenchmarkOrder(benchMarks, fundDetails, fundId, shareClassCode, config);\n\n const monthlyData = get(performance, 'monthlyPerfDetailsList');\n const quarterlyData = get(performance, 'quarterlyPerfDetailsList');\n const peersRankList = get(performance, 'peerRnksList');\n const peerRnksListQtly = get(performance, 'peerRnksListQtly');\n const displayOEIC = performanceUtils.displayOEIC(config, fundDetails);\n\n let thisMonthlyTable = {};\n let thisQuarterlyTable = {};\n\n if (typeof monthlyData !== 'undefined') {\n thisMonthlyTable = _performanceBuilder(monthlyData, peersRankList, shareClassCode, benchMarks, sortedBenchmarkOrder, config, allShareClassDetails, fundId, displayOEIC);\n }\n\n if (typeof quarterlyData !== 'undefined') {\n thisQuarterlyTable = _performanceBuilder(quarterlyData, peerRnksListQtly, shareClassCode, benchMarks, sortedBenchmarkOrder, config, allShareClassDetails, fundId, displayOEIC);\n }\n\n let siteVehicle = utilsFundDetails.getSiteVehicle(rawFundDetails);\n let showFundNumber = !utilsConfig.isValueInConfigKey(config, 'performance.hideFundNumber', siteVehicle);\n let showCurrency = !utilsConfig.isValueInConfigKey(config, 'performance.hideCurrency', siteVehicle);\n\n stateOBJ = Object.assign({}, state, {\n performanceCumulative: {\n MONTH_END: {\n graphNames: thisMonthlyTable.graphNames,\n tableData: thisMonthlyTable.tableData,\n inceptionDate: thisMonthlyTable.inceptionDate,\n dynamicLabel: thisMonthlyTable.dynamicLabel,\n hideChart: isNotEmptyDeep(performanceGraph) ? thisMonthlyTable.hideChart : true,\n fundName: thisMonthlyTable.fundName,\n showData: thisMonthlyTable.showData,\n PC_1YR: cumulativeUtils.processPerformanceChartData(performanceGraph, 0, 'monthlyGraphs', sortedBenchmarkOrder),\n PC_3YR: cumulativeUtils.processPerformanceChartData(performanceGraph, 1, 'monthlyGraphs', sortedBenchmarkOrder),\n PC_5YR: cumulativeUtils.processPerformanceChartData(performanceGraph, 2, 'monthlyGraphs', sortedBenchmarkOrder),\n PC_10YR: cumulativeUtils.processPerformanceChartData(performanceGraph, 3, 'monthlyGraphs', sortedBenchmarkOrder),\n PC_15YR: cumulativeUtils.processPerformanceChartData(performanceGraph, 4, 'monthlyGraphs', sortedBenchmarkOrder),\n PC_LIFE: cumulativeUtils.processPerformanceChartData(performanceGraph, 5, 'monthlyGraphs', sortedBenchmarkOrder)\n },\n QUARTER_END: {\n graphNames: thisQuarterlyTable.graphNames,\n tableData: thisQuarterlyTable.tableData,\n inceptionDate: thisQuarterlyTable.inceptionDate,\n dynamicLabel: thisQuarterlyTable.dynamicLabel,\n hideChart: isNotEmptyDeep(performanceGraph) ? thisQuarterlyTable.hideChart : true,\n fundName: thisQuarterlyTable.fundName,\n showData: thisQuarterlyTable.showData,\n PC_1YR: cumulativeUtils.processPerformanceChartData(performanceGraph, 0, 'quarterlyGraphs', sortedBenchmarkOrder),\n PC_3YR: cumulativeUtils.processPerformanceChartData(performanceGraph, 1, 'quarterlyGraphs', sortedBenchmarkOrder),\n PC_5YR: cumulativeUtils.processPerformanceChartData(performanceGraph, 2, 'quarterlyGraphs', sortedBenchmarkOrder),\n PC_10YR: cumulativeUtils.processPerformanceChartData(performanceGraph, 3, 'quarterlyGraphs', sortedBenchmarkOrder),\n PC_15YR: cumulativeUtils.processPerformanceChartData(performanceGraph, 4, 'quarterlyGraphs', sortedBenchmarkOrder),\n PC_LIFE: cumulativeUtils.processPerformanceChartData(performanceGraph, 5, 'quarterlyGraphs', sortedBenchmarkOrder)\n },\n options: {\n showFundNumber,\n showCurrency,\n useDynamicLabels,\n show1M3M6M,\n showYTD\n }\n }\n });\n } else {\n stateOBJ = state;\n }\n return stateOBJ;\n}\n\nfunction _performanceBuilder(performances, peersRankList, shareClassCode, benchMarks, sortedBenchmarkOrder, config, allShareClassDetails, fundId, displayOEIC) {\n let thisPerformanceObj = find(performances, {shClsCde: {val: shareClassCode} } );\n let asOfDate = get(thisPerformanceObj, 'asOfDate.val');\n let inceptionDate = get(thisPerformanceObj, 'fundIncDt.val');\n let inceptionDateLoc = get(thisPerformanceObj, 'fundIncDtLoc.val');\n let perfIncDt = get(thisPerformanceObj, 'perfIncDt.val');\n let fundName = get(thisPerformanceObj, 'name.val');\n let dynamicLabel = performanceUtils.dynamicPerformanceLabels(asOfDate, perfIncDt);\n let informationLinkMain = get(config, 'performance.informationLinkMain');\n\n const mdash = '—';\n let showMDash = performanceUtils.mustHidePerformanceData(config, inceptionDate);\n\n let rows = [];\n let graphNames = [];\n\n const hideChart = performanceUtils.hideChart(config, fundId, 'hideCumulativeChartFundList', showMDash, perfIncDt);\n\n // add the main shareclass to the table\n if (thisPerformanceObj) {\n thisPerformanceObj.link = informationLinkMain;\n let shRow = cumulativeUtils.getSHTableRow(thisPerformanceObj, showMDash, mdash, allShareClassDetails);\n rows.push(shRow);\n graphNames.push(shRow.name);\n }\n\n sortedBenchmarkOrder.forEach(item => {\n let bm = find(performances, {bmrkID: { val: get(benchMarks, `${item}.bmrkId.val`)}});\n if (bm) {\n bm.link = informationLinkMain;\n let bmRow = cumulativeUtils.getBMTableRow(bm, false, mdash);\n rows.push(bmRow);\n graphNames.push(bmRow.name);\n }\n });\n if (displayOEIC) {\n let IASector = performanceUtils.hasIASector(peersRankList, shareClassCode);\n if (IASector) {\n IASector.link = informationLinkMain;\n rows.push(cumulativeUtils.getIATableRow(IASector, mdash));\n }\n }\n let allRows = [];\n performances.forEach(item => {\n if (item !== thisPerformanceObj) {\n item.link = informationLinkMain;\n allRows.push(cumulativeUtils.getSHTableRow(item, showMDash, mdash, allShareClassDetails));\n }\n });\n let allRowsSorted = orderBy(allRows, ['name'], ['asc']);\n\n let showData = true;\n if ((rows.length === 0) && (allRows.length === 0)) { showData = false; }\n if (!thisPerformanceObj) { showData = false; }\n if (thisPerformanceObj && !get(thisPerformanceObj, 'cumulativeDetail.sinceIncp.val')) { showData = false; }\n\n return {\n tableData: {\n asOfDate,\n rows,\n allRows: allRowsSorted\n },\n inceptionDate: inceptionDateLoc,\n dynamicLabel,\n fundName,\n graphNames,\n hideChart,\n showData\n };\n}\n","/**\n * Data Reducer for performanceRiskStatistics\n * Takes site specific json data and creates model for components\n * after applying business and presentation logic and data mapping\n */\nimport {LogManager} from 'aurelia-framework';\nimport {configDecorator} from '../../../../lib/decorators/config-decorator';\nimport get from 'lodash/get';\nimport find from 'lodash/find';\nimport includes from 'lodash/includes';\nimport {utilsFundDetails} from '../../../../common/util/utils-fund-details';\n\nconst logger = LogManager.getLogger('performance-risk-statistics');\n\nexport function performanceRiskStatistics(state, action) {\n let stateOBJ;\n if (action.type === 'POPULATE_PERFORMANCE_RISK_STATISTICS_SUCCESS') {\n logger.debug('Reducing: POPULATE_PERFORMANCE_RISK_STATISTICS_SUCCESS');\n\n let fundID = action.fundId;\n let [rawPerformance, rawConfig, rawFundDetails] = action.json;\n let fundDetails = get(rawFundDetails, 'globalProductsValue.fundDetailIntl');\n let shareClasses = get(fundDetails, 'shClsDet');\n let performanceConfig = configDecorator(rawConfig, action.segment).performance;\n logger.debug('action', action);\n let siteVehicle = utilsFundDetails.getSiteVehicle(rawFundDetails);\n let currentClass = utilsFundDetails.getCurrentShareClass(action.shareClassKey, shareClasses);\n let shClsCde = get(currentClass, 'shCls.val') || get(fundDetails, 'shClassCode.val');\n let displayedFundId = get(currentClass, 'taID.val') || get(fundDetails, 'fundId.val');\n let fundName = get(fundDetails, 'fundName.val');\n\n //Default to show = false\n let showAlpha = _checkConfigForGivenFund(performanceConfig, fundID, 'showAlpha');\n let showRSquared = _checkConfigForGivenFund(performanceConfig, fundID, 'showRSquared');\n let showCorrelation = _checkConfigForGivenFund(performanceConfig, fundID, 'showCorrelation');\n let showUpsideCapture = _checkConfigForGivenFund(performanceConfig, fundID, 'showUpsideCapture');\n let showDownsideCapture = _checkConfigForGivenFund(performanceConfig, fundID, 'showUpsideCapture');\n\n //Default to show = true\n let defaultParam = true;\n let showStatistics = _checkConfigForGivenFund(performanceConfig, siteVehicle, 'hideStatistics', defaultParam);\n\n let showBeta = _checkConfigForGivenFund(performanceConfig, fundID, 'hideBeta', defaultParam);\n let showInfoRatio = _checkConfigForGivenFund(performanceConfig, fundID, 'hideBeta', defaultParam);\n let showTrackingError = _checkConfigForGivenFund(performanceConfig, fundID, 'hideTrackingError', defaultParam);\n let showFundNr = _checkConfigForGivenFund(performanceConfig, fundID, 'hideFundNumber', defaultParam);\n\n //TODO - make it shareclass dependent\n let riskStatistics = get(rawPerformance, 'globalProductsValue.performanceIntl.riskStatsList');\n let RSL = find(riskStatistics, {shareClassCode: {val: shClsCde} } );\n\n let riskStatsLists;\n let asOfDate;\n if (typeof RSL !== 'undefined') {\n riskStatsLists = _riskStatsListBuilder(RSL, displayedFundId, fundName, shClsCde);\n try {\n asOfDate = RSL.asOfDate.val;\n } catch (e) {\n logger.debug('asOfDateStd not defined in data');\n asOfDate = null;\n }\n } else {\n riskStatsLists = null;\n asOfDate = null;\n showStatistics = false;\n }\n stateOBJ = Object.assign({}, state, {\n performanceRiskStatistics: {\n asOfDate: asOfDate,\n tables: riskStatsLists,\n showStatistics: showStatistics,\n showAlpha: showAlpha,\n showRSquared: showRSquared,\n showCorrelation: showCorrelation,\n showBeta: showBeta,\n showInfoRatio: showInfoRatio,\n showTrackingError: showTrackingError,\n showFundNr: showFundNr,\n showUpsideCapture: showUpsideCapture,\n showDownsideCapture: showDownsideCapture,\n shareClassCode: shClsCde\n }\n });\n } else {\n stateOBJ = state;\n }\n return stateOBJ;\n}\n\n/**\n * Returns data for table\n * @param RSL\n * @return {{statisticsTable: {alphaRow: {name: string, oneYr, threeYr, fiveYr}, betaRow: {name: string, oneYr, threeYr, fiveYr}, infRatioRow: {name: string, oneYr, threeYr, fiveYr}, histTrackRow: {name: string, oneYr, threeYr, fiveYr}, correlationRow: {name: string, oneYr, threeYr, fiveYr}, rSquaredRow: {name: string, oneYr, threeYr, fiveYr}}, standardDeviationTable: {fundRow: {name, oneYr, threeYr, fiveYr}, bmRow: {name, oneYr, threeYr, fiveYr}}, sharpeRatioTable: {fundRow: {name, oneYr, threeYr, fiveYr}, bmRow: {name, oneYr, threeYr, fiveYr}}}}\n * @private\n */\nfunction _riskStatsListBuilder(RSL, displayedFundId, fundName, shClsCde) {\n let calcNameStd = _getCalcNameStd(RSL, fundName);\n\n let statisticsTable = {\n alphaRow: {\n // 'name' needs to match label value\n name: 'rs-alpha',\n oneYr: RSL.alpha.oneYr.val,\n threeYr: RSL.alpha.threeYr.val,\n fiveYr: RSL.alpha.fiveYr.val\n },\n betaRow: {\n name: 'rs-beta',\n oneYr: RSL.beta.oneYr.val,\n threeYr: RSL.beta.threeYr.val,\n fiveYr: RSL.beta.fiveYr.val\n },\n infRatioRow: {\n name: 'rs-information-ratio',\n oneYr: RSL.infRatio.oneYr.val,\n threeYr: RSL.infRatio.threeYr.val,\n fiveYr: RSL.infRatio.fiveYr.val\n },\n histTrackRow: {\n name: 'rs-tracking-error',\n oneYr: RSL.histTrack.oneYr.val,\n threeYr: RSL.histTrack.threeYr.val,\n fiveYr: RSL.histTrack.fiveYr.val\n },\n correlationRow: {\n name: 'rs-correlation',\n oneYr: RSL.correlation.oneYr.val,\n threeYr: RSL.correlation.threeYr.val,\n fiveYr: RSL.correlation.fiveYr.val\n },\n rSquaredRow: {\n name: 'rs-r-squared',\n oneYr: RSL.rSquared.oneYr.val,\n threeYr: RSL.rSquared.threeYr.val,\n fiveYr: RSL.rSquared.fiveYr.val\n }\n };\n\n let standardDeviationTable = {\n fundRow: {\n name: calcNameStd,\n fundNr: displayedFundId,\n shareClassCode: shClsCde,\n oneYr: RSL.stdDev.oneYr.val,\n threeYr: RSL.stdDev.threeYr.val,\n fiveYr: RSL.stdDev.fiveYr.val\n },\n bmRow: {\n name: RSL.benchMrkName.val,\n oneYr: RSL.bmStdDev.oneYr.val,\n threeYr: RSL.bmStdDev.threeYr.val,\n fiveYr: RSL.bmStdDev.fiveYr.val\n }\n };\n\n let sharpeRatioTable = {\n fundRow: {\n name: calcNameStd,\n fundNr: displayedFundId,\n shareClassCode: shClsCde,\n oneYr: RSL.shRatio.oneYr.val,\n threeYr: RSL.shRatio.threeYr.val,\n fiveYr: RSL.shRatio.fiveYr.val\n },\n bmRow: {\n name: RSL.benchMrkName.val,\n oneYr: RSL.bmShRatio.oneYr.val,\n threeYr: RSL.bmShRatio.threeYr.val,\n fiveYr: RSL.bmShRatio.fiveYr.val\n }\n };\n\n return {\n statisticsTable: statisticsTable,\n standardDeviationTable: standardDeviationTable,\n sharpeRatioTable: sharpeRatioTable\n };\n}\n\n/**\n * gets fund name or shareclass name, base on SINGLECLASS attribute\n * @param RSL\n * @returns {*}\n * @private\n */\nfunction _getCalcNameStd(RSL, fundName) {\n let calcNameStd;\n\n try {\n calcNameStd = (RSL.shareClassCode.val === 'SINGLCLASS' ? fundName : RSL.shareClassName.val);\n } catch (e) {\n logger.debug('shareClassName/fundName not defined in data');\n calcNameStd = null;\n }\n\n return calcNameStd;\n}\n\n/**\n * Returns true or false if config matches criteria.\n * @param {Object} performanceConfig\n * @param fundID\n * @param paramToCheck\n * @param defaultParam = false\n * @return {boolean}\n * @private\n */\nfunction _checkConfigForGivenFund(performanceConfig, fundID, paramToCheck, defaultParam = false) {\n let param = defaultParam;\n let returnParam;\n defaultParam === false ? returnParam = true : returnParam = false;\n try {\n let hasFund = includes(performanceConfig[paramToCheck], fundID);\n if (hasFund) {\n param = returnParam;\n }\n } catch (e) {\n logger.debug('returnParam stays default');\n }\n return param;\n}\n","/**\n * Data Reducer\n * Takes site specific json data and creates model for components\n * after applying business and presentation logic and data mapping\n */\nimport get from 'lodash/get';\nimport set from 'lodash/set';\nimport find from 'lodash/find';\nimport {utilsFundDetails} from '../../../../common/util/utils-fund-details';\nimport {utilsConfig} from '../../../../common/util/utils-config';\nimport {configDecorator} from '../../../../lib/decorators/config-decorator';\nimport {formatPercentage} from '../../../../lib/reducer-utils';\nimport {LogManager} from 'aurelia-framework';\nconst logger = LogManager.getLogger('fund-measures');\n\nexport function fundMeasuresReducer(state, action) {\n let componentObj;\n let newState;\n switch (action.type) {\n case 'POPULATE_FUND_MEASURES_SUCCESS':\n if (!action.cid) {\n logger.error('no cid given');\n return state;\n }\n componentObj = buildInitialState(action);\n newState = Object.assign({}, state);\n set(newState, 'portfolio.fundMeasures', componentObj);\n return newState;\n default:\n return state;\n }\n}\n\nfunction buildInitialState(action) {\n const [rawPortfolioDetails, rawPerformanceDetails, rawFundDetails, rawConfig] = action.json;\n const fundDetails = get(rawFundDetails, 'globalProductsValue.fundDetailIntl');\n const shareClasses = get(fundDetails, 'shClsDet');\n\n let fundCategory = utilsFundDetails.getFundCategory(rawFundDetails);\n const currentClass = utilsFundDetails.getCurrentShareClass(action.shareClassKey, shareClasses);\n const shareClassCode = get(currentClass, 'shCls.val') || get(fundDetails, 'shClassCode.val');\n\n // FIXME: COREWEB-2045 update riskStatsList to come from portfolio data feed, PDS to fix\n const performanceDetails = get(rawPerformanceDetails, 'globalProductsValue.performanceIntl');\n const riskStatsList = get(performanceDetails, 'riskStatsList', null);\n const riskStatsClassData = find(riskStatsList, {shareClassCode: {val: shareClassCode}});\n\n const portfolioDetails = get(rawPortfolioDetails, 'globalProductsValue.portfolioIntlValue');\n const forecastRiskStatsClassData = get(portfolioDetails, 'riskForecast', null);\n\n let componentObj = {\n riskStats: {\n visible: false\n },\n forecastRiskStats: {\n visible: false\n }\n };\n const config = configDecorator(rawConfig, action.segment);\n\n let isSuppressed = utilsConfig.isPortfolioComponentSuppressed(config, action.fundId, action.portfolioComponent, fundCategory);\n\n if (!isSuppressed && riskStatsClassData) {\n let columnConfig = [\n {\n labelId: '1-yr',\n dataKey: 'oneYr.val'\n },\n // {\n // labelId: '2-yr',\n // dataKey: 'twoYr.val'\n // },\n {\n labelId: '3-yr',\n dataKey: 'threeYr.val'\n },\n {\n labelId: '5-yr',\n dataKey: 'fiveYr.val'\n }\n // {\n // labelId: '7-yr',\n // dataKey: 'sevenYr.val'\n // },\n // {\n // labelId: '10-yr',\n // dataKey: 'tenYr.val'\n // },\n // {\n // // WORKAROUND: using same labels as 'PERFORMANCE-ANNUALISED'\n // // /en-gb/investor/products/performance?FundID=18319\n // labelId: 'inception',\n // dataKey: 'sinceIncp.val'\n // }\n ];\n\n let stdDevRow = {\n name: get(riskStatsClassData, 'name.val', '—'),\n data: columnConfig.map((o) => {\n return {\n labelId: o.labelId,\n val: formatPercentage(get(riskStatsClassData.stdDev, o.dataKey), true)\n };\n })\n };\n let bmStdDevRow = {\n name: get(riskStatsClassData, 'benchMrkName.val', '—'),\n data: columnConfig.map((o) => {\n return {\n labelId: o.labelId,\n val: formatPercentage(get(riskStatsClassData.bmStdDev, o.dataKey), true)\n };\n })\n };\n let betaRow = {\n betaVsName: get(riskStatsClassData, 'benchMrkName.val', '—'),\n data: columnConfig.map((o) => {\n return {\n labelId: o.labelId,\n val: formatPercentage(get(riskStatsClassData.beta, o.dataKey), true)\n };\n })\n };\n componentObj.riskStats = {\n visible: true,\n asOfDate: get(riskStatsClassData, 'asOfDate.val', '—'),\n stdDevRow,\n bmStdDevRow,\n betaRow\n };\n }\n\n if (!isSuppressed && riskStatsClassData && forecastRiskStatsClassData) {\n let forecastStdDevRow = {\n name: get(riskStatsClassData, 'name.val', '—'),\n data: [\n {\n labelId: '1-yr',\n val: formatPercentage(get(forecastRiskStatsClassData, 'stdDevOneYear.val'), true)\n }\n ]\n };\n let forecastBmStdDevRow = {\n name: get(riskStatsClassData, 'benchMrkName.val', '—'),\n data: [\n {\n labelId: '1-yr',\n val: formatPercentage(get(forecastRiskStatsClassData, 'bmkList[0].stdDev.val'), true)\n }\n ]\n };\n let forecastBetaRow = {\n betaVsName: get(riskStatsClassData, 'benchMrkName.val', '—'),\n data: [\n {\n labelId: '1-yr',\n val: formatPercentage(get(forecastRiskStatsClassData, 'betaOneYear.val'), true)\n }\n ]\n };\n componentObj.forecastRiskStats = {\n visible: true,\n asOfDate: get(riskStatsClassData, 'asOfDate.val', '—'),\n stdDevRow: forecastStdDevRow,\n bmStdDevRow: forecastBmStdDevRow,\n betaRow: forecastBetaRow\n };\n }\n return componentObj;\n}\n","/**\n * Data Reducer for portfolioStatisticsAndPositions\n * Takes site specific json data and creates model for components\n * after applying business and presentation logic and data mapping\n */\nimport { LogManager } from 'aurelia-framework';\nimport { extractFormattedValue, extractFormattedValues, FORMAT_TYPES } from '../../../../lib/reducer-utils';\nimport {utilsFundDetails} from '../../../../common/util/utils-fund-details';\nimport { utilsConfig } from '../../../../common/util/utils-config';\nimport { configDecorator } from '../../../../lib/decorators/config-decorator';\nimport {portfolioUtils} from '../../../util/util';\nconst logger = LogManager.getLogger('portfolio-statistics-and-positions');\nimport get from 'lodash/get';\nimport moment from 'moment';\n\nlet STATISTICS_PORTFOLIO_SUPPRESSION_ID = 'statistics';\nlet HOLDINGS_PORTFOLIO_SUPPRESSION_ID = 'positions-number-of-holdings';\nlet ISSUERS_PORTFOLIO_SUPPRESSION_ID = 'positions-number-of-issuers';\n\nlet STATISTIC_FIELDS = {\n 'weighted-average-maturity': {\n dataKey: 'maturityWgtAvg.val',\n type: FORMAT_TYPES.STRING,\n addendumData: {\n caveatId: {\n dataKey: 'WeightedAverageMaturity',\n type: FORMAT_TYPES.CONSTANT\n }\n }\n },\n 'average-duration': {\n dataKey: 'durationOADWgtAvg.val',\n type: FORMAT_TYPES.STRING,\n addendumData: {\n caveatId: {\n dataKey: 'AverageDuration',\n type: FORMAT_TYPES.CONSTANT\n }\n }\n },\n 'yield-to-maturity': {\n dataKey: 'yldToMatrtyWgtAvg.val',\n type: FORMAT_TYPES.PERCENTAGE,\n addendumData: {\n caveatId: {\n dataKey: 'YieldtoMaturity',\n type: FORMAT_TYPES.CONSTANT\n }\n }\n },\n 'average-credit-quality': {\n dataKey: 'avgCrdQltyRating.val',\n type: FORMAT_TYPES.STRING,\n addendumData: {\n caveatId: {\n dataKey: 'AverageCreditQuality',\n type: FORMAT_TYPES.CONSTANT\n }\n }\n },\n 'price-to-earnings-12-months-forward': {\n dataKey: 'priceToEarningRatioFwd.val',\n type: FORMAT_TYPES.STRING,\n addendumData: {\n caveatId: {\n dataKey: 'PriceToEarningForward',\n type: FORMAT_TYPES.CONSTANT\n }\n }\n },\n 'price-to-earnings-12-months-trailing': {\n dataKey: 'priceToEarnWgtAvg.val',\n type: FORMAT_TYPES.STRING,\n addendumData: {\n caveatId: {\n dataKey: 'PriceToEarningTrailing',\n type: FORMAT_TYPES.CONSTANT\n }\n }\n },\n 'price-to-book-value': {\n dataKey: 'priceToBValWgtAvg.val',\n type: FORMAT_TYPES.STRING,\n addendumData: {\n caveatId: {\n dataKey: 'PriceToBookValue',\n type: FORMAT_TYPES.CONSTANT\n }\n }\n },\n 'price-to-cash-flow': {\n dataKey: 'priceToCFlowWgtAvg.val',\n type: FORMAT_TYPES.STRING,\n addendumData: {\n caveatId: {\n dataKey: 'PriceToCashFlow',\n type: FORMAT_TYPES.CONSTANT\n }\n }\n },\n 'blended-yield': {\n dataKey: 'weightedYield.val',\n type: FORMAT_TYPES.STRING,\n addendumData: {\n caveatId: {\n dataKey: 'BlendedYield',\n type: FORMAT_TYPES.CONSTANT\n }\n }\n }\n};\n\n\nexport function portfolioStatisticsAndPositions(state, action) {\n switch (action.type) {\n case 'POPULATE_PORTFOLIO_STATISTICS_AND_POSITIONS_SUCCESS':\n logger.debug('Reducing: POPULATE_PORTFOLIO_STATISTICS_AND_POSITIONS_SUCCESS');\n\n const statPositionsData = _populateStatPositions(action);\n\n return Object.assign({}, state, {\n portfolioStatisticsAndPositions: statPositionsData\n });\n default:\n return state;\n }\n}\n\nfunction _populateStatPositions(action) {\n let [rawPortfolio, rawFundDetail, rawConfig, rawHoldings] = action.json;\n const portfolio = get(rawPortfolio, 'globalProductsValue.portfolioIntlValue');\n const fundInfo = get(rawFundDetail, 'globalProductsValue.fundDetailIntl');\n const stats = get(portfolio, 'stats');\n let fundCategory = utilsFundDetails.getFundCategory(rawFundDetail);\n\n let assets = get(rawHoldings, 'provider.LscsDocuments.assets');\n let holdingsPdf = '';\n if (assets) {\n if (!Array.isArray(assets)) {\n assets = [assets];\n }\n for (let asset of assets) {\n if (asset.document && asset.document.length > 0) {\n holdingsPdf = asset.document[0].path;\n } else if (asset.document) {\n holdingsPdf = asset.document.path;\n }\n }\n }\n\n const decoratedConfig = configDecorator(rawConfig, action.segment);\n\n // COREWEB-333 : Portfolio / Portfolio Statistics / Display rules set 2\n // Data element will not be available day one of the fund or class inception,\n // first data point is expected after full one month.\n const monthAgoMoment = moment().subtract(1, 'months');\n const fundIncpMoment = moment(get(fundInfo, 'fundIncpDtStd.val'), 'YYYY-MM-DD');\n\n let isStatsSuppressedByPerfInception = !fundIncpMoment.isBefore(monthAgoMoment);\n let showIssuers = decoratedConfig.portfolio.issuersList.includes(action.fundId);\n\n let isStatsSuppressed = utilsConfig.isPortfolioComponentSuppressed(\n decoratedConfig,\n action.fundId,\n STATISTICS_PORTFOLIO_SUPPRESSION_ID,\n fundCategory\n );\n let isIssuersSuppressed = utilsConfig.isPortfolioComponentSuppressed(\n decoratedConfig,\n action.fundId,\n ISSUERS_PORTFOLIO_SUPPRESSION_ID,\n fundCategory\n );\n let isHoldingsSuppressed = utilsConfig.isPortfolioComponentSuppressed(\n decoratedConfig,\n action.fundId,\n HOLDINGS_PORTFOLIO_SUPPRESSION_ID,\n fundCategory\n );\n\n\n const asOfDate = get(stats, 'asOfDate.val');\n let statistics;\n let nbrOfIssuers;\n let nbrOfHoldings;\n let isValid;\n if (isStatsSuppressedByPerfInception) {\n statistics = {\n isValid: false,\n isSuppressedByPerfInception: true,\n data: []\n };\n } else if (isStatsSuppressed) {\n statistics = {\n isValid: false,\n isSuppressed: true,\n data: []\n };\n } else {\n statistics = {\n data: extractFormattedValues(stats, STATISTIC_FIELDS, null, false)\n };\n statistics.isValid = (statistics.data.length > 0);\n }\n\n if (isIssuersSuppressed) {\n nbrOfIssuers = {\n isValid: false,\n isSuppressed: true\n };\n } else {\n nbrOfIssuers = extractFormattedValue(stats, 'number-of-issuers', {\n dataKey: 'nbrOfIssuers.val',\n type: FORMAT_TYPES.STRING,\n addendumData: {\n caveatId: {\n dataKey: 'NumberOfIssuers',\n type: FORMAT_TYPES.CONSTANT\n }\n }\n }, null);\n }\n\n if (isHoldingsSuppressed) {\n nbrOfHoldings = {\n isValid: false,\n isSuppressed: true\n };\n } else {\n nbrOfHoldings = extractFormattedValue(stats, 'number-of-holdings', {\n dataKey: 'nbrOfScrtyInclCash.val',\n type: FORMAT_TYPES.STRING,\n addendumData: {\n caveatId: {\n dataKey: 'NumberOfHoldings',\n type: FORMAT_TYPES.CONSTANT\n }\n }\n }, null);\n }\n\n isValid = statistics.isValid ||\n nbrOfIssuers.isValid ||\n nbrOfHoldings.isValid;\n\n let refreshRateFromConfig = get(decoratedConfig, 'portfolio.refreshRate');\n let refreshRate = portfolioUtils.convertRefreshFrequencyIntoLabelId(refreshRateFromConfig);\n\n return {\n asOfDate,\n holdingsPdf,\n nbrOfHoldings,\n nbrOfIssuers,\n showIssuers,\n statistics,\n isValid,\n refreshRate\n };\n}\n","/**\n * Data Reducer for riskContribution\n * Takes site specific json data and creates model for components\n * after applying business and presentation logic and data mapping\n * import {riskContribution} from '../../components/products/portfolio/ft-risk-contribution/lib/gw/risk-contribution.reducer';\n */\nimport get from 'lodash/get';\nimport {portfolioUtils} from '../../../util/util';\nimport {utilsConfig} from '../../../../common/util/utils-config';\nimport {configDecorator} from '../../../../lib/decorators/config-decorator';\nimport {formatStdDateToLocaleDay} from '../../../../lib/date-utils';\n\nimport {LogManager} from 'aurelia-framework';\n\nconst logger = LogManager.getLogger('risk-contribution');\n\nexport function riskContribution(state, action) {\n switch (action.type) {\n case 'POPULATE_RISK_CONTRIBUTION_SUCCESS':\n const data = _riskContributionBuilder(action);\n logger.debug('Reducing: POPULATE_RISK_CONTRIBUTION');\n return Object.assign({}, state, {\n riskContribution: {\n data: data\n }\n });\n default:\n return state;\n }\n}\n\nfunction getROData(riskData, sorted) {\n let filteredItems = riskData.filter(item => {\n if ((get(item, 'fact2.val', null) === null)\n && (get(item, 'parentFactSysNo.val', null) === null)\n && (get(item, 'fPeriod.val', null) === '1')) return item;\n });\n\n filteredItems = filteredItems.map(item => {\n return {\n 'name': get(item, 'fact1.val'),\n 'portAvg': get(item, 'portAvg.val', ''),\n 'portForeCntr': get(item, 'portForeCntr.val', ''),\n 'rank': get(item, 'rank.val')\n };\n });\n\n\n if (sorted) {\n filteredItems = portfolioUtils.sortBreakdown(filteredItems, 'rank');\n }\n\n return filteredItems;\n}\n\nfunction getRiskOverview(riskData, options = {}) {\n const sorted = options.hasOwnProperty('sorted') ? options.sorted : true;\n const obj = {visible: false};\n const lstDtls = get(riskData, 'RiskFactDt.lstDtls');\n\n if (typeof lstDtls !== 'undefined') {\n obj.table = getROData(lstDtls, sorted);\n obj.visible = (obj.table.length > 0);\n }\n\n obj.date = formatStdDateToLocaleDay(get(riskData, 'asOfDate.val') || get(riskData, 'asOfDateStd.val'));\n obj.currency = get(riskData, 'currency.val');\n\n return obj;\n}\n\nfunction _riskContributionBuilder(action) {\n const [rawPortfolio, rawConfig] = action.json;\n // Get and handle component configuration\n\n const config = configDecorator(rawConfig, action.segment);\n const useSuppression = utilsConfig.isPortfolioComponentSuppressed(config, action.fundId, action.portfolioComponent, action.assetClass);\n\n const rawRisk = get(rawPortfolio, 'globalProductsValue.portfolioIntlValue.riskCntr');\n\n let visible = (typeof rawRisk !== 'undefined');\n\n if (useSuppression) {\n visible = false;\n }\n\n let obj = {\n caveatSecName: 'Portfolio', tableID: 'risk-contribution-data', visible: visible\n };\n\n if (visible) {\n const riskOverview = getRiskOverview(rawRisk);\n obj = Object.assign({}, obj, riskOverview);\n\n obj.showChart = true;\n obj.spanRow = true;\n }\n return obj;\n}\n","/**\n * Data Reducer for securityTypeExposure\n * Takes site specific json data and creates model for components\n * after applying business and presentation logic and data mapping\n *\n */\nimport get from 'lodash/get';\nimport findIndex from 'lodash/findIndex';\nimport {portfolioUtils} from '../../../util/util';\nimport {utilsFundDetails} from '../../../../common/util/utils-fund-details';\nimport {utilsConfig} from '../../../../common/util/utils-config';\nimport {configDecorator} from '../../../../lib/decorators/config-decorator';\nimport {formatStdDateToLocaleDay} from '../../../../lib/date-utils';\nimport {parseNumber} from '../../../../lib/reducer-utils';\n\nimport {LogManager} from 'aurelia-framework';\n\nconst logger = LogManager.getLogger('security-type-exposure');\n\nexport function securityTypeExposure(state, action) {\n switch (action.type) {\n case 'POPULATE_SECURITY_TYPE_EXPOSURE_SUCCESS':\n const data = _securityExposureBuilder(action);\n logger.debug('Reducing: POPULATE_SECURITY_TYPE_EXPOSURE');\n\n return Object.assign({}, state, {\n securityTypeExposure: {\n data: data\n }\n });\n default:\n return state;\n }\n}\n// FIXME: should be moved/refactored into lib/charting reducers\nfunction processSecurityTypeLst(lstDtls) {\n const workLstDtls = [];\n const customLabels = {};\n let tempOrder = {};\n let ordering = [];\n\n for (const item of lstDtls) {\n let itemCategory = get(item, 'expoCategoryStd.val');\n const itemCategoryName = get(item, 'expoCategory.val');\n const itemType = get(item, 'expoTypeStd.val');\n const itemTypeName = get(item, 'expoType.val');\n const itemVal = get(item, 'brkdwnPercent.val');\n const itemRank = get(item, 'rank.val');\n const itemPrimary = get(item, 'expoSort.val', '2');\n\n // types\n // SECURITYNET, SECURITYGROSS, SECURITYRISK\n\n // const splitter = (itemType === 'SECURITYGROSS') ? '_K2_GROSS' : '_K2_NET';\n const splitter = `_K2_${itemType.split('SECURITY')[1]}`;\n\n itemCategory = itemCategory.split(splitter)[0];\n customLabels[itemCategory] = itemCategoryName;\n customLabels[itemType] = itemTypeName;\n\n tempOrder[itemType] = itemPrimary;\n const index = findIndex(workLstDtls, {name: itemCategory});\n\n if (index === -1) {\n const newItem = {name: itemCategory, rank: itemRank, values: {}};\n newItem.values[itemType] = itemVal;\n workLstDtls.push(newItem);\n } else {\n const existItem = workLstDtls[index];\n existItem.values[itemType] = itemVal;\n workLstDtls[index] = existItem;\n }\n }\n // we need to order these keys then turn them into an array\n for (let key of Object.keys(tempOrder)) {\n ordering[tempOrder[key] - 1] = key;\n }\n\n const mappedLabels = new Map(Object.keys(customLabels).map(key => [key, customLabels[key]]));\n\n return {workLstDtls, ordering, mappedLabels};\n}\n\nfunction buildSeries(data) {\n let mappedLabels = data.mappedLabels;\n const primary = data.ordering[0];\n const secondary = data.ordering[1];\n\n const seriesObj = {};\n seriesObj[primary] = [];\n seriesObj[secondary] = [];\n const seriesA = [];\n for (const item of data.workLstDtls) {\n seriesObj[primary].push(parseNumber(get(item.values, primary)));\n seriesObj[secondary].push(parseNumber(get(item.values, secondary)));\n }\n seriesA.push({\n name: (mappedLabels.get(primary) || `[${primary}`),\n data: seriesObj[primary]\n });\n\n seriesA.push({\n name: (mappedLabels.get(secondary) || `[${secondary}`),\n data: seriesObj[secondary]\n });\n return seriesA;\n}\n\nfunction buildCategories(data, labels) {\n return data.map(( o) => {\n return (labels.get(o.name) || `[${o.name}]`);\n });\n}\n\nfunction getSecurityType(breakdown, labels, options = {}) {\n const sorted = options.hasOwnProperty('sorted') ? options.sorted : true;\n\n const obj = {visible: false};\n const lstDtls = get(breakdown, 'brkDwnLst.lstSecExpDtls');\n\n if (typeof lstDtls !== 'undefined') {\n let interSecurityTypeData = processSecurityTypeLst(lstDtls);\n // sort by rank\n if (sorted) {\n interSecurityTypeData.workLstDtls = portfolioUtils.sortBreakdown(interSecurityTypeData.workLstDtls, 'rank');\n }\n\n // build graph series\n obj.series = buildSeries(interSecurityTypeData, labels);\n obj.visible = (obj.series.length > 0);\n\n obj.categories = buildCategories(interSecurityTypeData.workLstDtls, interSecurityTypeData.mappedLabels);\n //build table\n obj.table = interSecurityTypeData.workLstDtls;\n // New things that need to be stored.\n // Due to the dynamic nature of the data here, we need to store local custom labels\n // and local ordering of the columns.\n obj.mappedLabels = interSecurityTypeData.mappedLabels;\n obj.ordering = interSecurityTypeData.ordering;\n }\n\n // TODO: all this is broken shouldn't ever be using formatStdDateToLocaleDay! refactor to use common getDateAndCalType!\n obj.date = formatStdDateToLocaleDay(get(breakdown, 'asOfDate.val') || get(breakdown, 'asOfDateStd.val'));\n obj.calType = get(breakdown, 'calType.val') || get(breakdown, 'calName.val') || labels.get('calculation-type-total') || '';\n\n return obj;\n}\n\nfunction _securityExposureBuilder(action) {\n const [rawPortfolio, rawFundDetail, rawConfig, rawLabels] = action.json;\n const labels = new Map();\n\n // TODO: refactor all the labels out of here, shouldn't be duplicating logic\n if (rawLabels) {\n Object.keys(rawLabels).forEach(key => {\n labels.set(key, rawLabels[key]);\n });\n }\n\n // Get and handle component configuration\n const decoratedConfig = configDecorator(rawConfig, action.segment);\n let fundCategory = utilsFundDetails.getFundCategory(rawFundDetail);\n const useSuppression = utilsConfig.isPortfolioComponentSuppressed(decoratedConfig, action.fundId, action.portfolioComponent, fundCategory);\n\n const rawBreakdowns = get(rawPortfolio, 'globalProductsValue.portfolioIntlValue.breakdown.brkdwnDet');\n const breakdown = portfolioUtils.findObjInArray(rawBreakdowns, 'SECURITY_EXPOSURE');\n let visible = (typeof breakdown !== 'undefined');\n if (useSuppression) {\n // if this component is suppressed, then prevent it from continuing any further work.\n visible = false;\n }\n let obj = {\n caveatSecName: 'Portfolio', tableID: 'security-type-exposure-data', visible: visible\n };\n\n if (visible) {\n const tempBreakdown = getSecurityType(breakdown, labels, {'sorted': true});\n obj = Object.assign({}, obj, tempBreakdown);\n\n obj.showChart = true;\n obj.spanRow = true;\n\n let refreshRateFromConfig = get(decoratedConfig, 'portfolio.refreshRate');\n obj.refreshRate = portfolioUtils.convertRefreshFrequencyIntoLabelId(refreshRateFromConfig);\n }\n return obj;\n}\n","/**\n * Data Reducer for topRiskAllocationByAssetClass\n * Takes site specific json data and creates model for components\n * after applying business and presentation logic and data mapping\n */\nimport { LogManager } from 'aurelia-framework';\nimport filter from 'lodash/filter';\nimport get from 'lodash/get';\nimport uniqBy from 'lodash/uniqBy';\nimport orderBy from 'lodash/orderBy';\nimport groupBy from 'lodash/groupBy';\nimport forEach from 'lodash/forEach';\nimport {utilsFundDetails} from '../../../../common/util/utils-fund-details';\nimport { utilsConfig } from '../../../../common/util/utils-config';\nimport { configDecorator } from '../../../../lib/decorators/config-decorator';\nimport {portfolioUtils} from '../../../util/util';\n\nconst logger = LogManager.getLogger('top-risk-allocation-by-asset-class');\n\nexport function topRiskAllocationByAssetClass(state, action) {\n if (action.type === 'POPULATE_TOP_RISK_ALLOCATION_BY_ASSET_CLASS_SUCCESS') {\n logger.debug('Reducing: POPULATE_TOP_RISK_ALLOCATION_BY_ASSET_CLASS');\n let newState = Object.assign({}, state, {\n topRiskAllocationByAssetClass: {\n data: _dataBuilder(action)\n }\n });\n return newState;\n }\n return state;\n}\n\n/**\n * Build and reduce the data\n * @param {Object} action\n * @returns {Object}\n * @private\n */\nfunction _dataBuilder(action) {\n let [portfolioData, rawFundDetail, rawConfig, rawPageJsonConfig] = action.json;\n\n // Get and handle component configuration\n const config = configDecorator(rawConfig, action.segment);\n let fundCategory = utilsFundDetails.getFundCategory(rawFundDetail);\n const isSuppressed = utilsConfig.isPortfolioComponentSuppressed(config, action.fundId, action.portfolioComponent, fundCategory);\n\n const pageJsonConfig = portfolioUtils.parsePageJsonConfig(rawPageJsonConfig);\n\n // Get only the types of holdings that are suitable for this component\n const holdings = filter(get(portfolioData, 'globalProductsValue.portfolioIntlValue.holdings'), function(o) {\n let holding = get(o, 'calNameStd.val');\n switch (holding) {\n case 'TOTAL_PCT_OF_TOTAL_RISK_COMMOD':\n case 'TOTAL_PCT_OF_TOTAL_RISK_EQ':\n case 'TOTAL_PCT_OF_TOTAL_RISK_FI':\n case 'TOTAL_PCT_OF_TOTAL_RISK_FX':\n case 'NET_TOTAL_PCT_OF_NET_TOTAL_RISK_COMMOD':\n case 'NET_TOTAL_PCT_OF_NET_TOTAL_RISK_EQ':\n case 'NET_TOTAL_PCT_OF_NET_TOTAL_RISK_FI':\n case 'NET_TOTAL_PCT_OF_NET_TOTAL_RISK_FX':\n return true;\n default:\n return false;\n }\n });\n\n let visible = (typeof holdings !== 'undefined' && holdings.length !== 0);\n if (isSuppressed) {\n visible = false;\n }\n\n let obj = {\n visible: visible\n };\n\n if (visible) {\n obj.fundId = get(holdings[0], 'fundID.val');\n obj.showChart = pageJsonConfig.showChart;\n obj.spanRow = pageJsonConfig.spanRow;\n\n // Check the as-of dates of all holdings elements are the same.\n obj.date = get(holdings[0], 'asOfDate.val');\n let dates = uniqBy(holdings, 'asOfDate.val');\n if (dates.length !== 1) {\n logger.error('Multiple as-of dates exist for data which only displays one date');\n }\n\n // Group and sort the raw holdings elements.\n let valuePairsGroupedByAssetClass = groupBy(holdings, 'hldingDetails.lstDtls[0].rolUp.val'); // Group asset classes by roll-up value\n let valuePairsSortedByPrimaryFlag = [];\n forEach(valuePairsGroupedByAssetClass, function(table) {\n valuePairsSortedByPrimaryFlag.push(orderBy(table, 'hldingDetails.lstDtls[0].primFlag.val', 'desc')); // Sort pairs within the asset class by primary flag, Y = first, N = second\n });\n\n // Organise the grouped and sorted values into a model suitable for display.\n let tablesByAssetClass = [];\n forEach(valuePairsSortedByPrimaryFlag, function(pair) {\n tablesByAssetClass.push(_buildAssetClassTableData(pair[0], pair[1]));\n });\n\n obj.allocationsByAssetClass = orderBy(tablesByAssetClass, ['tableOrder']);\n obj.allocationsByAssetClass.forEach((table) => {\n delete table.tableOrder;\n });\n }\n\n return obj;\n}\n\n/**\n * @param {Object} primaryHoldings\n * @param {Object} secondaryHoldings\n * @returns {Object}\n * @private\n */\nfunction _buildAssetClassTableData(primaryHoldings, secondaryHoldings) {\n let table = {};\n try {\n // Table properties and headers\n table = {\n name: primaryHoldings.hldingDetails.lstDtls[0].asset.val,\n tableOrder: primaryHoldings.hldingDetails.lstDtls[0].rolUp.val,\n // TODO: would recommend spliting calName and calNameStd into separate variable\n // if calNameStd would need getLabel in view aka util.js -> getDateAndCalType\n primaryCalculationName: primaryHoldings.calName === undefined ? primaryHoldings.calNameStd.val : primaryHoldings.calName.val,\n secondaryCalculationName: secondaryHoldings.calName === undefined ? secondaryHoldings.calNameStd.val : secondaryHoldings.calName.val,\n rows: []\n };\n // Data rows\n primaryHoldings.hldingDetails.lstDtls.forEach(function(primaryElement) {\n let secondaryElement = secondaryHoldings.hldingDetails.lstDtls[primaryElement.rank.val - 1];\n table.rows[table.rows.length] = {\n name: primaryElement.name.val,\n // COREWEB-2491 numerical sorting required\n rowOrder: primaryElement.rank.val * 1,\n primaryDataPct: primaryElement.val.val,\n secondaryDataPct: secondaryElement.val.val\n };\n }, this);\n // Sort rows\n table.rows = orderBy(table.rows, ['rowOrder']);\n table.rows.forEach((row) => {\n delete row.rowOrder;\n });\n } catch (e) {\n logger.error('Something went wrong building table data', e);\n }\n return table;\n}\n","/**\n * Data Reducer for valueAtRisk\n * Takes site specific json data and creates model for components\n * after applying business and presentation logic and data mapping\n */\nimport {LogManager} from 'aurelia-framework';\nimport get from 'lodash/get';\nimport {utilsFundDetails} from '../../../../common/util/utils-fund-details';\nimport { utilsConfig } from '../../../../common/util/utils-config';\nimport { configDecorator } from '../../../../lib/decorators/config-decorator';\nimport {portfolioUtils} from '../../../util/util';\n\nconst logger = LogManager.getLogger('value-at-risk');\n\nexport function valueAtRisk(state, action) {\n let stateObj;\n if (action.type === 'POPULATE_VALUE_AT_RISK_SUCCESS') {\n logger.debug('Reducing: POPULATE_VALUE_AT_RISK_SUCCESS');\n\n stateObj = Object.assign({}, state, {\n valueAtRisk: {\n data: _dataBuilder(action)\n }\n });\n } else {\n stateObj = state;\n }\n return stateObj;\n}\n\n/**\n * Build and reduce the data\n * @param action\n * @returns {Object}\n * @private\n */\nfunction _dataBuilder(action) {\n let [portfolioData, rawFundDetail, rawConfig, rawPageJsonConfig] = action.json;\n\n const risk = get(portfolioData, 'globalProductsValue.portfolioIntlValue.riskForecast');\n const visible = (typeof risk !== 'undefined');\n let obj = {\n visible: visible\n };\n\n const pageJsonConfig = portfolioUtils.parsePageJsonConfig(rawPageJsonConfig);\n\n obj.showChart = pageJsonConfig.showChart;\n obj.spanRow = pageJsonConfig.spanRow;\n\n const config = configDecorator(rawConfig, action.segment);\n let fundCategory = utilsFundDetails.getFundCategory(rawFundDetail);\n const isSuppressed = utilsConfig.isPortfolioComponentSuppressed(config, action.fundId, action.portfolioComponent, fundCategory);\n if (isSuppressed) {\n obj.visible = false;\n obj.isSuppressed = true;\n return obj;\n }\n\n if (visible) {\n obj.value = get(risk, 'varOneMo.val');\n obj.date = get(risk, 'asOfDate.val');\n if (obj.value === undefined) {\n obj.visible = false;\n obj.isSuppressedByLackOfData = true;\n logger.debug('Hiding component because value undefined');\n }\n if (obj.date === undefined) {\n obj.visible = false;\n obj.isSuppressedByLackOfDate = true;\n logger.debug('Hiding component because date is undefined');\n }\n }\n\n return obj;\n}\n","/**\n * Data Reducer for ppss\n * Takes site specific json data and creates model for components\n * after applying business and presentation logic and data mapping\n */\nimport {LogManager} from 'aurelia-framework';\nimport get from 'lodash/get';\nimport kebabCase from 'lodash/kebabCase';\nimport moment from 'moment';\nimport {parseFundAlerts} from '../../../../common/elements/ft-fund-alert/lib/gw/fund-alert.reducer';\nimport {cleanString, formatCurrency, formatCusip, getUniqOptions, navDirection} from '../../../../lib/reducer-utils';\nimport {configDecorator} from '../../../../lib/decorators/config-decorator';\n\nconst logger = LogManager.getLogger('ppss');\n\nexport function ppss(state, action) {\n let newState;\n switch (action.type) {\n case 'POPULATE_PPSS_STATE_SUCCESS':\n logger.debug('Reducing: POPULATE_PPSS_STATE_SUCCESS', action, state);\n // NB: this action could be instigated from <ft-ppss> or <ft-find-a-fund> components\n // currently, if <ft-find-a-fund>, ppssComponentConfig will be undefined\n let [ppssData, ppssConfig, alertData, ppssComponentConfig] = action.json;\n let segment = action.segment;\n let config = configDecorator(ppssConfig, segment);\n\n let fundAlerts = parseFundAlerts(alertData);\n\n let tabsets = get(config, 'tabSets.tabSet', []);\n if (!Array.isArray(tabsets)) {\n tabsets = [tabsets];\n }\n tabsets = tabsets.map(ts => {\n let baseLink = `/${action.segment}/${get(ts, 'tabs.tab.0.page', '')}`;\n if (!action.hideSite) {\n baseLink = `/${action.site}${baseLink}`;\n }\n return {\n id: ts.id,\n funds: get(ts, 'funds', '').split(','),\n baseLink\n };\n });\n\n let softLaunchList = config.softLaunchList;\n let activeList = config.activeList;\n\n let funds = ppssData.globalProductsValue.ppsListIntl\n .map(_createFundMapper(activeList, softLaunchList, config, fundAlerts))\n .filter(_createFundFilter(activeList, softLaunchList, config))\n .map(_createFundLinks(tabsets));\n\n // if ppssComponentConfig is defined, then add extra data specifically needed for <ft-ppss>\n if (ppssComponentConfig) {\n // filters\n let selectedDropdowns = ppssComponentConfig['Filters_Primary'];\n let allDropdowns = state.app.ppss.config.allDropdowns.map(dd => {\n let urlParam = action.params[dd.name];\n if (urlParam) {\n if (dd.name === 'MORNINGSTAR_RATING') {\n dd.selected = {value: urlParam.split(',').map(rating => parseInt(rating, 10))};\n } else {\n dd.selected = {value: urlParam};\n }\n }\n dd.visible = selectedDropdowns.includes(dd.name);\n return dd;\n });\n\n let filters = state.app.ppss.filters;\n filters.dropdowns = allDropdowns;\n let filterOptions = _createFilterOptions(funds);\n\n let performanceViewOptions = [];\n if (ppssComponentConfig['Annualised_Data_Refresh_Rate'].length) {\n performanceViewOptions.push({\n name: 'AVG_ANNUAL',\n labelKey: 'avg-annual',\n periodEnds: ppssComponentConfig['Annualised_Data_Refresh_Rate']\n });\n }\n if (ppssComponentConfig['Calendar_Year_Data_Refresh_Rate'].length) {\n performanceViewOptions.push({\n name: 'CALENDAR_YEAR',\n labelKey: 'calendar-year',\n periodEnds: ppssComponentConfig['Calendar_Year_Data_Refresh_Rate']\n });\n }\n if (ppssComponentConfig['Cumulative_Data_Refresh_Rate'].length) {\n performanceViewOptions.push({\n name: 'CUMULATIVE',\n labelKey: 'cumulative',\n periodEnds: ppssComponentConfig['Cumulative_Data_Refresh_Rate']\n });\n }\n if (ppssComponentConfig['Discrete_Data_Refresh_Rate'].length) {\n performanceViewOptions.push({\n name: 'DISCRETE',\n labelKey: 'discrete-annual',\n periodEnds: ppssComponentConfig['Discrete_Data_Refresh_Rate']\n });\n }\n performanceViewOptions.map(pvo => {\n pvo.defaultPerformanceView = {\n name: pvo.name,\n labelKey: pvo.labelKey,\n periodEnd: pvo.periodEnds[0]\n };\n return pvo;\n });\n // logger.debug('performanceViewOptions:::', performanceViewOptions);\n\n // set the default view\n let performanceView = performanceViewOptions.find(pvo => pvo.name === ppssComponentConfig['Default_Performance'][0]).defaultPerformanceView;\n logger.debug('default performanceView:::', performanceView);\n\n // fund identifiers\n let allIdentifiers = state.app.ppss.config.allFundIdentifiers;\n let selectedIdentifiers = ppssComponentConfig['Fund_Identifiers'];\n selectedIdentifiers = selectedIdentifiers.map(id => allIdentifiers.find(idObj => id === idObj.name));\n\n // show morningstar rating\n let showMorningStarColumn = get(ppssComponentConfig, 'Show_Ratings.0', '') === 'YES';\n\n // discrete and calendar year <th> labels\n let discreteMonthlyLabels = _createLabels('DISCRETE', funds[0].performanceAsOfDateMonthly);\n let discreteQuarterlyLabels = _createLabels('DISCRETE', funds[0].performanceAsOfDateQuarterly);\n let calendarYearMonthlyLabels = _createLabels('CALENDAR_YEAR', funds[0].performanceAsOfDateMonthly);\n let calendarYearQuarterlyLabels = _createLabels('CALENDAR_YEAR', funds[0].performanceAsOfDateQuarterly);\n\n newState = Object.assign({}, state, {\n fundAlerts,\n ppss: {\n funds,\n filterOptions,\n ytdAsOfDate: get(ppssData, 'globalProductsValue.ppsListIntl[0].navAsOfDate.val', ''),\n navAsOfDateMonth: get(ppssData, 'globalProductsValue.ppsListIntl[0].monthlyVal.perfAsOfDt.val', ''),\n navAsOfDateQuarter: get(ppssData, 'globalProductsValue.ppsListIntl[0].qtrlyVal.perfAsOfDt.val', ''),\n discreteMonthlyLabels,\n discreteQuarterlyLabels,\n calendarYearMonthlyLabels,\n calendarYearQuarterlyLabels\n }\n });\n newState.app.ppss.config.performanceViewOptions = performanceViewOptions;\n newState.app.ppss.config.fundIdentifiers = selectedIdentifiers;\n newState.app.ppss.config.showMorningStarColumn = showMorningStarColumn;\n newState.app.ppss.display.performanceView = performanceView;\n newState.app.ppss.filters = filters;\n } else {\n // return minimum data needed for <ft-find-a-fund>\n // if ppss data already set in state, be careful not to overwrite\n newState = Object.assign({}, state);\n if (!newState.ppss) {\n Object.assign(newState, {ppss: {funds}});\n }\n }\n return newState;\n default:\n return state;\n }\n}\n\nfunction _createLabels(perfView, asOfDate) {\n // WARNING: parsing dates using locale, as no Std date provided yet\n let asOfMoment = moment(asOfDate, 'L');\n\n let labelObj = {};\n if (perfView === 'CALENDAR_YEAR') {\n let thisYear = asOfMoment.year();\n [1, 2, 3, 4, 5].forEach(yearsAgo => {\n Object.defineProperty(labelObj, `calendar-year-${yearsAgo}yr`, {enumerable: true, value: (thisYear - yearsAgo)});\n });\n }\n if (perfView === 'DISCRETE') {\n [1, 2, 3, 4, 5].forEach(yearsAgo => {\n let startDate = asOfMoment.clone().subtract(yearsAgo, 'years').format('MMM-YY');\n let endDate = asOfMoment.clone().subtract(yearsAgo - 1, 'years').format('MMM-YY');\n let dateRange = `${startDate} / ${endDate}`;\n Object.defineProperty(labelObj, `discrete-${yearsAgo}yr`, {enumerable: true, value: dateRange});\n });\n }\n return labelObj;\n}\n\nfunction _createFundFilter(activeList, softLaunchList, config) {\n let filters = []; //create and array of filter functions, that will later get reduced\n filters.push(fund => activeList.includes(fund.shareClassKey) || softLaunchList.includes(fund.shareClassKey));\n if (config.general.currencyList.length) {\n filters.push(fund => config.general.currencyList.includes(fund.currency));\n }\n if (config.general.shareClassList.length) {\n filters.push(fund => config.general.shareClassList.includes(fund.shareClassFeeStructure));\n }\n if (config.ppss.investmentVehicleList.length) {\n filters.push(fund => config.ppss.investmentVehicleList.includes(fund.investmentVehicle));\n }\n return fund => filters.reduce((pass, filter) => pass && filter(fund), true);\n}\n\nfunction _createFundLinks(tabsets) {\n return (fund) => {\n if (!fund.isActive || fund.isSoftLaunch) {\n fund.link = null;\n } else {\n fund.link = tabsets.reduce((link, tabset) => {\n return tabset.id === 'default' || tabset.funds.includes(fund.fundId.toString()) ? tabset.baseLink : link;\n }, null);\n }\n if (fund.link) fund.link += `/${fund.fundId}/${fund.shareClassCode}/${kebabCase(fund.fundLegalName)}`;\n return fund;\n };\n}\n\nfunction _createFundMapper(activeList, softLaunchList, config, fundAlerts) {\n // TODO: refactor mdash logic to use performance utils\n const mdash = ''; // NB: mdash will be added in view by value-converter. Just use empty string here to fix sorting COREWEB-1174\n const sixMonthsAgo = moment().subtract(6, 'months');\n const oneYearAgo = moment().subtract(1, 'years');\n return (fund) => {\n let fundId = parseInt(fund.fundInfo.fundNumber.val, 10);\n let currency = get(fund, 'fundInfo.shareClassCurrency.val', mdash);\n let nav = cleanString(get(fund, 'navList.nav.val', mdash));\n let navChange = cleanString(get(fund, 'navList.dlyNavChange.val', mdash));\n let mStarRatingOverall = parseInt(get(fund, 'msRatingOverAll.val', ''), 10);\n let shareClassCode = get(fund, 'fundInfo.shareClassCode.val', '');\n let shareClassKey = shareClassCode ? `${fundId}-${shareClassCode}` : fundId;\n let shareClassInceptionDate = get(fund, 'fundInfo.shareClassInceptionDate.val', '');\n let performanceInceptionDate = get(fund, 'perfIncpDate.val', '');\n let showMDash = false;\n if (config.general.showMDashForUnder1Year) {\n showMDash = moment(performanceInceptionDate).isAfter(oneYearAgo);\n } else if (config.general.showMDashForUnder6Months) {\n showMDash = moment(performanceInceptionDate).isAfter(sixMonthsAgo);\n }\n\n let alerts = fundAlerts.filter(alert => {\n // if alert has shareClassCode defined, match on both\n if (alert.shareClassCode) return alert.fundId === fundId.toString() && alert.shareClassCode === shareClassCode;\n // otherwise just match on fundId\n return alert.fundId === fundId.toString();\n });\n let fundObj = {\n fundId,\n currency,\n shareClassCode,\n shareClassKey,\n fundLegalName: fund.fundInfo.legalName.val,\n fundShortName: get(fund, 'fundInfo.fundShortName.val', ''),\n fundNameFull: `${fund.fundInfo.legalName.val} - ${fund.fundInfo.shareClass.val}`,\n inceptionDate: get(fund, 'fundInfo.inceptionDate.val', ''),\n shareClassInceptionDate,\n performanceInceptionDate,\n performanceInceptionDateLocal: get(fund, 'perfIncpDateLocal.val', ''),\n assetClass: get(fund, 'fundInfo.fndCategory.val', ''),\n assetClassTaxonomy: get(fund, 'fundInfo.assetClass.val', ''),\n assetClassTaxonomyStd: get(fund, 'fundInfo.assetClassStd.val', ''),\n classGeography: get(fund, 'fundInfo.classGeography.val', ''),\n classGeographyStd: get(fund, 'fundInfo.classGeographyStd.val', ''),\n classStrategy: get(fund, 'fundInfo.classStrategy.val', ''),\n classStrategyStd: get(fund, 'fundInfo.classStrategyStd.val', ''),\n shareClass: fund.fundInfo.shareClass.val,\n shareClassFeeStructure: get(fund, 'fundInfo.shrclsCodeFeeStruct.val', ''),\n msFundCategory: get(fund, 'fundInfo.fundClassifcationByRegional.val', ''),\n investmentVehicle: get(fund, 'invstmntVechleStd.val', ''),\n isActive: activeList.includes(shareClassKey),\n isSoftLaunch: softLaunchList.includes(shareClassKey),\n isSoftClosure: false, // (fund.displayStatus.val === 'S'),\n isHardClosure: false, // (fund.displayStatus.val === 'H'),\n fundAlerts: alerts,\n mStarRatingOverall,\n nav: formatCurrency(nav, currency),\n navChange: formatCurrency(navChange, currency),\n navChangeDirection: navDirection(get(fund, 'navList.dlyNavChange.val', '')),\n navAsOfDate: get(fund, 'navList.navEffectiveDate.val', ''),\n\n distribution: get(fund, 'shClsDistCode.val', ''),\n reportingStatus: get(fund, 'ukDistrbStat.val', ''),\n\n taId: get(fund, 'ta_ID.val', ''),\n isin: get(fund, 'isin.val', ''), // International\n cusip: formatCusip(get(fund, 'fundInfo.cusip.val', '')), // US\n reuters: get(fund, 'reuterSymbol.val', ''),\n bloomberg: get(fund, 'blmBerfIdentfr.val', ''),\n wkn: get(fund, 'wkn.val', ''), // Germany\n sedol: get(fund, 'sedol.val', ''), // UK\n mexid: get(fund, 'mexId.val', ''), // Mexico\n merrillLynchId: get(fund, 'mrlLyncIdntfr.val', ''),\n vln: get(fund, 'vlnSymbol.val', ''), // Switzerland\n rfi: get(fund, '', ''), // Polish LAM\n apri: get(fund, '', ''), // Australia\n arsn: get(fund, '', ''), // Australia\n fundCode: get(fund, '', ''), // Canada\n frontEnd: get(fund, '', ''), // Canada\n lowLoad: get(fund, '', ''), // Canada\n dsc: get(fund, '', ''), // Canada\n dbCode: get(fund, '', ''), // Brazil\n\n performanceAsOfDateMonthly: get(fund, 'monthlyVal.perfAsOfDt.val', ''),\n performanceAsOfDateQuarterly: get(fund, 'qtrlyVal.perfAsOfDt.val', ''),\n\n avgAnn1YearReturnMonthly: showMDash ? mdash : get(fund, 'monthlyVal.avgAnnlRtn.ret1Yr.val', mdash),\n avgAnn3YearReturnMonthly: showMDash ? mdash : get(fund, 'monthlyVal.avgAnnlRtn.ret3Yr.val', mdash),\n avgAnn5YearReturnMonthly: showMDash ? mdash : get(fund, 'monthlyVal.avgAnnlRtn.ret5Yr.val', mdash),\n avgAnn10YearReturnMonthly: showMDash ? mdash : get(fund, 'monthlyVal.avgAnnlRtn.ret10Yr.val', mdash),\n avgAnnSinceIncReturnMonthly: showMDash ? mdash : get(fund, 'monthlyVal.avgAnnlRtn.avgAnnualYrRetActInc.val', mdash),\n\n avgAnn1YearReturnQuarterly: showMDash ? mdash : get(fund, 'qtrlyVal.avgAnnlRtn.ret1Yr.val', mdash),\n avgAnn3YearReturnQuarterly: showMDash ? mdash : get(fund, 'qtrlyVal.avgAnnlRtn.ret3Yr.val', mdash),\n avgAnn5YearReturnQuarterly: showMDash ? mdash : get(fund, 'qtrlyVal.avgAnnlRtn.ret5Yr.val', mdash),\n avgAnn10YearReturnQuarterly: showMDash ? mdash : get(fund, 'qtrlyVal.avgAnnlRtn.ret10Yr.val', mdash),\n avgAnnSinceIncReturnQuarterly: showMDash ? mdash : get(fund, 'qtrlyVal.avgAnnlRtn.avgAnnualYrRetActInc.val', mdash),\n\n calendarYear1yrReturnMonthly: showMDash ? mdash : get(fund, 'monthlyVal.calYrRt.ret1Yr.val', mdash),\n calendarYear2yrReturnMonthly: showMDash ? mdash : get(fund, 'monthlyVal.calYrRt.ret2Yr.val', mdash),\n calendarYear3yrReturnMonthly: showMDash ? mdash : get(fund, 'monthlyVal.calYrRt.ret3Yr.val', mdash),\n calendarYear4yrReturnMonthly: showMDash ? mdash : get(fund, 'monthlyVal.calYrRt.ret4Yr.val', mdash),\n calendarYear5yrReturnMonthly: showMDash ? mdash : get(fund, 'monthlyVal.calYrRt.ret5Yr.val', mdash),\n calendarYear6yrReturnMonthly: showMDash ? mdash : get(fund, 'monthlyVal.calYrRt.ret6Yr.val', mdash),\n\n calendarYear1yrReturnQuarterly: showMDash ? mdash : get(fund, 'qtrlyVal.calYrRt.ret1Yr.val', mdash),\n calendarYear2yrReturnQuarterly: showMDash ? mdash : get(fund, 'qtrlyVal.calYrRt.ret2Yr.val', mdash),\n calendarYear3yrReturnQuarterly: showMDash ? mdash : get(fund, 'qtrlyVal.calYrRt.ret3Yr.val', mdash),\n calendarYear4yrReturnQuarterly: showMDash ? mdash : get(fund, 'qtrlyVal.calYrRt.ret4Yr.val', mdash),\n calendarYear5yrReturnQuarterly: showMDash ? mdash : get(fund, 'qtrlyVal.calYrRt.ret5Yr.val', mdash),\n calendarYear6yrReturnQuarterly: showMDash ? mdash : get(fund, 'qtrlyVal.calYrRt.ret6Yr.val', mdash),\n\n cumulativeRetYtdMonthly: showMDash ? mdash : get(fund, 'monthlyVal.cumulativeRet.cumulativeRetYtd.val', mdash),\n cumulativeRet1yrMonthly: showMDash ? mdash : get(fund, 'monthlyVal.cumulativeRet.ret1Yr.val', mdash),\n cumulativeRet3yrMonthly: showMDash ? mdash : get(fund, 'monthlyVal.cumulativeRet.ret3Yr.val', mdash),\n cumulativeRet5yrMonthly: showMDash ? mdash : get(fund, 'monthlyVal.cumulativeRet.ret5Yr.val', mdash),\n cumulativeRet10yrMonthly: showMDash ? mdash : get(fund, 'monthlyVal.cumulativeRet.ret10Yr.val', mdash),\n cumulativeRetIncMonthly: showMDash ? mdash : get(fund, 'monthlyVal.cumulativeRet.cumulativeRetActInc.val', mdash),\n\n cumulativeRetYtdQuarterly: showMDash ? mdash : get(fund, 'qtrlyVal.cumulativeRet.cumulativeRetYtd.val', mdash),\n cumulativeRet1yrQuarterly: showMDash ? mdash : get(fund, 'qtrlyVal.cumulativeRet.ret1Yr.val', mdash),\n cumulativeRet3yrQuarterly: showMDash ? mdash : get(fund, 'qtrlyVal.cumulativeRet.ret3Yr.val', mdash),\n cumulativeRet5yrQuarterly: showMDash ? mdash : get(fund, 'qtrlyVal.cumulativeRet.ret5Yr.val', mdash),\n cumulativeRet10yrQuarterly: showMDash ? mdash : get(fund, 'qtrlyVal.cumulativeRet.ret10Yr.val', mdash),\n cumulativeRetIncQuarterly: showMDash ? mdash : get(fund, 'qtrlyVal.cumulativeRet.cumulativeRetActInc.val', mdash),\n\n discreteAnnual1yrMonthly: showMDash ? mdash : get(fund, 'monthlyVal.discrAnnualRoll.ret1Yr.val', mdash),\n discreteAnnual2yrMonthly: showMDash ? mdash : get(fund, 'monthlyVal.discrAnnualRoll.ret2Yr.val', mdash),\n discreteAnnual3yrMonthly: showMDash ? mdash : get(fund, 'monthlyVal.discrAnnualRoll.ret3Yr.val', mdash),\n discreteAnnual4yrMonthly: showMDash ? mdash : get(fund, 'monthlyVal.discrAnnualRoll.ret4Yr.val', mdash),\n discreteAnnual5yrMonthly: showMDash ? mdash : get(fund, 'monthlyVal.discrAnnualRoll.ret5Yr.val', mdash),\n\n discreteAnnual1yrQuarterly: showMDash ? mdash : get(fund, 'qtrlyVal.discrAnnualRoll.ret1Yr.val', mdash),\n discreteAnnual2yrQuarterly: showMDash ? mdash : get(fund, 'qtrlyVal.discrAnnualRoll.ret2Yr.val', mdash),\n discreteAnnual3yrQuarterly: showMDash ? mdash : get(fund, 'qtrlyVal.discrAnnualRoll.ret3Yr.val', mdash),\n discreteAnnual4yrQuarterly: showMDash ? mdash : get(fund, 'qtrlyVal.discrAnnualRoll.ret4Yr.val', mdash),\n discreteAnnual5yrQuarterly: showMDash ? mdash : get(fund, 'qtrlyVal.discrAnnualRoll.ret5Yr.val', mdash)\n };\n return fundObj;\n };\n}\n\nfunction _createFilterOptions(funds) {\n return {\n ASSET_CLASS: getUniqOptions('assetClass')(funds),\n ASSET_CLASS_TAXONOMY: getUniqOptions('assetClassTaxonomy')(funds),\n CLASS_GEOGRAPHY: getUniqOptions('classGeography')(funds),\n CLASS_STRATEGY: getUniqOptions('classStrategy')(funds),\n CURRENCY: getUniqOptions('currency')(funds),\n DISTRIBUTION: getUniqOptions('distribution')(funds),\n MS_FUND_CATEGORY: getUniqOptions('msFundCategory')(funds),\n INVESTMENT_VEHICLE: getUniqOptions('investmentVehicle')(funds),\n MORNINGSTAR_RATING: [{\n value: [3, 4, 5],\n label: '3 +'\n }, {\n value: [4, 5],\n label: '4 +'\n }, {\n value: [5],\n label: '5'\n }],\n REPORTING_STATUS: getUniqOptions('reportingStatus')(funds),\n SHARE_CLASS: getUniqOptions('shareClassFeeStructure')(funds)\n };\n}\n","/**\n * Data Reducer for pricingDistribution\n * Takes site specific json data and creates model for components\n * after applying business and presentation logic and data mapping\n */\nimport {LogManager} from 'aurelia-framework';\nimport cloneDeep from 'lodash/cloneDeep';\nimport get from 'lodash/get';\nimport groupBy from 'lodash/groupBy';\nimport has from 'lodash/has';\nimport sortedUniq from 'lodash/sortedUniq';\nimport unionBy from 'lodash/unionBy';\nimport moment from 'moment';\nimport {performanceUtils} from '../../../../performance/util/util';\nimport {cleanString, formatCurrency, formatPercentage, navDirection, parseNumber} from '../../../../lib/reducer-utils';\nimport {createCompare} from '../../../../../../lib/sort-utils';\nimport {configDecorator} from '../../../../lib/decorators/config-decorator';\nimport {isEmptyDeep} from '../../../../common/util/utils';\nimport {calculateFromDateStd, DATE_RANGE_ENUM} from '../utils';\n\nconst logger = LogManager.getLogger('pricing-distribution');\n\n// NB: any of these actions could be reduced first, so each is capable of setting up the basic state\n\nexport function pricingDistribution(state, action) {\n let newState;\n let decoratoredConfig;\n\n switch (action.type) {\n case 'POPULATE_PRICING_DISTRIBUTION_ERROR':\n return Object.assign({}, state, {\n pricingDistribution: {\n error: true\n }\n });\n case 'POPULATE_PRICING_DISTRIBUTION_SUCCESS':\n logger.debug('Reducing: POPULATE_PRICING_DISTRIBUTION_SUCCESS', action);\n let [pdData, fundDetails, rawConfig] = action.json;\n // COREWEB-2090 if no data provides empty feed\n if (\n isEmptyDeep(pdData) &&\n isEmptyDeep(fundDetails)\n ) {\n return Object.assign({}, state, {\n pricingDistribution: {\n error: true\n }\n });\n }\n decoratoredConfig = configDecorator(rawConfig, action.segment);\n\n newState = _getNewState(state, fundDetails, action.fundId, decoratoredConfig);\n logger.debug('_getNewState P&D:::', newState);\n\n newState.pricingDistribution.shareClasses.forEach(_createAppendPDData(pdData.globalProductsValue.prceDistbIntl.shClsPriceDet));\n return newState;\n case 'POPULATE_PRICE_HISTORY_SUCCESS':\n logger.debug('Reducing: POPULATE_PRICE_HISTORY_SUCCESS', action);\n let [priceHist, fundDetails2, rawConfig2] = action.json;\n // TODO: check for empty data feeds\n\n decoratoredConfig = configDecorator(rawConfig2, action.segment);\n newState = _getNewState(state, fundDetails2, action.fundId, decoratoredConfig);\n _appendPriceHistData(newState, action.shareClassCode, priceHist, action.fromDate, action.toDate);\n\n return newState;\n case 'POPULATE_DISTRIBUTION_HISTORY_SUCCESS':\n logger.debug('Reducing: POPULATE_DISTRIBUTION_HISTORY_SUCCESS', action);\n let [divHist, fundDetails3, rawConfig3] = action.json;\n // TODO: check for empty data feeds\n\n decoratoredConfig = configDecorator(rawConfig3, action.segment);\n newState = _getNewState(state, fundDetails3, action.fundId, decoratoredConfig);\n _appendDivHistData(newState, divHist);\n\n return newState;\n case 'POPULATE_DISTRIBUTION_HISTORY_ERROR':\n logger.debug('Reducing: POPULATE_DISTRIBUTION_HISTORY_ERROR', action);\n // This can be triggered when no Dividend history data for class\n // Just ignore, as default logic is to hide dividend section anyway when no data\n return state;\n default:\n return state;\n }\n}\n\n// this gets or creates the basic p&d state object\nfunction _getNewState(state, fundDetails, fundId, config) {\n if (has(state, 'pricingDistribution')) {\n // p&d state already exists, so return a cloned version to reuse and augment\n return cloneDeep(state);\n }\n\n // p&d data hasn't been set up yet, so return a state object with basic share class data\n let shareClasses = get(fundDetails, 'globalProductsValue.fundDetailIntl.shClsDet', [])\n .map(_createParseBasicClassData(fundId, fundDetails, config))\n .sort((a, b) => a.className.localeCompare(b.className));\n return {\n pricingDistribution: {\n hasDistributionClasses: shareClasses.some(sc => sc.isDistributionClass), // keeping this in for the moment, although not currently used\n primaryShareClass: shareClasses.find(cls => cls.primary),\n shareClasses\n }\n };\n}\n\n// this return a function that will map basic share class data from the fund details service\nfunction _createParseBasicClassData(fundId, fundDetails, config) {\n // for now, toDate will always be today\n let toDate = moment();\n let toDateStd = toDate.format('YYYY-MM-DD');\n return sc => {\n let shareClassCode = get(sc, 'shCls.val', '');\n let shareClassKey = shareClassCode ? `${fundId}-${shareClassCode}` : fundId;\n let currency = get(sc, 'shClsCur.val', '');\n let shareClassInceptionDateStd = get(sc, 'shClIncDtStd.val');\n let performanceInceptionDateStd = get(sc, 'perfIncpDt.val');\n let inceptionDateMoment = moment(shareClassInceptionDateStd, 'YYYY-MM-DD');\n let showPerformanceData = !performanceUtils.mustHidePerformanceData(config, performanceInceptionDateStd);\n\n // set up empty data structures for historical price data\n let priceHistory = {};\n Object.entries(DATE_RANGE_ENUM).forEach(obj => {\n let [key, val] = obj;\n let ph = {};\n let fromDateMoment;\n ph.name = val.name;\n ph.labelKey = val.labelKey;\n ph.dataKey = val.dataKey;\n ph.downloadKey = val.downloadKey;\n ph.data = null; // will be array when set\n ph.dataFullyLoaded = false;\n ph.toDateStd = toDateStd;\n ph.fromDateStd = calculateFromDateStd(key, shareClassInceptionDateStd, toDateStd);\n // these dates reflect the data currently loaded for this range\n ph.toDateLoadedStd = null;\n ph.fromDateLoadedStd = null;\n // these dates will be based on actual data received\n // eg if toDateStd falls on a weekend, toDateActualStd will likely be the Friday before\n // or if fromDateStd falls on a weekend, fromDateActualStd will likely be the Monday after\n ph.toDateActualStd = null;\n ph.fromDateActualStd = null;\n\n // data options for 1 month and Since Inception will always be available\n // others depend on the inception date being early enough\n switch (key) {\n case 'CUSTOM_RANGE':\n ph.dataExists = null; // not relevant for custom date range\n break;\n case 'ONE_MONTH':\n ph.dataExists = true;\n break;\n case 'SINCE_INCEPTION':\n ph.dataExists = true;\n break;\n default:\n fromDateMoment = moment(ph.fromDateStd, 'YYYY-MM-DD');\n ph.dataExists = inceptionDateMoment.isBefore(fromDateMoment);\n }\n priceHistory[key] = ph;\n });\n\n return {\n className: get(sc, 'shClsNm.val', ''),\n primary: get(sc, 'prmryShCls.val', '').toUpperCase() === 'YES',\n shareClassCode,\n shareClassKey,\n shareClassInceptionDate: get(sc, 'shClsIncpDt.val', ''),\n shareClassInceptionDateStd,\n performanceInceptionDateStd,\n showPerformanceData,\n // COREWEB-1863 now determine this from dedicated field\n isDistributionClass: get(sc, 'shClsDistributionFlag.val', '').toUpperCase() === 'Y',\n currency,\n priceHistory,\n // TODO: create empty default objects for now. May be able to remove in future\n dividendHistory: [],\n dividendHistoryByYear: {},\n dividendYears: []\n };\n };\n}\n\nfunction _createAppendPDData(pdClasses) {\n return sc => {\n let matchingClass = pdClasses.find(pdc => get(pdc, 'shClsCD.val', '') === sc.shareClassCode);\n if (matchingClass) {\n let navChange = get(matchingClass, 'navDet.dlyNavChange.val', '');\n sc.nav = formatCurrency(cleanString(get(matchingClass, 'navDet.nav.val', '')), sc.currency);\n sc.navChange = formatCurrency(cleanString(navChange), sc.currency);\n sc.navChangeDirection = navDirection(navChange);\n sc.asOfDate = get(matchingClass, 'navDet.asOfDate.val', '');\n sc.dividend = _parseDividend(matchingClass.navDet.dividend, sc.currency);\n sc.highLowNav = get(matchingClass, 'highLowNav', [])\n .filter(hl => get(hl, 'highNav.val', '') && get(hl, 'lowNav.val', ''))\n .map(hl => ({\n year: get(hl, 'year.val', ''),\n highNav: formatCurrency(cleanString(get(hl, 'highNav.val', '')), sc.currency),\n lowNav: formatCurrency(cleanString(get(hl, 'lowNav.val', '')), sc.currency)\n }));\n }\n };\n}\n\nfunction _appendPriceHistData(newState, shareClassCode, priceHist, fromDateStd, toDateStd) {\n logger.debug('_appendPriceHistData():::', newState, shareClassCode, priceHist, fromDateStd, toDateStd);\n\n if (shareClassCode) {\n // find matching existing share class\n let shareClass = newState.pricingDistribution.shareClasses.find(sc => sc.shareClassCode === shareClassCode);\n if (shareClass) {\n let currency = get(priceHist, 'globalProductsValue.navHistoryIntlValue.shareClassCurrency.val', []);\n let navArray = get(priceHist, 'globalProductsValue.navHistoryIntlValue.navDetailValue', [])\n // parse each nav point\n .map(_createParseNavHistory(currency))\n // pre-filter navArray on fromDate and toDate for local testing. This is safe to leave in prod too.\n .filter(nav => moment(nav.navDate, 'YYYY-MM-DD')\n .isBetween(fromDateStd, toDateStd, null, '[]') // the [] makes the match inclusive\n )\n // sort by date\n .sort(createCompare('navDate', 'DESC'));\n\n let fromDateMoment = moment(fromDateStd, 'YYYY-MM-DD');\n let toDateMoment = moment(toDateStd, 'YYYY-MM-DD');\n\n // loop through each priceHistory range on share class, amd merge in new data (if needed)\n Object.keys(DATE_RANGE_ENUM).forEach(key => {\n let ph = shareClass.priceHistory[key];\n\n // only set data if it's not already there, AND data empty or new data range overlaps existing\n if (!ph.dataFullyLoaded\n && (!ph.data\n || (toDateMoment.isSameOrAfter(ph.fromDateLoadedStd) // this checks we'll have a continuous data range\n && fromDateMoment.isSameOrBefore(ph.toDateLoadedStd)))) {\n // 1. UNION the old and new data\n ph.data = unionBy(ph.data, navArray, 'navDate');\n\n // 2. work out new fromDateLoadedStd and toDateLoadedStd\n ph.fromDateLoadedStd = ph.fromDateLoadedStd\n ? moment.min(fromDateMoment, moment(ph.fromDateLoadedStd, 'YYYY-MM-DD')).format('YYYY-MM-DD')\n : fromDateMoment.format('YYYY-MM-DD');\n ph.toDateLoadedStd = ph.toDateLoadedStd\n ? moment.max(toDateMoment, moment(ph.toDateLoadedStd, 'YYYY-MM-DD')).format('YYYY-MM-DD')\n : toDateMoment.format('YYYY-MM-DD');\n\n // 3. Work out if all data now loaded for range\n ph.dataFullyLoaded = (moment(ph.fromDateLoadedStd).isSameOrBefore(ph.fromDateStd)\n && ph.toDateLoadedStd === ph.toDateStd);\n\n // 4. trim off any extra data\n ph.data = ph.data.filter(nav => moment(nav.navDate, 'YYYY-MM-DD')\n .isBetween(ph.fromDateStd, ph.toDateStd, null, '[]') // the [] makes the match inclusive\n );\n\n // 5. Work out fromDateActualStd and toDateActualStd\n // fromDateStd and toDateStd could fall on a weekend (or holiday), so these dates reflect what days we actually have data for\n if (ph.data && ph.data.length > 0) {\n ph.toDateActualStd = ph.data[0].navDate;\n ph.fromDateActualStd = ph.data[ph.data.length - 1].navDate;\n }\n }\n });\n }\n }\n}\n\n// takes share classessin state, finds matching one, and adds historical dividend data to it\nfunction _appendDivHistData(newState, divHist) {\n let shareClassCode = get(divHist, 'globalProductsValue.divHistoryIntlValue.shareClassCode.val');\n\n if (shareClassCode) {\n // find matching existing share class\n let shareClass = newState.pricingDistribution.shareClasses.find(sc => sc.shareClassCode === shareClassCode);\n if (shareClass) {\n let dividendData = get(divHist, 'globalProductsValue.divHistoryIntlValue.divDetailValue', []);\n shareClass.dividendHistory = dividendData.map(dvd => {\n let currency = get(dvd, 'curryCode.val', '');\n let asOfDateStd = get(dvd, 'asOfDtStd.val', '');\n let asOfDateMoment = moment(asOfDateStd);\n return {\n asOfDateStd,\n asOfDate: get(dvd, 'asOfDt.val', ''),\n asOfDateYear: asOfDateMoment.year(),\n recordDate: get(dvd, 'incmDistRecdDt.val', ''),\n exDividendDate: get(dvd, 'incmDistExDivDt.val', ''),\n distributionDate: get(dvd, 'incmDistPayableDt.val', ''),\n dividendsPerShare: formatCurrency(cleanString(get(dvd, 'divPerShare.val', '')), currency)\n };\n });\n shareClass.dividendYears = sortedUniq(shareClass.dividendHistory.map(dh => dh.asOfDateYear));\n shareClass.dividendHistoryByYear = groupBy(shareClass.dividendHistory, 'asOfDateYear');\n }\n }\n}\n\nfunction _createParseNavHistory(currency) {\n return navObj => {\n let nav = get(navObj, 'nav.val', '');\n let navChange = get(navObj, 'dlyNavChange.val', '');\n // TODO: quick hack that will only work for UK while developing. swap for navEffectiveDateStd when get data\n let navDate = moment(get(navObj, 'navEffectiveDate.val', ''), 'DD/MM/YYYY').format('YYYY-MM-DD');\n // let navDate = get(navObj, 'navEffectiveDateStd.val', '');\n let navDateFormatted = get(navObj, 'navEffectiveDate.val', '');\n let navChangePercent = get(navObj, 'dlyNavPcnt.val', '');\n return {\n navDate: navDate,\n navDateFormatted: navDateFormatted,\n nav: parseNumber(nav),\n navChange: parseNumber(navChange),\n navChangePercent: navChangePercent,\n navFormatted: formatCurrency(nav, currency, true),\n navChangeFormatted: formatCurrency(navChange, currency, true),\n navChangePercentFormatted: formatPercentage(navChangePercent, true)\n };\n };\n}\n\n/**\n * @param {Object} dvd\n * @param {string} currency eg USD\n * @returns {Object}\n * @private\n */\nfunction _parseDividend(dvd, currency) {\n if (!dvd) return null;\n if (!has(dvd, 'divPerUnit.val', false)) return null;\n return {\n // TODO: need data for some fields!\n asOfDateStd: get(dvd, 'asOfDt.val', ''),\n asOfDate: get(dvd, 'asOfDt.val', ''),\n recordDate: get(dvd, 'recordDt.val', ''),\n exDividendDate: get(dvd, 'exDivDt.val', ''),\n distributionDate: get(dvd, '', ''),\n dividendsPerShare: formatCurrency(cleanString(get(dvd, 'divPerUnit.val', '')), currency)\n };\n}\n","/**\n * Data Reducer for germanTax\n * Takes site specific json data and creates model for components\n * after applying business and presentation logic and data mapping\n */\nimport {LogManager} from 'aurelia-framework';\nimport {formatCurrency, formatPercentage, getUniqOptions} from '../../../../lib/reducer-utils';\nimport get from 'lodash/get';\n\nconst logger = LogManager.getLogger('german-tax');\n\nexport function germanTax(state, action) {\n let stateOBJ;\n if (action.type === 'POPULATE_GERMAN_TAX_SUCCESS') {\n logger.debug('Reducing: POPULATE_GERMAN_TAX_SUCCESS', state, action);\n let [taxData, taxComponentConfig] = action.json;\n\n // component config\n let showTaxColumns = get(taxComponentConfig, 'hideTaxColumns.0', 'false') === 'false';\n let showTaId = get(taxComponentConfig, 'ISIN-or-FundNumber.0', 'Fund-Number') === 'Fund-Number';\n let showIsin = !showTaId;\n let filterFunds = get(taxComponentConfig, 'Display-For-Funds', []);\n let includeOrExcludeFunds = get(taxComponentConfig, 'Funds-For-Display.0', '');\n if (includeOrExcludeFunds === 'Exclude') includeOrExcludeFunds = 'EXCLUDE';\n if (includeOrExcludeFunds === 'Include') includeOrExcludeFunds = 'INCLUDE';\n\n let selectedDropdowns = get(taxComponentConfig, 'Filters', []);\n // if only 1 option, it might take form of string or object\n // TODO: check this in QA with example\n if (!Array.isArray(selectedDropdowns)) selectedDropdowns = [selectedDropdowns];\n\n let funds = get(taxData, 'globalProductsValue.priceTaxIntl', [])\n .map(fund => ({\n fundId: get(fund, 'fundID.val'),\n fundName: get(fund, 'fundName.val', '—'),\n investmentVehicleCode: get(fund, 'umbrella.val', '—'),\n baseCurrency: get(fund, 'fundBaseCur.val', '—'),\n shareClasses: get(fund, 'shareClsDet', [])\n }));\n\n let shareClasses = funds.reduce((classes, fund) => {\n fund.shareClasses.forEach(sc => {\n sc.fundId = fund.fundId;\n sc.fundName = fund.fundName;\n sc.baseCurrency = fund.baseCurrency;\n sc.investmentVehicleCode = fund.investmentVehicleCode;\n });\n return classes.concat(fund.shareClasses);\n }, [])\n .map(sc => {\n let currency = get(sc, 'shClsCurncy.val', '—');\n let shareClassName = get(sc, 'shareClassName.val', '—');\n let shareClassCode = get(sc, 'shareClassCode.val', '—');\n let interimProfitStd = parseFloat(get(sc, 'interimProfitSTD.val', '0'));\n return {\n fundId: sc.fundId,\n fundName: sc.fundName,\n investmentVehicleCode: sc.investmentVehicleCode,\n showCurrencyFootnote: (sc.baseCurrency !== currency),\n showPositiveProfitFootnote: (interimProfitStd > 0),\n showNegativeProfitFootnote: (interimProfitStd < 0),\n\n shareClassName,\n fundShareClassName: `${sc.fundName} - ${shareClassName}`,\n shareClassKey: `${sc.fundId}-${shareClassCode}`,\n investmentVehicle: get(sc, 'umbrellaDesc.val', '—'),\n shareClassCode,\n taId: get(sc, 'ta_id.val', ''),\n redemptionPrice: formatCurrency(get(sc, 'navValue.val'), currency, true),\n\n isin: get(sc, 'isin.val', '—'),\n currency,\n nav: formatCurrency(get(sc, 'gemOfferPriceValue.val'), currency, true),\n interimProfit: formatCurrency(get(sc, 'interimProfit.val'), currency, true),\n interimProfitStd,\n equityGainEstG: formatPercentage(get(sc, 'equityGain.val'), true),\n equityGainKstG: formatPercentage(get(sc, 'kstgEquityGain.val'), true),\n realEstateProfit: formatCurrency(get(sc, 'realEstateGain.val'), currency, true),\n accumulatedDividendIncome: formatCurrency(get(sc, 'accuDeemedDist.val'), currency, true),\n asOf: get(sc, 'asOfDate.val', '—')\n };\n })\n .filter(sc => {\n switch (includeOrExcludeFunds) {\n case 'INCLUDE':\n return filterFunds.includes(sc.shareClassKey);\n case 'EXCLUDE':\n return !filterFunds.includes(sc.shareClassKey);\n default:\n return true;\n }\n });\n // logger.debug('Filtered shareClasses:::', shareClasses.length, includeOrExcludeFunds);\n\n // filters\n let allDropdowns = state.app.tax.config.allDropdowns.map(dd => {\n let urlParam = action.params[dd.name];\n if (urlParam) {\n dd.selected = {value: urlParam};\n }\n dd.visible = selectedDropdowns.includes(dd.name);\n return dd;\n });\n\n let filters = state.app.tax.filters;\n filters.dropdowns = allDropdowns;\n let filterOptions = _createFilterOptions(shareClasses);\n\n stateOBJ = Object.assign({}, state, {\n tax: {\n filterOptions,\n funds,\n shareClasses\n }\n });\n stateOBJ.app.tax.config.showTaxColumns = showTaxColumns;\n stateOBJ.app.tax.config.showTaId = showTaId;\n stateOBJ.app.tax.config.showIsin = showIsin;\n } else {\n stateOBJ = state;\n }\n return stateOBJ;\n}\n\nfunction _createFilterOptions(shareClasses) {\n return {\n INVESTMENT_VEHICLE: getUniqOptions('investmentVehicle')(shareClasses),\n FUND_NAME: getUniqOptions('fundShareClassName')(shareClasses)\n };\n}\n","/**\n * App State Reducer for ftMultiSelectBar\n * Takes application state data and creates model for components\n * rmclaughlin 25/05/17\n */\n\nimport get from 'lodash/get';\n// import {LogManager} from 'aurelia-framework';\n// const logger = LogManager.getLogger('ft-multi-select-bar');\n\nexport function ftMultiSelectBar(state, action) {\n switch (action.type) {\n case 'LOAD_LABELS_MARKETING_SUCCESS':\n let [data] = action.json;\n let beanData = get(data, 'labels');\n\n let selectMultiple = get(beanData, 'doclister-select-multiple');\n let selectedPdfs = get(beanData, 'selected-pdf-labels');\n let editLabel = get(beanData, 'edit-label');\n let emailSelectedLabel = get(beanData, 'email-selected-label');\n let downloadLink = get(beanData, 'download-link');\n let onState = get(beanData, 'on-state');\n let offState = get(beanData, 'off-state');\n let editSelectedDocumentsText = get(beanData, 'edit-selected-documents-text');\n let emailSelectedDocumentsText = get(beanData, 'email-selected-documents-text');\n let downloadSelectedDocumentsText = get(beanData, 'download-selected-documents-text');\n let fromNameText = get(beanData, 'from-name-text');\n let removeRecipientText = get(beanData, 'remove-recipient-text');\n let recipientNameText = get(beanData, 'recipient-name-text');\n let recipientEmailText = get(beanData, 'recipient-email-text');\n let addRecipientText = get(beanData, 'add-recipient-text');\n let messageLabel = get(beanData, 'message-label');\n let yourDocumentsSentText = get(beanData, 'your-documents-sent-text');\n let backLabel = get(beanData, 'back-label');\n let continueLabel = get(beanData, 'continue-label');\n let sendLink = get(beanData, 'send-link');\n let validFromName = get(beanData, 'doclister-valid-from-name');\n let validToName = get(beanData, 'doclister-valid-to-name');\n let validEmail = get(beanData, 'doclister-valid-email');\n\n return Object.assign({}, state, {\n ftMultiSelectBar: {\n selectMultiple,\n selectedPdfs,\n editLabel,\n emailSelectedLabel,\n onState,\n offState,\n downloadLink,\n editSelectedDocumentsText,\n emailSelectedDocumentsText,\n downloadSelectedDocumentsText,\n fromNameText,\n removeRecipientText,\n recipientNameText,\n recipientEmailText,\n addRecipientText,\n messageLabel,\n yourDocumentsSentText,\n backLabel,\n continueLabel,\n sendLink,\n validFromName,\n validToName,\n validEmail\n }\n });\n default:\n return state;\n }\n}\n","/**\n * App State Reducer for ftTypeAheadSearch\n * Takes application state data and creates model for components\n * rmclaughlin 25/05/17\n */\n\nimport get from 'lodash/get';\n// import {LogManager} from 'aurelia-framework';\n// const logger = LogManager.getLogger('ft-type-ahead-search');\n\nexport function ftTypeAheadSearch(state, action) {\n switch (action.type) {\n case 'LOAD_LABELS_MARKETING_SUCCESS':\n let [data] = action.json;\n let beanData = get(data, 'labels');\n\n let classLabel = get(beanData, 'class-label');\n let emptyResults = get(beanData, 'empty-results');\n let searchInput = get(beanData, 'search-input');\n\n return Object.assign({}, state, {\n ftTypeAheadSearch: {\n classLabel: classLabel,\n searchInput: searchInput,\n emptyResults: emptyResults\n }\n });\n default:\n return state;\n }\n}\n","/**\n * Data Reducer for fundAlert\n * Takes site specific json data and creates model for components\n * after applying business and presentation logic and data mapping\n */\nimport {LogManager} from 'aurelia-framework';\nimport get from 'lodash/get';\nimport {utilsConfig} from '../../../../util/utils-config';\n\nconst logger = LogManager.getLogger('fund-alert');\n\n// TODO: put in gw-etf folder, used by gw and etf\nexport function fundAlert(state, action) {\n let stateOBJ;\n if (action.type === 'POPULATE_FUND_ALERT_SUCCESS') {\n logger.debug('Reducing: POPULATE_FUND_ALERT_SUCCESS', action, state);\n let [alertData] = action.json;\n\n stateOBJ = Object.assign({}, state, {\n fundAlerts: parseFundAlerts(alertData)\n });\n } else {\n stateOBJ = state;\n }\n return stateOBJ;\n}\n\n// This allows the POPULATE_PPSS_STATE_SUCCESS action reducer to reuse functionality\n// This should maybe be in a utility file somewhere else\nexport function parseFundAlerts(alertData) {\n let alerts = utilsConfig.arrayConvertListOfFields(alertData, ['provider.LscsDocuments.assets.document']);\n return get(alerts, 'provider.LscsDocuments.assets.document', [])\n .map(_alertMapper);\n}\n\nfunction _alertMapper(alert) {\n let fields = get(alert, 'metadata.field', []);\n let fundId = fields.find(f => f.name === 'TeamSite/Metadata/frk_oneTISNumber');\n let shareClassCode = fields.find(f => f.name === 'TeamSite/Metadata/frk_shareClassCode');\n return {\n fundId: get(fundId, 'content', null),\n shareClassCode: get(shareClassCode, 'content', null),\n alert: get(alert, 'content.generic.content.fund_alert', ''),\n title: get(alert, 'content.generic.content.title', ''),\n content: get(alert, 'content.generic.content.content', '')\n };\n}\n","/**\n * Data Reducer for managerRosterAndAllocation\n * Takes site specific json data and creates model for components\n * after applying business and presentation logic and data mapping\n */\nimport { LogManager } from 'aurelia-framework';\nimport filter from 'lodash/filter';\nimport get from 'lodash/get';\nimport orderBy from 'lodash/orderBy';\nimport groupBy from 'lodash/groupBy';\nimport forEach from 'lodash/forEach';\nimport {utilsFundDetails} from '../../../../../common/util/utils-fund-details';\nimport { utilsConfig } from '../../../../../common/util/utils-config';\nimport { configDecorator } from '../../../../../lib/decorators/config-decorator';\n\nconst logger = LogManager.getLogger('manager-roster');\n\nexport function managerRoster(state, action) {\n let stateOBJ;\n if (action.type === 'POPULATE_MANAGER_ROSTER_AND_ALLOCATION_SUCCESS') {\n logger.debug('Reducing: POPULATE_MANAGER_ROSTER_AND_ALLOCATION_SUCCESS');\n\n stateOBJ = Object.assign({}, state, {\n managerRosterAndAllocation: {\n data: _dataBuilder(action)\n }\n });\n } else {\n stateOBJ = state;\n }\n return stateOBJ;\n}\n\n/**\n * Build and reduce the data\n * @param action\n * @returns {Object}\n * @private\n */\nfunction _dataBuilder(action) {\n let [portfolioData, rawFundData, rawConfig, managerRosterData, managerRosterFundData] = action.json;\n\n // Get and handle component configuration\n const config = configDecorator(rawConfig, action.segment);\n let fundCategory = utilsFundDetails.getFundCategory(rawFundData);\n const isSuppressed = utilsConfig.isPortfolioComponentSuppressed(config, action.fundId, action.portfolioComponent, fundCategory);\n\n // Get only the types of holdings that are suitable for this component\n const managerData = filter(\n get(portfolioData, 'globalProductsValue.portfolioIntlValue.breakdown.brkdwnDet'),\n {'type': 'MANAGER_ALLOCATION'}\n );\n\n // Use the fund-specific override content if it is populated\n let rosterContent = get(managerRosterFundData, 'provider.manager-roster.manager');\n if (!rosterContent) {\n rosterContent = get(managerRosterData, 'provider.manager-roster.manager');\n }\n\n let visible = (typeof managerData !== 'undefined' && managerData.length !== 0);\n if (isSuppressed) {\n visible = false;\n }\n\n let obj = {\n caveatSecName: 'Portfolio',\n tableID: 'manager-roster-and-allocation-data',\n showAllocations: false,\n visible: visible\n };\n\n if (visible) {\n obj.date = get(managerData, '[0]asOfDate.val');\n obj.showAllocations = config.portfolio.showManagerAllocations !== undefined ? config.portfolio.showManagerAllocations : false;\n\n let allocations = [];\n // Group the raw allocations and sort rows in each table by value\n let allocationsGroupedByName = groupBy(managerData[0].brkDwnLst.lstDtls, 'name.val');\n forEach(allocationsGroupedByName, function(group) {\n let allocationGroup = {\n name: get(group, '[0]name.val'),\n total: get(group, '[0]val.val'),\n managers: orderBy(group.slice(1), function(o) {\n return parseInt(o.val.val, 10);\n }, 'desc')\n };\n forEach(allocationGroup.managers, function(manager) {\n manager.displayName = manager.name2.val;\n let detail = filter(rosterContent, {'name': manager.name2.val});\n if (detail !== undefined && detail.length > 0) {\n let name = get(detail, '[\"0\"][\"display-name\"]');\n if (name) {\n manager.displayName = name;\n }\n manager.image = get(detail, '[\"0\"][\"image\"]');\n manager.fullDesc = get(detail, '[\"0\"][\"full-description\"]');\n manager.shortDesc = get(detail, '[\"0\"][\"short-description\"]');\n }\n });\n allocations.push(allocationGroup);\n });\n\n obj.managerAllocations = allocations;\n }\n\n return obj;\n}\n","/**\n * Data Reducer for sectorExposure\n * Takes site specific json data and creates model for components\n * after applying business and presentation logic and data mapping\n * import {sectorExposure} from '../../components/products/portfolio/ft-sector-exposure/lib/gw/sector-exposure.reducer';\n */\nimport get from 'lodash/get';\nimport {portfolioUtils} from '../../../../util/util';\n\nimport {utilsFundDetails} from '../../../../../common/util/utils-fund-details';\nimport {utilsConfig} from '../../../../../common/util/utils-config';\nimport {configDecorator} from '../../../../../lib/decorators/config-decorator';\nimport {getHierarchicalBreakdown} from '../../../../util/hierarchical-utils';\nimport {LogManager} from 'aurelia-framework';\n\nconst logger = LogManager.getLogger('sector-exposure');\n\nexport function sectorExposure(state, action) {\n switch (action.type) {\n case 'POPULATE_SECTOR_EXPOSURE_SUCCESS':\n const data = _infoBuilder(action);\n logger.debug('Reducing: POPULATE_SECTOR_EXPOSURE');\n\n return Object.assign({}, state, {\n sectorExposure: {\n data: data\n }\n });\n default:\n return state;\n }\n}\n\n// FIXME: should be moved/refactored into lib/charting reducers\nfunction _infoBuilder(action) {\n const [rawPortfolio, rawFundDetail, rawConfig] = action.json;\n // Get and handle component configuration\n\n const decoratedConfig = configDecorator(rawConfig, action.segment);\n let fundCategory = utilsFundDetails.getFundCategory(rawFundDetail);\n const isSuppressed = utilsConfig.isPortfolioComponentSuppressed(decoratedConfig, action.fundId, action.portfolioComponent, fundCategory);\n\n const rawBreakdowns = get(rawPortfolio, 'globalProductsValue.portfolioIntlValue.breakdown.brkdwnDet');\n const breakdown = portfolioUtils.findObjInArray(rawBreakdowns, 'K2_SECTOR_ALLOCATION');\n let visible = (typeof breakdown !== 'undefined');\n if (isSuppressed) {\n // if this component is suppressed, then prevent it from continuing any further work.\n visible = false;\n }\n let seObj = {\n caveatSecName: 'Portfolio',\n visible: visible\n };\n\n if (visible) {\n const tempBreakdown = getHierarchicalBreakdown(\n breakdown,\n {\n buildChart: false,\n tableMappingKeys: {\n val: 'val.val',\n val2: 'val2.val',\n val3: 'val3.val'\n },\n nameFunc: (o) => {\n let isParent = get(o, 'name2.val', null) === null;\n if (isParent) {\n return get(o, 'name.val');\n }\n return get(o, 'name2.val');\n },\n rangeKey: 'name.val'\n }\n );\n\n seObj = Object.assign({}, seObj, tempBreakdown);\n\n seObj.showChart = true;\n seObj.spanRow = true;\n\n let dateObj = portfolioUtils.getDateAndCalType(breakdown, {});\n seObj.date = dateObj.date;\n seObj.calType = dateObj.calType;\n seObj.calTypeStd = dateObj.calTypeStd;\n\n let refreshRateFromConfig = get(decoratedConfig, 'portfolio.refreshRate');\n seObj.refreshRate = portfolioUtils.convertRefreshFrequencyIntoLabelId(refreshRateFromConfig);\n\n seObj.table = tempBreakdown.table;\n seObj.tableTwoLevel = tempBreakdown.tableTwoLevel;\n seObj.chart = tempBreakdown.chart;\n seObj.visible = tempBreakdown.visible;\n seObj.showChart = true;\n seObj.spanRow = true;\n seObj.hasNestedChildren = tempBreakdown.hasNestedChildren;\n seObj.missingBenchmarkData = seObj.bmrkId !== undefined;\n }\n return seObj;\n}\n"],"sourceRoot":"../.."} |