1import{$ as e,A as t,B as n,C as r,F as i,G as a,I as o,L as s,M as c,N as l,P as u,Q as d,R as f,S as p,V as m,W as h,X as g,Z as _,et as v,j as y,l as b,n as x,rt as S,t as C,z as w}from"./index-DQv37lpF.js";import{t as T}from"./NotFoundView-DRxn-INe.js";import{t as E}from"./LandingArticle-B_hy_oi3.js";var D=18,O=100,ee=1e8,te=1e6,ne=0,k=15;function A(e){if(e==null||e===``)return null;if(typeof e==`number`)return Number.isFinite(e)?e:NaN;if(typeof e==`string`){let t=e.trim();if(t===``)return null;let n=Number(t);return Number.isFinite(n)?n:NaN}return NaN}function j(e,t,n,r){if(n==null||n===``||typeof n==`string`&&n.trim()===``){e.push({field:t,code:`required`,message:`${r} is required.`});return}let i=A(n);if(i===null||Number.isNaN(i)){e.push({field:t,code:`invalid_format`,message:`${r} must be a number.`});return}return i}function M(e){let t=[],n=j(t,`currentAge`,e.currentAge,`Current age`),r=j(t,`retirementAge`,e.retirementAge,`Retirement age`),i=j(t,`currentSavings`,e.currentSavings,`Current savings`),a=j(t,`monthlyContribution`,e.monthlyContribution,`Monthly contribution`),o=j(t,`annualReturnPercent`,e.annualReturnPercent,`Expected annual return`);return n!==void 0&&(!Number.isInteger(n)||n<D||n>O)&&t.push({field:`currentAge`,code:`out_of_range`,message:`Current age must be a whole number between ${D} and ${O}.`}),r!==void 0&&(!Number.isInteger(r)||r<D||r>O)&&t.push({field:`retirementAge`,code:`out_of_range`,message:`Retirement age must be a whole number between ${D} and ${O}.`}),n!==void 0&&Number.isInteger(n)&&n>=D&&n<=O&&r!==void 0&&Number.isInteger(r)&&r>=D&&r<=O&&r<=n&&t.push({field:`retirementAge`,code:`inconsistent`,message:`Retirement age must be greater than current age.`}),i!==void 0&&(i<0||i>ee)&&t.push({field:`currentSavings`,code:`out_of_range`,message:`Current savings must be between 0 and 100,000,000.`}),a!==void 0&&(a<0||a>te)&&t.push({field:`monthlyContribution`,code:`out_of_range`,message:`Monthly contribution must be between 0 and 1,000,000.`}),o!==void 0&&(o<ne||o>k)&&t.push({field:`annualReturnPercent`,code:`out_of_range`,message:`Expected annual return must be between 0 and 15 percent.`}),t.length>0||n===void 0||r===void 0||i===void 0||a===void 0||o===void 0?{ok:!1,code:`validation_failed`,message:`Retirement calculator could not run with the values provided.`,errors:t}:N({currentAge:n,retirementAge:r,currentSavings:i,monthlyContribution:a,annualReturnPercent:o})}function N(e){let t=e.retirementAge-e.currentAge,n=e.annualReturnPercent/100,r=e.monthlyContribution*12,i=[],a=e.currentSavings;for(let o=1;o<=t;o+=1)a=a*(1+n)+r,i.push({age:e.currentAge+o,balance:a});let o=e.currentSavings+r*t,s=i[i.length-1]?.balance??e.currentSavings;return{ok:!0,values:e,yearsUntilRetirement:t,projectedBalance:s,totalContributions:o,growthFromReturns:s-o,yearly:i}}var P=new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,maximumFractionDigits:0});function F(e){return P.format(e)}var I={class:`tool-widget`,"aria-labelledby":`retirement-widget-title`},L={class:`tool-widget__field`},R=[`aria-invalid`],z={key:0,class:`tool-widget__error`,role:`alert`},B={class:`tool-widget__field`},V=[`aria-invalid`],H={key:0,class:`tool-widget__error`,role:`alert`},U={class:`tool-widget__field`},W=[`aria-invalid`],G={key:0,class:`tool-widget__error`,role:`alert`},K={class:`tool-widget__field`},q=[`aria-invalid`],J={key:0,class:`tool-widget__error`,role:`alert`},Y={class:`tool-widget__field`},X=[`aria-invalid`],Z={key:0,class:`tool-widget__error`,role:`alert`},re={key:0,class:`tool-widget__error`,role:`alert`},ie={key:0,class:`tool-widget__results`,role:`status`},ae={class:`tool-widget__summary`},oe=[`aria-expanded`],se={key:0,id:`retirement-yearly-table`,class:`tool-widget__table`},ce={class:`tool-widget__disclaimer`},le=p(m({__name:`RetirementCalculator`,setup(t){let r=d({currentAge:``,retirementAge:``,currentSavings:``,monthlyContribution:``,annualReturnPercent:``}),o=d({}),u=e(``),p=e(null),m=e(!1);function b(e){o.currentAge=``,o.retirementAge=``,o.currentSavings=``,o.monthlyContribution=``,o.annualReturnPercent=``;for(let t of e)o[t.field]=t.message}function x(){let e=M({currentAge:r.currentAge,retirementAge:r.retirementAge,currentSavings:r.currentSavings,monthlyContribution:r.monthlyContribution,annualReturnPercent:r.annualReturnPercent});if(!e.ok){b(e.errors),u.value=e.message,p.value=null;return}b([]),u.value=``,p.value=e}return(e,t)=>(h(),f(`section`,I,[t[19]||=i(`p`,{class:`eyebrow tool-widget__eyebrow`},`Illustration only`,-1),t[20]||=i(`h2`,{id:`retirement-widget-title`,class:`tool-widget__title`},`Retirement calculator`,-1),t[21]||=i(`p`,{class:`tool-widget__intro`},` Estimate how current savings and monthly contributions could grow if returns compounded once a year. This is not a forecast, a plan, or investment advice. `,-1),i(`form`,{class:`tool-widget__form`,novalidate:``,onSubmit:c(x,[`prevent`])},[i(`div`,L,[t[6]||=i(`label`,{for:`retire-current-age`},`Current age`,-1),_(i(`input`,{id:`retire-current-age`,"onUpdate:modelValue":t[0]||=e=>r.currentAge=e,type:`number`,name:`current-age`,min:`18`,max:`100`,step:`1`,required:``,"aria-invalid":!!o.currentAge},null,8,R),[[y,r.currentAge]]),o.currentAge?(h(),f(`p`,z,S(o.currentAge),1)):s(``,!0)]),i(`div`,B,[t[7]||=i(`label`,{for:`retire-retirement-age`},`Retirement age`,-1),_(i(`input`,{id:`retire-retirement-age`,"onUpdate:modelValue":t[1]||=e=>r.retirementAge=e,type:`number`,name:`retirement-age`,min:`18`,max:`100`,step:`1`,required:``,"aria-invalid":!!o.retirementAge},null,8,V),[[y,r.retirementAge]]),o.retirementAge?(h(),f(`p`,H,S(o.retirementAge),1)):s(``,!0)]),i(`div`,U,[t[8]||=i(`label`,{for:`retire-savings`},`Current savings (USD)`,-1),_(i(`input`,{id:`retire-savings`,"onUpdate:modelValue":t[2]||=e=>r.currentSavings=e,type:`number`,name:`current-savings`,min:`0`,step:`1`,required:``,"aria-invalid":!!o.currentSavings},null,8,W),[[y,r.currentSavings]]),o.currentSavings?(h(),f(`p`,G,S(o.currentSavings),1)):s(``,!0)]),i(`div`,K,[t[9]||=i(`label`,{for:`retire-monthly`},`Monthly contribution (USD)`,-1),_(i(`input`,{id:`retire-monthly`,"onUpdate:modelValue":t[3]||=e=>r.monthlyContribution=e,type:`number`,name:`monthly-contribution`,min:`0`,step:`1`,required:``,"aria-invalid":!!o.monthlyContribution},null,8,q),[[y,r.monthlyContribution]]),o.monthlyContribution?(h(),f(`p`,J,S(o.monthlyContribution),1)):s(``,!0)]),i(`div`,Y,[t[10]||=i(`label`,{for:`retire-return`},`Expected annual return (%)`,-1),_(i(`input`,{id:`retire-return`,"onUpdate:modelValue":t[4]||=e=>r.annualReturnPercent=e,type:`number`,name:`annual-return`,min:`0`,max:`15`,step:`0.1`,required:``,"aria-invalid":!!o.annualReturnPercent},null,8,X),[[y,r.annualReturnPercent]]),o.annualReturnPercent?(h(),f(`p`,Z,S(o.annualReturnPercent),1)):s(``,!0)]),t[11]||=i(`button`,{type:`submit`,class:`btn`},`Calculate illustration`,-1),u.value&&!Object.values(o).some(Boolean)?(h(),f(`p`,re,S(u.value),1)):s(``,!0)],32),p.value?(h(),f(`div`,ie,[i(`h3`,null,`Projected balance at age `+S(p.value.values.retirementAge),1),i(`ul`,ae,[i(`li`,null,`Years until retirement: `+S(p.value.yearsUntilRetirement),1),i(`li`,null,`Projected balance: `+S(v(F)(p.value.projectedBalance)),1),i(`li`,null,`Starting savings + contributions: `+S(v(F)(p.value.totalContributions)),1),i(`li`,null,`Growth from assumed returns: `+S(v(F)(p.value.growthFromReturns)),1)]),i(`button`,{type:`button`,class:`tool-widget__table-toggle`,"aria-expanded":m.value,"aria-controls":`retirement-yearly-table`,onClick:t[5]||=e=>m.value=!m.value},S(m.value?`Hide`:`Show`)+` year-by-year table `,9,oe),m.value?(h(),f(`table`,se,[t[12]||=i(`caption`,{class:`visually-hidden`},` Year-by-year illustrated balances `,-1),t[13]||=i(`thead`,null,[i(`tr`,null,[i(`th`,{scope:`col`},`Age`),i(`th`,{scope:`col`},`Balance`)])],-1),i(`tbody`,null,[(h(!0),f(l,null,a(p.value.yearly,e=>(h(),f(`tr`,{key:e.age},[i(`td`,null,S(e.age),1),i(`td`,null,S(v(F)(e.balance)),1)]))),128))])])):s(``,!0)])):s(``,!0),i(`p`,ce,[t[16]||=w(` Illustration only â not advice. Continue with `,-1),n(v(C),{to:`/learn/investment-planning`},{default:g(()=>[...t[14]||=[w(`investment planning`,-1)]]),_:1}
1),t[17]||=w(` or `,-1),n(v(C),{to:`/learn/financial-advisor`},{default:g(()=>[...t[15]||=[w(`talking to a licensed advisor`,-1)]]),_:1}),t[18]||=w(`. `,-1)])]))}}),[[`__scopeId`,`data-v-35ff6a9c`]]),ue=/^[A-Z][A-Z0-9.]{0,9}$/,de=1e-4,Q=1e6;function fe(e){return typeof e==`string`?e.trim().toUpperCase():``}function pe(e){return e===`buy`||e===`sell`}function me(e){let t=[],n=fe(e.ticker);n.length===0?t.push({field:`ticker`,code:`required`,message:`Ticker is required.`}):ue.test(n)||t.push({field:`ticker`,code:`invalid_format`,message:`Enter a ticker using letters and optional numbers or a dot (for example AAPL or BRK.B).`}),e.side===void 0||e.side===null||e.side===``?t.push({field:`side`,code:`required`,message:`Choose buy or sell.`}):pe(e.side)||t.push({field:`side`,code:`invalid_enum`,message:`Side must be buy or sell.`});let r;if(e.quantity===void 0||e.quantity===null||e.quantity===``)t.push({field:`quantity`,code:`required`,message:`Quantity is required.`});else if(typeof e.quantity==`string`){let n=e.quantity.trim();if(n===``)t.push({field:`quantity`,code:`required`,message:`Quantity is required.`});else{let e=Number(n);Number.isFinite(e)?r=e:t.push({field:`quantity`,code:`invalid_format`,message:`Quantity must be a number.`})}}else typeof e.quantity==`number`&&Number.isFinite(e.quantity)?r=e.quantity:t.push({field:`quantity`,code:`invalid_format`,message:`Quantity must be a number.`});if(r!==void 0&&(r<=0||r>Q?t.push({field:`quantity`,code:`out_of_range`,message:`Quantity must be greater than 0 and at most ${Q.toLocaleString(`en-US`)}.`}):r<de&&t.push({field:`quantity`,code:`out_of_range`,message:`Quantity is too small to evaluate.`})),t.length>0)return{ok:!1,code:`validation_failed`,message:`Trade Checker preview could not run with the values provided.`,errors:t};let i={ticker:n,side:e.side,quantity:r};return{ok:!0,values:i,items:he(i)}}function he(e){let t=e.side===`buy`?`adding`:`reducing`,n=e.side===`buy`?`a larger`:`a smaller`;return[{id:`portfolio-impact`,title:`Portfolio impact`,body:`Ask how ${t} ${e.quantity} share${e.quantity===1?``:`s`} of ${e.ticker} would change position size, cash, and overall allocation before you act.`},{id:`diversification`,title:`Diversification`,body:`Check whether this ${e.side} concentrates you further in one name â or whether ${n} ${e.ticker} weight would leave a gap the rest of the book does not cover.`},{id:`sector-concentration`,title:`Sector concentration`,body:`Look at sector and industry exposure after the trade. Mutual funds and ETFs can hide the same sector you are about to ${e.side}.`},{id:`risk`,title:`Risk and volatility`,body:`Pressure-test whether the ${e.side} of ${e.ticker} fits your risk tolerance, time horizon, and existing drawdown â not just the last headline.`},{id:`timing`,title:`Timing and process`,body:`Confirm size, timing, and whether you still want the trade after a second look. In the app, AI Trade Checker runs these categories against your linked portfolio.`}]}var ge={class:`tool-widget`,"aria-labelledby":`trade-checker-widget-title`},_e={class:`tool-widget__field`},ve=[`aria-invalid`],ye={key:0,class:`tool-widget__error`,role:`alert`},be={class:`tool-widget__field`},$=[`aria-invalid`],xe={key:0,class:`tool-widget__error`,role:`alert`},Se={class:`tool-widget__field`},Ce=[`aria-invalid`],we={key:0,class:`tool-widget__error`,role:`alert`},Te={key:0,class:`tool-widget__error`,role:`alert`},Ee={key:0,class:`tool-widget__results`,role:`status`},De=[`href`],Oe=p(m({__name:`TradeCheckerWidget`,setup(n){let r=d({ticker:``,side:`buy`,quantity:``}),o=d({}),u=e(``),p=e([]),m=e(``),g=e(`buy`);function x(e){o.ticker=``,o.side=``,o.quantity=``;for(let t of e)o[t.field]=t.message}function C(){let e=me({ticker:r.ticker,side:r.side,quantity:r.quantity});if(!e.ok){x(e.errors),u.value=e.message,p.value=[];return}x([]),u.value=``,p.value=e.items,m.value=e.values.ticker,g.value=e.values.side}return(e,n)=>(h(),f(`section`,ge,[n[8]||=i(`p`,{class:`eyebrow tool-widget__eyebrow`},`Educational preview`,-1),n[9]||=i(`h2`,{id:`trade-checker-widget-title`,class:`tool-widget__title`},`Try the AI Trade Checker checklist`,-1),n[10]||=i(`p`,{class:`tool-widget__intro`},` Enter a ticker, side, and quantity. You will get a structured pre-trade checklist â not live analysis and not personalized advice. `,-1),i(`form`,{class:`tool-widget__form`,novalidate:``,onSubmit:c(C,[`prevent`])},[i(`div`,_e,[n[3]||=i(`label`,{for:`trade-ticker`},`Ticker`,-1),_(i(`input`,{id:`trade-ticker`,"onUpdate:modelValue":n[0]||=e=>
1r.ticker=e,type:`text`,name:`ticker`,autocomplete:`off`,inputmode:`text`,spellcheck:`false`,required:``,"aria-invalid":!!o.ticker},null,8,ve),[[y,r.ticker]]),o.ticker?(h(),f(`p`,ye,S(o.ticker),1)):s(``,!0)]),i(`div`,be,[n[5]||=i(`label`,{for:`trade-side`},`Side`,-1),_(i(`select`,{id:`trade-side`,"onUpdate:modelValue":n[1]||=e=>r.side=e,name:`side`,required:``,"aria-invalid":!!o.side},[...n[4]||=[i(`option`,{value:`buy`},`Buy`,-1),i(`option`,{value:`sell`},`Sell`,-1)]],8,$),[[t,r.side]]),o.side?(h(),f(`p`,xe,S(o.side),1)):s(``,!0)]),i(`div`,Se,[n[6]||=i(`label`,{for:`trade-quantity`},`Quantity`,-1),_(i(`input`,{id:`trade-quantity`,"onUpdate:modelValue":n[2]||=e=>r.quantity=e,type:`number`,name:`quantity`,min:`0.0001`,step:`any`,required:``,"aria-invalid":!!o.quantity},null,8,Ce),[[y,r.quantity]]),o.quantity?(h(),f(`p`,we,S(o.quantity),1)):s(``,!0)]),n[7]||=i(`button`,{type:`submit`,class:`btn`},`Show checklist`,-1),u.value&&!o.ticker&&!o.side&&!o.quantity?(h(),f(`p`,Te,S(u.value),1)):s(``,!0)],32),p.value.length?(h(),f(`div`,Ee,[i(`h3`,null,`Checklist for a `+S(g.value)+` of `+S(m.value),1),i(`ol`,null,[(h(!0),f(l,null,a(p.value,e=>(h(),f(`li`,{key:e.id}
1,[i(`strong`,null,S(e.title),1),i(`p`,null,S(e.body),1)]))),128))]),i(`a`,{class:`btn`,href:v(b),target:`_blank`,rel:`noopener`,"data-analytics-placement":`tool_ai_trade_checker_widget`},` Run the full AI Trade Checker in the app `,8,De)])):s(``,!0),n[11]||=i(`p`,{class:`tool-widget__disclaimer`},` Educational preview only, generated in your browser from the values you enter. The in-app AI Trade Checker analyzes your linked portfolio. This website stores nothing you type and cannot place orders. `,-1)]))}}),[[`__scopeId`,`data-v-35956a6b`]]),ke={key:1,class:`tool-page`},Ae={class:`container`},je=p(m({__name:`ToolPageView`,setup(e){let t=x(),a=u(()=>r(t.path));return(e,t)=>a.value?(h(),f(`div`,ke,[i(`div`,Ae,[n(E,{page:a.value},{widget:g(()=>[a.value.widget===`trade-checker`?(h(),o(Oe,{key:0})):a.value.widget===`retirement-calculator`?(h(),o(le,{key:1})):s(``,!0)]),_:1},8,[`page`])])])):(h(),o(T,{key:0}))}}),[[`__scopeId`,`data-v-c9048dc3`]]);export{je as default};
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.