1"use strict";(self.webpackChunkproject_x_ui=self.webpackChunkproject_x_ui||[]).push([[4387],{23650:(e,t,n)=>{n.d(t,{E:()=>q});var i=n(72791),a=n(59434),l=n(47881),r=n(96599),c=n(22880),o=n(92506),s=n(1997),u=n(67538),d=n(98838),m=n(36740),p=n(12304),x=n(17133);let h=function(e){return e.currentBalance="currentBalance",e.monthlySavings="monthlySavings",e.expectedSavingsGrowth="expectedSavingsGrowth",e.expectedProfitability="expectedProfitability",e.calculateRetirement="calculateRetirement",e.retirementType="retirementType",e.monthlySpending="monthlySpending",e.currentAge="currentAge",e.lifeExpectancy="lifeExpectancy",e.expectedInflation="expectedInflation",e.retirementProfitability="retirementProfitability",e}({});var v=n(68096),y=n(47071),g=n(80184);const b=e=>{let{name:t,label:n,placeholder:i,prefix:a,helpText:l,averageProfitability:r,expectedProfitability:c}=e;const{t:u}=(0,s.$G)(),[,,d]=(0,o.U$)({name:t});return(0,g.jsxs)(v.Z,{children:[(0,g.jsx)(m.Ki,{name:t,label:n,placeholder:i,prefix:a,helpText:l,allowNegative:!1,required:!0}),null!==r.value&&(0,g.jsxs)(y.Z,{children:[r.label,":"," ",r.value>0?(0,g.jsx)(m.ZP,{onClick:()=>{d.setValue(r.value)},children:u("common.percent",{value:r.value})}):u("common.undefined")]}),null!==c.value&&(0,g.jsxs)(y.Z,{children:[c.label,":"," ",c.value>0?(0,g.jsx)(m.ZP,{onClick:()=>{d.setValue(c.value)},children:u("common.percent",{value:c.value})}):u("common.undefined")]})]})},f=i.memo(b),j=e=>{let{name:t,label:n,options:i,helpText:a}=e;return(0,g.jsx)(m.dU,{helpText:a,isInputHelp:!0,children:(0,g.jsx)(m.Ph,{name:t,options:i,label:n})})},P=i.memo(j);var Z=n(68402),S=n(36314),T=n(68802),B=n(98528);const A=(0,g.jsx)(s.cC,{i18nKey:"prediction.calculation.lifeExpectancy-tooltip",components:[(0,g.jsx)(m.RA,{href:T.Ew.INFO.LIFE_EXPECTANCY,spaceBefore:!0,sx:{color:"inherit"}},0)]}),C=e=>{let{fromName:t,toName:n,min:a,max:l,distance:r}=e;const{t:c}=(0,s.$G)(),u=(0,o.u6)(),[d,p]=(0,o.U$)({name:t}),[x,h]=(0,o.U$)({name:n}),[b,f]=i.useState([d.value,x.value]);return i.useEffect((()=>{const[e,i]=b;if(d.value!==e||x.value!==i){const a=u.values;u.setValues({...a,[t]:e,[n]:i})}}),[b]),(0,g.jsxs)(v.Z,{children:[(0,g.jsx)(m.dU,{helpText:A,children:(0,g.jsx)(y.Z,{children:c("prediction.calculation.lifeExpectancy")})}),(0,g.jsx)(Z.ZP,{value:b,onChange:(e,t,n)=>{const[i,c]=t;if(c-i<r)if(0===n){const e=Math.min(i,l-r);f([e,e+r])}else{const e=Math.max(c,r+a);f([e-r,e])}else f([i,c])},valueLabelDisplay:"auto",min:a,max:l,size:"small",disableSwap:!0}),(0,g.jsxs)(S.Z,{direction:"row",justifyContent:"space-between",children:[(0,g.jsxs)(m.l0,{children:[c("prediction.calculation.lifeExpectancy-from"),": ",(0,g.jsx)("b",{children:c("prediction.format.yearsOld",{count:d.value})})]}),(0,g.jsxs)(m.l0,{children:[c("prediction.calculation.lifeExpectancy-to"),": ",(0,g.jsx)("b",{children:c("prediction.format.yearsOld",{count:x.value})})]})]}),!!p.error&&(0,g.jsx)(y.Z,{error:!0,children:(0,B.j1)(p.error)}),!!h.error&&(0,g.jsx)(y.Z,{error:!0,children:(0,B.j1)(h.error)})]})},M=e=>{let{name:t,label:n,min:i,max:a,helpText:l,formatValue:r}=e;const[c,,s]=(0,o.U$)({name:t});return(0,g.jsxs)(v.Z,{children:[(0,g.jsx)(m.dU,{helpText:l,children:(0,g.jsxs)(y.Z,{children:[n,": ",(0,g.jsx)("b",{children:r(c.value)})]})}),(0,g.jsx)(Z.ZP,{...c,name:t,valueLabelDisplay:"auto","aria-label":n,size:"small",min:i,max:a,value:c.value,onChange:(e,t)=>
1{s.setTouched(!0),s.setValue(t)}})]})};var O=n(50533);const w=e=>{let{name:t,label:n,placeholder:i,prefix:a,helpText:l,initialBalance:r}=e;const{t:c}=(0,s.$G)(),[,,d]=(0,o.U$)({name:t}),{baseCurrency:p}=(0,u.mJ)();return(0,g.jsxs)(v.Z,{children:[(0,g.jsx)(m.Ki,{name:t,label:n,placeholder:i,prefix:a,helpText:l,required:!0}),!!r&&(0,g.jsxs)(y.Z,{children:[c("prediction.calculation.currentBalance-relevant"),": ",(0,g.jsx)(O.Z,{component:"button",type:"button",fontSize:"inherit",underline:"none",onClick:()=>{d.setValue(r)},children:(0,g.jsx)(m.tA,{value:r,currency:p,inline:!0,hiddenModeChangeDisabled:!0})})]})]})},N=e=>{let{currencySymbol:t,portfolioAverageProfitability:n,portfolioExpectedProfitability:i,initialBalance:a}=e;const{t:l}=(0,s.$G)(),r=(0,o.u6)();return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(x.Z,{component:"legend",children:l("prediction.calculation.header")}),(0,g.jsx)(w,{name:h.currentBalance,label:l("prediction.calculation.currentBalance"),placeholder:l("common.placeholders.numberValue",{value:3e4}),prefix:t,helpText:l("prediction.calculation.currentBalance-tooltip"),initialBalance:a}),(0,g.jsx)(m.Ki,{name:h.monthlySavings,label:l("prediction.calculation.monthlySavings"),placeholder:l("common.placeholders.numberValue",{value:500}),prefix:t,helpText:l("prediction.calculation.monthlySavings-tooltip"),allowNegative:!1,required:!0}),(0,g.jsx)(m.Ki,{name:h.expectedSavingsGrowth,label:l("prediction.calculation.expectedSavingsGrowth"),placeholder:l("common.placeholders.numberValue",{value:5}),prefix:"%",helpText:l("prediction.calculation.expectedSavingsGrowth-tooltip"),allowNegative:!1,required:!0}),(0,g.jsx)(f,{name:h.expectedProfitability,label:l("prediction.calculation.expectedProfitability"),placeholder:l("common.placeholders.numberValue",{value:7}),prefix:"%",helpText:(0,g.jsx)(s.cC,{i18nKey:"prediction.calculation.expectedProfitability-tooltip"}),averageProfitability:{label:l("prediction.calculation.expectedProfitability-portfolioAverage"),value:n},expectedProfitability:{label:l("prediction.calculation.expectedProfitability-portfolioExpected"),value:i}}),(0,g.jsx)(m.J7,{name:h.calculateRetirement,label:l("prediction.calculation.calculateRetire"),checked:r.values.calculateRetirement,onChange:r.handleChange})]})},R=(0,g.jsx)(s.cC,{i18nKey:"prediction.calculation.expectedInflation-tooltip",components:[(0,g.jsx)(m.RA,{href:T.Ew.INFO.INFLATION_TOOLTIP,spaceBefore:!0,sx:{color:"inherit"}},0)]}),E=(0,g.jsx)(s.cC,{i18nKey:"prediction.calculation.retirementProfitability-tooltip"}),V=e=>{let{shown:t}=e;const{t:n}=(0,s.$G)(),i=(0,o.u6)(),{baseCurrency:a}=(0,u.mJ)(),l=(0,p.j)(a);return t?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(P,{name:h.retirementType,label:n("prediction.calculation.retirementType"),options:[{value:r.w.LiveOnPassiveIncome,text:n("prediction.calculation.retirementType-liveOnPassiveIncome")},{value:r.w.LiveOnCapital,text:n("prediction.calculation.retirementType-liveOnCapital")}],helpText:(0,g.jsx)(s.cC,{i18nKey:"prediction.calculation.retirementType-tooltip"})}),(0,g.jsx)(m.Ki,{name:h.monthlySpending,label:n("prediction.calculation.monthlySpending"),placeholder:n("common.placeholders.numberValue",{value:500}),prefix:l,helpText:n("prediction.calculation.monthlySpending-tooltip"),allowNegative:!1,required:!0}),(0,g.jsx)(m.Ki,{name:h.retirementProfitability,label:n("prediction.calculation.retirementProfitability"),placeholder:n("common.placeholders.numberValue",{value:4}),helpText:E,prefix:"%",allowNegative:!1,required:!0}),(0,g.jsx)(m.Ki,{name:h.expectedInflation,label:n("prediction.calculation.expectedInflation"),placeholder:n("common.placeholders.numberValue",{value:3.27}),helpText:R,prefix:"%",allowNegative:!1,required:!0}),i.values.retirementType===r.w.LiveOnPassiveIncome&&(0,g.jsx)(M,{name:h.currentAge,label:n("prediction.calculation.currentAge"),min:T.Zl.minAge,max:T.Zl.maxAge-T.Zl.currentAgeToLifeExpectancyDistanceInYears,helpText:n("prediction.calculation.currentAge-tooltip"),formatValue:e=>n("prediction.format.yearsOld",{count:e})}),i.values.retirementType===r.w.LiveOnCapital&&(0,g.jsx)(C,{fromName:h.currentAge,toName:h.lifeExpectancy,distance:T.Zl.currentAgeToLifeExpectancyDistanceInYears,min:T.Zl.minAge,max:T.Zl.maxAge})]}):null};var I=n(8007);const L=()=>I.Ry().shape({[h.currentBalance]:I.Rx().typeError(T.Bc.OnlyNumbers).max(T.Zl.MaxNumberValue,T.Bc.NotMoreThan(T.Zl.MaxNumberValue)).min(T.Zl.MinNumberValue,T.Bc.NotLessThan(T.Zl.MinNumberValue)).required(T.Bc.Required),[h.monthlySavings]:I.Rx().typeError(T.Bc.OnlyNumbers).max(T.Zl.MaxNumberValue,T.Bc.NotMoreThan(T.Zl.MaxNumberValue)).min(T.Zl.MinSavingsValue,T.Bc.NotLessThan(T.Zl.MinSavingsValue)).required(T.Bc.Required),[h.expectedSavingsGrowth]:I.Rx().typeError(T.Bc.OnlyNumbers).max(T.Zl.MaxPercentValue,T.Bc.NotMoreThan(T.Zl.MaxPercentValue)).min(T.Zl.MinPercentValue,T.Bc.NotLessThan(T.Zl.MinPercentValue)).required(T.Bc.Required),[h.expectedProfitability]:I.Rx().typeError(T.Bc.OnlyNumbers).max(T.Zl.MaxPercentValue,T.Bc.NotMoreThan(T.Zl.MaxPercentValue)).min(T.Zl.MinPercentValue,T.Bc.NotLessThan(T.Zl.MinPercentValue)).required(T.Bc.Required),[h.calculateRetirement]:I.O7(),[h.retirementType]:I.Z_().when(h.calculateRetirement,{is:!0,then:e=>e.oneOf(Object.values(r.w)).required(T.Bc.Required)}),[h.monthlySpending]:I.Rx().when([h.calculateRetirement],{is:e=>e,then:e=>e.typeError(T.Bc.OnlyNumbers).max(T.Zl.MaxNumberValue,T.Bc.NotMoreThan(T.Zl.MaxNumberValue)).min(T.Zl.MinSpendingValue,T.Bc.NotLessThan(T.Zl.MinSpendingValue)).required(T.Bc.Required)}),[h.expectedInflation]:I.Rx().when([h.calculateRetirement],{is:e=>e,then:e=>e.typeError(T.Bc.OnlyNumbers).max(T.Zl.MaxPercentValue,T.Bc.NotMoreThan(T.Zl.MaxPercentValue)).min(T.Zl.MinPercentValue,T.Bc.NotLessThan(T.Zl.MinPercentValue)).required(T.Bc.Required)}),[h.retirementProfitability]:I.Rx().when([h.calculateRetirement],{is:e=>e,then:e=>e.typeError(T.Bc.OnlyNumbers).max(T.Zl.MaxPercentValue,T.Bc.NotMoreThan(T.Zl.MaxPercentValue)).min(T.Zl.MinPercentValue,T.Bc.NotLessThan(T.Zl.MinPercentValue)).required(T.Bc.Required)}),[h.currentAge]:I.Rx().when([h.calculateRetirement],{is:e=>e,then:e=>e.typeError(T.Bc.OnlyNumbers).min(T.Zl.minAge,T.Bc.NotMoreThan(T.Zl.minAge)).max(T.Zl.maxAge,T.Bc.NotLessThan(T.Zl.maxAge)).required(T.Bc.Required)}),[h.lifeExpectancy]:I.Rx().when([h.calculateRetirement,h.retirementType],{is:(e,t)=>e&&t===r.w.LiveOnCapital,then:e=>e.typeError(T.Bc.OnlyNumbers).min(T.Zl.minAge,T.Bc.NotMoreThan(T.Zl.minAge)).max(T.Zl.maxAge,T.Bc.NotLessThan(T.Zl.maxAge)).required(T.Bc.Required).test({name:"prediction-life-expectancy-in-range",message:T.Bc.PredictionLifeExpectancy,test:(e,t)=>
1{const n=t.parent[h.currentAge];return!!e&&e>=n+T.Zl.currentAgeToLifeExpectancyDistanceInYears}})})}),k=e=>{let{onSubmit:t,portfolioAverageProfitability:n,portfolioExpectedProfitability:i,initialBalance:l}=e;const{t:r}=(0,s.$G)(),{baseCurrency:c}=(0,u.mJ)(),x=(0,a.v9)(d.P.getCalculation),h=(0,p.j)(c),v={currentBalance:x.currentBalance,monthlySavings:x.monthlySavings,expectedSavingsGrowth:x.expectedSavingsGrowth,expectedProfitability:x.profitabilityPercent,calculateRetirement:x.calculateRetirement,retirementType:x.predictionType,monthlySpending:x.monthlySpending,currentAge:x.currentAge,lifeExpectancy:x.liveOnCapitalLifeExpectancy,expectedInflation:x.expectedInflation,retirementProfitability:x.retirementProfitability};return(0,g.jsx)(o.J9,{initialValues:v,onSubmit:t,validationSchema:L,enableReinitialize:!0,children:e=>(0,g.jsxs)(m.Gq,{autoComplete:"off",name:"retirement-calculation",id:"retirement-calculation",children:[(0,g.jsx)(N,{currencySymbol:h,portfolioAverageProfitability:n,portfolioExpectedProfitability:i,initialBalance:l}),(0,g.jsx)(V,{shown:e.values.calculateRetirement}),(0,g.jsx)(m.Mm,{formProps:e,label:r("prediction.calculation.calculate")})]})})},q=e=>{let{initialBalance:t,portfolioAverageProfitability:n,portfolioExpectedProfitability:o}=e;const s=(0,a.I0)(),u=i.useCallback((async e=>{const t={startingBalance:e.currentBalance,monthlySavings:e.monthlySavings,savingsGrowthPercent:e.expectedSavingsGrowth,profitabilityPercent:e.expectedProfitability,liveOnPassiveIncome:null,liveOnCapital:null,yearsToForecast:c.zs};e.calculateRetirement&&e.retirementType===r.w.LiveOnPassiveIncome&&(t.liveOnPassiveIncome={monthlySpending:e.monthlySpending,retirementProfitability:e.retirementProfitability,inflationPercent:e.expectedInflation,currentAge:e.currentAge}),e.calculateRetirement&&e.retirementType===r.w.LiveOnCapital&&(t.liveOnCapital={monthlySpending:e.monthlySpending,retirementProfitability:e.retirementProfitability,inflationPercent:e.expectedInflation,currentAge:e.currentAge,lifeExpectancy:e.lifeExpectancy}),s(l.z.loadPrediction(t)),s(l.z.updatePredictionCalculation({currentBalance:e.currentBalance,monthlySavings:e.monthlySavings,expectedSavingsGrowth:e.expectedSavingsGrowth,profitabilityPercent:e.expectedProfitability,calculateRetirement:e.calculateRetirement,predictionType:e.retirementType,monthlySpending:e.monthlySpending,currentAge:e.currentAge,liveOnCapitalLifeExpectancy:e.lifeExpectancy,expectedInflation:e.expectedInflation,retirementProfitability:e.retirementProfitability}))}),[t]);return(0,g.jsx)(k,{onSubmit:u,initialBalance:t,portfolioAverageProfitability:n,portfolioExpectedProfitability:o})}},47318:(e,t,n)=>{n.d(t,{k:()=>T});var i=n(72791),a=n(59434),l=n(47047),r=n(40948),c=n(67538),o=n(98838),s=n(13967),u=n(697),d=n(74624),m=n(1997),p=n(36740),x=n(74204),h=n(74568),v=n(20890),y=n(36314),g=n(80184);const b=e=>{let{label:t,returns:n,savings:i,info:a,currency:l}=e;const{t:r}=(0,m.$G)(),c=(0,s.Z)();if(!a)return null;const{base:o}=c.palette.charts.colors,u=[o.cornflower,o.padua];return(0,g.jsxs)(p.h7,{children:[(0,g.jsx)(v.Z,{fontWeight:"bold",fontSize:"inherit",children:t}),a.age&&(0,g.jsxs)(p.Q5,{children:[r("prediction.chart.currentAge"),": ",r("prediction.format.yearsOld",{count:a.age})]}),(0,g.jsxs)(y.Z,{direction:"row",alignItems:"center",spacing:1,children:[(0,g.jsxs)(p.Q5,{children:[r("common.total"),":"]}),(0,g.jsx)(p.tA,{value:n+i,currency:l,decimalOutput:"none"})]}),(0,g.jsxs)(y.Z,{direction:"row",alignItems:"center",spacing:1,children:[(0,g.jsx)(h.Z,{fontSize:"small",sx:{color:u[1]}}),(0,g.jsxs)(p.Q5,{children:[r("prediction.chart.returns"),":"]}),(0,g.jsx)(p.tA,{value:n,currency:l,decimalOutput:"none"})]}),(0,g.jsxs)(y.Z,{direction:"row",alignItems:"center",spacing:1,children:[(0,g.jsx)(h.Z,{fontSize:"small",sx:{color:u[0]}}),(0,g.jsxs)(p.Q5,{children:[r("prediction.chart.savings"),":"]}),(0,g.jsx)(p.tA,{value:i,currency:l,decimalOutput:"none"})]}),!!a.monthlySaving&&(0,g.jsxs)(y.Z,{direction:"row",alignItems:"center",spacing:1,children:[(0,g.jsxs)(p.Q5,{children:[r("prediction.calculation.monthlySavings"),":"]}),(0,g.jsx)(p.tA,{value:a.monthlySaving,currency:l,decimalOutput:"none"})]}),(0,g.jsxs)(y.Z,{direction:"row",alignItems:"center",spacing:1,children:[(0,g.jsxs)(p.Q5,{children:[r("prediction.chart.monthlyChanges-passiveIncome"),":"]}),(0,g.jsx)(p.tA,{value:a.averageMonthlyReturn,currency:l,decimalOutput:"none",isHighlighted:!0})]}),(0,g.jsxs)(y.Z,{direction:"row",alignItems:"center",spacing:1,children:[a.averageMonthlyBalanceChange>=0&&(0,g.jsxs)(p.Q5,{children:[r("prediction.chart.monthlyChanges-increaseCapital"),":"]}),a.averageMonthlyBalanceChange<0&&(0,g.jsxs)(p.Q5,{children:[r("prediction.chart.monthlyChanges-decreaseCapital"),":"]}),(0,g.jsx)(p.tA,{value:a.averageMonthlyBalanceChange,currency:l,decimalOutput:"none",isHighlighted:!0})]}),!!a.retirementMonthlySpending&&(0,g.jsxs)(y.Z,{direction:"row",alignItems:"center",spacing:1,children:[(0,g.jsxs)(p.Q5,{children:[r("prediction.chart.monthlySpending-calculated"),":"]}),(0,g.jsx)(p.tA,{value:a.retirementMonthlySpending,currency:l,decimalOutput:"none"})]})]})},f=i.memo(b),j=(e,t)=>({axis:"x",legendOrientation:"vertical",legendPosition:"top-right",value:new Date(Number(e),0,1),lineStyle:{stroke:t,strokeWidth:1}}),P=(e,t)=>e?[j(e,t)]:[],Z=e=>{var t;
1let{chartData:n,savings:a,returns:l,info:r,metadata:c,isHiddenMode:o,currency:h}=e;const{t:v}=(0,m.$G)(),y=(0,s.Z)(),b=(0,x.$z)(),{base:j}=y.palette.charts.colors,Z=[j.cornflower,j.padua],S=y.palette.orange.retire,T=i.useMemo((()=>{var e;return((e,t,n)=>({axisLeft:e?null:{tickSize:0,format:" >-.3s",ticksPosition:"before"},axisBottom:{tickSize:0,tickPadding:10,tickRotation:0,format:"%Y"},margin:{top:0,right:0,bottom:30,left:e?20:40},markers:P(t,n)}))(o,null===c||void 0===c||null===(e=c.retirePoint)||void 0===e?void 0:e.year,S)}),[o,null===c||void 0===c||null===(t=c.retirePoint)||void 0===t?void 0:t.year,S]),B=!(null===c||void 0===c||!c.retirePoint),A=i.useMemo((()=>[{key:"0",label:v("prediction.chart.savings"),color:Z[0]},{key:"1",label:v("prediction.chart.returns"),color:Z[1]},...B?[{key:"2",label:v("prediction.chart.retirement"),color:S}]:[]]),[B,Z,S]),C=i.useMemo((()=>Math.min(Math.min(...Object.values(a)),Math.min(...Object.values(l)))),[a,l]),M=i.useMemo((()=>Math.max(...Object.values(a))+Math.max(...Object.values(l))),[a,l]);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(u.Z,{height:500,children:(0,g.jsx)(d.fH,{data:n,colors:Z,pointBorderColor:{from:"serieColor"},pointColor:"white",margin:T.margin,xScale:{type:"time",format:"%Y",precision:"year",useUTC:!1},yScale:{type:"linear",min:C<0?1.15*C:0,max:1.15*M,stacked:!0},yFormat:" >-.3s",xFormat:"time:%Y",curve:"monotoneX",axisBottom:T.axisBottom,axisLeft:T.axisLeft,pointSize:0,pointLabelYOffset:-12,pointBorderWidth:0,enableArea:!0,useMesh:!0,markers:T.markers,motionConfig:"slow",enableCrosshair:!0,crosshairType:"x",enableSlices:"x",theme:b,sliceTooltip:e=>{const[t,n]=e.slice.points,i=t.data.xFormatted,c=n.data.xFormatted;return(0,g.jsx)(f,{label:i,savings:a[c],returns:l[i],info:r[i],currency:h})}})}),(0,g.jsx)(u.Z,{sx:{pt:1},children:(0,g.jsx)(p.De,{items:A})})]})},S=i.memo(Z),T=()=>{const{baseCurrency:e}=(0,c.mJ)(),{isHiddenMode:t}=(0,i.useContext)(r.J6),n=(0,a.v9)(o.P.getMetadata),s=(0,a.v9)(o.P.getPredictionChartData),u=(0,a.v9)(o.P.getPredictionSavings),d=(0,a.v9)(o.P.getPredictionReturns),m=(0,a.v9)(o.P.getPredictionInfo);return(0,a.v9)(o.P.isFirstTimeLoading)?(0,g.jsx)(l.Z,{height:500,variant:"rectangular"}):(0,g.jsx)(S,{chartData:s,savings:u,returns:d,info:m,metadata:n,isHiddenMode:t,currency:e})}},10157:(e,t,n)=>{n.d(t,{q:()=>M});var i=n(72791),a=n(59434),l=n(98838),r=n(61889),c=n(1997),o=n(67538),s=n(36740),u=n(57621),d=n(39504),m=n(20890),p=n(66934),x=n(80184);const h=()=>(0,x.jsx)(m.Z,{fontSize:"inherit",letterSpacing:2,children:"----"}),v=(0,p.ZP)(u.Z)((e=>{let{theme:t}=e;return{backgroundColor:t.palette.primary.main,color:t.palette.primary.contrastText}})),y=e=>{let{label:t,value:n}=e;return(0,x.jsx)(v,{variant:"outlined",children:(0,x.jsxs)(d.Z,{children:[(0,x.jsxs)(s.Dy,{children:[t,":"]}),n?(0,x.jsx)(m.Z,{fontSize:32,fontWeight:700,children:n}):(0,x.jsx)(h,{})]})})},g=i.memo(y),b=(0,p.ZP)(m.Z)((e=>{let{theme:t}=e;return{color:t.palette.text.secondary,fontSize:"inherit"}})),f=(0,p.ZP)(r.ZP)({overflow:"hidden",textOverflow:"ellipsis"}),j=(0,p.ZP)(r.ZP)((e=>{let{theme:t}=e;return{fontSize:t.typography.textPrimary.fontSize,padding:t.spacing(1)}})),P=e=>{let{items:t}=e;return(0,x.jsx)(j,{container:!0,spacing:2,children:t.map((e=>(0,x.jsxs)(i.Fragment,{children:[(0,x.jsx)(r.ZP,{item:!0,xs:7,children:(0,x.jsxs)(b,{children:[e.label,":"]})}),(0,x.jsx)(f,{item:!0,xs:5,children:e.value?e.value:(0,x.jsx)(h,{})})]},e.label)))})},Z=i.memo(P),S=()=>{var e;const{t:t}=(0,c.$G)(),{baseCurrency:n}=(0,o.mJ)(),i=(0,a.v9)(l.P.getPredictionSavings),u=(0,a.v9)(l.P.getPredictionReturns),d=(0,a.v9)(l.P.getCalculation),m=(new Date).getFullYear(),p=d.currentBalance,h=i[m+10]+u[m+10],v=i[m+20]+u[m+20],y=Math.trunc(p/1e6),g=1e6*(y+1),b=null!==(e=Object.keys(i).map((e=>Number(e))).find((e=>i[e]+u[e]>g)))&&void 0!==e?e:0;return(0,x.jsxs)(r.ZP,{container:!0,spacing:2,children:[(0,x.jsx)(r.ZP,{item:!0,xs:12,sm:4,children:(0,x.jsx)(Z,{items:[{label:t("prediction.notice.balance"),value:(0,x.jsx)(s.tA,{value:p,currency:n,decimalOutput:"none"})},{label:t("prediction.notice.balance-in10Years"),value:(0,x.jsx)(s.tA,{value:h,currency:n,decimalOutput:"none"})},{label:t("prediction.notice.balance-in20Years"),value:(0,x.jsx)(s.tA,{value:v,currency:n,decimalOutput:"none"})}]})}),(0,x.jsx)(r.ZP,{item:!0,xs:12,sm:4,children:(0,x.jsx)(Z,{items:[{label:t("prediction.calculation.monthlySavings"),value:(0,x.jsx)(s.tA,{value:d.monthlySavings,currency:n,decimalOutput:"none"})},{label:t("prediction.calculation.yearlySavings"),value:(0,x.jsx)(s.tA,{value:12*d.monthlySavings,currency:n,decimalOutput:"none"})},{label:t("prediction.calculation.expectedProfitability"),value:(0,x.jsx)(s.gG,{value:d.profitabilityPercent,isHighlighted:!0})}]})}),(0,x.jsx)(r.ZP,{item:!0,xs:12,sm:4,children:b>m&&(0,x.jsx)(Z,{items:[{label:t("prediction.notice.nThMillion",{million:y+1}),value:(0,x.jsx)(x.Fragment,{children:t("prediction.format.years_one",{c
1ount:b})})}]})})]})};var T=n(94070),B=n(763),A=n(96599);const C=()=>{var e,t,n;const{t:i}=(0,c.$G)(),{baseCurrency:u}=(0,o.mJ)(),d=(0,a.v9)(l.P.getMetadata),m=(0,a.v9)(l.P.getPredictionSavings),p=(0,a.v9)(l.P.getPredictionReturns),h=(0,a.v9)(l.P.getCalculation),v=h.currentBalance,y=null!==d&&void 0!==d&&d.retirePointReached?i("prediction.notice.ageOf",{count:d.retirePoint.age}):null,b=null!==d&&void 0!==d&&null!==(e=d.retirePoint)&&void 0!==e&&e.year?m[d.retirePoint.year]+p[d.retirePoint.year]:null,f=null===d||void 0===d||null===(t=d.retirePoint)||void 0===t?void 0:t.year,j=null!==d&&void 0!==d&&null!==(n=d.retirePoint)&&void 0!==n&&n.month?i("common.month",{date:new Date(2e3,d.retirePoint.month-1,1)}):null,P=Object.keys(m),S=(0,B.last)(P),C=S&&m[S]+p[S]===0,M=!0===(null===d||void 0===d?void 0:d.retirePointReached)&&h.predictionType===A.w.LiveOnCapital&&!C;return(0,x.jsxs)(r.ZP,{container:!0,spacing:2,children:[!1===(null===d||void 0===d?void 0:d.retirePointReached)&&(0,x.jsx)(r.ZP,{item:!0,xs:12,children:(0,x.jsx)(T.Z,{color:"warning",children:i("prediction.notice.retirementNotification-notReached")})}),M&&(0,x.jsx)(r.ZP,{item:!0,xs:12,children:(0,x.jsx)(T.Z,{color:"info",children:i("prediction.notice.retirementNotification-metAlready")})}),(0,x.jsx)(r.ZP,{item:!0,xs:12,sm:4,children:(0,x.jsx)(g,{label:i("prediction.notice.retirementAt-age"),value:y})}),(0,x.jsx)(r.ZP,{item:!0,xs:12,sm:4,children:(0,x.jsx)(Z,{items:[{label:i("prediction.notice.balance"),value:(0,x.jsx)(s.tA,{value:v,currency:u,decimalOutput:"none"})},{label:i("prediction.notice.balance-whenRetire"),value:b?(0,x.jsx)(s.tA,{value:b,currency:u,decimalOutput:"none"}):null},{label:i("prediction.notice.retirementAt-year"),value:(0,x.jsxs)(x.Fragment,{children:[f,j&&`, ${j}`]})}]})}),(0,x.jsx)(r.ZP,{item:!0,xs:12,sm:4,children:(0,x.jsx)(Z,{items:[{label:i("prediction.calculation.monthlySavings"),value:(0,x.jsx)(s.tA,{value:h.monthlySavings,currency:u,decimalOutput:"none"})},{label:i("prediction.calculation.yearlySavings"),value:(0,x.jsx)(s.tA,{value:12*h.monthlySavings,currency:u,decimalOutput:"none"})},{label:i("prediction.calculation.expectedProfitability"),value:(0,x.jsx)(s.gG,{value:h.profitabilityPercent,isHighlighted:!0})}]})})]})},M=()=>(0,a.v9)(l.P.getCalculation).calculateRetirement?(0,x.jsx)(C,{}):(0,x.jsx)(S,{})},67207:(e,t,n)=>{n.d(t,{m:()=>o});n(72791);var i=n(94070),a=n(1997),l=n(36740),r=n(68802),c=n(80184);const o=()=>(0,c.jsx)(i.Z,{severity:"info",variant:"outlined",children:(0,c.jsx)(a.cC,{i18nKey:"prediction.beta-message",components:{retirementPlannerLink:(0,c.jsx)(l.KT,{to:r.Z5.PUBLIC.RETIREMENT_CALCULATOR})}})})},14850:(e,t,n)=>{n.d(t,{T:()=>x});var i=n(72791),a=n(59434),l=n(763),r=n(43706),c=n(697),o=n(1997),s=n(47881),u=n(98838),d=n(22880),m=n(73099),p=n(80184);const x=()=>{const{t:e}=(0,o.$G)(),t=(0,a.I0)(),n=(0,r.Z)((e=>e.breakpoints.down("mobileLandscape"))),x=(0,a.v9)(u.P.getYearsProjection),h=e=>{t(s.z.updatePredictionProjection(e))},v=i.useMemo((()=>{var t;const n=(0,l.initial)(d.Gk),i=null!==(t=(0,l.last)(d.Gk))&&void 0!==t?t:Number.MAX_VALUE;return[...n.map((t=>({label:e("common.timePeriod.years",{count:t}),value:t,hasAccess:!0}))),{label:e("common.timePeriod.max"),value:i,hasAccess:!0}]}),[d.Gk]);return(0,p.jsx)(c.Z,{sx:{display:"flex",justifyContent:"flex-end"},children:n?(0,p.jsx)(m.P,{value:x,onChange:h,options:v}):(0,p.jsx)(m.n,{value:x,onChange:h,options:v})})}},73099:(e,t,n)=>{n.d(t,{n:()=>p,P:()=>u});var i=n(72791),a=n(697),l=n(24518),r=n(31976),c=n(23786),o=n(85172),s=n(80184);function u(e){var t;const{value:n,onChange:u,options:d,disabled:m}=e,[p,x]=i.useState(null),h=Boolean(p),v=()=>{x(null)},y=i.useMemo((()=>d.find((e=>e.value===n))),[d,n]);return(0,s.jsxs)(a.Z,{children:[(0,s.jsx)(l.Z,{variant:"outlined",size:"small","aria-controls":h?"time-period-menu":void 0,"aria-haspopup":"true","aria-expanded":h?"true":void 0,endIcon:(0,s.jsx)(o.Z,{}),disableElevation:!0,onClick:e=>{x(e.currentTarget)},disabled:m,children:null!==(t=null===y||void 0===y?void 0:y.label)&&void 0!==t?t:n}),(0,s.jsx)(r.Z,{MenuListProps:{"aria-labelledby":"time-period-menu"},anchorEl:p,open:h,onClose:v,children:d.map((e=>(0,s.jsx)(c.Z,{value:e.value,onClick:()=>(e=>{u(e),v()})(e.value),disabled:!e.hasAccess,children:e.label},e.value)))})]})}var d=n(36314),m=n(79671);function p(e){const{value:t,onChange:n,options:a,wrapper:l,disabled:r}=e,c=i.useMemo((()=>a.map((e=>{const a=(0,s.jsx)(m.VQ,{size:"small",label:e.label,onClick:()=>n(e.value),active:e.value===t,disabled:r||!e.hasAccess},e.value);return l?(0,s.jsx)(i.Fragment,{children:l(a,e)},e.value):a}))),[a,t,n,r,l]);return(0,s.jsx)(d.Z,{direction:"row",spacing:1,children:c})}}}]); 2//# sourceMappingURL=4387.924ab0b9.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.