1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1ef54b61-1b9a-4c4e-8243-a8f800c8d91c",e._sentryDebugIdIdentifier="sentry-dbid-1ef54b61-1b9a-4c4e-8243-a8f800c8d91c")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[17528],{17528:(e,t,n)=>{n.d(t,{InvestmentCalculator:()=>k});var a=n(95155),r=n(12115),l=n(52056),s=n(5917),o=n(24033),i=n(35695),c=n(48434),u=n(20292),d=n(22771),m=n(49201);function h(e){var t;let{series:n,mode:l,label:s,className:o="",formatValue:i,formatDate:c}=e,h=(0,r.useId)().replace(/[^a-zA-Z0-9]/g,""),[x,p]=(0,r.useState)(null),f=(0,r.useMemo)(()=>(function(e,t){let n=e.length;if(n<2)return null;let{width:a,height:r,padTop:l,padBottom:s}=t,o=r-l-s,i=Math.max(...e.map(e=>Math.max(e.value,e.contributed))),c=(i>0?i:1)*1.04,u=e=>e/(n-1)*a,d=e=>l+(1-e/c)*o,m=t=>e.map((e,n)=>"".concat(0===n?"M":"L").concat(u(n).toFixed(1),",").concat(d(t(e)).toFixed(1))).join(" "),h=m(e=>e.value),x=m(e=>e.contributed),p=e.map((e,t)=>({p:e,i:t})).reverse().map(e=>{let{p:t,i:n}=e;return"L".concat(u(n).toFixed(1),",").concat(d(t.contributed).toFixed(1))}).join(" "),f=d(0),b="".concat(x," L").concat(u(n-1).toFixed(1),",").concat(f.toFixed(1)," L").concat(u(0).toFixed(1),",").concat(f.toFixed(1)," Z");return{valuePath:h,contribPath:x,areaPath:"".concat(h," ").concat(p," Z"),contribAreaPath:b,baseline:f,max:c,x:u,y:d}})(n,{width:1e3,height:220,padTop:12,padBottom:14}),[n]),b=(0,r.useCallback)(e=>{let t=n.length;if(t<u.dF)return;let a=e.currentTarget.getBoundingClientRect();if(a.width<=0)return;let r=(0,u.mS)({viewX:e.clientX-a.left,count:t,span:a.width});p(e=>e===r?e:r)},[n.length]);if(!f)return null;let{valuePath:v,contribPath:g,areaPath:y,contribAreaPath:j,x:N,y:w}=f,k="fact"===l,P="wiz-savings-clip-".concat(h),C="wiz-savings-gain-".concat(h),F="wiz-savings-contrib-".concat(h),z=null==x?null:null!=(t=n[x])?t:null,M=z&&i?z:null,S=null==x?0:N(x),A=null!=x&&x>(n.length-1)*.6;return(0,a.jsxs)("div",{className:"relative ".concat(o),onPointerMove:b,onPointerLeave:()=>p(null),onPointerCancel:()=>p(null),children:[(0,a.jsx)("style",{children:"\n @keyframes wizSavingsWipe".concat(h," { from { width: 0 } to { width: ").concat(1e3,"px } }\n .wizSavingsWipe").concat(h," { animation: wizSavingsWipe").concat(h," ").concat(d.HG,"ms ").concat(d.ul," both; }\n @media (prefers-reduced-motion: reduce) {\n .wizSavingsWipe").concat(h," { animation: none; width: ").concat(1e3,"px; }\n }\n ")}),(0,a.jsxs)("svg",{viewBox:"0 0 ".concat(1e3," ").concat(220),preserveAspectRatio:"none",role:"img","aria-label":s,className:"h-[150px] w-full sm:h-[200px]",children:[(0,a.jsxs)("defs",{children:[(0,a.jsxs)("linearGradient",{id:C,x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,a.jsx)("stop",{offset:"0%",stopColor:m.zz.gain,stopOpacity:"0.20"}),(0,a.jsx)("stop",{offset:"100%",stopColor:m.zz.gain,stopOpacity:"0.02"})]}),(0,a.jsxs)("linearGradient",{id:F,x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,a.jsx)("stop",{offset:"0%",stopColor:"#FFFFFF",stopOpacity:"0.075"}),(0,a.jsx)("stop",{offset:"100%",stopColor:"#FFFFFF",stopOpacity:"0.025"})]}),(0,a.jsx)("clipPath",{id:P,children:(0,a.jsx)("rect",{x:"0",y:"0",width:1e3,height:220,className:"wizSavingsWipe".concat(h)})})]}),(0,a.jsxs)("g",{clipPath:"url(#".concat(P,")"),children:[(0,a.jsx)("path",{d:j,fill:"url(#".concat(F,")")}),k&&(0,a.jsx)("path",{d:y,fill:"url(#".concat(C,")")}),(0,a.jsx)("path",{d:g,fill:"none",stroke:"var(--border-strong)",strokeWidth:"2",strokeLinecap:"round",vectorEffect:"non-scaling-stroke"}),(0,a.jsx)("path",{d:v,fill:"none",stroke:m.zz.gain,strokeWidth:k?2.5:2,strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:k?void 0:"7 6",vectorEffect:"non-scaling-stroke"})]}),z&&(0,a.jsx)("g",{pointerEvents:"none",children:(0,a.jsx)("line",{x1:S,x2:S,y1:12,y2:206,stroke:"var(--border-strong)",strokeWidth:"1",vectorEffect:"non-scaling-stroke"})})]}),z&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{"aria-hidden":!0,
1className:"pointer-events-none absolute h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:"".concat(S/1e3*100,"%"),top:"".concat(w(z.contributed)/220*100,"%"),background:"var(--border-strong)"}}),(0,a.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute h-2 w-2 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:"".concat(S/1e3*100,"%"),top:"".concat(w(z.value)/220*100,"%"),background:m.zz.gain}})]}),M&&i&&(0,a.jsxs)("div",{className:"pointer-events-none absolute top-1 z-10 rounded-lg border border-theme bg-theme-panel px-2.5 py-1.5",style:{left:"".concat(S/1e3*100,"%"),transform:A?"translateX(calc(-100% - 10px))":"translateX(10px)"},children:[c&&(0,a.jsx)("div",{className:"font-mono text-[10px] tabular-nums text-theme-tertiary",children:c(M.t)}),(0,a.jsx)("div",{className:"mt-0.5 font-mono text-[13px] font-semibold tabular-nums",style:{color:m.zz.gain},children:i(M.value)}),(0,a.jsxs)("div",{className:"font-mono text-[11px] tabular-nums text-theme-tertiary",children:["in ",i(M.contributed)]})]})]})}var x=n(20724),p=n(62559),f=n(34641),b=n(69602);function v(e){let t=e.filter(e=>e&&Number.isFinite(e.t)&&Number.isFinite(e.adjClose)&&e.adjClose>0).sort((e,t)=>e.t-t.t);return t.filter((e,n)=>{let a=t[n-1],r=t[n+1];if(!a||!r)return!0;let l=t=>e.adjClose>4*t.adjClose||4*e.adjClose<t.adjClose;return!(l(a)&&l(r))})}function g(e,t){let n=e.filter(e=>e&&Number.isFinite(e.close)&&e.close>0).map(e=>({t:e.t,adjClose:e.close,close:e.close}));return n.length<2?null:function(e,t){if(!Number.isFinite(t)||t<=0)return null;let n=v(e);if(n.length<2)return null;let a=n[n.length-1],r=a.t-315576e5*t;if(n[0].t>r+3888e6)return null;let l=n[0];for(let e of n)if(Math.abs(e.t-r)<Math.abs(l.t-r)&&(l=e),e.t>r+3888e6)break;let s=(a.t-l.t)/315576e5;return s<=0||l.adjClose<=0?null:((a.adjClose/l.adjClose)**(1/s)-1)*100}(n,t)}function y(e){let t=Math.max(0,Number(e.monthlyAmount)||0),n=Math.max(0,Number(e.years)||0),a=Math.max(0,Number(e.startingAmount)||0),r=Number(e.priceGrowthPctPerYear)||0,l=Math.max(0,Number(e.dividendYieldPctPerYear)||0),s=Math.max(0,Number(e.annualFeePct)||0),o=Math.round(12*n),i=r+(e.reinvestDividends?l:0),c=i-s,u=(1+c/100)**(1/12),d=(1+i/100)**(1/12),m=e.reinvestDividends?0:l/100/12,h=a,x=a,p=0,f=[],b=Date.UTC(1970,0,1);for(let e=1;e<=o;e+=1){if(h=(h+t)*u,x=(x+t)*d,m>0){let e=h*m;p+=e,h-=e,x-=x*m}f.push({t:b+30.4375*e*864e5,contributed:a+t*e,value:h,withoutFees:x})}return{grossTotalReturnPctPerYear:i,netTotalReturnPctPerYear:c,contributions:a+t*o,endValue:h,cashDividendsPaidOut:p,feeCostTotal:Math.max(0,x-h),series:f}}let j=[5,10,15,20,25,30],N=[];function w(e){return"SEK"===e||"NOK"===e||"JPY"===e?{step:100,min:500,max:2e4,start:2e3}:{step:10,min:50,max:2e3,start:200}}function k(e){var t,n,o,c,u,d;let{companies:m,defaultSymbol:f,initialPayload:k}=e,[z,M]=(0,r.useState)("fact"),[S,A]=(0,r.useState)(f),[D,E]=(0,r.useState)((null==k||null==(t=k.bars)?void 0:t.length)?k:null),[Y,L]=(0,r.useState)(!1),[R,W]=(0,r.useState)(0),[I,T]=(0,r.useState)(()=>{var e;let t=(null==k?void 0:k.currency)||(null==(e=m.find(e=>e.symbol===f))?void 0:e.listingCurrency)||null;return t?w(t).start:null}),[V,G]=(0,r.useState)(null),[O,B]=(0,r.useState)(10),[_,X]=(0,r.useState)(7),[K,U]=(0,r.useState)(0),Z=(0,r.useRef)(!1),[H,J]=(0,r.useState)(.4),[q,Q]=(0,r.useState)(!0);(0,r.useEffect)(()=>{!S&&f&&A(f)},[f,S]);let $=(0,r.useMemo)(()=>{var e;return null!=(e=m.find(e=>e.symbol===S))?e:null},[m,S]),ee=(null==D?void 0:D.currency)||(null==$?void 0:$.listingCurrency)||"USD",et=(0,r.useMemo)(()=>w(ee),[ee]),en=(0,r.useCallback)(()=>{if(null==V)return;let e=Number(V);V.trim()&&Number.isFinite(e)&&(ea.current=!0,T(Math.min(et.max,Math.max(et.min,Math.round(e)))))},[V,et.max,et.min]),ea=(0,r.useRef)(!1);(0,r.useEffect)(()=>{ea.current||T(et.start)},[et.start]);let er=(0,r.useRef)((null==k||null==(n=k.bars)?void 0:n.length)?k.symbol:null);(0,r.useEffect)(()=>{if(!S||er.current&&er.current===S&&0===R)return;er.current=null;let e=!0;return E(null),L(!1),fetch("/api/wiz/investment-companies/bars?symbol=".concat(encodeURIComponent(S))).then(e=>e.ok?e.json():Promise.reject(Error(String(e.status)))).then(t=>{e&&E(t)}
1).catch(()=>{e&&L(!0)}),()=>{e=!1}},[S,R]);let el=null!=(o=null==D?void 0:D.bars)?o:N,es=!D&&!Y,eo=(0,r.useMemo)(()=>el.length?function(e){let{amountPerMonth:t}=e;if(!Number.isFinite(t)||t<=0)return null;let n=v(e.bars).filter(t=>(null==e.from||t.t>=e.from)&&(null==e.to||t.t<=e.to));if(n.length<2)return null;let a=n[n.length-1].adjClose,r=0,l=[];for(let e=0;e<n.length;e+=1)r+=t/n[e].adjClose,l.push({t:n[e].t,contributed:t*(e+1),value:r*n[e].adjClose});let s=t*n.length,o=r*a;return{contributions:s,finalValue:o,months:n.length,firstBuyAt:n[0].t,lastBuyAt:n[n.length-1].t,totalReturnPct:(o/s-1)*100,moneyWeightedAnnualPct:function(e,t,n){if(!e.length||!Number.isFinite(n)||n<=0)return null;let a=a=>e.reduce((e,n)=>e+n.amount*(1+a)**((t-n.t)/315576e5),0)-n,r=-.9999,l=10;if(a(-.9999)>0||0>a(l))return null;for(let e=0;e<200;e+=1){let e=(r+l)/2;0>a(e)?r=e:l=e}let s=(r+l)/2;return Number.isFinite(s)?100*s:null}(n.map(e=>({t:e.t,amount:t})),n[n.length-1].t,o),series:l}}({bars:el,amountPerMonth:1,from:Date.now()-315576e5*O}):null,[el,O]),ei=(0,r.useMemo)(()=>eo&&I?{...eo,contributions:eo.contributions*I,finalValue:eo.finalValue*I,series:eo.series.map(e=>({t:e.t,contributed:e.contributed*I,value:e.value*I}))}:null,[eo,I]),ec=(0,r.useMemo)(()=>el.length?(el[el.length-1].t-el[0].t)/315576e5:null,[el]),eu=null!=ec&&O>ec+.1;(0,r.useEffect)(()=>{var e;if(!el.length||Z.current)return;let t=null!=(e=g(el,10))?e:g(el,5);X(null==t?7:Math.round(10*t)/10),U((null==$?void 0:$.dividendYieldPct)==null?0:Math.round(10*$.dividendYieldPct)/10)},[el,null==$?void 0:$.dividendYieldPct]);let ed=(0,r.useMemo)(()=>null==I?null:y({monthlyAmount:I,years:O,priceGrowthPctPerYear:_,dividendYieldPctPerYear:K,reinvestDividends:q,annualFeePct:H}),[I,O,_,K,q,H]),em=(0,r.useMemo)(()=>{if(null==I)return null;let e=e=>y({monthlyAmount:I,years:O,priceGrowthPctPerYear:_,dividendYieldPctPerYear:K,reinvestDividends:q,annualFeePct:e}).endValue;return{low:e(.1),high:e(1.5)}},[I,O,_,K,q]),eh=(0,r.useCallback)(e=>(0,p.vv)(e,ee),[ee]),ex=(0,r.useCallback)(e=>eh(Math.round(e)),[eh]),ep=(0,r.useCallback)(e=>new Date(e).toLocaleDateString("en-GB",{month:"short",year:"numeric"}),[]),ef=(e,t,n)=>a=>{Z.current=!0;let r=Number(a.replace(",","."));Number.isFinite(r)&&e(Math.min(n,Math.max(t,r)))},eb="fact"===z?ei:ed,ev="fact"===z?null!=(c=null==ei?void 0:ei.finalValue)?c:null:null!=(u=null==ed?void 0:ed.endValue)?u:null;return(0,a.jsxs)("section",{className:"mt-6 rounded-2xl border border-theme bg-theme-secondary p-4 sm:p-5",children:[(0,a.jsx)("div",{role:"tablist","aria-label":"Calculator mode",className:"flex gap-1",children:[["fact","What it did"],["model","What it could do"]].map(e=>{let[t,n]=e;return(0,a.jsx)("button",{type:"button",role:"tab","aria-selected":z===t,onClick:()=>M(t),className:"rounded-md px-3.5 py-1.5 text-[12px] font-semibold transition-colors duration-150 ease-out motion-reduce:transition-none focus:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--wiz-focus)] ".concat(z===t?"bg-[color:var(--wiz-green-soft-bg)] text-[color:var(--wiz-green-text)]":"text-theme-tertiary hover:bg-theme-overlay-hover hover:text-theme-primary"),children:n},t)})}),Y&&"fact"===z&&(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(x.h,{message:"Couldnât load this companyâs history just now.",onRetry:()=>W(e=>e+1)})}),(0,a.jsxs)("div",{className:"mt-4",children:[es&&"fact"===z?(0,a.jsx)("span",{className:"inline-block h-[38px] w-52 animate-pulse rounded bg-theme-elevated sm:h-[52px]","aria-label":"Loading"}):null==ev?(0,a.jsx)("p",{className:"font-mono text-[34px] font-semibold leading-none tabular-nums text-theme-tertiary sm:text-[48px]",children:"â"}):(0,a.jsx)("p",{className:"font-mono text-[34px] font-semibold leading-none tabular-nums text-theme-primary sm:text-[48px]",children:ex(ev)}),(0,a.jsxs)("p",{className:"mt-2 text-[13px] text-theme-secondary",children:[null==I?"":eh(I)," a month","fact"===z&&$?" into ".concat($.name):""," for ",O," years"]}),"fact"===z&&ei&&(0,a.jsxs)("p",{className:"mt-1 font-mono text-[12px] tabular-nums text-theme-tertiary",children:["Paid in ",ex(ei.contributions),null!=ei.moneyWeightedAnnualPct&&" \xb7 ".concat(ei.moneyWeightedAnnualPct.toFixed(1),"% a year"),(null==D?void 0:D.dataState)==="stale"&&D.historyAsOf?" \xb7 as of ".concat(D.historyAsOf.slice(0,10)):""]}),"model"===z&&ed&&(0,a.jsxs)("p",{className:"mt-1 font-mono text-[12px] tabular-nums text-theme-tertiary",children:["Paid in ",ex(ed.contributions)," \xb7 a guess, not a record"]})]}),"fact"===z&&eu&&(null==D?void 0:D.historyStartAt)&&(0,a.jsxs)("p",{className:"mt-3 flex items-start gap-1.5 text-[11px] leading-snug text-theme-tertiary",children:[(0,a.jsx)(l.A,{className:"mt-px h-3 w-3 shrink-0","aria-hidden":!0}),(0,a.jsxs)("span",{children:[null==$?void 0:$.name," has been listed since ",D.historyStartAt.slice(0,7),", so this covers ",ec?Math.floor(ec):0," years, not ",O,"."]})]}),(0,a.jsx)("div",{className:"mt-4",children:"fact"===z&&ei?(0,a.jsx)(h,{mode:"fact",series:ei.series,formatValue:eh,formatDate:ep,label:"".concat(null!=(d=null==$?void 0:$.name)?d:"This company",": ").concat(eh(null!=I?I:0)," a month grew from ").concat(eh(ei.contributions)," paid in to ").concat(eh(ei.finalValue)," over ").concat(O," years.")}):"model"===z&&ed?(0,a.jsx)(h,{mode:"model",series:ed.series,formatValue:eh,formatDate:ep,label:"A projection: ".concat(eh(null!=I?I:0)," a month at ").concat(ed.netTotalReturnPctPerYear.toFixed(1),"% a year after fees would reach ").concat(eh(ed.endValue)," in ").concat(O," years.")}):(0,a.jsx)("div",{className:"h-[150px] w-full rounded-xl bg-theme-elevated sm:h-[200px]","aria-hidden":!0})}),(0,a.jsxs)("div",{className:"mt-5 grid gap-4 sm:grid-cols-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-1 flex items-baseline justify-between gap-3",children:[(0,a.jsx)("span",{className:"text-[11px] text-theme-tertiary",children:"Every month"}),(0,a.jsxs)("span",{className:"flex items-baseline gap-1.5",children:[(0,a.jsx)("input",{type:"text",inputMode:"numeric",value:null!=V?V:null==I?"":String(I),onChange:e=>G(e.target.value.replace(/[^\d]/g,"")),onBlur:()=>{en(),G(null)},onKeyDown:e=>{"Enter"===e.key&&e.currentTarget.blur()},"aria-label":"Amount saved every month",className:"w-[7ch] rounded-lg border border-theme bg-theme-tertiary px-2 py-1 text-right font-mono text-[16px] font-semibold tabular-nums text-theme-primary transition-colors duration-150 ease-out motion-reduce:transition-none hover:border-[color:var(--border-strong)] focu
1s:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--wiz-focus)] sm:text-[13px]"}),(0,a.jsx)("span",{className:"font-mono text-[11px] text-theme-tertiary",children:ee})]})]}),(0,a.jsx)(i.m,{value:null!=I?I:et.start,min:et.min,max:et.max,step:et.step,onChange:e=>{ea.current=!0,T(e)},ariaLabel:"Amount saved every month"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"mb-1 block text-[11px] text-theme-tertiary",children:"For"}),(0,a.jsx)("div",{className:"grid grid-cols-6 gap-1 sm:flex sm:flex-wrap sm:gap-1.5",children:j.map(e=>(0,a.jsxs)("button",{type:"button","aria-pressed":O===e,onClick:()=>B(e),className:"rounded-md px-1 py-1.5 text-center text-[12px] font-semibold tabular-nums transition-colors duration-150 ease-out motion-reduce:transition-none focus:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--wiz-focus)] sm:px-3 ".concat(O===e?"bg-[color:var(--wiz-green-soft-bg)] text-[color:var(--wiz-green-text)]":"text-theme-tertiary hover:bg-theme-overlay-hover hover:text-theme-primary"),children:[e," yr"]},e))})]})]}),"fact"===z?(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsx)("span",{className:"mb-1 block text-[11px] text-theme-tertiary",children:"Into"}),(0,a.jsx)(F,{companies:m,symbol:S,onPick:A})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"mt-4 grid grid-cols-3 gap-2",children:[(0,a.jsx)(P,{label:"Growth",value:_,onChange:ef(X,-50,50)}),(0,a.jsx)(P,{label:"Dividend",value:K,onChange:ef(U,0,30)}),(0,a.jsx)(P,{label:"Fee",value:H,onChange:ef(J,0,5)})]}),(0,a.jsxs)("button",{type:"button",role:"switch","aria-checked":q,onClick:()=>{(0,b.g)("select"),Q(e=>!e)},className:"mt-3 flex items-center gap-2 text-[12px] text-theme-secondary transition-colors hover:text-theme-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--wiz-focus)]",children:[(0,a.jsx)("span",{className:"flex h-4 w-4 items-center justify-center rounded border transition-colors ".concat(q?"border-transparent bg-[color:var(--wiz-green)]":"border-[color:var(--border-strong)]"),children:q&&(0,a.jsx)(s.A,{className:"h-3 w-3",style:{color:"var(--wiz-on-green)"},"aria-hidden":!0})}),"Buy more with the dividends"]}),ed&&(0,a.jsxs)("p",{className:"mt-3 font-mono text-[12px] tabular-nums text-theme-secondary",children:[_.toFixed(1),"%",q?" + ".concat(K.toFixed(1),"%"):"",H>0?" â ".concat(H.toFixed(1),"%"):""," = ",(0,a.jsxs)("span",{className:"font-semibold text-theme-primary",children:[ed.netTotalReturnPctPerYear.toFixed(1),"% a year"]}),!q&&ed.cashDividendsPaidOut>0&&(0,a.jsxs)("span",{className:"text-theme-tertiary",children:[" ","\xb7 ",eh(ed.cashDividendsPaidOut)," paid out as cash"]})]}),em&&(0,a.jsxs)("div",{className:"mt-4 grid grid-cols-2 gap-2",children:[(0,a.jsx)(C,{label:"At ".concat("0.1","% a year"),value:eh(em.low),strong:!0}),(0,a.jsx)(C,{label:"At ".concat("1.5","% a year"),value:eh(em.high)})]})]}),null==eb&&!es&&!Y&&(0,a.jsx)("p",{className:"mt-4 text-[11px] text-theme-tertiary",children:"Pick a company and an amount to see the number."})]})}function P(e){let{label:t,value:n,onChange:r}=e;return(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1 block text-[11px] text-theme-tertiary",children:t}),(0,a.jsxs)("span",{className:(0,c.hd)({compact:!0}),children:[(0,a.jsx)("input",{type:"text",inputMode:"decimal",value:String(n),onChange:e=>r(e.target.value),"aria-label":"".concat(t,", percent per year"),className:(0,c.ty)({numeric:!0,alignRight:!0})}),(0,a.jsx)("span",{className:"shrink-0 text-[11px] text-theme-tertiary",children:"%"})]})]})}function C(e){let{label:t,value:n,strong:r=!1}=e;return(0,a.jsxs)("div",{className:"rounded-xl bg-theme-elevated px-3 py-2.5",children:[(0,a.jsx)("p",{className:"text-[11px] text-theme-tertiary",children:t}),(0,a.jsx)("p",{className:"mt-0.5 font-mono text-[15px] tabular-nums ".concat(r?"font-semibold text-theme-primary":"text-theme-secondary"),children:n})]})}function F(e){var t,n;let{companies:l,symbol:s,onPick:i}=e,[c,u]=(0,r.useState)(!1),d=null!=(t=l.find(e=>e.symbol===s))?t:null;return(0,r.useEffect)(()=>
1{if(!c)return;let e=e=>{"Escape"===e.key&&u(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[c]),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>u(e=>!e),"aria-haspopup":"listbox","aria-expanded":c,className:"flex w-full items-center gap-2 rounded-md border border-theme bg-theme-elevated px-3 py-2.5 text-left text-[13px] font-semibold text-theme-primary transition-colors duration-150 ease-out motion-reduce:transition-none hover:border-[color:var(--border-strong)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--wiz-focus)] sm:w-auto sm:min-w-[240px]",children:[d&&(0,a.jsx)(f.AssetIcon,{symbol:d.symbol,size:"xs",profile:!1}),(0,a.jsx)("span",{className:"mr-auto truncate",children:null!=(n=null==d?void 0:d.name)?n:"Pick a company"}),(0,a.jsx)(o.A,{className:"h-4 w-4 shrink-0 text-theme-tertiary transition-transform ".concat(c?"rotate-180":""),"aria-hidden":!0})]}),c&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button","aria-hidden":!0,tabIndex:-1,onClick:()=>u(!1),className:"fixed inset-0 z-30 cursor-default"}),(0,a.jsx)("ul",{role:"listbox",className:"absolute left-0 z-40 mt-1 max-h-[280px] w-full min-w-[240px] overflow-y-auto rounded-lg border border-theme bg-theme-elevated py-1 shadow-2xl sm:w-auto",children:l.map(e=>(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",role:"option","aria-selected":e.symbol===s,onClick:()=>{i(e.symbol),u(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-[13px] transition-colors hover:bg-theme-overlay-hover ".concat(e.symbol===s?"text-theme-primary":"text-theme-secondary"),children:[(0,a.jsx)(f.AssetIcon,{symbol:e.symbol,size:"xs",profile:!1}),(0,a.jsx)("span",{className:"truncate",children:e.name}),(0,a.jsx)("span",{className:"ml-auto shrink-0 font-mono text-[11px] text-theme-tertiary",children:e.symbol})]})},e.symbol))})]})]})}},22771:(e,t,n)=>{n.d(t,{C2:()=>s,HG:()=>a,t8:()=>l,ul:()=>r});let a=900,r="cubic-bezier(0.22, 0.61, 0.36, 1)";function l(e){return{isAnimationActive:!e,animationDuration:a,animationEasing:"ease-out"}}function s(e,t){let n;if(!e||t||"function"!=typeof e.animate)return null;try{n=e.animate([{clipPath:"inset(0 100% 0 0)",opacity:.4},{clipPath:"inset(0 0 0 0)",opacity:1}],{duration:a,easing:r,fill:"both"})}catch(e){return null}return()=>{try{n.cancel()}catch(e){}}}}}]);
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.