PageSourceSearch

https://www.channelnewsasia.com/sites/default/files/js/js_yfaLJ_Ub…kJ-9lQ2Wo9UalLVZblsz6aOjaqq3rwq3rTvwLkeAqtA

js channelnewsasia.com collected 2026-09-24 08:28:20 UTC 11,291 bytes, 5 lines download raw bytes

1/* @license MIT https://raw.githubusercontent.com/js-cookie/js-cookie/v3.0.5/LICENSE */
2!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self,function(){var n=e.Cookies,o=e.Cookies=t();o.noConflict=function(){return e.Cookies=n,o;};}());}(this,(function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o];}return e;}var t=function t(n,o){function r(t,r,i){if("undefined"!=typeof document){"number"==typeof (i=e({},o,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var u in i)i[u]&&(c+="; "+u,!0!==i[u]&&(c+="="+i[u].split(";")[0]));return document.cookie=t+"="+n.write(r,t)+c;}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],o={},r=0;r<t.length;r++){var i=t[r].split("="),c=i.slice(1).join("=");try{var u=decodeURIComponent(i[0]);if(o[u]=n.read(c,u),e===u)break;}catch(e){}}return e?o[e]:o;}},remove:function(t,n){r(t,"",e({},n,{expires:-1}));},withAttributes:function(n){return t(this.converter,e({},this.attributes,n));},withConverter:function(n){return t(e({},this.converter,n),this.attributes);}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(n)}});}({read:function(e){return '"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent);}},{path:"/"});return t;}));;
3/* @license GPL-2.0-or-later https://www.drupal.org/licensing/faq */
4(function($,Drupal,cookies){window._locationUtility={getLocationApi:function(){let countryCode;$.ajax({async:false,url:window.location.origin+'/api/v1/location',type:'GET',dataType:'json',success:function(result){countryCode=result.countryCode;},error:function(xhr,status,error){countryCode='SG';}});return countryCode;},getCookieByName:function(name){return cookies.get(name);},setCookieByName:function(name,extra_params){cookies.set('country_code',name,extra_params);},redirectByPath:function(path){window.location.href=path;},attachClassByIdentifierClass:function(identifier_class,class_name){$("."+identifier_class).addClass(class_name);},removeClassByIdentifierClass:function(identifier_class,class_name){$("."+identifier_class).removeClass(class_name);},replaceHref:function(identifier_class,href){$("."+identifier_class).attr("href",href);}};})(jQuery,Drupal,window.Cookies);;
5(function($,Drupal,drupalSettings,cookies){'use strict';let isIndonesiaEdition=_locationUtility.getCookieByName('is_indonesia_edition')==='true';Drupal.behaviors.ipLocation={attach:function(context,settings){const self=this;const config=drupalSettings.mc_location.config;const LOCAL_URL=config.local_url?config.local_url:'/';const INTERNATIONAL_URL=config.international_url;const INDONESIA_URL=config.indonesia_url;const UNITED_STATES_URL=config.united_states_url;const LOCAL_CODE=config.local_code?config.local_code:'SG';const INTERNATIONAL_CODE='INTERNATIONAL';const INDONESIA_CODE='ID';const UNITED_STATES_CODE='US';const UNITED_KINGDOM_CODE='GB';const EXPIRES_IN=config.cookie_expire?parseInt(config.cookie_expire):30;const isBahasaEdition=LOCAL_CODE===INDONESIA_CODE;let country_code=_locationUtility.getCookieByName('country_code');if(window.document.referrer===INDONESIA_URL)if(window.location.pathname===UNITED_STATES_URL){country_code=UNITED_STATES_CODE;self.updateIsIndonesiaEditionCookie(false,{expiresIn:EXPIRES_IN});_locationUtility.setCookieByName(country_code,{expires:EXPIRES_IN,path:'/'});}else if(window.location.pathname===INTERNATIONAL_URL){country_code=INTERNATIONAL_CODE;self.updateIsIndonesiaEditionCookie(false,{expiresIn:EXPIRES_IN});_locationUtility.setCookieByName(country_code,{expires:EXPIRES_IN,path:'/'});}else{if(window.location.pathname===LOCAL_URL){country_code=LOCAL_CODE;self.updateIsIndonesiaEditionCookie(false,{expiresIn:EXPIRES_IN});_locationUtility.setCookieByName(country_code,{expires:EXPIRES_IN,path:'/'});}}else{if(window.document.referrer===''||!window.document.referrer.includes(window.location.hostname))if(window.location.pathname===UNITED_STATES_URL){country_code=UNITED_STATES_CODE;self.updateIsIndonesiaEditionCookie(false,{expiresIn:EXPIRES_IN});_locationUtility.setCookieByName(country_code,{expires:EXPIRES_IN,path:'/'});}else{if(window.location.pathname===INTERNATIONAL_URL){country_code=INTERNATIONAL_CODE;self.updateIsIndonesiaEditionCookie(false,{expiresIn:EXPIRES_IN});_locationUtility.setCookieByName(country_code,{expires:EXPIRES_IN,path:'/'});}}}if(country_code&&!isBahasaEdition&&isIndonesiaEdition){country_code=_locationUtility.getLocationApi();if(country_code===UNITED_KINGDOM_CODE)country_code=UNITED_STATES_CODE;else{if(country_code===INDONESIA_CODE)country_code=INTERNATIONAL_CODE;}_locationUtility.setCookieByName(country_code,{expires:EXPIRES_IN,path:'/'});}if(!country_code){country_code=_locationUtility.getLocationApi();if(country_code===UNITED_STATES_CODE||country_code===UNITED_KINGDOM_CODE)if(UNITED_STATES_URL)country_code=UNITED_STATES_CODE;else{if(INTERNATIONAL_URL)country_code=INTERNATIONAL_CODE;}else if(country_code===INDONESIA_CODE){if(INDONESIA_URL)if(isBahasaEdition)country_code=INDONESIA_CODE;else self.updateIsIndonesiaEditionCookie(true,{expiresIn:EXPIRES_IN});if(INTERNATIONAL_URL)country_code=INTERNATIONAL_CODE;}else{if(country_code!==LOCAL_CODE&&INTERNATIONAL_URL)country_code=INTERNATIONAL_CODE;}_locationUtility.setCookieByName(country_code,{expires:EXPIRES_IN,path:'/'});}if(country_code&&(window.location.pathname===LOCAL_URL)&&(INTERNATIONAL_URL||UNITED_STATES_URL||INDONESIA_URL)){let redirectionPath='';if(!isBahasaEdition&&isIndonesiaEdition&&INDONESIA_URL)redirectionPath=INDONESIA_URL;else{if(country_code!==LOCAL_CODE)if(country_code===UNITED_STATES_CODE)redirectionPath=UNITED_STATES_URL;else redirectionPath=INTERNATIONAL_URL;}
5if(redirectionPath){const urlParams=new URLSearchParams(window.location.search);const cid=urlParams.get('cid');if(cid)redirectionPath+=`?cid=${encodeURIComponent(cid)}`;_locationUtility.redirectByPath(redirectionPath);}}let pageCountryCode=country_code;if(window.location.pathname===LOCAL_URL||pageCountryCode===LOCAL_CODE){$('.local','.edition-block, .edition-block__mobile').addClass('main-menu__link--active');pageCountryCode=LOCAL_CODE;}else if(window.location.pathname===INTERNATIONAL_URL||pageCountryCode===INTERNATIONAL_CODE){$('.international','.edition-block, .edition-block__mobile').addClass('main-menu__link--active');_locationUtility.replaceHref('top-stories',INTERNATIONAL_URL);pageCountryCode=INTERNATIONAL_CODE;}else{if(window.location.pathname===UNITED_STATES_URL||pageCountryCode===UNITED_STATES_CODE){$('.us','.edition-block, .edition-block__mobile').addClass('main-menu__link--active');_locationUtility.replaceHref('top-stories',UNITED_STATES_URL);pageCountryCode=UNITED_STATES_CODE;}}if(window.location.pathname===LOCAL_URL||window.location.pathname===INTERNATIONAL_URL||window.location.pathname===UNITED_STATES_URL)$('.header__menu .top-stories').addClass('main-menu__link--active');$('.menu-edition').click(function(){let countryCode;if(!isBahasaEdition)self.updateIsIndonesiaEditionCookie(false,{expiresIn:EXPIRES_IN});if($(this).hasClass('international'))countryCode=INTERNATIONAL_CODE;else if($(this).hasClass('united-states'))countryCode=UNITED_STATES_CODE;else if($(this).hasClass('indonesia'))if(isBahasaEdition)country_code=INDONESIA_CODE;else self.updateIsIndonesiaEditionCookie(true,{expiresIn:EXPIRES_IN});else{if($(this).hasClass('singapore'))countryCode=LOCAL_CODE;}if(!window.location.href.includes(INDONESIA_URL))_locationUtility.setCookieByName(countryCode,{expires:EXPIRES_IN,path:'/'});if($(this).hasClass('international')||$(this).hasClass('indonesia')||$(this).hasClass('united-states')){let activeClass;if($(this).hasClass('international'))activeClass="international";else if($(this).hasClass('indonesia'))activeClass="indonesia";else{if($(this).hasClass('united-states'))activeClass="united-states";}$('.menu-edition','.edition-block, .edition-block__mobile').removeClass('main-menu__link--active');$(`.${activeClass}`,'.edition-block, .edition-block__mobile').addClass('main-menu__link--active');}if($(this).hasClass('local')){$('.international, .indonesia, .united-states','.edition-block, .edition-block__mobile').removeClass('main-menu__link--active');$('.local','.edition-block, .edition-block__mobile').addClass('main-menu__link--active');}});function editionSwitcherActiveClass(){let topStoriesUrl;let editionClass;if(window.location.href.includes(LOCAL_URL))if(window.location.pathname===UNITED_STATES_URL){topStoriesUrl=UNITED_STATES_URL;editionClass="united-states";}else if(window.location.pathname===INTERNATIONAL_URL){topStoriesUrl=INTERNATIONAL_URL;editionClass="international";}else if(pageCountryCode===LOCAL_CODE){topStoriesUrl=LOCAL_URL;editionClass="local";}else if(pageCountryCode===UNITED_STATES_CODE){topStoriesUrl=UNITED_STATES_URL;editionClass="united-states";}else{topStoriesUrl=INTERNATIONAL_URL;editionClass="international";}else{if(window.location.href.includes(INDONESIA_URL)){topStoriesUrl=INDONESIA_URL;editionClass="local";}}_locationUtility.replaceHref('top-stories',topStoriesUrl);if(window.location.pathname===topStoriesUrl)$('.cnar-primary-menu__item .top-stories').addClass('is-active').parent().addClass('main-menu__item--active');$('.menu-edition','.edition-block, .edition-block__mobile').removeClass('is-active');$(`.${editionClass}`,'.edition-block, .edition-block__mobile').addClass('is-active');}editionSwitcherActiveClass();$('html').addClass(`edition-${pageCountryCode.toLowerCase()}`);$('html').removeClass('is-loading-editions');self.updateMenuItemsByEditions([LOCAL_CODE,INTERNATIONAL_CODE,UNITED_STATES_CODE]);},updateIsIndonesiaEditionCookie:(value,args={})=>{const {expiresIn}=args;isIndonesiaEdition=value;cookies.set('is_indonesia_edition',value,{expires:expiresIn||30,path:'/'});},updateMenuItemsByEditions:(countryCodes)=>{const menuItems=$('.main-menu__item, .hamburger-menu__item');$(menuItems).each((menuItemIndex,menuItem)=>
5{countryCodes.forEach((countryCode)=>{const menuItemLink=menuItem.querySelector('a, span');if(menuItemLink.classList.contains(countryCode.toLowerCase()))menuItem.classList.add(countryCode.toLowerCase());});});},updateIsIndonesiaEditionCookie:(value,args={})=>{const {expiresIn}=args;isIndonesiaEdition=value;cookies.set('is_indonesia_edition',value,{expires:expiresIn||30,path:'/'});}};Drupal.behaviors.editionSwitcherParam={attach:function(context){const query=window.location.search;if(!query)return;document.querySelectorAll('.edition-menu-dropdown__link').forEach((link)=>{const originalHref=link.getAttribute('data-original-href')||link.getAttribute('href');link.setAttribute('data-original-href',originalHref);if(originalHref)link.href=originalHref+(originalHref.includes('?')?'&':'?')+query.substring(1);});}};})(jQuery,Drupal,drupalSettings,window.Cookies);;

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.