1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8135],{19202:(e,r,t)=>{t.d(r,{m:()=>a});function a(){let e,{years:r=10,monthlyContribution:t=0,start:a=0,paths:n=400,seed:s=777,mu:i=.072,sigma:o=.16}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=12*r,d=1/12*(i-o*o/2),u=o*Math.sqrt(1/12),c=(e=s>>>0,function(){e|=0;let r=Math.imul((e=e+0x6d2b79f5|0)^e>>>15,1|e);return(((r=r+Math.imul(r^r>>>7,61|r)^r)^r>>>14)>>>0)/0x100000000}),m=[];for(let e=0;e<n;e+=1){let e=a,r=[e];for(let a=1;a<=l;a+=1)e=e*Math.exp(d+u*function(e){let r=0,t=0;for(;0===r;)r=e();for(;0===t;)t=e();return Math.sqrt(-2*Math.log(r))*Math.cos(2*Math.PI*t)}(c))+t,r.push(e);m.push(r)}let x=(e,r)=>e[Math.min(e.length-1,Math.floor(r*e.length))],p=[];for(let e=0;e<=l;e+=1){let r=m.map(r=>r[e]).sort((e,r)=>e-r);p.push({month:e,year:Math.round(e/12*100)/100,p10:x(r,.1),p25:x(r,.25),median:x(r,.5),p75:x(r,.75),p90:x(r,.9),band1090:x(r,.9)-x(r,.1),band2575:x(r,.75)-x(r,.25)})}return{rows:p,invested:a+t*l,final:p[p.length-1]}}},58135:(e,r,t)=>{t.r(r),t.d(r,{default:()=>L});var a=t(95155),n=t(12115),s=t(77685),i=t(83540),o=t(57046),l=t(94754),d=t(96025),u=t(16238),c=t(50747),m=t(62341),x=t(21374),p=t(70919),h=t(38637),f=t.n(h),g=t(33109),v=t(51154),j=t(86926),b=t(61050),y=t(81031),N=t(32434),w=t(52327),k=t(19202),S=t(17652),M=t(72797);let A=[5,10,20],z=[0,200,500,1e3];function q(e){let{etichetta:r,ariaGruppo:t,ariaLibero:s,opzioni:i,mostra:o,valore:l,onChange:d,min:u,max:c,unita:m,larghezza:x}=e,[p,h]=(0,n.useState)(""),f=!i.includes(l);return(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:r}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1 rounded-lg bg-muted p-1",role:"group","aria-label":t,children:[i.map(e=>(0,a.jsx)("button",{type:"button","aria-pressed":l===e,onClick:()=>{h(""),d(e)},className:(0,j.cn)("rounded-md px-3 py-1 text-xs font-medium tabular-nums transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",l===e?"bg-card text-foreground shadow-sm ring-1 ring-border":"text-muted-foreground hover:text-foreground"),children:o(e)},e)),(0,a.jsxs)("span",{className:(0,j.cn)("flex items-center gap-1 rounded-md border bg-card px-2 py-1 transition-colors",f?"border-brand shadow-sm":"border-muted-foreground/90 focus-within:border-brand"),children:[(0,a.jsx)("input",{type:"text",inputMode:"numeric",value:p,onChange:e=>(function(e){let r=Number(e.replace(",","."));if(""===e.trim()||!Number.isFinite(r))return void h(e);let t=Math.min(c,Math.max(u,Math.round(r)));h(r>c?String(c):e),d(t)})(e.target.value),onBlur:()=>{""!==p.trim()&&h(String(l))},"aria-label":s,placeholder:"â",className:(0,j.cn)(x,"bg-transparent text-xs tabular-nums text-foreground placeholder:text-muted-foreground/70 focus:outline-none")}),(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:m})]})]})]})}function F(e){var r;let{active:t,payload:n}=e,s=(0,S.c3)("MyPortfolios"),i=(0,M.Ym)(),{valuta:o}=(0,w.X)();if(!t||!(null==n?void 0:n.length))return null;let l=null==(r=n[0])?void 0:r.payload;return l?(0,a.jsxs)("div",{className:"rounded-lg border border-border bg-popover/95 px-3 py-2 shadow-md",children:[(0,a.jsx)("p",{className:"mb-1.5 text-xs text-muted-foreground",children:s("advisor.year",{n:Math.round(l.year)})}),(0,a.jsx)("p",{className:"text-sm font-semibold tabular-nums text-brand",children:s("advisor.median",{value:(0,N.S8)(l.median,{currency:o,locale:i})})}),(0,a.jsx)("p",{className:"text-xs tabular-nums text-muted-foreground",children:s("advisor.halfScenarios",{a:(0,N.S8)(l.p25,{currency:o,locale:i}),b:(0,N.S8)(l.p75,{currency:o,locale:i})})}),(0,a.jsx)("p",{className:"text-xs tabular-nums text-muted-foreground",children:s("advisor.nineOfTen",{a:(0,N.S8)(l.p10,{currency:o,locale:i}),b:(0,N.S8)(l.p90,{currency:o,locale:i})})})]}):null}function L(e){let{portfolioId:r="all"}=e,{valuta:t}=(0,w.X)(),h=(0,S.c3)("MyPortfolios"),f=(0,M.Ym)(),[L,R]=(0,n.useState)(10),[C,G]=(0,n.useState)(0),[D,I]=(0,n.useState)(!0),K=(0,n.useMemo)(()=>
1{try{return 0..toLocaleString(f,{style:"currency",currency:t,minimumFractionDigits:0,maximumFractionDigits:0}).replace(/[\d\s\u00a0]/g,"")}catch(e){return"â¬"}},[f,t]),[O,Y]=(0,n.useState)(null),[_,T]=(0,n.useState)(null);(0,n.useEffect)(()=>{let e=!1;return(async()=>{I(!0),Y(null),T(null);try{let i=await (0,y.h)(()=>(0,b.Yt)(r),"proj:".concat(r),{priority:30});if(e)return;if(null==i?void 0:i.success){var t,a,n,s;T({nav:Number(i.nav)||0,mu:null!=(t=i.mu)?t:.072,sigma:null!=(a=i.sigma)?a:.16,seed:null!=(n=i.default_seed)?n:777,paths:null!=(s=i.paths)?s:400,muSource:i.mu_source})}else Y((null==i?void 0:i.error)||h("advisor.projectionUnavailable")),T(null)}catch(r){if(e)return;Y((null==r?void 0:r.message)||h("advisor.projectionUnavailable")),T(null)}finally{e||I(!1)}})(),()=>{e=!0}},[r]);let{rows:W,invested:E,final:H}=(0,n.useMemo)(()=>_?(0,k.m)({years:L,monthlyContribution:C,start:_.nav,paths:_.paths,seed:_.seed,mu:_.mu,sigma:_.sigma}):{rows:[],invested:0,final:{median:0,p10:0,p25:0,p75:0}},[_,L,C]),P=(0,n.useMemo)(()=>{let e=L<=2?1:L<=12?3:6;return W.filter(r=>r.month%e==0)},[W,L]);return(0,a.jsxs)("section",{className:(0,j.cn)((0,s.ai)("piatto"),"p-5"),children:[(0,a.jsx)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-brand/12 text-brand",children:(0,a.jsx)(g.A,{className:"h-4 w-4","aria-hidden":!0})}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("h3",{className:"flex items-baseline gap-2 text-lg font-semibold text-foreground",children:[h("advisor.projGrow"),_?(0,a.jsx)(s.R2,{titolo:h("advisor.projGrow"),children:h("advisor.projMethod",{paths:_.paths,sigma:(100*_.sigma).toLocaleString(f,{minimumFractionDigits:1,maximumFractionDigits:1}),mu:(100*_.mu).toLocaleString(f,{minimumFractionDigits:1,maximumFractionDigits:1})})}):null]}),(0,a.jsx)("p",{className:"mt-0.5 max-w-xl text-sm text-muted-foreground",children:h("advisor.projLead")})]})]})}),D?(0,a.jsx)("div",{className:"flex h-40 items-center justify-center",children:(0,a.jsx)(v.A,{className:"h-5 w-5 animate-spin text-brand"})}):O?(0,a.jsx)("p",{className:"mt-4 text-sm text-destructive",children:O}):_?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"mt-4 flex flex-wrap gap-4",children:[(0,a.jsx)(q,{etichetta:h("advisor.projHorizon"),ariaGruppo:h("advisor.projHorizonAria"),ariaLibero:h("advisor.projHorizonFree"),opzioni:A,mostra:e=>h("advisor.projYears",{n:e}),valore:L,onChange:R,min:1,max:40,unita:h("advisor.projYearsUnit"),larghezza:"w-8"}),(0,a.jsx)(q,{etichetta:h("advisor.projContribution"),ariaGruppo:h("advisor.projContributionAria"),ariaLibero:h("advisor.projContributionFree"),opzioni:z,mostra:e=>0===e?h("advisor.projNone"):"".concat(e," ").concat(K),valore:C,onChange:G,min:0,max:5e4,unita:K,larghezza:"w-14"})]}),(0,a.jsx)("div",{className:"mt-5 h-64 w-full sm:h-72",children:(0,a.jsx)(i.u,{width:"100%",height:"100%",children:(0,a.jsxs)(o.X,{data:P,margin:{top:8,right:4,left:0,bottom:0},children:[(0,a.jsx)(l.d,{stroke:"hsl(var(--border))",strokeOpacity:.4,vertical:!1}),(0,a.jsx)(d.W,{dataKey:"year",type:"number",domain:[0,L],tickFormatter:e=>0===e?h("advisor.projToday"):h("advisor.projYearShort",{n:Math.round(e)}),tick:{fill:"hsl(var(--muted-foreground))",fontSize:11},axisLine:!1,tickLine:!1,minTickGap:30}),(0,a.jsx)(u.h,{orientation:"right",width:56,tickFormatter:e=>"".concat(Math.round(e/1e3),"k"),tick:{fill:"hsl(var(--muted-foreground))",fontSize:11},axisLine:!1,tickLine:!1}),(0,a.jsx)(c.m,{content:(0,a.jsx)(F,{})}),(0,a.jsx)(m.G,{dataKey:"p10",stackId:"wide",stroke:"none",fill:"transparent",isAnimationActive:!1}),(0,a.jsx)(m.G,{dataKey:"band1090",stackId:"wide",stroke:"none",fill:"hsl(var(--brand))",fillOpacity:.12,isAnimationActive:!1}),(0,a.jsx)(m.G,{dataKey:"p25",stackId:"narrow",stroke:"none",fill:"transparent",isAnimationActive:!1}),(0,a.jsx)(m.G,{dataKey:"band2575",stackId:"narrow",stroke:"none",fill:"hsl(var(--brand))",fillOpacity:.22,isAnimationActive:!1}),(0,a.jsx)(x.N,{type:"monotone",dataKey:"median",stroke:"hsl(var(--brand))",strokeWidth:2,dot:!1,isAnimationActive:!1}),(0,a.jsx)(x.N,{type:"monotone",dataKey:"p10",stroke:"hsl(var(--warning))",strokeWidth:1.75,strokeDasharray:"5 4",dot:!1,isAnimationActive:!1}),(0,a.jsx)(p.e,{y:E,stroke:"hsl(var(--muted-foreground))",strokeDasharray:"4 4",label:{value:h("advisor.projInvested"),position:"insideTopLeft",fill:"hsl(var(--muted-foreground))",fontSize:11}})]})})}),(0,a.jsxs)("div",{className:"mt-5 rounded-blocco border border-warning/35 bg-warning/10 p-4",children:[(0,a.jsx)("p",{className:"text-[11px] font-bold uppercase tracking-wide text-warning-testo",children:h("advisor.projWorst")}),(0,a.jsxs)("p",{className:"mt-1 flex flex-wrap items-baseline gap-x-3 gap-y-1",children:[(0,a.jsx)("span",{className:"text-3xl font-black tabular-nums leading-none text-foreground",children:(0,N.S8)(H.p10,{currency:t,locale:f})}),(0,a.jsx)("span",{className:"text-sm text-muted-foreground",children:h("advisor.projOnInvested",{invested:(0,N.S8)(E,{currency:t,locale:f})})}),(0,a.jsxs)("span",{className:(0,j.cn)("text-sm font-bold tabular-nums",(0,N.vd)(H.p10-E)),children:[H.p10-E>=0?"+":"",(0,N.S8)(H.p10-E,{currency:t,locale:f})]})]})]}),(0,a.jsxs)("dl",{className:"mt-3 flex flex-wrap gap-x-8 gap-y-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("dt",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:h("advisor.projNormal")}),(0,a.jsx)("dd",{className:"mt-0.5 text-lg font-semibold tabular-nums text-brand",children:(0,N.S8)(H.median,{currency:t,locale:f})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("dt",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:h("advisor.projBest")}),(0,a.jsx)("dd",{className:"mt-0.5 text-lg font-semibold tabular-nums text-foreground",children:(0,N.S8)(H.p90,{currency:t,locale:f})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("dt",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:h("advisor.projInvested")}),(0,a.jsx)("dd",{className:"mt-0.5 text-lg font-semibold tabular-nums text-foreground",children:(0,N.S8)(E,{currency:t,locale:f})})]})]}),(0,a.jsx)("p",{className:"mt-3 text-sm leading-relaxed text-foreground",children:h("advisor.projSummary",{years:L,p25:(0,N.S8)(H.p25,{currency:t,locale:f}),p75:(0,N.S8)(H.p75,{currency:t,locale:f}),p10:(0,N.S8)(H.p10,{currency:t,locale:f})})}),(0,a.jsx)("p",{className:"mt-2 text-xs leading-relaxed text-muted-foreground",children:h("advisor.projDisclaimer")})]}):(0,a.jsx)("div",{className:"flex h-40 items-center justify-center",children:(0,a.jsx)(v.A,{className:"h-5 w-5 animate-spin text-brand"})})]})}
1q.propTypes={etichetta:f().string.isRequired,ariaGruppo:f().string.isRequired,ariaLibero:f().string.isRequired,opzioni:f().arrayOf(f().number).isRequired,mostra:f().func.isRequired,valore:f().number.isRequired,onChange:f().func.isRequired,min:f().number.isRequired,max:f().number.isRequired,unita:f().string.isRequired,larghezza:f().string.isRequired}}}]);
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.