1try{let 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]="bef4b583-b7e0-4cf9-a60d-54c6bee1c44d",e._sentryDebugIdIdentifier="sentry-dbid-bef4b583-b7e0-4cf9-a60d-54c6bee1c44d")}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5667],{65667:(e,t,o)=>{let r;o.d(t,{A:()=>U});var a=o(37876),n=o(14232),l=o(89099),i=o(78071),s=o(48011),c=o(71776),d=o(19461);let u=(0,s.Ng)(e=>({location:e.router.location,dashboardPortfolioDescription:d.et.dashboardPortfolioDescriptionData(e),dashboardPortfolios:d.et.getAllDashboardPortfolios(e),...d.et.getCustomCompositionData(e,"CUSTOM_USD"),customPortfolioMetadata:d.et.getCustomPortfolioMetadata(e),pendingPortfolioCreation:d.$u.getPendingPortfolioCreation(e),...d.et.getSelectedEtfs(e)}),e=>({getCustomPortfolioMetadata:()=>e(c.s4.getCustomPortfolioMetadata()),setAppliedFilters:t=>e(c.s4.setCustomAppliedFilters(t)),setSelectedEtfs:t=>e(c.s4.addCustomEtfs(t)),getPortfolioData:t=>e(c.s4.getCustomPortfolioDataWithSIPEtfs(t)),getDashboardPortfolioDescriptionData:()=>e(c.s4.getDashboardPortfolioDescriptionData()),setEtfCompositionStatus:t=>e(c.s4.setCustomEtfCompositionStatus(t))}));var f=o(54755),p=o(95706),h=o(24376),m=o(25349),g=o(81444),b=o(82167),C=o(21651),O=o(74222);let E=(0,s.Ng)((e,t)=>({pathname:e.router.location.pathname,editPortfolioData:t=>d.et.getEditPortfolioData(e,t),location:e.router.location,isCompositionEdited:d.et.getSelectedEtfStatus(e),...d.et.getSelectedEtfs(e),customPortfolioMetadata:d.et.getCustomPortfolioMetadata(e)}),e=>({navigate:t=>e((0,O.VC)(t)),goBack:()=>e((0,O.OE)()),setSelectedEtfs:t=>e(c.s4.addCustomEtfs(t)),setEtfCompositionStatus:t=>e(c.s4.setCustomEtfCompositionStatus(t)),savePortfolio:(t,o,r)=>e(c.s4.createPortfolio(t,o,r))}));var T=o(34219),P=o(72131),x=o(96344),D=o(70995);let A="CUSTOM_USD",_=(0,b.Ay)(T.pT).withConfig({componentId:"sc-9936b2c5-0"})(["border-bottom:1px solid rgba(154,171,204,0.1);display:inline-flex;@media (min-width:","){border:none;}"],(0,C.y)("breakpoints.md")),I=E(e=>{let{buttonText:t,customEtfsAllocation:o,navigate:r,location:l,setSelectedEtfs:s,customPortfolioMetadata:c,isCompositionEdited:d,editPortfolioData:u,edit:m,goBack:g}=e,[b,C]=(0,n.useState)(!1),{strings:{general:{add_cta:O,remove_cta:E,confirm_portfolio_cta:I},portfolio_data_page:{custom:{view_portfolio_cta:y,create_portfolio_caption:j,view_all_caption:S,max_allocation_popup:k,empty_allocation_popup:v,max_etf_limit_popup:R}}}}=(0,i.Ym)(),F={VIEW_PORTFOLIO:y,CONFIRM_PORTFOLIO:I,ADD_ETF:O,REMOVE_ETF:E,UPDATE_PORTFOLIO:"Update portfolio"},U=m||(0,f.V8)(l.search,"portfolioId"),w=()=>{let e=(0,f.V8)(l.search,"etf"),{etfs:t,isMaxCount:r}=(0,h.RR)(o,e||"");d||(t={...(0,h.mW)(t)}),s(t),r?C(!0):g()},M=(0,f.V8)(e.location.search,"isActivePortfolio"),V=()=>M&&U?"".concat(p.lUm,"/?portfolioId=").concat(U,"&isActivePortfolio=true"):U?"".concat(p.tjf,"/?portfolioId=").concat(U):"".concat(p.Yly,"/"),B=e=>{if(c&&Object.keys(c).length){let t=c.categories.find(t=>t.name===e);return null==t?void 0:t.displayName}},L=l.pathname.includes(p.lUm),N=!!(t===F.VIEW_PORTFOLIO&&Object.keys(o||{}).length<1),Y=[];for(let e in o)Y.push({symbol:e,value:o[e]});return(0,a.jsxs)(T.mc,{children:[b&&(0,a.jsx)(D.A,{onCtaClick:()=>{C(!1)},text:R.caption}),(0,a.jsx)(x.A,{renderOn:["desktop"],children:(0,a.jsx)(_,{pb:10,pt:{_:6,xl:0},width:"100%",children:(0,a.jsx)(T.az,{color:"BT.2",flex:1,children:(0,a.jsxs)(T.pT,{alignItems:"center",justifyContent:"space-between",children:[(0,a.jsx)(T.EY,{color:"N.1",variant:"h5",children:(()=>{let e="";if(t===F.ADD_ETF)e=((0,f.V8)(l.search,"etf")||"").toUpperCase();else if(t===F.VIEW_PORTFOLIO){let t=(0,f.V8)(l.search,"category");e=t?B(t):S}else if(t===F.CONFIRM_PORTFOLIO)e=j;else{if(L)return"Edit Custom";t===F.UPDATE_PORTFOLIO&&(e="Update Custom")}return e})()}),(0,a.jsx)(T.az,{minWidth:97,ml:"auto",mr:0,children:t===F.CONFIRM_PORTFOLIO||t===F.UPDATE_PORTFOLIO?(0,a.jsx)(P.A,{buttonText:t,etfs:Y,portfolio:U&&u(U),portfolioType:A,updateMode:t===F.UPDATE_PORTFOLIO,confirmRoute:((e,t)=>t?"".concat((0,p.T6u)(A,p.wx5.CONFIRM,!1),"?type=").concat(A,"&portfolioId=").concat(t):"".concat((0,p.T6u)(A,p.wx5.CONFIRM,!1),"?type=").concat(A))(0,U),getEtfPromptText:()=>(0,h.RY)(o,k.caption,v.caption),shouldShowEtfPrompt:()=>(0,h.qF)(o)}
1):(0,a.jsx)(T.$n,{fullWidth:!0,disabled:N,onClick:()=>{t===F.ADD_ETF?w():t===F.VIEW_PORTFOLIO&&r(V())},children:(()=>{if(t===F.ADD_ETF&&o){let e=(0,f.V8)(l.search,"etf");return o.hasOwnProperty(e)?F.REMOVE_ETF:F.ADD_ETF}return t})()})})]})})})})]})}),y=()=>{let{search:e,pathname:t}=(0,s.d4)(e=>e.router.location),o=(0,f.V8)(e,"portfolioId"),{strings:{general:{confirm_portfolio_cta:r}}}=(0,i.Ym)();return(0,a.jsx)(a.Fragment,{children:0>t.indexOf(p.wx5.CONFIRM)?(0,a.jsx)(I,{edit:o,buttonText:o?"Update portfolio":r}):null})};var j=o(67260),S=o(88591),k=o(142);let v=()=>{let{strings:{portfolio_data_page:{custom:{view_portfolio_cta:e}}}}=(0,i.Ym)();return(0,a.jsx)(I,{buttonText:e})},R=()=>{let{strings:{general:{add_cta:e}}}=(0,i.Ym)();return(0,a.jsx)(I,{buttonText:e})},F=(e,t)=>{switch(t){case p.Iq2:return{useAccountContainer:!0,tabletSameAsDesktop:!0,title:"CREATE CUSTOM",iconClickRoute:e?p.oVb:null};case p.RxP:return{useAccountContainer:!0,tabletSameAsDesktop:!0,title:"Investments"};case p.wTy:return{headerComponent:v,useAccountContainer:!0,tabletSameAsDesktop:!1,portfolioType:"CUSTOM_USD",alternativeTitle:"VIEW ALL"};case p.bRX:return{headerComponent:R,useAccountContainer:!0,tabletSameAsDesktop:!1,portfolioType:"CUSTOM_USD",titleQueryKey:"etf",alternativeTitle:"ETF DETAIL"};case p.SBP:case p.nSp:case p.lUm:return{headerComponent:y}}},U=u((0,m.A)(e=>{let{location:t,etfComposition:o,setSelectedEtfs:s,customEtfsAllocation:c,customPortfolioMetadata:d,getPortfolioData:u,setAppliedFilters:m,setEtfCompositionStatus:b,getCustomPortfolioMetadata:C,pendingPortfolioCreation:O,dashboardPortfolioDescription:E,getDashboardPortfolioDescriptionData:P,dashboardPortfolios:x,children:D}=e,A=(0,n.useRef)(null),[_,I]=(0,n.useState)(!1),y=t.pathname.includes(p.lUm),{strings:{portfolio_data_page:{custom:{alert_exit_popup:{caption:v,description_text:R,composition_change_text:U}}}}}=(0,i.Ym)(),w=(0,l.useRouter)(),M=(0,f.Hm)(w),V=e=>{let[t,o]=e.split("?"),r=-1===p.TAX.indexOf(t),a=(0,f.V8)(o,"editPortfolioSuccess"),n=!!c&&Object.keys(c||{}).length>0,l=t.indexOf(p.QcH)>-1;return n&&r&&!l&&!a};if((0,n.useEffect)(()=>{E||P()},[E]),(0,n.useEffect)(()=>{let e=e=>{if(V(e)&&!A.current)throw I(!0),A.current=e,r=()=>w.push(e),w.events.emit("routeChangeError"),w.replace(w.asPath),"routeChange aborted"};return w.events.on("routeChangeStart",e),()=>{w.events.off("routeChangeStart",e)}},[c,w.asPath]),(0,n.useEffect)(()=>()=>{s({}),m({filters:{},sort:{}}),b(!1)},[]),(0,n.useEffect)(()=>{u((0,f.V8)(t.search,"portfolioId"))},[]),(0,n.useEffect)(()=>{d||C()},[]),!d||Object.keys(o||{}).length<1)return(0,a.jsx)(g.k,{});let B=!0;x.length&&(B=(0,h.RO)(x,k.jv.CUSTOM_USD));let{useAccountContainer:L=!1,headerComponent:N,...Y}=F(O,M),W=N?(0,a.jsx)(N,{}):null;return(0,a.jsxs)(a.Fragment,{children:[B&&(0,a.jsx)(S.A,{header:W,children:L?(0,a.jsx)(j.A,{headerComponent:N,...Y,children:D}):D}),_&&(0,a.jsx)(T.QQ,{bg:"B.6",onCancel:()=>{A.current=null,I(!1)},onPrimaryAction:()=>{I(!1),r&&r()},width:"360px",primaryActionLabel:(0,a.jsx)(T.EY,{variant:"button1",children:y?"Go back":"Continue"}),children:(0,a.jsxs)(T.az,{children:[(0,a.jsx)(T.EY,{color:"BT.1",variant:"body1",children:v}),(0,a.jsx)(T.EY,{color:"BT.2",mt:2,variant:"body2",children:y?U:R})]})})]})},"DASHBOARD"))},67260:(e,t,o)=>{o.d(t,{A:()=>h});var r=o(37876),a=o(14232),n=o(54755),l=o(96344),i=o(34219),s=o(48011),c=o(74222),d=o(71776),u=o(19461);let f=(0,s.Ng)(e=>({globalBreadcrumbs:u.vB.getBreadCrumbs(e),globalTitle:u.vB.getTitle(e),location:e.router.location}),e=>({addCrumb:t=>e(d.v_.addCrumb(t)),removeCrumb:t=>e(d.v_.removeCrumb(t)),navigate:t=>e((0,c.VC)(t)),goBack:()=>e((0,c.OE)())})),p=e=>{let{location:t,titleQueryKey:o,alternativeTitle:s,hideBackButton:c}=e,d="";if(o&&!e.title){let e=(0,n.V8)(t.search,o);e&&(d=e.toUpperCase()),s&&!d&&(d=s)}a.useEffect(()=>{let{breadcrumbs:t,addCrumb:o,removeCrumb:r}=e;return t&&t.map(e=>o({label:e.label,link:e.link,fetchQueryParameter:e.fetchQueryParameter})),function(){t&&t.map(e=>r({label:e.label,link:e.link,fetchQueryParameter:e.fetchQueryParameter}))}},[e.breadcrumbs]);let{headerComponent:u,globalBreadcrumbs:f}=e;return!o&&!e.title&&f&&f.length>0&&(d=f[f.length-1].label),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.A,{renderOn:["desktop",...e.tabletSameAsDesktop?["tablet"]:[]],children:e.children}),(0,r.jsx)(l.A,{renderOn:["phone",...e.tabletSameAsDesktop?[]:["tablet"]],children:(0,r.jsx)(i._x,{childrenBgColor:e.popupBgColor,elevation:e.elevation,headerBgColor:e.popupBgColor,hideBackButton:c,title:e.globalTitle||d||e.title,withGradient:!e.notWithGradient,onIconClick:()=>{e.iconClickRoute?e.navigate(e.iconClickRoute):e.goBack()},children:(0,r.jsxs)(r.Fragment,{children:[e.headerComponent&&(0,r.jsx)(u,{}),e.children]})})})]})};p.defaultProps={elevation:"z2"};let h=f(p)}}]);
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.