1import{j as s}from"./jsx-runtime-BgjmLhhW.js";import{r as m}from"./index-BqkNX_XC.js";import{r as T,d as j,u as y}from"./breakpoints-BFMC4mhA.js";import{D as F,v as O}from"./FundCardView-DUCoP-3Q-DMhWx7Da.js";import{V as U}from"./isNavigationMobile-D4yB3zlS-CGqnVg4f.js";import{y as h}from"./Button-D1BZXwDH-BDkMigXz.js";import{$ as M}from"./FaIcon-DTQallQy-Cfu02mpc.js";import"./index-fN7hCOo3-DUOKOLJB.js";import"./_commonjsHelpers-BkfeUUK--CtUiGMfT.js";import"./useRichText-DxYJgamW-CkgH0oiM.js";import"./sanitiseHtml-BlsISXRY-CHTsGGBt.js";import"./addClassToLinks-Y3DgUbrp-GEio4dUH.js";import"./isSsr-CKRBkAvO-CXwf3Nhs.js";import"./adobe-tracking-map-FuYnSgXJ-nXOxFVsQ.js";import"./adobe-tracking-DpSHGK7T-QlveT4Bz.js";import"./keyboard-BZJvo5uC-D03dO0Qx.js";let u=[],f=0;const p=4,x=e=>{let t=[],a={get(){return a.lc||a.listen(()=>{})(),a.value},lc:0,listen(n){return a.lc=t.push(n),()=>{for(let l=f+p;l<u.length;)u[l]===n?u.splice(l,p):l+=p;let i=t.indexOf(n);~i&&(t.splice(i,1),--a.lc||a.off())}},notify(n,i){let l=!u.length;for(let o of t)u.push(o,a.value,n,i);if(l){for(f=0;f<u.length;f+=p)u[f](u[f+1],u[f+2],u[f+3]);u.length=0}},off(){},set(n){let i=a.value;i!==n&&(a.value=n,a.notify(i))},subscribe(n){let i=a.listen(n);return n(a.value),i},value:e};return a};function V(e,t,a){let n=new Set(t).add(void 0);return e.listen((i,l,o)=>{n.has(o)&&a(i,l,o)})}const P=(e={})=>{let t=x(e);return t.setKey=function(a,n){let i=t.value;typeof n>"u"&&a in t.value?(t.value={...t.value},delete t.value[a],t.notify(i,a)):t.value[a]!==n&&(t.value={...t.value,[a]:n},t.notify(i,a))},t},d={INITIALIZE:"@@BASKET/INITIALIZE",STATE_UPDATED:"@@BASKET/STATE_UPDATED",REMOVE_FUND:"@@BASKET/REMOVE_FUND",FUND_REMOVED:"@@BASKET/FUND_REMOVED",UPDATE_FUNDS:"@@BASKET/UPDATE_FUNDS",UPDATE_NOTIFICATION_STATUS:"@@BASKET/UPDATE_NOTIFICATION_STATUS",OPEN_DRAWER:"@@BASKET/OPEN_DRAWER",CLOSE_DRAWER:"@@BASKET/CLOSE_DRAWER",OPEN_DRAWER_DISABLED:"@@BASKET/OPEN_DRAWER_DISABLED",CLOSE_DRAWER_DISABLED:"@@BASKET/CLOSE_DRAWER_DISABLED",START_LOADING:"@@BASKET/START_LOADING",STOP_LOADING:"@@BASKET/STOP_LOADING",ERROR:"@@BASKET/ERROR"},$="debug:basket";let k=null;function H(){return window.__REDUX_DEVTOOLS_EXTENSION__}function N(){return typeof window>"u"?!1:localStorage.getItem($)==="true"}function Z(e,t){if(!N())return;const a=H();a&&(k=a.connect({name:"Basket Store",features:{jump:!0,skip:!1}}),k?.init(t),e.listen(n=>{k?.send({type:d.STATE_UPDATED},n)}))}function c(e,t,a){if(k&&N()){const n=a?a():null;k.send({type:e,payload:t},n)}}const b=x(void 0),D={basketDrawerItems:[],isBasketDisabled:!1,notificationStatus:{isBasketFull:!1,isAlreadyAdded:!1},basketConfig:{},isLoading:!1,basketMethods:void 0},r=P(D);Z(r,D);const C=x(void 0);function K(e){C.set(e)}function W(){var e;const t=r.get().basketConfig,a=((e=t?.content)==null?void 0:e.basket_go_to_compare_button_link)??"";return!!a&&location.pathname.includes(a)}function A(e){var t,a;const n=C.get();if(r.get().isBasketDisabled||W()){c(d.OPEN_DRAWER_DISABLED,{},()=>r.get());return}if(e!=null&&e.skipOnMobile){const i=y();if(j(i)){c(d.OPEN_DRAWER_DISABLED,{reason:"mobile-auto-open-disabled"},()=>r.get());return}}(((t=n?.current)==null?void 0:t.open)??!1)||((a=n?.current)==null||a.show(),c(d.OPEN_DRAWER,{},()=>r.get()))}function G(){var e;const t=C.get();if(r.get().isBasketDisabled){c(d.CLOSE_DRAWER_DISABLED,{},()=>r.get());return}(e=t?.current)==null||e.close(),L({isBasketFull:!1,isAlreadyAdded:!1}),c(d.CLOSE_DRAWER,{},()=>r.get())}function L(e){r.setKey("notificationStatus",e),c(d.UPDATE_NOTIFICATION_STATUS,{status:e},()=>r.get())}function X(){var e;(e=b.get())==null||e.onBasketChange(()=>{I()})}function z(){var e;(e=b.get())==null||e.onIsLoading(t=>{w(t??!1),t&&A({skipOnMobile:!0})})}function Y(){var e;(e=b.get())==null||e.onBasketNotificationChange(()=>{var t;return L({isBasketFull:((t=b.get())==null?void 0:t.isBasketFull())??!1,isAlreadyAdded:!1})})}function q(){var e;(e=b.get())==null||e.onErrorHandler(t=>{c(d.ERROR,{error:t},()=>r.get())})}function J(){var e;(e=b.get())==null||e.onFundRemoved(()=>{A({skipOnMobile:!0}),c(d.FUND_REMOVED,{},()=>r.get())})}function I(){var e;const t=(e=b.get())==null?void 0:e.getBasket();L({isBasketFull:!1,isAlreadyAdded:!1}),r.setKey("basketDrawerItems",t?.funds??[]),c(d.UPDATE_FUNDS,{basket:t},()=>r.get())}function Q(e){var t;(t=b.get())==null||t.removeFromBasket(e),c(d.REMOVE_FUND,{id:e},()=>r.get())}function w(e){r.setKey("isLoading",e),c(e?d.START_LOADING:d.STOP_LOADING,{isLoading:e},()=>r.get())}function ee(e,t){var a;b.set(t),e&&(r.set({...D,basketDrawerItems:((a=b.get())==null?void 0:a.getBasket().funds)||[],...e}),c(d.INITIALIZE,{initialValue:e},()=>r.get())),X(),z(),Y(),q(),J()}let E=(e,t)=>a=>{e.current!==a&&(e.current=a,t())};function v(e,{keys:t,deps:a=[e,t]}={}){let n=m.useRef();n.current=e.get();let i=m.useCallback(o=>(E(n,o)(e.value),t?.length>0?V(e,t,E(n,o)):e.listen(E(n,o))),a),l=()=>n.current;return m.useSyncExternalStore(i,l,l)}function g(){const e=v(r),t=v(C),a=v(b),n=r.get().basketDrawerItems.length;return{drawerDialogRef:t,notificationStatus:e.notificationStatus,isBasketDisabled:e.isBasketDisabled,basketDrawerItems:e.basketDrawerItems,basketItemsCount:n,brand:e.brand,marketingServiceUrl:e.marketingServiceUrl,basketConfig:e.basketConfig.content,sectionBasePath:e.sectionBasePath,isLoading:e.isLoading,basketMethods:a,basketLoaded:!!a,openDrawerDialog:A,closeDrawerDialog:G,updateFunds:I,updateNotificationStatus:L,removeFund:Q,setIsLoading:w}}function te({initialValue:e,children:t}){const a=m.useRef(null);return m.useEffect(()=>{const n=F.getInstance({},e.basketConfig);n.serviceReady(()=>{const i=n.exposedMethods();ee({...e,basketMethods:i},i)}),K(a)},[]),s.jsx(s.Fragment,{children:t})}const ae={1:"M 12.77 15.06 L 12.77 13.72 L 11.15 13.72 L 11.15 8 L 10.14 8 L 8.2 9.16 L 8.8 10.42 L 9.6 9.89 L 9.6 13.72 L 8 13.72 L 8 15.06 Z",2:"M12.47,15.14 L12.47,13.81 L9.37,13.85 L10.63,12.68 C11.7,11.68 12.19,10.95 12.19,9.98 C12.19,8.56 11.16,8 9.74,8 C8.47,8 7.59,8.42 7,9.54 L8.06,10.31 C8.41,9.64 8.8,9.31 9.57,9.31 C10.2,9.31 10.61,9.56 10.61,10.18 C10.61,10.78 10.17,11.23 9.46,11.88 L7.18,13.95 L7.18,15.14 L12.47,15.14 Z",3:"M9.67,15.28 C11.42,15.28 12.35,14.4 12.35,13.11 C12.35,12.29 11.95,11.8 11.29,11.52 C11.86,11.19 12.2,10.68 12.2,9.96 C12.2,8.71 11.31,8 9.72,8 C8.49,8 7.67,8.41 7.14,9.45 L8.22,10.1 C8.55,9.52 8.89,9.26 9.54,9.26 C10.26,9.26 10.66,9.54 10.66,10.15 C10.66,10.69 10.29,11 9.67,11 L8.87,11 L8.87,12.18 L9.67,12.18 C10.47,12.18 10.82,12.49 10.82,13.06 C10.82,13.74 10.34,14.05 9.57,14.05 C8.89,14.05 8.45,13.8 8.09,13.17 L7,13.92 C7.56,14.89 8.44,15.28 9.67,15.28 Z",4:"M 12.03 15 L 12.03 13.48 L 12.83 13.48 L 12.83 12.15 L 12.03 12.15 L 12.03 10.22 L 10.53 10.22 L 10.53 12.15 L 8.64 12.15 L 10.81 8 L 9.29 8 L 7 12.34 L 7 13.48 L 10.53 13.48 L 10.53 15 Z"},ne="M20,10 L20,6.875 C20,6.38020833 19.8111979,5.94401042 19.4335938,5.56640625 C19.0559896,5.18880208 18.6197917,5 18.125,5 L18.125,5 L15,5 L15,3.125 C15,2.63020833 14.8111979,2.19401042 14.4335938,1.81640625 C14.0559896,1.43880208 13.6197917,1.25 13.125,1.25 L13.125,1.25 L6.875,1.25 C6.38020833,1.25 5.94401042,1.43880208 5.56640625,1.81640625 C5.18880208,2.19401042 5,2.63020833 5,3.125 L5,3.125 L5,5 L1.875,5 C1.38020833,5 0.944010417,5.18880208 0.56640625,5.56640625 C0.188802083,5.94401042
10,6.38020833 0,6.875 L0,6.875 L0,10 L20,10 Z M12.5,5 L7.5,5 L7.5,3.75 L12.5,3.75 L12.5,5 Z M18.125,18.75 C18.6197917,18.75 19.0559896,18.5297309 19.4335938,18.0891927 C19.8111979,17.6486545 20,17.1397569 20,16.5625 L20,10 L12.5,10 L7.5,10 L0,10 L0,16.5625 C0,17.1397569 0.188802083,17.6486545 0.56640625,18.0891927 C0.944010417,18.5297309 1.38020833,18.75 1.875,18.75 L18.125,18.75 Z",S=4,se=S,ie=1,le=[{fill:"#6ac577",cx:"8"},{fill:"#00ae53",cx:"32"},{fill:"#008540",cx:"56"},{fill:"#005847",cx:"80"}],re=({width:e="20",height:t="20",fill:a="#000000",count:n=0,unit:i="px"})=>{const l=m.useMemo(()=>{if(n<ie||n>se)return null;const o=ae[n];return s.jsx("path",{fill:"#FFFFFF",fillRule:"nonzero",d:o,"data-testid":"basket-button-icon-badge"})},[n]);return s.jsx("svg",{width:e+i,height:t+i,viewBox:`0 0 ${e} ${t}`,version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",className:"basket-button-icon","data-testid":"basket-button-icon",children:s.jsxs("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:[s.jsx("g",{fill:a,fillRule:"nonzero",children:s.jsx("path",{d:ne})}),l]})})},oe="button block | tertiary | link click | basket button",de=()=>{const{isBasketDisabled:e,basketItemsCount:t,openDrawerDialog:a,basketConfig:n,brand:i}=g(),l=m.useMemo(()=>s.jsxs("div",{className:"basket-button-content-container",children:[s.jsx(re,{width:"20",count:t}),s.jsx("span",{className:"basket-button-content-label",children:n?.basket_button_text??"basket_button_text"})]}),[t,n?.basket_button_text]),o=`basket-button ${e?"disabled":""}`,_=`${l} basket with ${t} items`;return s.jsx(h,{appearance:"tertiary",className:o,onClick:()=>{a()},disabled:e,ariaLabel:_,type:"reset",label:l,dataLinkEvent:oe,"data-testid":"basket-button",brand:i})},ce=({currentBasketItemNumber:e})=>{const{basketConfig:t}=g(),a=`${e} ${t?.basket_fund_card_placeholder_separator||"basket_fund_card_placeholder_separator"} ${S}`;return s.jsxs("div",{className:"basket-fund-card-empty-content","data-testid":"basket-fund-card-empty-content","aria-hidden":"true",children:[s.jsx("span",{className:"basket-fund-card-empty-content-placeholder oneds-body-xs-compact",children:a}),s.jsxs("svg",{width:"100%",height:"auto",viewBox:"0 0 260 264",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"basket-fund-card-empty-content-skeleton","aria-hidden":"true",focusable:"false",children:[s.jsx("path",{d:"M0 2C0 0.895431 0.895431 0 2 0H10C11.1046 0 12 0.895431 12 2V10C12 11.1046 11.1046 12 10 12H2C0.895431 12 0 11.1046 0 10V2Z",fill:"#F5F5EB"}),s.jsx("path",{d:"M0 224C0 222.895 0.89543 222 2 222H132C133.105 222 134 222.895 134 224V262C134 263.105 133.105 264 132 264H2C0.895429 264 0 263.105 0 262V224Z",fill:"#F5F5EB"}),s.jsx("path",{d:"M144 224C144 222.895 144.895 222 146 222H243C244.105 222 245 222.895 245 224V262C245 263.105 244.105 264 243 264H146C144.895 264 144 263.105 144 262V224Z",fill:"#F5F5EB"}),s.jsx("path",{d:"M16 2C16 0.895431 16.8954 0 18 0H89C90.1046 0 91 0.895431 91 2V10C91 11.1046 90.1046 12 89 12H18C16.8954 12 16 11.1046 16 10V2Z",fill:"#F5F5EB"}),s.jsx("path",{d:"M0 37C0 35.8954 0.89543 35 2 35H164C165.105 35 166 35.8954 166 37V70C166 71.1046 165.105 72 164 72H2C0.895429 72 0 71.1046 0 70V37Z",fill:"#F5F5EB"}),s.jsx("path",{d:"M0 90C0 88.8954 0.895431 88 2 88H258C259.105 88 260 88.8954 260 90V106C260 107.105 259.105 108 258 108H2.00001C0.895438 108 0 107.105 0 106V90Z",fill:"#F5F5EB"}),s.jsx("path",{d:"M0 120C0 118.895 0.895431 118 2 118H258C259.105 118 260 118.895 260 120V136C260 137.105 259.105 138 258 138H2.00001C0.895438 138 0 137.105 0 136V120Z",fill:"#F5F5EB"}),s.jsx("path",{d:"M0 158C0 156.895 0.895431 156 2 156H89C90.1046 156 91 156.895 91 158V170C91 171.105 90.1046 172 89 172H2C0.89543 172 0 171.105 0 170V158Z",fill:"#F5F5EB"}),s.jsx("path",{d:"M0 198.5C0 197.672 0.671573 197 1.5 197H258.5C259.328 197 260 197.672 260 198.5V198.5C260 199.328 259.328 200 258.5 200H1.50001C0.671579 200 0 199.328 0 198.5V198.5Z",fill:"#F5F5EB"})]})]})},ue=()=>{const e=v(r),{marketingServiceUrl:t,basketConfig:a}=g();return s.jsx("div",{className:"basket-drawer-body-container","data-testid":"basket-drawer-body-container",children:Array.from({length:S},(n,i)=>{const l=e.basketDrawerItems[i],o=l!=null&&l.mstarRatingOverall?parseInt(l.mstarRatingOverall):null,_=o!==null&&!isNaN(o);return l!=null&&l.name?s.jsx(O,{isActive:l.active,eyebrow:l.assetClass,description:l.sfdr,title:l.name,marketingServiceUrl:t||"",ticker:l.ticker,shareClass:l.shareClass.map((B,R)=>R===0?B:`(${B})`).join(" "),...(l.isaEligibility==="Y"||l.isaEligibility==="Yes")&&{isIsaReady:!0},..._&&{mStarRating:o},..._&&{mStarRatingInfo:l.mstarRatingOverallInfo},buttonList:[{_type:"cta",label:a?.basket_fund_card_view_label||"Explore",href:l.url},{_type:"compare",addLabel:"",removeLabel:a?.basket_fund_card_remove_label||"Remove",portfolioId:l.id}]},`basket-fund-card-slot-${i}`):s.jsx("article",{className:"basket-fund-card","data-testid":`basket-fund-card-${i+1}`,"aria-live":"polite",children:s.jsx(ce,{currentBasketItemNumber:i+1},`basket-fund-card-${i+1}`)},`basket-fund-card-${i+1}`)})})},be=({notificationMessage:e,isVisible:t,marketingServiceUrl:a})=>t?s.jsxs("div",{className:"basket-notification","data-testid":"basket-notification",role:"alert","aria-live":"polite",children:[s.jsx(M,{marketingServiceUrl:a,iconId:"circle-info",width:"20",height:"20",className:"basket-notification-icon"}),s.jsx("span",{className:"basket-notification-message oneds-body-s-compact",children:e})]}):null,fe=(e,t)=>
1!e||e.startsWith("http")?"":e.startsWith("/")||!t?e:`${t.replace(/\/$/,"")}/${e}`,ke=(e,t)=>e.isBasketFull?t?.basket_notification_full_message||"basket_notification_full_message":e.isAlreadyAdded?t?.basket_notification_already_added_message||"basket_notification_already_added_message":"",me=()=>{const{marketingServiceUrl:e,basketConfig:t,brand:a,notificationStatus:n,sectionBasePath:i}=g(),l=fe(t?.basket_go_to_compare_button_link,i);return s.jsxs("div",{className:"basket-drawer-footer-container","data-testid":"basket-drawer-footer-container",children:[s.jsx(be,{isVisible:n.isBasketFull||n.isAlreadyAdded,notificationMessage:ke(n,t??{}),marketingServiceUrl:e}),s.jsx(h,{buttonIcon:"chevron-right",marketingServiceUrl:e,appearance:"primary",type:"button",className:"basket-go-to-compare-button",label:t?.basket_go_to_compare_button_text||"basket_go_to_compare_button_text",buttonLink:l,ariaLabel:t?.basket_go_to_compare_button_text||"basket_go_to_compare_button_text",disabled:!l,brand:a,buttonIconVisible:!0})]})},ge=()=>{const{closeDrawerDialog:e,basketConfig:t,marketingServiceUrl:a,brand:n}=g();return s.jsx("header",{className:"basket-drawer-header-container","data-testid":"basket-drawer-header-container",children:s.jsx(h,{buttonIcon:"xmark",marketingServiceUrl:a,appearance:"tertiary",className:"basket-close-button",type:"reset",onClick:e,ariaLabel:t?.basket_close||"basket_close",label:t?.basket_close||"basket_close","data-testid":"basket-close-button",tabIndex:0,buttonIconColor:"000000",brand:n,isCustomIconColor:!0,buttonIconVisible:!0})})},_e=({className:e})=>s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"basket-loading-holder"}),s.jsx("div",{className:`basket-loading-animation ${e||""}`,"data-testid":"basket-loader",children:s.jsx("svg",{className:"loader-animation-svg",version:"1.1",id:"L5",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 88 80",enableBackground:"new 0 0 0 0",xmlSpace:"preserve","aria-label":"Loading animation",children:le.map((t,a)=>s.jsx("circle",{fill:t.fill,stroke:"none",cx:t.cx,cy:"40",r:"8",children:s.jsx("animateTransform",{attributeName:"transform",dur:"1s",type:"translate",values:"0 10 ; 0 -10; 0 10",repeatCount:"indefinite",begin:`0.${a+1}`})},a))})})]}),pe=()=>{const{drawerDialogRef:e,isLoading:t}=g();return s.jsx("dialog",{ref:e,className:"basket-drawer","aria-label":"Basket drawer","data-testid":"basket-drawer",children:s.jsxs("div",{className:"basket-drawer-content-container",children:[t&&s.jsx(_e,{}),s.jsx(ge,{}),s.jsx(ue,{}),s.jsx(me,{})]})})},ve=()=>{const e=U()===T.Mobile;return s.jsxs("section",{"aria-label":"Basket content",className:`basket-config-container ${e?"basket-config-container-mobile":"basket-config-container-desktop"}`,"data-testid":"basket-config-container",children:[s.jsx(de,{}),s.jsx(pe,{})]})},Fe=({brand:e,marketingServiceUrl:t,isBasketDisabled:a,basketConfig:n,sectionBasePath:i})=>s.jsx(te,{initialValue:{brand:e,marketingServiceUrl:t,isBasketDisabled:a,basketConfig:n,sectionBasePath:i},children:s.jsx(ve,{})});export{Fe as Basket};
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.