PageSourceSearch

https://www.straitstimes.com/assets/Header-D7qFk7J6.js

js straitstimes.com collected 2026-10-01 07:56:03 UTC 16,283 bytes, 1 lines download raw bytes

1import{E as e,I as t,O as n,j as r}from"./chunk-KS7C4IRE-DIkipulk.js";import{t as i}from"./jsx-runtime-CsaOnxTR.js";import{S as a,f as o,h as s,l as c,m as l,p as u,t as d,v as f,w as p,y as m}from"./components-JSzoenoU.js";import{$r as ee,Aa as h,Ai as g,Ba as _,Da as te,Ea as v,Fi as y,Fn as ne,Ia as b,Ii as x,In as S,Ja as C,Ji as re,La as w,Li as T,Ln as ie,Mi as E,Na as D,Ni as ae,Oa as O,Pt as oe,Ra as k,Ri as se,Ui as ce,Va as A,Xi as le,Zr as j,ai as ue,dr as de,ea as M,fa as fe,ft as pe,ga as me,gr as he,it as ge,ji as N,jr as P,ka as F,kn as I,na as L,qr as R,rr as _e,sa as z,ta as B,ur as ve,va as V,ya as H,za as U,zi as ye,zn as be}from"./Elements-C-xYWSPQ.js";import{t as xe}from"./ST-logo-default-DY1puEYz.js";var W=t(r(),1),Se=async(e,t,n,r)=>{try{let i=`st_saved_${t}`,a=V.get(i),o=a===void 0?[]:K(a);z(o)&&(o.length<60?r(!1):r(!0)),(await P(`saveBookmarks`,`POST`,{},!1,{cueid:e,visitorid:t})).code===200&&(n(!0),G(`save`,e,t));return}catch(e){_(U.ERROR,`BAAS:: Save Bookmarks API request failed`,{err:e})}},Ce=async(e,t,n)=>{try{(await P(`deleteBookmarks`,`POST`,{},!1,{cueid:e,visitorid:t})).code===200&&(n(!1),G(`delete`,e,t));return}catch(e){_(U.ERROR,`BAAS:: Save Bookmarks API request failed`,{err:e})}};function G(e,t,n){let r=`st_saved_${n}`,i=K(V.get(r));if(e===`save`){let e=[...i,t];V.set(r,JSON.stringify(e))}if(e===`delete`){let e=i.filter(e=>e!==t);V.set(r,JSON.stringify(e))}}function K(e){if(!e)return[];try{let t=JSON.parse(e);return z(t)?t:[]}catch{return[]}}var q=i();function we({cueId:e,savedStatus:t,visitorId:n,urlPath:r}){let[i,a]=(0,W.useState)(),[o,s]=(0,W.useState)(!1),[l,u]=(0,W.useState)(!1),d=`st_saved_${n}`,f=V.get(d),{lightbox:p}=be();(0,W.useMemo)(()=>{if(z(t)&&e){let e=`st_saved_${n}`,r=V.get(e),i=r===void 0?[]:K(r);if(z(i)){let n=[...t,...i],r=[...new Set(n)];V.remove(e,{path:`/`}),V.set(e,JSON.stringify(r))}else V.remove(e,{path:`/`}),V.set(e,JSON.stringify(t))}},[n]),(0,W.useMemo)(()=>{e&&f!==void 0&&f.includes(e)&&a(!0),e&&f!==void 0&&!f.includes(e)&&a(!1)},[f,e]);let m=(0,W.useCallback)(t=>{n||s(!0),n&&e&&(t?Ce(e,n,a):(Se(e,n,a,u),h({eventCategory:D.BOOKMARK,eventAction:`Click`,eventLabel:r})))},[n,e]);return(0,q.jsxs)(q.Fragment,{children:[o&&(0,q.jsx)(`div`,{className:`following-modal`,children:(0,q.jsx)(I,{title:`Log in to use myST+`,successButton:`Log in / Sign up`,showSuccessButton:!0,successFill:y.PRIMARY,onClose:()=>{s(!1)},onSuccessClick:()=>{c&&me(p),s(!1)},children:`Follow topics and authors, save articles and explore content that matters to you.`})}),l&&(0,q.jsx)(`div`,{className:`following-modal`,children:(0,q.jsx)(I,{title:`You have saved 60 articles`,successButton:`Manage Saved`,showSuccessButton:!0,successFill:y.PRIMARY,onSuccessClick:()=>{c&&window.location.assign(`/myst/saved`)},onClose:()=>{u(!1),c&&window.location.assign(`/myst/saved`)},children:`To keep current favourites, go to your space in myST+ to remove the ones you no longer want.`})}),(0,q.jsx)(j,{className:`action-button`,fill:y.NONE,type:T.ICON_ONLY,icon:{iconName:i?w.ACTION_BOOKMARK_FILLED:w.ACTION_BOOKMARK_OUTLINED,iconWidth:k.REGULAR},handler:()=>{m(!!i)}})]})}var J=(0,W.forwardRef)(({title:e,progress:t,urlPath:n,shortUrl:r,cueId:i,bookmarked:a,visitorId:o,className:s,testId:c=`sticky-headline-test-id`},l)=>{let[u,d]=(0,W.useState)(e),[f,p]=(0,W.useState)(t),[m,h]=(0,W.useState)(n),[_,te]=(0,W.useState)(r),[v,y]=(0,W.useState)(i),[x,S]=(0,W.useState)(a),[C,T]=(0,W.useState)(o),E=ge(m);return(0,W.useImperativeHandle)(l,()=>({update:({title:e,progress:t,urlPath:n,shortUrl:r,cueId:i,bookmarked:a,visitorId:o})=>{d(e),p(t),h(n),te(r),y(i),S(a),T(o)}})),(0,q.jsxs)(`div`,{className:b(`sticky-headline`,s),"data-test-id":c,children:[(0,q.jsx)(`div`,{className:`outer-sticky-headline-container`,children:(0,q.jsxs)(`div`,{className:`inner-container`,children:[(0,q.jsxs)(`div`,{className:`logo-and-text items-center`,children:[(0,q.jsx)(M,{type:B.CUSTOM,url:A,children:(0,q.jsxs)(`div`,{className:`logo-container`,"data-testid":`sticky-headline-logo-test-id`,children:[(0,q.jsx)(`span`,{className:`full-logo-container`,"data-testid":`sticky-headline-st-full-logo-test-id`,children:(0,q.jsx)(ee,{className:`full-logo`,symmetric:!1,iconName:w.ST_FULL_LOGO_DEFAULT,iconWidth:`231px`,iconHeight:`18px`})}),(0,q.jsx)(`span`,{className:`initial-logo-container`,"data-testid":`sticky-headline-st-initial-logo-test-id`,children:(0,q.jsx)(ee,{className:`initial-logo`,iconName:w.ST_INITIAL_LOGO_DEFAULT})})]})}
1),(0,q.jsx)(N,{className:`logo-divider`,type:g.DEFAULT,vertical:!0}),(0,q.jsx)(`div`,{className:`text-container`,"data-testid":`sticky-headline-title-test-id`,children:(0,q.jsx)(ce,{type:re.BODY,className:`title`,size:le.SM,children:u??``})})]}),(0,q.jsxs)(`div`,{className:b(`action-container`,F.ACCOUNT_HUB_ENTRYPOINT&&`!min-w-unset`),children:[(0,q.jsx)(pe,{className:`gap-08 py-16 h-full items-start`,type:oe.STICKY_HEADLINE,title:u,url:m,shortUrl:_}),!E&&(0,q.jsx)(we,{cueId:v,savedStatus:x,visitorId:C,urlPath:m}),(0,q.jsx)(ie,{enabled:F.ACCOUNT_HUB_ENTRYPOINT,children:(0,q.jsx)(ne,{})})]})]})}),(0,q.jsx)(`div`,{className:`progress-bar-container`,children:(0,q.jsx)(`span`,{"data-testid":`sticky-headline-progress-bar-test-id`,className:`progress-bar`,style:{width:`${Math.min(Math.max(f,10),100)}%`}})})]})});J.displayName=`StickyHeadline`;function Te(e){return C()?O(e):O(te(e))}var Y=function(e){return e.GLOBAL=`/global`,e.SINGAPORE=`/`,e}({}),X=Te(e=>({edition:`/`,setEdition:t=>{e({edition:t})}}));function Z({title:e,url:t,className:n,testId:r=`menu-item-test-id`,divider:i=!0}){if(!(!t||!e))return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(M,{url:t,title:e,type:B.TEXT_ONLY,className:b(`px-16 tablet:px-24 py-12`,n),textClassName:`font-button-sm-regular`,testId:r}),i&&(0,q.jsx)(N,{className:`mx-00 ml-16 desktop:ml-24 h-01 !border-subtle`})]})}function Ee({openMenu:e,menuToggle:t,testId:r=`menu-container-test-id`,className:i}){let[a,o]=(0,W.useState)(!1),c=X(e=>e.edition),l=(0,W.useRef)(null),{deviceType:u}=he(!0),f=(0,W.useCallback)(e=>{e.key===`Escape`&&t(!1)},[t]);(0,W.useEffect)(()=>(document.addEventListener(`keydown`,f,!1),()=>{document.removeEventListener(`keydown`,f,!1)}),[f]),se(l,()=>{t(!1)}),ye(()=>{setTimeout(()=>{o(e)},50)},[e]);let p=n(),m=v(e=>e.userInfo);return(0,q.jsxs)(`nav`,{className:b(`menu-container`,!e&&`hidden`,a?`show`:`hide`,i),"data-testid":r,ref:l,children:[(0,q.jsx)(`div`,{className:`pt-16 pb-08 flex w-full justify-end mobile:px-16 tablet:px-24`,children:(0,q.jsx)(j,{handler:()=>{t(!e)},type:T.ICON_ONLY,fill:y.NONE,className:`p-00`,icon:{iconName:w.STATUS_ERROR_FILLED,iconWidth:k.LARGE},testId:`menu-container-close-button-test-id`})}),(0,q.jsxs)(`div`,{className:`w-full`,children:[(0,q.jsx)(ve,{id:`menu-edition`,title:`Choose edition`,items:[{label:`Singapore`,value:`/`},{label:`International`,value:`/global`}],size:de.SMALL,orientation:`horizontal`,init:c===Y.GLOBAL?`/global`:`/`,className:`mobile:px-16 tablet:px-24`,handler:e=>{p(e??``,{replace:!0,relative:`route`})}}),(0,q.jsx)(N,{type:g.DEFAULT,className:`mx-00 w-full h-01 pb-16`})]}),(0,q.jsxs)(`div`,{className:`w-full`,children:[(0,q.jsx)(M,{title:`Search`,url:`/search`,className:`mobile:px-16 tablet:px-24 justify-between w-full font-button-md-bold`,type:B.ICON_RIGHT,rightIconProps:{iconName:w.NAV_SEARCH}}),(0,q.jsx)(N,{type:g.DEFAULT,className:`mx-00 w-full h-01 pb-16`})]}),(0,q.jsx)(d,{children:ke(u===`desktop`,m?.usertype===H.SUBSCRIBER)}),(0,q.jsxs)(`div`,{className:`w-full `,children:[Object.keys(s).map((e,t)=>(0,q.jsx)(ae,{header:e,items:s[e],type:E.COLUMN,className:`capitalize`},t)),(0,q.jsx)(Z,{url:`/visual`,title:`Visual`,className:`w-full`}),(0,q.jsx)(Z,{url:`/st-podcasts`,title:`Podcasts`,className:`w-full`,divider:!1}),(0,q.jsx)(N,{type:g.DEFAULT,className:`mx-00 w-full h-01 pb-16`})]}),Oe(),De(),(0,q.jsx)(`div`,{className:`w-full min-h-80 block tablet:hidden`,children:`\xA0`})]})}var De=()=>{let[e,t]=(0,W.useState)(L());return(0,W.useEffect)(()=>{c&&t(L(window.navigator.userAgent))},[]),(0,q.jsxs)(`div`,{className:`w-full pb-16`,children:[(0,q.jsx)(Z,{url:`https://consumerfaq.sph.com.sg/kb?lang=en`,title:`FAQs`,className:`w-full`}),(0,q.jsx)(Z,{url:e,title:`Contact us`,className:`w-full`,divider:!1})]})},Oe=()=>(0,q.jsxs)(`div`,{className:`w-full `,children:[(0,q.jsx)(Z,{url:u,title:`STClassifieds`,className:`w-full`}),(0,q.jsx)(Z,{url:f,title:`Paid press releases`,className:`w-full`}),(0,q.jsx)(M,{title:`Advertise with us`,url:o,type:B.ICON_RIGHT,rightIconProps:{iconName:w.NAV_EXTERNAL},className:`mobile:px-16 tablet:px-24 py-12 justify-between w-full`,textClassName:`font-button-sm-regular`}),(0,q.jsx)(N,{type:g.DEFAULT,className:`mx-00 w-full h-01 pb-16`})]}),ke=(e,t=!1)=>{let n=(0,W.useCallback)(()=>{c&&(h({eventCategory:D.SUBSCRIBE,eventAction:`click`,eventLabel:window.location.href,click_reference:`subscribe-usermenu`}),F.ESAAS_GA_TAGGING?window.location.assign(window._data.articleid?`${p}&article_id=${window._data.articleid}`:p):window.location.assign(p))},[]);return(0,q.jsxs)(`div`,{className:`w-full`,children:[!t&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(j,{text:`Subscribe`,fill:y.NONE,size:x.SMALL,className:`subscribe-link w-full justify-start`,textClassName:`font-button-sm-regular`,handler:n,testId:`sidebar-subscribe-button-test-id`}),(0,q.jsx)(N,{className:`mx-00 ml-16 desktop:ml-24 h-01 !border-subtle`})]}),(0,q.jsx)(Z,{url:l,title:`E-paper`,className:`w-full`,divider:!0}),(0,q.jsx)(Z,{url:`/newsletter-signup`,title:`Newsletters`,className:b(`w-full`),divider:!0}),(0,q.jsx)(Z,{url:`/myst`,title:`myST+`,className:b(`w-full`),divider:!1}),(0,q.jsx)(N,{type:g.DEFAULT,className:`mx-00 w-full h-01 pb-16`})]})};function Q(){let[e,t]=(0,W.useState)(!1),[n,r]=(0,W.useState)(!1),i=()=>{t(!e),h({eventLabel:`menu`,eventAction:D.CLICK,eventCategory:`masterhead`})};return(0,W.useEffect)(()=>{e?document.documentElement.setAttribute(`style`,`overflow-y: hidden !important`):document.documentElement.removeAttribute(`style`)},[e]),ye(()=>{setTimeout(()=>{r(e)},150)},[e]),(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(j,{text:`Menu`,icon:{iconName:w.MENU_HAMBURGER_SEARCH},type:T.ICON_LEFT,fill:y.NONE,handler:i,size:x.SMALL,textClassName:b(`font-secondary-label-sm-regular`),className:`header-menu hidden items-end tablet:flex !px-08 !py-16`,testId:`desktop-menu-trigger-button-test-id`}),(0,q.jsx)(j,{icon:{iconName:w.MENU_HAMBURGER_SEARCH},type:T.ICON_ONLY,fill:y.NONE,handler:i,size:x.SMALL,textClassName:`font-secondary-label-sm-regular`,className:`flex items-end tablet:hidden !px-08 !py-16`,testId:`mobile-menu-trigger-button-test-id`}
1),n&&(0,q.jsx)(`div`,{className:`h-screen w-screen z-1000 absolute top-00 left-00 opacity-40 bg-neutral-90/80 `}),(0,q.jsx)(Ee,{menuToggle:t,openMenu:e})]})}var $=({isErrorPage:e,isVisualStoryPage:t})=>(0,q.jsxs)(`div`,{className:b(`flex justify-between mobile:flex-nowrap tablet:flex-wrap content-center h-full items-stretch `,`pl-16 pr-08`,`tablet:pl-24 tablet:pr-12`,`desktop:pl-32 desktop:pr-24`,`breakpoint:px-00 breakpoint:max-w-breakpoint breakpoint:mx-auto`),"data-testid":`header-main-test-id`,children:[(0,q.jsx)(`div`,{className:`flex items-center`,"data-testid":`header-main-left-test-id`,children:(0,q.jsx)(M,{type:B.IMAGE_ONLY,alt:`Straitstimes.com header logo`,src:xe,url:A,textClassName:`flex items-start`,imageClassName:`h-48 py-16 aspect-auto desktop:h-56 flex-shrink-0 w-auto object-contain`},`header-st-logo-default`)}),!e&&(0,q.jsxs)(`div`,{className:`flex items-center flex-shrink`,"data-testid":`header-main-right-test-id`,children:[(0,q.jsx)(S,{}),!t&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(N,{vertical:!0,className:`hidden desktop:block`}),(0,q.jsx)(Q,{})]})]})]}),Ae=()=>(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`hidden desktop:block breakpoint:max-w-breakpoint breakpoint:mx-auto`,"data-testid":`header-home-test-id`,children:[(0,q.jsx)(je,{}),(0,q.jsx)(`div`,{className:b(`flex justify-between flex-wrap content-center h-full items-stretch desktop:pb-24`),children:(0,q.jsxs)(`div`,{className:`flex items-center `,children:[(0,q.jsx)(M,{type:B.IMAGE_ONLY,alt:`Straitstimes.com header logo`,src:xe,url:A,textClassName:`flex items-start`,imageClassName:`h-48 py-16 aspect-auto desktop:py-00`},`header-st-logo-default`),fe()&&(0,q.jsx)(`div`,{className:`pl-08 hidden desktop:flex homepage-doodle`,children:(0,q.jsx)(`img`,{src:`/assets/ndp2026-Cm09-2x-.gif`,width:`150px`,alt:`ST Doodle`})})]})}),(0,q.jsx)(Me,{})]}),(0,q.jsx)(`div`,{className:`block desktop:hidden`,children:(0,q.jsx)($,{})})]}),je=()=>{let[e,t]=(0,W.useState)(!1),n=(0,W.useRef)(null),r=[{label:`Singapore`,value:Y.SINGAPORE},{label:`International`,value:Y.GLOBAL}],i=v(e=>e.userInfo),o=X(e=>e.edition);se(n,()=>{t(!1)});let s=i?.display_name,u=i?.usertype,d=(0,W.useCallback)(()=>{c&&(h({eventCategory:D.SUBSCRIBE,eventAction:`click`,eventLabel:window.location.href,click_reference:`subscribe-header`}),window.location.assign(a))},[]);return(0,q.jsxs)(`div`,{className:b(`hidden desktop:flex justify-between flex-wrap pb-24`),children:[(0,q.jsxs)(`div`,{className:`flex items-center`,children:[(0,q.jsx)(`div`,{className:`p-08 pl-00 flex`,ref:n,children:(0,q.jsxs)(R,{className:`min-h-unset`,children:[(0,q.jsx)(R.Trigger,{children:(0,q.jsx)(j,{handler:()=>{t(!e)},fill:y.NONE,type:T.ICON_RIGHT,icon:{iconName:e?w.NAV_EXPAND_LESS:w.NAV_EXPAND_MORE,iconWidth:k.SMALL},text:o===Y.GLOBAL?`International`:`Singapore`,textClassName:`font-secondary-label-sm-bold`,className:`p-00`})}),(0,q.jsx)(R.Items,{className:`left w-200 p-00`,children:(0,q.jsxs)(`div`,{className:`flex flex-col pb-08 font-secondary-label-md-regular`,children:[(0,q.jsx)(`span`,{className:`font-secondary-label-sm-regular text-disabled p-16 pb-08`,children:`Choose edition`}),r.map(({label:e,value:t})=>o===(t===Y.GLOBAL?Y.GLOBAL:Y.SINGAPORE)?(0,q.jsx)(`span`,{className:`py-12 px-16 font-secondary-label-md-bold after:inline-block after:content-[''] after:w-24 after:h-24 after:ml-08 after:bg-[url('/src/app/assets/images/icon-status-nav-edition.png')] after:bg-no-repeat after:bg-center after:bg-contain after:align-sub`,children:e},e):(0,q.jsx)(`a`,{href:t,className:`py-12 px-16`,children:e},e))]})})]})}),(0,q.jsx)(N,{type:g.DEFAULT,vertical:!0}),(0,q.jsx)(`div`,{className:`px-08 py-12`,children:(0,q.jsx)(M,{url:l,title:`E-paper`,textClassName:`font-secondary-label-sm-regular`})})]}),(0,q.jsxs)(`div`,{className:`flex items-center`,children:[!(s&&u===H.SUBSCRIBER)&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{children:(0,q.jsx)(j,{text:`Subscribe`,fill:y.NONE,size:x.SMALL,className:`header-subscribe-link`,textClassName:`font-secondary-label-sm-regular`,handler:d,testId:`Subscribe`})}),(0,q.jsx)(N,{type:g.DEFAULT,vertical:!0})]}),(0,q.jsx)(`div`,{children:(0,q.jsx)(`div`,{className:`block`,children:(0,q.jsx)(S,{})})})]})]})},Me=()=>(0,q.jsxs)(`div`,{className:`hidden desktop:flex justify-between flex-wrap`,children:[(0,q.jsx)(`div`,{className:`flex items-center`,children:(0,q.jsx)(_e,{arrayList:m,vertical:!1,linkProps:{className:`py-12 px-16 first:pl-00`}})}),(0,q.jsx)(`div`,{className:`flex items-center`,children:(0,q.jsx)(Q,{})})]});function Ne({isHomepage:t=!1,isArticlePage:n=!1,isVisualStoryPage:r=!1,isErrorPage:i=!1,disableSticky:a=!1,stickyHeadlineRef:o,className:s}){let[l,u]=(0,W.useState)(!1),d=X(e=>e.setEdition),f=(0,W.useContext)(ue);return(0,W.useEffect)(()=>{let e=()=>{let e=document.body.scrollTop||document.documentElement.scrollTop;e===0?u(!1):e>190&&!l?u(!0):l&&e<100&&u(!1)};return c&&!a&&window.addEventListener(`scroll`,e,{passive:!0}),()=>{c&&window.removeEventListener(`scroll`,e)}},[]),(0,W.useEffect)(()=>{c&&d(window.location.pathname.startsWith(`/global`)?Y.GLOBAL:Y.SINGAPORE)},[e().pathname,d]),(0,q.jsx)(`div`,{className:b(`block border-b border-default`,!n&&``,n&&!l&&``,!l&&t?`desktop:py-16 desktop:pl-32 desktop:pr-24`:l&&n?`py-00`:`desktop:py-08`,l&&`sticky top-00 z-1050 layer-one layer-no-hover`,`transition-all duration-100 ease-linear`,s),"data-testid":`header-wrapper-test-id`,children:l&&n?(0,q.jsx)(J,{ref:o,title:f.title||``,progress:f.infiniteScrolling?.progress||0,urlPath:f.urlPath,shortUrl:f.shortUrl}):!l&&t?(0,q.jsx)(Ae,{}):(0,q.jsx)($,{isErrorPage:i,isVisualStoryPage:r})})}
1export{G as i,$ as n,J as r,Ne as t};

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.