1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[57260],{57260:function(e,n,i){i.r(n),i.d(n,{default:function(){return b}});var t=i(85893),r=i(5152),a=i.n(r),o=i(67294),l=i(60870),s=i(39480),d=i(31838),c=i(6619),u=i(1597),m=i(621),h=i(55822);l.default.use([l.Navigation]);var v=a()((function(){return Promise.resolve().then(i.bind(i,64310))}),{loadableGenerated:{webpack:function(){return[64310]}}}),_=a()((function(){return i.e(38518).then(i.bind(i,38518))}),{loadableGenerated:{webpack:function(){return[38518]}}}),p=a()((function(){return Promise.resolve().then(i.bind(i,40880))}),{loadableGenerated:{webpack:function(){return[40880]}}}),f=function(e,n,i){var t,r=(0,u.$d)(n),a=(0,m.ej)("token"),o=Boolean(a&&!a.includes("amp-")),l=o?(0,m.ej)("_ht_clientid"):"";dataLayer.push({event:"widget_clicked",widget_name:"article_click",position:"".concat(e+1),page_type:"homepage",section_name:"homenew",sub_section_name:"",article_title:(0,u.tH)(n),published_date:(0,u.dy)((null===n||void 0===n?void 0:n.lastPublishedDate)||(null===n||void 0===n?void 0:n.firstPublishedDate))||"",article_category:(null===r||void 0===r?void 0:r.toLowerCase())||"",story_id:"".concat(null===n||void 0===n?void 0:n.id),user_login_status:o?"logged_in":"non_logged_in",user_id:o?l:"",login_status:o?"logged_in":"non_logged_in",clientID:o?l:"NA",data_source:"non_amp",cta_text:(null===(t=null===i||void 0===i?void 0:i.trim())||void 0===t?void 0:t.replace(/\s/g,"-").toLowerCase())||""})},x=function(e){var n=(0,m.ej)("token"),i=Boolean(n&&!n.includes("amp-")),t=i?(0,m.ej)("_ht_clientid"):"";dataLayer.push({event:"widget_clicked",widget_name:"view_all_article_clicked",page_type:"homepage",section_name:"homenew",sub_section_name:"",data_source:"non_amp",user_login_status:i?"logged_in":"non_logged_in",user_id:i?t:""})},g=function(e){var n=e.item,i=(0,u.$d)(n),r=i&&(0,u.Uc)(n);return(0,t.jsxs)("div",{className:"home_section_feed_metaRow",children:[i&&(0,t.jsx)("span",{className:"home_section_feed_category",children:r?(0,t.jsx)("a",{href:r,children:i}):i}),(null===n||void 0===n?void 0:n.firstPublishedDate)&&(0,t.jsx)("span",{className:"home_section_feed_date",children:(0,t.jsx)("span",{dangerouslySetInnerHTML:{__html:(0,m.iM)(null===n||void 0===n?void 0:n.lastPublishedDate,null===n||void 0===n?void 0:n.firstPublishedDate)}})})]})},j=function(e){var n,i,r,a=e.item;return(0,t.jsxs)(t.Fragment,{children:[(null===a||void 0===a||null===(n=a.metadata)||void 0===n?void 0:n.breakingNews)?(0,t.jsx)("span",{className:"breakingBadge",children:"Breaking"}):(null===a||void 0===a||null===(i=a.metadata)||void 0===i?void 0:i.premiumStory)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"premiumBadge",children:"Premium"}),(0,t.jsx)("span",{className:"premiumBadgeCrown"})]}):(null===a||void 0===a||null===(r=a.metadata)||void 0===r?void 0:r.app)&&(0,t.jsx)("span",{className:"exclusiveBadge",children:"App Exclusive"}),"video"===(null===a||void 0===a?void 0:a.articleType)&&(0,t.jsx)("span",{className:"home_page_vIcon","aria-hidden":"true"}),"gallery"===(null===a||void 0===a?void 0:a.articleType)&&(0,t.jsx)("span",{className:"home_page_pIcon","aria-hidden":"true",children:(0,t.jsx)("span",{children:null===a||void 0===a?void 0:a.elements})})]})},w=function(e){var n,i,r,a=e.item;return(0,t.jsxs)(t.Fragment,{children:[(null===a||void 0===a||null===(n=a.metadata)||void 0===n?void 0:n.breakingNews)?(0,t.jsx)("span",{className:"breakingBadgeSmall",children:"Breaking"}):(null===a||void 0===a||null===(i=a.metadata)||void 0===i?void 0:i.premiumStory)?(0,t.jsx)("span",{className:"premiumBadgeCrown"}):(null===a||void 0===a||null===(r=a.metadata)||void 0===r?void 0:r.app)&&(0,t.jsx)("span",{className:"exclusiveBadgeSmall",children:"App Exclusive"}),"video"===(null===a||void 0===a?void 0:a.articleType)&&(0,t.jsx)("span",{className:"home_page_vIcon","aria-hidden":"true"}),"gallery"===(null===a||void 0===a?void 0:a.articleType)&&(0,t.jsx)("span",{className:"home_page_pIcon","aria-hidden":"true",children:(0,t.jsx)("span",{children:null===a||void 0===a?void 0:a.elements})})]})},k=function(e){var n,i,r=e.item,a=e.index,o=e.title,l=(0,u.tH)(r),h=(0,u.gJ)(null===r||void 0===r||null===(n=r.image)||void 0===n?void 0:n.images,"fullImage","375x250","375x211","328x246","240x180")||d.Nl,x=(null===r||void 0===r||null===(i=r.metadata)||void 0===i?void 0:i.url)?"".concat(s.BuA).concat(r.metadata.url):"#",w=(0,m.R5)(r);return(0,t.jsxs)("div",{className:"home_section_feed_topCard ".concat(w?"liveFeature":""),children:[(0,t.jsx)(p,{item:r,children:(0,t.jsx)("a",{href:x,className:"home_section_feed_topImgLink",onClick:function(){return f(a,r,o)},children:(0,t.jsxs)("div",{className:"home_section_feed_topImgWrap",children:[(0,t.jsx)(c.Z,{src:h,alt:l,title:l,width:"375",height:"250",defaultImage:d.Nl}),w&&(0,t.jsx)("span",{className:"home_section_feed_liveBadge home_section_feed_topCardLiveBadge",children:"Live"}),(0,t.jsx)(j,{item:r})]})})}),(0,t.jsxs)("div",{className:"home_section_feed_topBody",children:[(0,t.jsx)(_,{item:r,inlineStyle:{marginBottom:"0"}}),(0,t.jsxs)("h3",{className:"home_section_feed_topHeadline",children:[w&&(0,t.jsx)("span",{className:"home_section_feed_liveBadge home_section_feed_topCardLiveBadge",children:"Live"}),(0,t.jsx)("a",{href:x,onClick:function(){return f(a,r,o)},dangerouslySetInnerHTML:{__html:l}})]}),w?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"dHide",children:(0,t.jsx)(v,{item:r,position:a+1,sendTracking:f,isTopStory:!0})}),(0,t.jsx)("div",{className:"mHide",children:(0,t.jsx)(g,{item:r})})]}):(0,t.jsx)(g,{item:r})]})]})},N=function(e){var n,i,r=e.item,a=e.index,o=e.title,l=e.isMobile,h=(0,u.tH)(r),p=(0,u.gJ)(null===r||void 0===r||null===(n=r.image)||void 0===n?void 0:n.images,"148x111","96x96","240x180")||d.ES,x=(null===r||void 0===r||null===(i=r.metadata)||void 0===i?void 0:i.url)?"".concat(s.BuA).concat(r.metadata.url):"#",j=(0,m.R5)(r);return j&&l?(0,t.jsx)(v,{item:r,position:a+1,sendTracking:f,component:function(){return(0,t.jsx)(_,{item:r,small:!0,inlineStyle:{marginBottom:"0"}})}}):(0,t.jsxs)("div",{className:"home_section_feed_listCard",children:[(0,t.jsxs)("div",{className:"home_section_feed_listBody",children:[(0,t.jsx)(_,{item:r,small:!0,inlineStyle:{marginBottom:"0"}}),(0,t.jsxs)("h4",{className:"home_section_feed_listHeadline",children:[j&&(0,t.jsx)("span",{className:"home_section_feed_liveBadge",children:"Live"}),(0,t.jsx)("a",{href:x,onClick:function(){return f(a,r,o)},dangerouslySetInnerHTML:{__html:h}})]}),(0,t.jsx)(g,{item:r})]}),(0,t.jsx)("a",{href:x,className:"home_section_feed_listImgLink",onClick:function(){return f(a,r,o)},children:(0,t.jsxs)("div",{className:"home_section_feed_listImgWrap",children:[(0,t.jsx)(c.Z,{src:p,alt:h,title:h,width:"148",he
1ight:"111",defaultImage:d.dj}),j&&(0,t.jsx)("span",{className:"home_section_feed_liveBadge",children:"\u2022 Live"}),(0,t.jsx)(w,{item:r})]})})]})};function b(e){var n,i,r=e.title,a=e.data,l=(e.addata,e.isMobile),d=e.showWeatherWidget,c=void 0!==d&&d,u=((0,o.useRef)(null),(0,o.useRef)(null),(0,o.useState)(0)),m=u[0],v=u[1],_=(0,o.useState)(null),p=_[0],f=_[1];if(!a)return null;var g=null===a||void 0===a||null===(n=a.listCollectionStories)||void 0===n?void 0:n.filter((function(e){return null===e||void 0===e?void 0:e.id}));if(!Array.isArray(g)||0===g.length)return null;var j=Array.isArray(p)?p:g,w=l?1:3,b=l?j.slice(0,1):j.slice(0,3),y=l?j.slice(w,w+3):j.slice(3,6),C=function(e,n,i){var t;return"".concat(e,"-").concat((null===n||void 0===n?void 0:n.id)||(null===n||void 0===n?void 0:n.storyId)||(null===n||void 0===n||null===(t=n.metadata)||void 0===t?void 0:t.url)||"item","-").concat(i)},B=c?"".concat(s.BuA,"/cities/").concat(null===(i=h.G[m])||void 0===i?void 0:i.url):a.externalUrl?"".concat(s.BuA).concat(a.externalUrl):null,L=r||a.title;return(0,t.jsxs)("section",{className:"home_section_feed",children:[(0,t.jsx)("div",{className:"home_section_feed_sectionHeader",children:(0,t.jsx)("h2",{className:"home_section_feed_sectionTitle",children:B?(0,t.jsxs)("a",{href:B,onClick:function(){return x()},children:[L,(0,t.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:"mHide",children:(0,t.jsx)("path",{d:"M9 6l6 6-6 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]}):(0,t.jsxs)(t.Fragment,{children:[L,(0,t.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M9 6l6 6-6 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})})}),(0,t.jsxs)("div",{className:"home_section_feed_desktopLayout",children:[c&&(0,t.jsx)(h.Z,{onCityChange:function(e){var n=e.index,i=e.stories;v(n),i&&f(i)}}),(0,t.jsx)("div",{className:"home_section_feed_topGrid",children:b.map((function(e,n){return(0,t.jsx)(k,{item:e,index:n,title:L},C("topCard",e,n))}))}),y.length>0&&(0,t.jsx)("div",{className:"home_section_feed_listGrid",children:y.map((function(e,n){return(0,t.jsx)(N,{item:e,index:w+n,title:L,isMobile:l},C("listCard",e,n))}))})]}),(0,t.jsx)("div",{className:"home_section_feed_viewMoreWrap",children:(0,t.jsxs)("a",{href:B,className:"home_section_feed_viewMoreBtn",onClick:function(){return x()},children:["View More",(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",children:(0,t.jsx)("path",{d:"M9 6l6 6-6 6",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})})]})}},55822:function(e,n,i){i.d(n,{G:function(){return _},Z:function(){return x}});var t=i(47568),r=i(10253),a=i(34051),o=i.n(a),l=i(85893),s=i(5152),d=i.n(s),c=i(67294),u=i(39480),m=i(621),h=i(55786),v=d()((function(){return i.e(68826).then(i.bind(i,58305))}),{loadableGenerated:{webpack:function(){return[58305]}}}),_=[{name:"New Delhi",url:"delhi-news"},{name:"Mumbai",url:"mumbai-news"},{name:"Pune",url:"pune-news"},{name:"Bengaluru",url:"bengaluru-news"},{name:"Gurugram",url:"gurugram-news"},{name:"Noida",url:"noida-news"},{name:"Kolkata",url:"kolkata-news"},{name:"Bhopal",url:"bhopal-news"},{name:"Chandigarh",url:"chandigarh-news"},{name:"Dehradun",url:"dehradun-news"},{name:"Indore",url:"indore-news"},{name:"Jaipur",url:"jaipur-news"},{name:"Patna",url:"patna-news"},{name:"Ranchi",url:"ranchi-news"},{name:"Lucknow",url:"lucknow-news"}],p=function(e){var n=Number(e);return Number.isFinite(n)?n:null},f=function(e){return null===e||void 0===e?void 0:e.replace(/-news$/i,"")};function x(e){var n=e.onCityChange,i=(0,c.useState)(0),a=i[0],s=i[1],d=(0,c.useState)({aqi:"NA",temperature:"NA",condition:"NA",label:void 0}),x=d[0],g=d[1],j=(0,c.useState)(!1),w=j[0],k=j[1],N=(0,c.useRef)(null),b=(0,c.useRef)(null),y=(0,c.useRef)({}),C=(0,c.useRef)({}),B=(0,c.useContext)(h.gb).showAdFree,L=function(){var e=(0,t.Z)(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!N.current){e.next=2;break}return e.abrupt("return",N.current);case 2:return b.current||(b.current=(0,m._i)(u.Upg).then((function(e){return N.current=e,e})).catch((function(e){throw b.current=null,e}))),e.abrupt("return",b.current);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),A=function(){var e=(0,t.Z)(o().mark((function e(n){var i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}return e.abrupt("return");case 2:if(i=f(n),!y.current[i]){e.next=6;break}return g(y.current[i]),e.abrupt("return",y.current[i]);case 6:return C.current[i]||(C.current[i]=Promise.all([fetch("".concat(u.GHC,"/").concat(encodeURIComponent(i),".json")),L(),(0,m._i)("".concat(u.KwX,"/").concat("delhi"===i?"new-delhi":i,".json"))]).then(function(){var e=(0,t.Z)(o().mark((function e(n){var t,a,l,s,d,c,u,m,h,v,_,f,x,g,j,w;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=(0,r.Z)(n,3),a=t[0],l=t[1],s=t[2],a.ok){e.next=4;break}return e.abrupt("return",null);case 4:return e.next=6,a.json();case 6:return _=e.sent,f=null===_||void 0===_?void 0:_.data,x=p(null===f||void 0===f||null===(d=f.airQuality)||void 0===d?void 0:d.pollutantAverage),g=(null===(u=null===l||void 0===l||null===(c=l.weather)||void 0===c?void 0:c.find((function(e){var n;return(null===(n=e.name)||void 0===n?void 0:n.toLowerCase())===("delhi"===i?"new delhi":i)})))||void 0===u?void 0:u.temprature_long_details)||(null===s||void 0===s||null===(m=s.weather)||void 0===m||null===(h=m[0])||void 0===h?void 0:h.description),j=null===s||void 0===s||null===(v=s.main)||void 0===v?void 0:v.temp,w={aqi:Number.isFinite(x)?x:"NA",temperature:Number.isFinite(j)?Math.round(j):"NA",condition:g||"NA",label:void 0},y.current[i]=w,e.abrupt("return",w);case 14:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()).catch((function(e){throw delete C.current[i],e})).finally((function(){delete C.current[i]}))),e.next=9,C.current[i];case 9:return(a=e.sent)&&g(a),e.abrupt("return",a);case 12:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();(0,c.useEffect)((function(){var e;A(null===(e=_[0])||void 0===e?void 0:e.url)}),[]);var I=function(){var e=(0,t.Z)(o().mark((function e(i,t){var a,l,d,c;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((null===i||void 0===i?void 0:i.url)&&!w){e.next=2;break}return e.abrupt("return");case 2:return s(t),n({city:i,index:t}),k(!0),e.prev=5,e.t0=r.Z,e.next=9,Promise.all([fetch("".concat(u.zBH,"cities/").concat(encodeURIComponent(i.url),"&size=6")),A(i.url)]);case 9:if(e.t1=e.sent,a=(0,e.t0)(e.t1,1),(l=a[0]).ok){e.next=14;break}throw new Error("Failed to fetch city stories");case 14:return e.next=16,l.json();case 16:d=e.sent,c=null===d||void 0===d?void 0:d.listCollectionStories,n({city:i,index:t,stories:Array.isArray(c)?c:[]}),e.next=24;break;case 21:e.prev=21,e.t2=e.catch(5),n({city:i,index:t,stories:[]});case 24:return e.prev=24,k(!1),e.finish(24);case 27:case"end":return e.stop()}}),e,null,[[5,21,24,27]])})));return function(n,i){return e.apply(this,arguments)}}();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"home_section_layout_sectionTabs ".concat(B?"adFree":""),children:(0,l.jsx)("ul",{children:_.map((function(e,n){return(0,l.jsx)("li",{className:n===a?"home_section_layout_selected":void 0,onClick:function(){return I(e,n)},onKeyDown:function(i){"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),I(e,n))},role:"button",tabIndex:0,children:e.name},e.name)}))})}),(0,l.jsx)(v,{aqi:x.aqi,temperature:x.temperature,condition:x.c
1ondition,label:x.label})]})}}}]);
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.