PageSourceSearch

https://indianexpress.com/wp-content/themes/indianexpress/js/min/ie-infinite-scroll.js?ver=03072026.01

js indianexpress.com collected 2026-09-24 06:04:29 UTC 41,701 bytes, 1 lines download raw bytes

1let iversion="28052026.1";const ieInfiniteScroll={allStories:[],showedStories:[],allStoriesIds:[],showedStoriesIds:[],ieInfiniteUaMata:[],nextStoryUrl:"",nextStoryId:"",processingAjax:false,currentVisibleId:null,totalNextStories:0,browserUrl:"",totalAjaxHit:0,isSubscriber:false,seoMeta:[],ieAdCodes:[],adCounter:0,shortCodeCss:false,audioCodeCss:false,instagramJs:false,twitterJs:false,recommededlogic:false,cssMap:{desktop:["wp-content/themes/indianexpress/style/block-editor/article-block-editor.min.css?ver="+iversion,"wp-content/themes/indianexpress/style/story.css?ver="+iversion,"wp-content/themes/indianexpress/style/article-opinion.css?ver="+iversion,"wp-content/themes/indianexpress/style/story-no-right.css?ver="+iversion],mobile:["wp-content/themes/indianexpress/style/block-editor/article-block-editor.min.css?ver="+iversion,"wp-content/themes/indianexpress/style/block-editor/article-block-editor-responsive.min.css?ver="+iversion,"wp-content/themes/indianexpress/style/article-opinion.css?ver="+iversion,"wp-content/themes/indianexpress/microsites/wap/style/ie-article-style-min.css?ver="+iversion,"wp-content/themes/indianexpress/style/story-no-right.css?ver="+iversion]},viewedStories:new Set,awslogic:false,awsAlogrithm:"",previousUrl:window.location.href,previousArticleId:ieInfiniteScrollDetails.current_postid,lastModifiedBookDiv:"",lastPushedUrl:"",init:function(){let evolokUserPlanDetails=this.getCookie("ie_userdata");if("undefined"!==typeof evolokUserPlanDetails&&""!==evolokUserPlanDetails){evolokUserPlanDetails=JSON.parse(evolokUserPlanDetails);if("undefined"!==typeof evolokUserPlanDetails.subscription_plan&&Array.isArray(evolokUserPlanDetails.subscription_plan)&&evolokUserPlanDetails.subscription_plan.includes("Digital Subscriber")){this.isSubscriber=true;if("undefined"!==typeof ieInfiniteScrollDetails){var link=document.createElement("link");link.rel="stylesheet";link.type="text/css";link.href=ieInfiniteScrollDetails.siteUrl+""+"wp-content/themes/indianexpress/style/ie-custom-infinite-scroll.css?ver=29052026.01";link.media="all";document.head.appendChild(link)}}}let upsc_user_cookie=this.getCookie("user_subscription_details");let currentUrl=window.location.pathname;if("undefined"!==typeof upsc_user_cookie&&""!==upsc_user_cookie&&currentUrl.includes("/article/upsc-current-affairs/")){upsc_user_cookie=JSON.parse(upsc_user_cookie);if("undefined"!==typeof upsc_user_cookie.is_upsc&&false===upsc_user_cookie.is_upsc){this.isSubscriber=false}}if("undefined"!==typeof ieInfiniteScrollDetails&&"undefined"!==typeof DOMPurify&&true===this.isSubscriber){if("true"===ieInfiniteScrollDetails.new_recommended_api&&"off"===ieInfiniteScrollDetails.enable_aws_infinite){this.recommededlogic=true;this.initasync()}else{this.initsync()}if(0<jQuery(".rightpanel").length){this.stickysidebar(".rightpanel")}this.removeAdsSubscribers()}},stickysidebar:function(gallerysidebar){if(typeof jQuery!=="undefined"&&typeof jQuery.fn.theiaStickySidebar==="function"){if(window.innerWidth>=990){jQuery(gallerysidebar).theiaStickySidebar({additionalMarginTop:60,updateSidebarHeight:false})}}},initsync:function(){this.parseAdCodes();this.initiateNextStorySeoMeta(ieInfiniteScrollDetails.current_postid);if("on"===ieInfiniteScrollDetails.enable_aws_infinite){this.initAwsInfiniteScroll()}else{this.initiateInfiniteScroll()}this.removeWidgets();$this.removeSidebarWidgets("pageload",ieInfiniteScrollDetails.current_postid)},initasync:async function(){this.parseAdCodes();this.initiateNextStorySeoMeta(ieInfiniteScrollDetails.current_postid);await this.hit_recommended_api(ieInfiniteScrollDetails.current_postid);this.initiateInfiniteScroll();this.removeWidgets();$this.removeSidebarWidgets("pageload",ieInfiniteScrollDetails.current_postid)},initAwsInfiniteScroll:function(){let outerThis=this;let retryPlanDetails=1;let handle=setInterval(function(){try{if("undefined"!==typeof responseAllWidgets&&Array.isArray(responseAllWidgets)&&responseAllWidgets.length>0){const combinedResult=responseAllWidgets.filter(function(widget){return widget&&(widget.widgetId===14||widget.widgetId===15||widget.widgetId===17)&&Array.isArray(widget.articleSummaries)}).reduce((acc,widget)=>{acc.widgetIds.push(widget.widgetId);acc.articleSummaries=acc.articleSummaries.concat(widget.articleSummaries);return acc},{widgetIds:[],articleSummaries:[]});combinedResult.widgetIds=[...new Set(combinedResult.widgetIds)];combinedResult.totalArticles=combinedResult.articleSummaries.length;if(0<combinedResult.totalArticles){let sectionsSlug=typeof iers_object
1!=="undefined"&&Array.isArray(iers_object.sectionsSlug)?iers_object.sectionsSlug:[];let section=sectionsSlug[0]||null;let subsection=sectionsSlug[1]||null;let level1=[];let level2=[];let others=[];combinedResult.articleSummaries.forEach(function(article){if(!article||typeof article!=="object"){return}let slugs=Array.isArray(article.sectionsSlug)?article.sectionsSlug:[];if(subsection&&slugs.indexOf(subsection)!==-1&&level1.length<3){level1.push(article)}else if(section&&slugs.indexOf(section)!==-1&&level1.length<3){level2.push(article)}else{others.push(article)}});let combinedLevels=level1.concat(level2);let topMatched=combinedLevels.slice(0,3);let remaining=combinedLevels.slice(3);combinedResult.articleSummaries=topMatched.concat(remaining).concat(others).slice(0,10);combinedResult.articleSummaries=combinedResult.articleSummaries.reverse();let posts_ids=[];let posts_url=[];let article_id=ieInfiniteScrollDetails.current_postid;const filterdata={[article_id]:ieInfiniteScrollDetails.posts_info[article_id]};combinedResult.articleSummaries.forEach((element,index)=>{if(element&&typeof element.articleUrl==="string"&&element.articleUrl!==""){outerThis.awsAlogrithm=element.algorithm;let articleId=element.articleId;let articleUrl=element.articleUrl;posts_ids[index]=articleId;posts_url[index]=articleUrl;filterdata[articleId]={seo_meta:{},url:articleUrl}}});ieInfiniteScrollDetails.posts_info={};ieInfiniteScrollDetails.posts_info=filterdata;ieInfiniteScrollDetails.posts_url=posts_url;ieInfiniteScrollDetails.posts_ids=posts_ids;outerThis.awslogic=true;outerThis.initiateInfiniteScroll();clearInterval(handle)}else{outerThis.initiateInfiniteScroll();clearInterval(handle)}}if(3===retryPlanDetails){clearInterval(handle);outerThis.initiateInfiniteScroll()}retryPlanDetails++}catch(e){clearInterval(handle);outerThis.initiateInfiniteScroll()}},1e3)},initiateInfiniteScroll:function(){$this=this;if(1===jQuery(".pdsc-related-modify").length){$this.shortCodeCss=true}if(1===jQuery(".audio-player-tts-sec").length){$this.audioCodeCss=true}$this.currentVisibleId=ieInfiniteScrollDetails.current_postid;$this.allStories=ieInfiniteScrollDetails.posts_url;$this.allStoriesIds=ieInfiniteScrollDetails.posts_ids;$this.totalNextStories=$this.allStories.length;$this.setObserverPattern(document.querySelector(".iestory_"+$this.currentVisibleId));$this.updateState("load");jQuery(window).on("scroll",function(){$this.debounce($this.processScroll,100)})},trackReadMoreWidgetOnInfiniteScroll:function(articleContId,src){$this=this;implyEventType="wordpress";if(true===this.awslogic){implyEventType=this.awsAlogrithm;if("undefined"!==typeof initiateIersApiCall){let pageWidgets=[{widgetId:16,name:"Infinite Scroll Article",slug:"infinite_scroll_article",widgetArticleIdClicked:articleContId,recommendationId:"",impressions:[{articleId:articleContId}]}];let additionalParams={type:"aws_infinite_scroll",articleContId:articleContId,pageReferer:$this.previousUrl,previousArticleId:$this.previousArticleId};initiateIersApiCall("click",pageWidgets,additionalParams);$this.previousUrl=src;$this.previousArticleId=articleContId}}else if("true"===ieInfiniteScrollDetails.new_recommended_api){implyEventType="nanu"}var implyBody={};if("undefined"!==typeof window.psdkvar){implyBody.e1="appear";implyBody.e3=ieInfiniteScrollDetails.section;implyBody.fpuuid=$this.getImplyPluuidFromCookie();implyBody.pageUrl=$this.seoMeta[articleContId].og_url;implyBody.storyId=$this.seoMeta[articleContId].post_id;implyBody.eventName="infinite_article";implyBody.eventType=implyEventType;if("undefined"!==typeof iersUserType&&""!==iersUserType){implyBody.e5=iersUserType}if("undefined"!==typeof $this.isSubscriber&&"subscriber"===$this.isSubscriber){implyBody.type=7}window.psdkvar.eventCapture(implyBody)}},getImplyPluuidFromCookie:function(){let name="pluuid=";let ca=document.cookie.split(";");let ca_length=ca.length;for(let i=0;i<ca_length;i++){let c=ca[i];while(" "===c.charAt(0)){c=c.substring(1)}if(0===c.indexOf(name)){return c.substring(name.length,c.length)}}return""},processScroll:function(){var allStories=jQuery("#section").children(".native_story");if(allStories.length===0){allStories=jQuery("#section")}var lastStory=allStories.last();var windowScrollTop=jQuery(window).scrollTop();var windowHeight=jQuery(window).height();var viewportBottom=windowScrollTop+windowHeight;var lastStoryTop=lastStory.offset().top;var lastStoryHeight=lastStory.outerHeight();var scrolledIntoLastStory=viewportBottom-lastStoryTop;var percentageScrolled=scrolledIntoLastStory/lastStoryHeight*100;console.log("Last story scrolled: "+percentageScrolled.toFixed(2)+"%");if(percentageScrolled>=50&&false===$this.processingAjax&&0<$this.totalNextStories){console.log("Loading next story...");$this.processingAjax=true;$this.getNextStory()}},getCurrentArticle:function(){let best={el:null,ratio:0};jQuery(".native_story").each(function(){const rect=this.getBoundingClientRect();const viewportTop=0;const viewportBottom=window.innerHeight;const visibleTop=Math.max(viewportTop,rect.top);const visibleBottom=Math.min(viewportBottom,rect.bottom);const visibleHeight=Math.max(0,visibleBottom-visibleTop);const height=rect.height||rect.bottom-rect.top||1;const ratio=Math.max(0,Math.min(visibleHeight/height,1));if(ratio>best.ratio)best={el:this,ratio:ratio}});return best.el},debounce:function(method,delay){$this=this;clearTimeout(method._tId);method._tId=setTimeout(function(){$this.processScroll()},delay)},getNextStory:function(){$this=this;let nextStoryIndicationDiv=document.createElement("div");nextStoryIndicationDiv.className="infinite_loading_outer clear";let nextStoryIndicationInnerDiv=document.createElement("div");nextStoryIndicationInnerDiv.className="ie_infinite_loading";nextStoryIndicationDiv.appendChild(nextStoryIndicationInnerDiv);let nextStoryScrollDiv=document.createElement("div");nextStoryScrollDiv.className="next-auto-scroll-story";let nextStoryScrollSpan=document.createElement("span");nextStoryScrollSpan.innerText="Next Story";nextStoryScrollDiv.appendChild(nextStoryScrollSpan);jQuery("#section").append(nextStoryIndicationDiv);jQuery("#section").append(nextStoryScrollDiv);if(undefined!==ieInfiniteScrollDetails&&undefined!==ieInfiniteScrollDetails.section&&"columns"!==ieInfiniteScrollDetails.section&&"editorials"
1!==ieInfiniteScrollDetails.section){$this.createInfiniteScrollAd()}window.ieDeviceCssInjected=window.ieDeviceCssInjected||false;setTimeout(()=>{jQuery(".infinite_loading_outer").show();jQuery.ajax({type:"GET",url:$this.nextStoryUrl+"?get_infinite_ajax_var=1&section="+ieInfiniteScrollDetails.section+"&last_post_id="+ieInfiniteScrollDetails.last_post_id+"&load_post_ids="+ieInfiniteScrollDetails.load_post_ids+"&infinite_current_postid="+$this.nextStoryId,success:function(response,textStatus,xhr){if("undefined"!==typeof xhr.status&&200===parseInt(xhr.status)){let newStoryId=$this.nextStoryId;$this.getInfiniteUaData(response,newStoryId);$this.addInstagramJs();$this.addTwitterJs();$this.updateState("ajax");jQuery(".infinite_loading_outer").remove();if(true===$this.recommededlogic||true===$this.awslogic){$this.get_new_seo_meta(response,newStoryId)}var response=response.substring(response.indexOf('<div id="getnextstoryliststart"></div>'),response.lastIndexOf('<div id="getnextstorylistend"></div>'));response=response.replace('<div id="getnextstoryliststart"></div>',"");jQuery("#section").append(DOMPurify.sanitize(response));jQuery(".infinite_new_section .breaking-news").remove();$this.addCss();$this.removeSidebarWidgets("ajaxload",newStoryId);if(0<jQuery(".rightpanel").length){$this.stickysidebar(".rightpanel")}if(0<jQuery("#native_story_"+newStoryId+" .leftpanel").length){$this.stickysidebar("#native_story_"+newStoryId+" .leftpanel")}$this.totalAjaxHit=$this.totalAjaxHit+1;$this.initiateNextStorySeoMeta(newStoryId,"ajaxload");$this.reinitiateAds(newStoryId);$this.updateCustomUaData(newStoryId);$this.fireClicks();if(0<jQuery(".share-box").length){$this.sharebtn(newStoryId)}if(0<jQuery(".block3_readmore").length){jQuery(document).on("click",".read-more-btn",function(){jQuery(this).parent().parent().parent(".article-body-readmore").removeClass("cropped-readmore");jQuery(this).parent().remove()})}setTimeout(function(){const target=document.querySelectorAll(".lazyloading");const observerCallback=(entries,observer)=>{entries.forEach(entry=>{if(entry.isIntersecting&&entry.target.getAttribute("data-src")){entry.target.src=entry.target.getAttribute("data-src");entry.target.removeAttribute("data-src");if(entry.target.getAttribute("data-srcset")){entry.target.srcset=entry.target.getAttribute("data-srcset");entry.target.removeAttribute("data-srcset")}observer.unobserve(entry.target)}})};const observerOptions={threshold:.2};const observer=new IntersectionObserver(observerCallback,observerOptions);if(target){target.forEach(img=>{observer.observe(img)})}$this.processingAjax=false},3e3)}},error:function(xhr,ajaxOptions,thrownError){jQuery(".infinite_loading_outer").remove();console.log("error_in_infinite_scroll")}})},400)},updateState:function(type){$this=this;if(0<$this.allStories.length){$this.nextStoryUrl=$this.allStories.pop();$this.nextStoryId=$this.allStoriesIds.pop()}if("ajax"===type){$this.showedStories.push($this.nextStoryUrl);$this.showedStoriesIds.push($this.nextStoryId);$this.currentVisibleId=$this.nextStoryId;$this.totalNextStories=$this.totalNextStories-1}},setObserverPattern:function(element){$this=this;const hideWhenBoxInView=new IntersectionObserver(entries=>{if(entries[0].intersectionRatio<=0){console.log("innotview")}else{if("function"===typeof iersRerenderWidget){iersRerenderWidget()}let currentViewPortPostId=entries[0].target.getAttribute("data-postid");$this.updateUrl(currentViewPortPostId);$this.updateSeoMeta(currentViewPortPostId);if(!$this.viewedStories.has(currentViewPortPostId)){if(0<jQuery(".infinite_new_section").length){console.log("mycustomeventtracking");$this.updateEventdata(currentViewPortPostId)}$this.viewedStories.add(currentViewPortPostId)}}});hideWhenBoxInView.observe(element)},updateEventdata:function(currentViewPortPostId){$this=this;let currentStoryUrl=ieInfiniteScrollDetails["posts_info"][currentViewPortPostId]["url"];$this.fireEvents(currentStoryUrl,currentViewPortPostId);$this.fireEvolokApiCall()},updateUrl:function(currentViewPortPostId){$this=this;if(currentViewPortPostId&&ieInfiniteScrollDetails["posts_info"][currentViewPortPostId]){let currentURL=ieInfiniteScrollDetails["posts_info"][currentViewPortPostId]["url"];let newUrl=currentURL;if(currentViewPortPostId!==ieInfiniteScrollDetails.current_postid){if(currentURL.includes("?")){if(!currentURL.includes("ref=")){newUrl=currentURL+"&ref=infinite"}}else{newUrl=currentURL+"?ref=infinite"}}if(this.lastPushedUrl===newUrl||window.location.href===newUrl){return}this.lastPushedUrl=newUrl;this.browserUrl=newUrl;window.history.replaceState("","",newUrl)}},initiateNextStorySeoMeta:function(nextStoryId,loadtype="notajax"){$this=this;$this.seoMeta[nextStoryId]=ieInfiniteScrollDetails.posts_info[nextStoryId].seo_meta;if("ajaxload"!==loadtype){$this.updateSeoMeta(nextStoryId)}setTimeout(function(){let nextElement=document.querySelector(".iestory_"+nextStoryId);if("undefined"!==typeof nextElement&&null!==nextElement){$this.setObserverPattern(nextElement)}},2e3)},updateSeoMeta:function(id){$this=this;if("undefined"!==typeof $this.seoMeta[id]&&""!==$this.seoMeta[id]){document.getElementsByTagName("title")[0].innerText=$this.seoMeta[id].seo_title;const metaDes=document.querySelector("meta[name=description]");if("undefined"!==metaDes&&null!==metaDes){document.querySelector("meta[name=description]").setAttribute("content",$this.seoMeta[id].seo_de
1scription)}const metaKey=document.querySelector("meta[name=keywords]");if("undefined"!==metaKey&&null!==metaKey){document.querySelector("meta[name=keywords]").setAttribute("content",$this.seoMeta[id].seo_keywords)}const ogTitle=document.querySelector('meta[property="og:title"]');if("undefined"!==ogTitle&&null!==ogTitle){document.querySelector('meta[property="og:title"]').setAttribute("content",$this.seoMeta[id].og_title)}const ogDes=document.querySelector('meta[property="og:description"]');if("undefined"!==ogDes&&null!==ogDes){document.querySelector('meta[property="og:description"]').setAttribute("content",$this.seoMeta[id].og_description)}const ogUrl=document.querySelector('meta[property="og:url"]');if("undefined"!==ogUrl&&null!==ogUrl){document.querySelector('meta[property="og:url"]').setAttribute("content",$this.seoMeta[id].og_url)}const ogImg=document.querySelector('meta[property="og:image"]');if("undefined"!==ogImg&&null!==ogImg){document.querySelector('meta[property="og:image"]').setAttribute("content",$this.seoMeta[id].og_image)}const twTitle=document.querySelector('meta[name="twitter:title"]');if("undefined"!==twTitle&&null!==twTitle){document.querySelector('meta[name="twitter:title"]').setAttribute("content",$this.seoMeta[id].tw_title)}const twDes=document.querySelector('meta[name="twitter:description"]');if("undefined"!==twDes&&null!==twDes){document.querySelector('meta[name="twitter:description"]').setAttribute("content",$this.seoMeta[id].tw_description)}const twUrl=document.querySelector('meta[name="twitter:url"]');if("undefined"!==twUrl&&null!==twUrl){document.querySelector('meta[name="twitter:url"]').setAttribute("content",$this.seoMeta[id].tw_url)}const twCre=document.querySelector('meta[name="twitter:creator"]');if("undefined"!==twCre&&null!==twCre){document.querySelector('meta[name="twitter:creator"]').setAttribute("content",$this.seoMeta[id].tw_creator)}const twImg=document.querySelector('meta[property="twitter:image"]');if("undefined"!==twImg&&null!==twImg){document.querySelector('meta[property="twitter:image"]').setAttribute("content",$this.seoMeta[id].tw_image)}const canonical=document.querySelector('link[rel="canonical"]');if("undefined"!==canonical&&null!==canonical){canonical.href=$this.seoMeta[id].seo_canonical}}},addCss:function(){$this=this;if(1===jQuery(".pdsc-related-modify").length&&false==$this.shortCodeCss){$this.shortCodeCss=true;var head=document.getElementsByTagName("head")[0];var link=document.createElement("link");link.rel="stylesheet";link.type="text/css";link.href=ieInfiniteScrollDetails.siteUrl+"wp-content/themes/indianexpress/style/priority-driven-shortcode.css?ver=15042020.1";link.media="all";head.appendChild(link)}if(1===jQuery(".audio-player-tts-sec").length&&false==$this.audioCodeCss){$this.audioCodeCss=true;var head=document.getElementsByTagName("head")[0];var link=document.createElement("link");link.rel="stylesheet";link.type="text/css";link.href=ieInfiniteScrollDetails.siteUrl+"wp-content/plugins/ie-aws/assets/css/audio-player.css?ver=06022023.3";link.media="all";head.appendChild(link)}if(typeof ieInfiniteScrollDetails==="undefined"){return}if(window.ieDeviceCssInjected===true){jQuery(".infinite_new_section .author-tab.comments").hide();return}var cssMap=this.cssMap;var device=ieInfiniteScrollDetails.device;if(!cssMap[device]){return}var cssFiles=cssMap[device];for(var i=0;i<cssFiles.length;i++){var link=document.createElement("link");link.rel="stylesheet";link.type="text/css";link.href=ieInfiniteScrollDetails.siteUrl+cssFiles[i];link.media="all";document.head.appendChild(link)}window.ieDeviceCssInjected=true;jQuery(".infinite_new_section .author-tab.comments").hide()},addInstagramJs:function(){$this=this;if(false===$this.instagramJs){$this.instagramJs=true;scriptEle=document.createElement("script");scriptEle.setAttribute("src","https://www.instagram.com/embed.js");scriptEle.setAttribute("type","text/javascript");scriptEle.setAttribute("async",true);document.body.appendChild(scriptEle)}if(typeof window.instgrm!=="undefined"){setTimeout(function(){window.instgrm.Embeds.process()},2e3)}},addTwitterJs:function(){$this=this;if(false===$this.twitterJs){$this.twitterJs=true;var scriptEle=document.createElement("script");scriptEle.setAttribute("src","https://platform.twitter.com/widgets.js");scriptEle.setAttribute("type","text/javascript");scriptEle.setAttribute("async",true);document.body.appendChild(scriptEle)}if(typeof window.twttr!=="undefined"&&window.twttr.widgets){setTimeout(function(){window.twttr.widgets.load()},2e3)}},fireEvents:function(src,id=""){$this=this;var loc="";loc=src;src=src.replace(ieInfiniteScrollDetails.siteUrl,"");if("undefined"!==jQuery.type(gtag)){gtag("event","infinite_scroll",{device:ieInfiniteScrollDetails.device,storyNumber:parseInt($this.totalAjaxHit+1)});gtag("event","page_view",{page:src,page_location:loc})}if("undefined"!==typeof COMSCORE){COMSCORE.beacon({c1:"2",c2:"8738137",c4:src})}if("undefined"!==typeof pSUPERFLY&&$this.seoMeta[id]){pSUPERFLY.virtualPage({sections:ieInfiniteScrollDetails.section,path:src,title:$this.seoMeta[id].seo_title})}$this.trackReadMoreWidgetOnInfiniteScroll(id,src);$this.fireUaCaptureEvent(id);if("undefined"!==typeof Moengage){Moengage.track_page_view()}},fireEvolokApiCall:function(){let usergeolocation=sessionStorage.getItem("ua_geoip_location");if("undefined"!==typeof custom_ev_data&&"undefined"!==typeof usergeolocation&&""!==usergeolocation){geo_data=jQuery.parseJSON(usergeolocation);geo_var=geo_data.countryIsoCode.toLowerCase();geo_city=geo_data.city.toLowerCase().replace(/[^a-zA-Z0-9]+/g,"-");geo_state=geo_data.state.toLowerCase().replace(/[^a-zA-Z0-9]+/g,"-");do_metering(custom_ev_data,geo_var,geo_city,geo_state)}},reinitiateAds:function(postid){$this=this;let uniqueContainer="#native_story_"+postid+" .ad-slot";let adClasses=document.querySelectorAll(uniqueContainer);let adClassesLength=document.querySelectorAll(uniqueContainer).length;let notRemoveAdsSingle=["gpt_ad_IE_ROS_ATF_728X90","gpt_ad_IE_ROS_ROTATE_1_300X250"];
1if("mobile"===ieInfiniteScrollDetails.device){notRemoveAdsSingle=["gpt_ad_IE_ROS_ATF_300X250","gpt_ad_IE_ROS_BTF_300X250"]}if(undefined!==ieInfiniteScrollDetails&&(undefined!==ieInfiniteScrollDetails.section||undefined!==ieInfiniteScrollDetails.political_details)&&("opinion"===ieInfiniteScrollDetails.section||"columns"===ieInfiniteScrollDetails.section||"editorials"===ieInfiniteScrollDetails.section||"1"===ieInfiniteScrollDetails.political_details)){notRemoveAdsSingle=["gpt_ad_IE_ROS_ATF_728X90","gpt_ad_IE_ROS_ATF_300X250"];if("mobile"===ieInfiniteScrollDetails.device){notRemoveAdsSingle=["gpt_ad_IE_ROS_ATF_300X250","gpt_ad_IE_ROS_MID_300X250"]}}for(i=0;i<adClassesLength;i++){let elementId=adClasses[i].getAttribute("data-id");if("string"!==typeof elementId){elementId=adClasses[i].getAttribute("id")}adClasses[i].setAttribute("id",elementId)}setTimeout(function(){if(0<$this.ieAdCodes.length){for(AdCode in $this.ieAdCodes){let adDetails=$this.ieAdCodes[AdCode];let slotId=adDetails["slot_id"];let slotName=adDetails["slot_name"];let slotSize=adDetails["slot_size"];let oldId="#native_story_"+postid+" #"+slotId;let newId=slotId+"_"+postid;if(notRemoveAdsSingle.includes(slotId)&&(0<jQuery("#"+slotId).length||0<jQuery('[data-id="'+slotId+'"]').length)){if(0<jQuery(oldId).length){jQuery(oldId).attr("id",newId);let definedAdSlots=googletag.defineSlot(slotName,slotSize,newId).addService(googletag.pubads());googletag.display(newId);googletag.pubads().refresh([definedAdSlots])}}else{if(0<jQuery("#"+slotId).closest(".ie-adsbox").length){jQuery("#"+slotId).closest(".ie-adsbox").remove()}else if(0<jQuery('[data-id="'+slotId+'"]').closest(".ie-adsbox").length){jQuery('[data-id="'+slotId+'"]').closest(".ie-adsbox").remove()}else if(0<jQuery("#"+slotId).closest(".ads-container").length){jQuery("#"+slotId).closest(".ads-container").remove()}else if(0<jQuery('[data-id="'+slotId+'"]').closest(".ads-container").length){jQuery('[data-id="'+slotId+'"]').closest(".ads-container").remove()}else{if("Advertisement"===jQuery("#"+slotId).prev(".ie-adtext").html()||"Story continues below this ad"===jQuery("#"+slotId).prev(".ie-adtext").html()){jQuery("#"+slotId).parent(".adboxtop").css("padding-bottom",0);jQuery("#"+slotId).parent(".adboxtop").css("min-height",0);jQuery("#"+slotId).prev(".ie-adtext").remove()}else if("Advertisement"===jQuery("#"+slotId).prev(".ie-adtext").html()||"Story continues below this ad"===jQuery('[data-id="'+slotId+'"]').prev(".ie-adtext").html()){jQuery('[data-id="'+slotId+'"]').parent(".adboxtop").css("padding-bottom",0);jQuery('[data-id="'+slotId+'"]').parent(".adboxtop").css("min-height",0);jQuery('[data-id="'+slotId+'"]').prev(".ie-adtext").remove()}if(!notRemoveAdsSingle.includes("gpt_ad_IE_ROS_ATF_1X1")){if(0<jQuery(".osv-ad-class").length){jQuery(".osv-ad-class").remove()}}if(0<jQuery(".ie-int-campign-ad").length){jQuery(".ie-int-campign-ad").remove()}if(0<jQuery("#native_story_"+postid+" .ie-above-breadcrumb-ad").length){jQuery("#native_story_"+postid+" .ie-above-breadcrumb-ad").remove()}jQuery("#"+slotId).remove();jQuery('[data-id="'+slotId+'"]').remove()}}}if(undefined!==ieInfiniteScrollDetails&&undefined!==ieInfiniteScrollDetails.section&&"columns"!==ieInfiniteScrollDetails.section&&"editorials"!==ieInfiniteScrollDetails.section){$this.renderInfiniteScrollAd(postid)}$this.adCounter=$this.adCounter+1}$this.removeAdsSubscribers()},3e3)},removeWidgets:function(){if(0<jQuery("#jetpack_most_read_posts_list").length){jQuery("#jetpack_most_read_posts_list").remove()}},removeSidebarWidgets:function(loadType,newStoryId){if("ajaxload"===loadType&&0<jQuery(".iestory_"+newStoryId+" #taboola-right-article-personalisation").length){jQuery(".iestory_"+newStoryId+" #taboola-right-article-personalisation").remove()}if(1<jQuery(".iestory_"+newStoryId+" .rightpanel .add-first").length){jQuery(".iestory_"+newStoryId+" .rightpanel .add-first").remove()}if(1<jQuery(".iestory_"+newStoryId+" .right-section .add-first").length){jQuery(".iestory_"+newStoryId+" .right-section .add-first").remove()}if(1<jQuery(".iestory_"+newStoryId+" .add-first").length){let elementCount=jQuery(".iestory_"+newStoryId+" .add-first").length;for(i=1;i<elementCount;i++){jQuery(".iestory_"+newStoryId+" .add-first").eq(i).remove()}}if(1<jQuery(".iestory_"+newStoryId+" .editor-pic").length){let elementCount=jQuery(".iestory_"+newStoryId+" .editor-pic").length;for(i=1;i<elementCount;i++){jQuery(".iestory_"+newStoryId+" .editor-pic").eq(i).remove()}}if(0<jQuery(".iestory_"+newStoryId+" .h-text-widget").length){jQuery(".iestory_"+newStoryId+" .h-text-widget").remove()}if(0<jQuery(".iestory_"+newStoryId+" .rhs-banner-wrapn").length){jQuery(".iestory_"+newStoryId+" .rhs-banner-wrapn").remove()}if("ajaxload"===loadType){jQuery(".iestory_"+newStoryId+" .rightpanel .add-first").remove();jQuery(".iestory_"+newStoryId+" .right-section .add-first").remove()}},parseAdCodes:function(){$this=this;if("undefined"!==typeof ad_code_params&&"undefined"!==typeof ad_code_params.ad_units){for(AdCode in ad_code_params.ad_units){let slotId=ad_code_params.ad_units[AdCode]["slot_id"];let slotName=ad_code_params.ad_units[AdCode]["slot_name"];let slotSizeMayBe=slotId.split("_").pop();let slotSize=[1,1];if("article-opinion"===ad_code_params.tag_slug||"1"===ad_code_params.political_template){slotSize=ad_code_params.ad_units[AdCode]["slot_size"]}else if("undefined"!==typeof slotSizeMayBe&&-1!==slotSizeMayBe.indexOf("X")){slotSize=slotSizeMayBe.split("X");slotSize=slotSize.map(Number)}let slotDetails={slot_id:slotId,slot_name:slotName,slot_size:slotSize};$this.ieAdCodes.push(slotDetails)}}},getCookie:function(cname){let name=cname+"=";let decodedCookie=decodeURIComponent(document.cookie);let ca=decodedCookie.split(";");for(let i=0;i<ca.length;i++){let c=ca[i];while(c.charAt(0)==" "){c=c.substring(1)}if(c.indexOf(name)==0){return c.substring(name.length,c.length)}}return""},async hit_recommended_api(article_id){if(""===article_id){return}let userId=this.getCookie("pluuid");var host_url=window.location.hostname;let apiUrl=`https://devua.indianexpress.com/api/druid/article/summary?channelId=2&hour=640&articleId=${article_id}&limit=4&algo=2&userId=${userId}`;let apiOrigin="https://preprod.indianexpress.com/";if("indianexpress.com"==host_url){apiUrl=`https://ua.indianexpress.com/api/druid/article/summary?channelId=2&hour=640&articleId=${article_id}&limit=4&algo=2&userId=${userId}`;apiOrigin="https://indianexpress.com/"}let apiKey="0355c2d801f6d0fee2f1977f14cc673d25d7335d2324f7e8a5db3bdfce04d0f5";const myHeaders=new Headers;myHeaders.append("Origin",apiOrigin);myHeaders.append("API-KEY",apiKey);const requestOptions={method:"GET",headers:myHeaders};try{const response=await fetch(apiUrl,requestOptions);if(!response.ok){throw new Error(`HTTP error! status: ${response.status}`)}let result=await response.json();result=result.slice(1);let posts_ids=[];let posts_url=[];const filterdata={[article_id]:ieInfiniteScrollDetails.posts_info[article_id]};result.forEach((element,index)=>{if(element.articleUrl&&"string"===typeof element.articleUrl&&""!==element.articleUrl){posts_ids[index]=element.articleId;posts_url[index]=element.articleUrl;filterdata[element.articleId]={seo_meta:{},url:element.articleUrl}}});ieInfiniteScrollDetails.posts_info={};ieInfiniteScrollDetails.posts_info=filterdata;ieInfiniteScrollDetails.posts_url=posts_url;ieInfiniteScrollDetails.posts_ids=posts_ids}catch(error){console.error("Error fetching data:",error)}},get_new_seo_meta:function(getresponse,article_id){let parser=new DOMParser;let doc=parser.parseFromString(getresponse,"text/html");let headTag=doc.head.outerHTML;if(headTag){let headDoc=parser.parseFromString(headTag,"text/html");let title=headDoc.querySelector("title")?.innerText??"";let metaDescription=headDoc.querySelector('meta[name="description"]')?.getAttribute("content")??"";let keywords=headDoc.querySelector('meta[name="keywords"]')?.getAttribute("content")??"";let ogtitle=headDoc.querySelector('meta[property="og:title"]')?.getAttribute("content")??"";let ogdescription=headDoc.querySelector('meta[property="og:description"]')?.getAttribute("content")??"";let ogurl=headDoc.querySelector('meta[property="og:url"]')?.getAttribute("content")??"";let og_image=headDoc.querySelector('meta[property="og:image"]')?.getAttribute("content")??"";let tw_title=headDoc.querySelector('meta[property="twitter:title"]')?.getAttribute("content")??"";let tw_description=headDoc.querySelector('meta[property="twitter:description"]')?.getAttribute("content")??"";let tw_url=headDoc.querySelector('meta[property="twitter:url"]')?.getAttribute("content")??"";let tw_creator=headDoc.querySelector('meta[property="twitter:creator"]')?.getAttribute("content")??"";let tw_image=headDoc.querySelector('meta[property="twitter:image"]')?.getAttribute("content")??"";let p_author=headDoc.querySelector('meta[itemprop="author"]')?.getAttribute("content")??"";let p_tags=headDoc.querySelector('meta[name="news_keywords"]')?.getAttribute("content")??"";let canonical=document.querySelector('link[rel="canonical"]')?.getAttribute("href")??"";if(document.getElementsByTagName("title")[0]&&"undefined"!==typeof title&&null!==title&&""!==title){document.getElementsByTagName("title")[0].innerText=title}if(document.querySelector("meta[name=description]")&&"undefined"!==typeof metaDescription&&null!==metaDescription&&""!==metaDescription){document.querySelector("meta[name=description]").setAttribute("content",metaDescription)}if(document.querySelector("meta[name=keywords]")&&"undefined"!==typeof keywords&&null!==keywords&&""!==keywords){document.querySelector("meta[name=keywords]").setAttribute("content",keywords)}if(document.querySelector('meta[property="og:title"]')&&"undefined"!==typeof ogtitle&&null!==ogtitle&&""!==ogtitle){document.querySelector('meta[property="og:title"]').setAttribute("content",ogtitle)}if(document.querySelector('meta[property="og:description"]')&&"undefined"!==typeof ogdescription&&null!==ogdescription&&""!==ogdescription){document.querySelector('meta[property="og:description"]').setAttribute("content",ogdescription)}if(document.querySelector('meta[property="og:url"]')&&"undefined"!==typeof ogurl&&null!==ogurl&&""!==ogurl){document.querySelector('meta[property="og:url"]').setAttribute("content",ogurl)}if(document.querySelector('meta[property="og:image"]')&&"undefined"!==typeof og_image&&null!==og_image&&""!==og_image){document.querySelector('meta[property="og:image"]').setAttribute("content",og_image)}if(document.querySelector('meta[property="twitter:title"]')&&"undefined"!==typeof tw_title&&null!==tw_title&&""!==tw_title){document.querySelector('meta[property="twitter:title"]').setAttribute("content",tw_title)}if(document.querySelector('meta[property="twitter:description"]')&&"undefined"!==typeof tw_description&&null!==tw_description&&""!==tw_description){document.querySelector('meta[property="twitter:description"]').setAttribute("content",tw_description)}if(document.querySelector('meta[property="twitter:url"]')&&"undefined"!==typeof tw_url&&null!==tw_url&&""!==tw_url){document.querySelector('meta[property="twitter:url"]').setAttribute("content",tw_url)}if(document.querySelector('meta[property="twitter:creator"]')&&"undefined"!==typeof tw_creator&&null!==tw_creator&&""!==tw_creator){document.querySelector('meta[property="twitter:creator"]').setAttribute("content",tw_creator)}if(document.querySelector('meta[property="twitter:image"]')&&"undefined"!==typeof tw_image&&null!==tw_image&&""!==tw_image){document.querySelector('meta[property="twitter:image"]').setAttribute("content",tw_image)}if(document.querySelector('link[rel="canonical"]')&&"undefined"!==typeof canonical&&null!==canonical&&""!==canonical){document.querySelector('link[rel="canonical"]').setAttribute("href",canonical)}if(document.querySelector('meta[property="og:type"]')&&"undefined"!==typeof tw_creator&&null!==tw_creator&&""!==tw_creator){document.querySelector('meta[property="og:type"]').setAttribute("content",tw_creator)}if(document.querySelector('meta[itemprop="author"]')&&"undefined"!==typeof p_author&&null!==p_author&&""!==p_author){document.querySelector('meta[itemprop="author"]').setAttribute("content",p_author)}if(document.querySelector('meta[name="news_keywords"]')&&"undefined"!==typeof p_tags&&null!==p_tags&&""!==p_tags){document.querySelector('meta[name="news_keywords"]').setAttribute("content",p_tags)}ieInfiniteScrollDetails.posts_info[article_id]={seo_meta:{post_id:article_id,seo_title:title,seo_description:metaDescription,seo_keywords:keywords,seo_canonical:canonical,seo_robots:"NOODP",og_title:ogtitle,og_description:ogdescription,og_url:ogurl,og_image:og_image,tw_title:tw_title,tw_description:tw_description,tw_url:tw_url,tw_creator:tw_creator,t
1w_image:tw_image,p_author:p_author,p_tags:p_tags},url:ieInfiniteScrollDetails.posts_info[article_id].url}}},sharebtn:function(postid){$this=this;let shareIcon=document.querySelectorAll("#native_story_"+postid+" .share-box .share-btn");let shareIconMobile=document.querySelectorAll("#native_story_"+postid+" .share-article-btn .share-btn");let sharePopup=document.querySelector("#native_story_"+postid+" .share-options");let shareCloseBtn=document.querySelector("#native_story_"+postid+" #share-Btn-close");let shareButtons=document.querySelectorAll("#native_story_"+postid+" .a-share-btn");shareIcon.forEach(function(item){item.addEventListener("click",event=>{event.stopPropagation();event.preventDefault();let target=item.closest(".share-box");target.appendChild(sharePopup);sharePopup.classList.add("active")})});shareIconMobile.forEach(function(item){item.addEventListener("click",event=>{event.stopPropagation();event.preventDefault();let target=item.closest(".share-article-btn");target.appendChild(sharePopup);sharePopup.classList.add("active")})});if(shareCloseBtn){shareCloseBtn.addEventListener("click",function(event){event.stopPropagation();event.preventDefault();this.closest("#options-share").classList.remove("active")})}if(shareButtons){shareButtons.forEach(function(button){button.addEventListener("click",function(event){event.preventDefault();let shareUrl=button.getAttribute("data-href");if(shareUrl){window.open(shareUrl,"_blank")}})})}},fireClicks:function(){if(!window.iePublishToggleInit){window.iePublishToggleInit=true;ieInitPublishDateToggle()}},createInfiniteScrollAd:function(){$this=this;const subcEosParentId="sub_eoc_unique_id_"+$this.nextStoryId;const subcEosParentDiv=document.createElement("div");subcEosParentDiv.id=subcEosParentId;const isDesktop=ieInfiniteScrollDetails.device==="desktop";const wrapperDiv=document.createElement("div");wrapperDiv.className=isDesktop?"add-first":"ads-container";const adText=document.createElement("div");adText.className="ie-adtext";adText.innerText="Advertisement";if("undefined"!==ieInfiniteScrollDetails.remove_top_ad&&"1"===ieInfiniteScrollDetails.remove_top_ad){return}if(isDesktop){wrapperDiv.appendChild(adText)}else{const adBoxTop=document.createElement("div");adBoxTop.className="adboxtop adsizes";adBoxTop.appendChild(adText);wrapperDiv.appendChild(adBoxTop)}subcEosParentDiv.appendChild(wrapperDiv);jQuery("#section").append(subcEosParentDiv)},renderInfiniteScrollAd:function(postid){$this=this;let device=ieInfiniteScrollDetails.device;let getSubsEosDiv="desktop"===device?"#sub_eoc_unique_id_"+postid+" .add-first":"#sub_eoc_unique_id_"+postid+" .ads-container .adboxtop";let subsEosAdUnit="gpt_ad_IE_MOB_SUBS_EOS_300X250_"+postid;let subEosSlotName="/1050432/www.indianexpress.com/IE_mWeb_SUBS_EOS_300x250";let subEosSlotSize=[[300,250],[336,280]];if("undefined"!==ieInfiniteScrollDetails.remove_top_ad&&"1"===ieInfiniteScrollDetails.remove_top_ad){return}if(0<jQuery(getSubsEosDiv).length){if("desktop"===device){subsEosAdUnit="gpt_ad_IE_DESK_SUBS_EOS_300X250_"+postid;subEosSlotName="/1050432/www.indianexpress.com/IE_Desk_SUBS_EOS_300x250";subEosSlotSize=[300,250]}let subsAdDiv=document.createElement("div");subsAdDiv.id=subsEosAdUnit;jQuery(getSubsEosDiv).append(subsAdDiv);let definedSubAdSlots=googletag.defineSlot(subEosSlotName,subEosSlotSize,subsEosAdUnit).addService(googletag.pubads());googletag.display(subsEosAdUnit);googletag.pubads().refresh([definedSubAdSlots])}},getInfiniteUaData:function(response,id){try{if(!response||!id){return}let parser=new DOMParser;let doc=parser.parseFromString(response,"text/html");let rawData=doc.querySelector("#ie-infinite-custom-ua-data")?.getAttribute("data-ua");if(rawData){$this.ieInfiniteUaMata[id]=JSON.parse(rawData)}}catch(e){console.log("IE Infinite: getInfiniteUaData error",e)}},fireUaCaptureEvent:function(current_id){try{let id=parseInt(current_id,10);if($this.ieInfiniteUaMata&&typeof $this.ieInfiniteUaMata[id]!=="undefined"){window.custom_ua_data=$this.ieInfiniteUaMata[id];story_id=id;if(typeof psdkvar!=="undefined"&&psdkvar&&typeof psdkvar.resetInit==="function"){psdkvar.resetInit()}}}catch(error){console.log("IE Infinite: fireUaCaptureEvent error:",error)}},updateCustomUaData:function(id){let $this=this;
1try{if(!id||id===$this.lastModifiedBookDiv){return}if(typeof window.ieInfiniteScrollDetails==="undefined"||typeof window.custom_ua_data==="undefined"||!window.ieInfiniteScrollDetails||!window.custom_ua_data){return}setTimeout(function(){let currentDivId=document.getElementById("article_bookmark_"+id);if(!currentDivId){return}let postsInfo=window.ieInfiniteScrollDetails.posts_info;if(!postsInfo||!postsInfo[id]){return}let postInfo=postsInfo[id];let cu_data=postInfo.seo_meta;if(!cu_data||typeof cu_data!=="object"){return}let slug="";if(cu_data.og_url){slug=$this.getSlugFromUrl(cu_data.og_url)}window.custom_ua_data.articleId=cu_data.post_id||"";window.custom_ua_data.title=cu_data.seo_title||"";window.custom_ua_data.slug=slug;if(cu_data.p_author&&cu_data.p_author.trim()!==""){window.custom_ua_data.authors=cu_data.p_author}if(cu_data.p_tags&&cu_data.p_tags.trim()!==""){window.custom_ua_data.tags=cu_data.p_tags}$this.lastModifiedBookDiv=currentDivId.id;if(currentDivId.id!=="infinite-below-article-1"&&typeof window.infiniteBookmarkHandle==="function"){window.infiniteBookmarkHandle(currentDivId.id)}$this.userTraceCall(id)},2e3)}catch(error){}},userTraceCall:function(id){let $this=this;if(typeof ieInfiniteScrollDetails==="undefined"&&typeof ieInfiniteScrollDetails.enable_user_trace==="undefined"&&typeof ieInfiniteScrollDetails.enable_user_trace==="false"&&typeof window.infiniteUserTraceCall==="undefined"){return}infiniteUserTraceCall("#native_story_"+id)},getSlugFromUrl:function(url){if(!url){return""}return url.split("?")[0].replace(/\/$/,"").split("/").pop()},removeAdsSubscribers:function(){if(0<jQuery(".ie-above-breadcrumb-ad").length){jQuery(".ie-above-breadcrumb-ad").hide()}if(0<jQuery(".ie-mobile-ad-carousel").length){jQuery(".ie-mobile-ad-carousel").hide()}}};jQuery(document).ready(function(){setTimeout(function(){ieInfiniteScroll.init()},2e3)});function ieInitPublishDateToggle(){document.addEventListener("click",function(e){var arrow=e.target.closest(".arrowDown");if(!arrow){return}var publish=arrow.closest(".publish-date");if(!publish){return}e.preventDefault();e.stopPropagation();e.stopImmediatePropagation();var text=publish.querySelector(".updated-drop-text");if(arrow.classList.contains("active")){arrow.classList.remove("active");text.classList.remove("active")}else{arrow.classList.add("active");text.classList.add("active")}},true)}

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.