1var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{ 2let window = _____WB$wombat$assign$function_____("window"); 3let self = _____WB$wombat$assign$function_____("self"); 4let document = _____WB$wombat$assign$function_____("document"); 5let location = _____WB$wombat$assign$function_____("location"); 6let top = _____WB$wombat$assign$function_____("top"); 7let parent = _____WB$wombat$assign$function_____("parent"); 8let frames = _____WB$wombat$assign$function_____("frames"); 9let opens = _____WB$wombat$assign$function_____("opens"); 10( function ( g ) { 11 12 var t = { 13 PLATFORM_WINDOWS: 'windows', 14 PLATFORM_IPHONE: 'iphone', 15 PLATFORM_IPOD: 'ipod', 16 PLATFORM_IPAD: 'ipad', 17 PLATFORM_BLACKBERRY: 'blackberry', 18 PLATFORM_BLACKBERRY_10: 'blackberry_10', 19 PLATFORM_SYMBIAN: 'symbian_series60', 20 PLATFORM_SYMBIAN_S40: 'symbian_series40', 21 PLATFORM_J2ME_MIDP: 'j2me_midp', 22 PLATFORM_ANDROID: 'android', 23 PLATFORM_ANDROID_TABLET: 'android_tablet', 24 PLATFORM_FIREFOX_OS: 'firefoxOS', 25 PLATFORM_MOBILE_GENERIC: 'mobile_generic', 26 27 userAgent : false, // Shortcut to the browser User Agent String. 28 matchedPlatformName : false, // Matched platform name. False otherwise. 29 matchedUserAgentName : false, // Matched UA String. False otherwise. 30 31 init: function() { 32 try { 33 t.userAgent = g.navigator.userAgent.toLowerCase(); 34 t.getPlatformName(); 35 t.getMobileUserAgentName(); 36 } catch ( e ) { 37 console.error( e ); 38 } 39 }, 40 41 initForTest: function( userAgent ) { 42 t.matchedPlatformName = false; 43 t.matchedUserAgentName = false; 44 try { 45 t.userAgent = userAgent.toLowerCase(); 46 t.getPlatformName(); 47 t.getMobileUserAgentName(); 48 } catch ( e ) { 49 console.error( e ); 50 } 51 }, 52 53 /** 54 * This method detects the mobile User Agent name. 55 */ 56 getMobileUserAgentName: function() { 57 if ( t.matchedUserAgentName !== false ) 58 return t.matchedUserAgentName; 59 60 if ( t.userAgent === false ) 61 return false; 62 63 if ( t.isChromeForIOS() ) 64 t.matchedUserAgentName = 'chrome-for-ios'; 65 else if ( t.isTwitterForIpad() ) 66 t.matchedUserAgentName = 'twitter-for-ipad'; 67 else if ( t.isTwitterForIphone() ) 68 t.matchedUserAgentName = 'twitter-for-iphone'; 69 else if ( t.isIPhoneOrIPod() ) 70 t.matchedUserAgentName = 'iphone'; 71 else if ( t.isIPad() ) 72 t.matchedUserAgentName = 'ipad'; 73 else if ( t.isAndroidTablet() ) 74 t.matchedUserAgentName = 'android_tablet'; 75 else if ( t.isAndroid() ) 76 t.matchedUserAgentName = 'android'; 77 else if ( t.isBlackberry10() ) 78 t.matchedUserAgentName = 'blackberry_10'; 79 else if ( has( 'blackberry' ) ) 80 t.matchedUserAgentName = 'blackberry'; 81 else if ( t.isBlackberryTablet() ) 82 t.matchedUserAgentName = 'blackberry_tablet'; 83 else if ( t.isWindowsPhone7() ) 84 t.matchedUserAgentName = 'win7'; 85 else if ( t.isWindowsPhone8() ) 86 t.matchedUserAgentName = 'winphone8'; 87 else if ( t.isOperaMini() ) 88 t.matchedUserAgentName = 'opera-mini'; 89 else if ( t.isOperaMobile() ) 90 t.matchedUserAgentName = 'opera-mobi'; 91 else if ( t.isKindleFire() ) 92 t.matchedUserAgentName = 'kindle-fire'; 93 else if ( t.isSymbianPlatform() ) 94 t.matchedUserAgentName = 'series60'; 95 else if ( t.isFirefoxMobile() ) 96 t.matchedUserAgentName = 'firefox_mobile'; 97 else if ( t.isFirefoxOS() ) 98 t.matchedUserAgentName = 'firefoxOS'; 99 else if ( t.isFacebookForIphone() ) 100 t.matchedUserAgentName = 'facebook-for-iphone'; 101 else if ( t.isFacebookForIpad() ) 102 t.matchedUserAgentName = 'facebook-for-ipad'; 103 else if ( t.isWordPressForIos() ) 104 t.matchedUserAgentName = 'ios-app'; 105 else if ( has( 'iphone' ) ) 106 t.matchedUserAgentName = 'iphone-unknown'; 107 else if ( has( 'ipad' ) ) 108 t.matchedUserAgentName = 'ipad-unknown'; 109 110 return t.matchedUserAgentName; 111 }, 112 113 /** 114 * This method detects the mobile platform name. 115 */ 116 getPlatformName : function() { 117 if ( t.matchedPlatformName !== false ) 118 return t.matchedPlatformName; 119 120 if ( t.userAgent === false ) 121 return false;
122 123 if ( has( 'windows ce' ) || has( 'windows phone' ) ) { 124 t.matchedPlatformName = t.PLATFORM_WINDOWS; 125 } else if ( has( 'ipad' ) ) { 126 t.matchedPlatformName = t.PLATFORM_IPAD; 127 } else if ( has( 'ipod' ) ) { 128 t.matchedPlatformName = t.PLATFORM_IPOD; 129 } else if ( has( 'iphone' ) ) { 130 t.matchedPlatformName = t.PLATFORM_IPHONE; 131 } else if ( has( 'android' ) ) { 132 if ( t.isAndroidTablet() ) 133 t.matchedPlatformName = t.PLATFORM_ANDROID_TABLET; 134 else 135 t.matchedPlatformName = t.PLATFORM_ANDROID; 136 } else if ( t.isKindleFire() ) { 137 t.matchedPlatformName = t.PLATFORM_ANDROID_TABLET; 138 } else if ( t.isBlackberry10() ) { 139 t.matchedPlatformName = t.PLATFORM_BLACKBERRY_10; 140 } else if ( has( 'blackberry' ) ) { 141 t.matchedPlatformName = t.PLATFORM_BLACKBERRY; 142 } else if ( t.isBlackberryTablet() ) { 143 t.matchedPlatformName = t.PLATFORM_BLACKBERRY; 144 } else if ( t.isSymbianPlatform() ) { 145 t.matchedPlatformName = t.PLATFORM_SYMBIAN; 146 } else if ( t.isSymbianS40Platform() ) { 147 t.matchedPlatformName = t.PLATFORM_SYMBIAN_S40; 148 } else if ( t.isJ2MEPlatform() ) { 149 t.matchedPlatformName = t.PLATFORM_J2ME_MIDP; 150 } else if ( t.isFirefoxOS() ) { 151 t.matchedPlatformName = t.PLATFORM_FIREFOX_OS; 152 } else if ( t.isFirefoxMobile() ) { 153 t.matchedPlatformName = t.PLATFORM_MOBILE_GENERIC; 154 } 155 156 return t.matchedPlatformName; 157 }, 158 159 160 /** 161 * Detect the BlackBerry OS version. 162 * 163 * Note: This is for smartphones only. Does not work on BB tablets. 164 */ 165 getBlackBerryOSVersion : check( function() { 166 if ( t.isBlackberry10() ) 167 return '10'; 168 169 if ( ! has( 'blackberry' ) ) 170 return false; 171 172 var rv = -1; // Return value assumes failure. 173 var re; 174 175 if ( has( 'webkit' ) ) { // Detecting the BB OS version for devices running OS 6.0 or higher 176 re = /Version\/([\d\.]+)/i; 177 } else { 178 // BlackBerry devices <= 5.XX 179 re = /BlackBerry\w+\/([\d\.]+)/i; 180 } 181 if ( re.exec( t.userAgent ) != null ) 182 rv = RegExp.$1.toString(); 183 184 return rv === -1 ? false : rv; 185 } ), 186 187 /** 188 * Detects if the current UA is iPhone Mobile Safari or another iPhone or iPod Touch Browser. 189 */ 190 isIPhoneOrIPod : check( function() { 191 return has( 'safari' ) && ( has( 'iphone' ) || has( 'ipod' ) ); 192 } ), 193 194 /** 195 * Detects if the current device is an iPad. 196 */ 197 isIPad : check( function() { 198 return has( 'ipad' ) && has( 'safari' ); 199 } ), 200 201 202 /** 203 * Detects if the current UA is Chrome for iOS 204 */ 205 isChromeForIOS : check( function() { 206 return t.isIPhoneOrIPod() && has( 'crios/' ); 207 } ), 208 209 /** 210 * Detects if the current browser is the Native Android browser. 211 */ 212 isAndroid : check( function() { 213 if ( has( 'android' ) ) { 214 return ! ( t.isOperaMini() || t.isOperaMobile() || t.isFirefoxMobile() ); 215 } 216 } ), 217 218 /** 219 * Detects if the current browser is the Native Android Tablet browser. 220 */ 221 isAndroidTablet : check( function() { 222 if ( has( 'android' ) && ! has( 'mobile' ) ) { 223 return ! ( t.isOperaMini() || t.isOperaMobile() || t.isFirefoxMobile() ); 224 } 225 } ), 226 227 228 /** 229 * Detects if the current browser is Opera Mobile 230 */ 231 isOperaMobile : check( function() { 232 return has( 'opera' ) && has( 'mobi' ); 233 } ), 234 235 /** 236 * Detects if the current browser is Opera Mini 237 */ 238 isOperaMini : check( function() { 239 return has( 'opera' ) && has( 'mini' ); 240 } ), 241 242 243 /** 244 * isBlackberry10() can be used to check the User Agent for a BlackBerry 10 device. 245 */ 246 isBlackberry10 : check( function() { 247 return has( 'bb10' ) && has( 'mobile' ); 248 } ), 249 250 /** 251 * isBlackberryTablet() can be used to check the User Agent for a RIM blackberry tablet 252 */ 253 isBlackberryTablet : check( function() { 254 return has( 'playbook' ) && has( 'rim tablet' ); 255 } ), 256 257 /** 258 * Detects if the current browser is a Windows Phone 7 device. 259 */ 260 isWindowsPhone7 : check( function () { 261 return has( 'windows phone os 7' ); 262 } ), 263 264 /** 265 * Detects if the current browser is a Windows Phone 8 device. 266 */ 267 isWindowsPhone8 : check( function () { 268 return has( 'windows phone 8' ); 269 } ), 270 271 /** 272 * Detects if the device platform is J2ME. 273 */ 274 isJ2MEPlatform : check( function () { 275 return has( 'j2me/midp' ) || ( has( 'midp' ) && has( 'cldc' ) ); 276 } ), 277 278 279 /** 280 * Detects if the device platform is the Symbian Series 40. 281 */ 282 isSymbianS40Platform : check( function() { 283 if ( has( 'series40' ) ) { 284 return has( 'nokia' ) || has( 'ovibrowser' ) || has( 'nokiabrowser' ); 285 } 286 } ), 287 288 289 /** 290 * Detects if the device platform is the Symbian Series 60. 291 */ 292 isSymbianPlatform : check( function() { 293 if ( has( 'webkit' ) ) { 294 // First, test for WebKit, then make sure it's either Symbian or S60. 295 return has( 'symbian' ) || has( 'series60' ); 296 } else if ( has( 'symbianos' ) && has( 'series60' ) ) { 297 return true; 298 } else if ( has( 'nokia' ) && has( 'series60' ) ) { 299 return true; 300 } else if ( has( 'opera mini' ) ) { 301 return has( 'symbianos' ) || has( 'symbos' ) || has( 'series 60' ); 302 } 303 } ), 304 305 306 /** 307 * Detects if the current browser is the Kindle Fire Native browser. 308 */ 309 isKindleFire : check( function() { 310 return has( 'silk/' ) && has( 'silk-accelerated=' ); 311 } ), 312 313 /** 314 * Detects if the current browser is Firefox Mobile (Fennec) 315 */ 316 isFirefoxMobile : check( function() { 317 return has( 'fennec' ); 318 } ), 319 320 321 /** 322 * Detects if the current browser is the native FirefoxOS browser 323 */ 324 isFirefoxOS : check( function() { 325 return has( 'mozilla' ) && has( 'mobile' ) && has( 'gecko' ) && has( 'firefox' ); 326 } ), 327 328 329 /** 330 * Detects if the current UA is Facebook for iPad 331 */ 332 isFacebookForIpad : check( function() { 333 if ( ! has( 'ipad' ) ) 334 return false;
335 336 return has( 'facebook' ) || has( 'fbforiphone' ) || has( 'fban/fbios;' ); 337 } ), 338 339 /** 340 * Detects if the current UA is Facebook for iPhone 341 */ 342 isFacebookForIphone : check( function() { 343 if ( ! has( 'iphone' ) ) 344 return false; 345 346 return ( has( 'facebook' ) && ! has( 'ipad' ) ) || 347 ( has( 'fbforiphone' ) && ! has( 'tablet' ) ) || 348 ( has( 'fban/fbios;' ) && ! has( 'tablet' ) ); // FB app v5.0 or higher 349 } ), 350 351 /** 352 * Detects if the current UA is Twitter for iPhone 353 */ 354 isTwitterForIphone : check( function() { 355 if ( has( 'ipad' ) ) 356 return false; 357 358 return has( 'twitter for iphone' ); 359 } ), 360 361 /** 362 * Detects if the current UA is Twitter for iPad 363 */ 364 isTwitterForIpad : check( function() { 365 return has( 'twitter for ipad' ) || ( has( 'ipad' ) && has( 'twitter for iphone' ) ); 366 } ), 367 368 369 /** 370 * Detects if the current UA is WordPress for iOS 371 */ 372 isWordPressForIos : check( function() { 373 return has( 'wp-iphone' ); 374 } ) 375 }; 376 377 function has( str ) { 378 return t.userAgent.indexOf( str ) != -1; 379 } 380 381 function check( fn ) { 382 return function() { 383 return t.userAgent === false ? false : fn() || false; 384 } 385 } 386 387 g.wpcom_mobile_user_agent_info = t; 388 389} )( typeof window !== 'undefined' ? window : this ); 390; 391!function(){"use strict";var t={response:null,getEndpointURL:function(t){var e,s="undefined"!=typeof wp&&wp.customize&&wp.customize.settings&&wp.customize.settings.url&&wp.customize.settings.url.self;s?(e=document.createElement("a")).href=wp.customize.settings.url.self:e=document.location,"string"==typeof t&&t.match(/^https?:\/\//)&&((e=document.createElement("a")).href=t);var a="relatedposts=1",o=document.querySelector("#jp-relatedposts");if(!o)return!1;o.hasAttribute("data-exclude")&&(a+="&relatedposts_exclude="+o.getAttribute("data-exclude")),s&&(a+="&jetpackrpcustomize=1");var r=e.pathname;return"/"!==r[0]&&(r="/"+r),""===e.search?r+"?"+a:r+e.search+"&"+a},getAnchor:function(t,e){var s=t.title,a=document.createElement("a");a.setAttribute("class",e),a.setAttribute("href",t.url),a.setAttribute("title",s),a.setAttribute("data-origin",t.url_meta.origin),a.setAttribute("data-position",t.url_meta.position),""!==t.rel&&a.setAttribute("rel",t.rel);var o=document.createElement("div");o.appendChild(a);var r=o.innerHTML;return[r.substring(0,r.length-4),"</a>"]},generateMinimalHtml:function(t,e){var s=this,a="";return t.forEach((function(t,o){var r=s.getAnchor(t,"jp-relatedposts-post-a"),p="jp-relatedposts-post jp-relatedposts-post"+o;t.classes.length>0&&(p+=" "+t.classes.join(" ")),a+='<p class="'+p+'" data-post-id="'+t.id+'" data-post-format="'+t.format+'">',a+='<span class="jp-relatedposts-post-title">'+r[0]+t.title+r[1]+"</span>",e.showDate&&(a+='<time class="jp-relatedposts-post-date" datetime="'+t.date+'">'+t.date+"</time>"),e.showContext&&(a+='<span class="jp-relatedposts-post-context">'+t.context+"</span>"),a+="</p>"})),'<div class="jp-relatedposts-items jp-relatedposts-items-minimal jp-relatedposts-'+e.layout+' ">'+a+"</div>"},generateVisualHtml:function(t,e){var s=this,a="";return t.forEach((function(t,o){var r=s.getAnchor(t,"jp-relatedposts-post-a"),p="jp-relatedposts-post jp-relatedposts-post"+o;t.classes.length>0&&(p+=" "+t.classes.join(" ")),t.img.src?p+=" jp-relatedposts-post-thumbs":p+=" jp-relatedposts-post-nothumbs";var n=document.createElement("p");n.innerHTML=t.excerpt;var i=n.textContent;if(a+='<div class="'+p+'" data-post-id="'+t.id+'" data-post-format="'+t.format+'">',t.img.src)a+=r[0]+'<img class="jp-relatedposts-post-img" loading="lazy" src="'+t.img.src+'" width="'+t.img.width+'" height="'+t.img.height+'" alt="'+t.img.alt_text+'" />'+r[1];else{var l=s.getAnchor(t,"jp-relatedposts-post-a jp-relatedposts-post-aoverlay");a+=l[0]+l[1]}a+="<"+related_posts_js_options.post_heading+' class="jp-relatedposts-post-title">'+r[0]+t.title+r[1]+"</"+related_posts_js_options.post_heading+">",a+='<p class="jp-relatedposts-post-excerpt">'+i+"</p>
391",e.showDate&&(a+='<time class="jp-relatedposts-post-date" datetime="'+t.date+'">'+t.date+"</time>"),e.showContext&&(a+='<p class="jp-relatedposts-post-context">'+t.context+"</p>"),a+="</div>"})),'<div class="jp-relatedposts-items jp-relatedposts-items-visual jp-relatedposts-'+e.layout+' ">'+a+"</div>"},setVisualExcerptHeights:function(){var t=document.querySelectorAll("#jp-relatedposts .jp-relatedposts-post-nothumbs .jp-relatedposts-post-excerpt");if(t.length)for(var e=getComputedStyle(t[0]),s=parseInt(e.fontSize,10),a=parseInt(e.lineHeight,10),o=0;o<t.length;o++)t[o].style.maxHeight=5*a/s+"em"},getTrackedUrl:function(t){var e="relatedposts_hit=1";e+="&relatedposts_origin="+t.getAttribute("data-origin"),e+="&relatedposts_position="+t.getAttribute("data-position");var s=t.pathname;return"/"!==s[0]&&(s="/"+s),""===t.search?s+"?"+e:s+t.search+"&"+e},cleanupTrackedUrl:function(){if("function"==typeof history.replaceState){var t=document.location.search.replace(/\brelatedposts_[a-z]+=[0-9]*&?\b/gi,"");"?"===t&&(t=""),document.location.search!==t&&history.replaceState({},document.title,document.location.pathname+t)}}};function e(){t.setVisualExcerptHeights();var e=document.querySelectorAll("#jp-relatedposts a.jp-relatedposts-post-a");Array.prototype.forEach.call(e,(function(e){document.addEventListener("click",(function(){e.href=t.getTrackedUrl(e)}))}))}function s(){t.cleanupTrackedUrl();var s=t.getEndpointURL(),a=document.querySelector("#jp-relatedposts");if(s)if(document.querySelectorAll("#jp-relatedposts .jp-relatedposts-post").length)e();else{var o=new XMLHttpRequest;o.open("GET",s,!0),o.setRequestHeader("x-requested-with","XMLHttpRequest"),o.onreadystatechange=function(){if(this.readyState===XMLHttpRequest.DONE&&200===this.status)try{var s=JSON.parse(o.responseText);if(0===s.items.length||0===a.length)return;t.response=s;var r,p,n={};"undefined"!=typeof wp&&wp.customize?(p=wp.customize.instance("jetpack_relatedp
391osts[show_thumbnails]").get(),n.showDate=wp.customize.instance("jetpack_relatedposts[show_date]").get(),n.showContext=wp.customize.instance("jetpack_relatedposts[show_context]").get(),n.layout=wp.customize.instance("jetpack_relatedposts[layout]").get()):(p=s.show_thumbnails,n.showDate=s.show_date,n.showContext=s.show_context,n.layout=s.layout),r=p?t.generateVisualHtml(s.items,n):t.generateMinimalHtml(s.items,n);var i=document.createElement("div");if(a.appendChild(i),i.outerHTML=r,n.showDate){var l=a.querySelectorAll(".jp-relatedposts-post-date");Array.prototype.forEach.call(l,(function(t){t.style.display="block"}))}a.style.display="block",e()}catch(t){}},o.send()}}function a(){"undefined"!=typeof wp&&wp.customize?(wp.customize.selectiveRefresh&&wp.customize.selectiveRefresh.bind("partial-content-rendered",(function(t){"jetpack_relatedposts"===t.partial.id&&s()})),wp.customize.bind("preview-ready",s)):s()}"loading"!==document.readyState?a():document.addEventListener("DOMContentLoaded",a)}();; 392// listen for rlt authentication events and pass them to children of this document. 393( function() { 394 var currentToken; 395 var parentOrigin; 396 var iframeOrigins; 397 var initializationListeners = []; 398 var hasBeenInitialized = false; 399 var RLT_KEY = 'jetpack:wpcomRLT'; 400 401 // IE11 compat version that doesn't require on `new URL( src )` 402 function getOriginFromUrl( url ) { 403 var parser = document.createElement('a'); 404 parser.href = url; 405 return parser.origin; 406 } 407 408 // run on `load` for suitable iframes, this injects the current token if available 409 function rltIframeInjector( event ) { 410 if ( ! currentToken ) { 411 return; 412 } 413 rltInjectToken( currentToken, event.target.contentWindow, getOriginFromUrl( event.target.src ) ); 414 } 415 416 // run on DOMContentLoaded or later 417 function rltMonitorIframes() { 418 // wait until suitable iframes are loaded before trying to inject the RLT 419 var iframes = document.querySelectorAll( "iframe" ); 420 for( var i=0; i<iframes.length; i++ ) { 421 var iframe = iframes[i]; 422 if ( rltShouldAuthorizeIframe( iframe ) ) { 423 iframe.addEventListener('load', rltIframeInjector); 424 } 425 } 426 427 // listen for newly-created iframes, since some are injected dynamically 428 var observer = new MutationObserver(function( mutationsList, observer ) { 429 for(var i=0; i<mutationsList.length; i++) { 430 var mutation = mutationsList[i]; 431 if (mutation.type === 'childList') { 432 for(var j=0; j<mutation.addedNodes.length; j++) { 433 var node = mutation.addedNodes[j]; 434 if (node instanceof HTMLElement && node.nodeName === 'IFRAME' && rltShouldAuthorizeIframe(node)) { 435 node.addEventListener('load', rltIframeInjector); 436 } 437 } 438 } 439 } 440 }); 441 442 observer.observe(document.body, { subtree: true, childList: true }); 443 } 444 445 // should we inject RLT into this iframe? 446 function rltShouldAuthorizeIframe( iframe ) { 447 if ( ! Array.isArray( iframeOrigins ) ) { 448 return; 449 } 450 return iframeOrigins.indexOf( getOriginFromUrl( iframe.src ) ) >= 0; 451 } 452 453 function rltInvalidateWindowToken( token, target, origin ) { 454 if ( target && typeof target.postMessage === 'function' ) { 455 try { 456 target.postMessage( JSON.stringify( { 457 type: 'rltMessage', 458 data: { 459 event: 'invalidate', 460 token: token, 461 sourceOrigin: window.location.origin, 462 }, 463 } ), origin ); 464 } catch ( err ) { 465 return; 466 } 467 } 468 } 469 470 /** 471 * PUBLIC METHODS 472 */ 473 window.rltInvalidateToken = function( token, sourceOrigin ) { 474 // invalidate in current context 475 if ( token === currentToken ) { 476 currentToken = null; 477 } 478 479 // remove from localstorage, but only if in a top level window, not iframe 480 try { 481 if ( window.location === window.parent.location && window.localStorage ) { 482 if ( window.localStorage.getItem(RLT_KEY) === token ) { 483 window.localStorage.removeItem(RLT_KEY); 484 } 485 } 486 } catch( e ) { 487 console.info("localstorage access for invalidate denied - probably blocked third-party access", window.location.href); 488 } 489 490 // invalidate in iframes 491 var iframes = document.querySelectorAll("iframe"); 492 for( var i=0; i<iframes.length; i++ ) { 493 var iframe = iframes[i];
494 var iframeOrigin = getOriginFromUrl( iframe.src ); 495 if ( iframeOrigin !== sourceOrigin && rltShouldAuthorizeIframe( iframe ) ) { 496 rltInvalidateWindowToken( token, iframe.contentWindow, iframeOrigin ); 497 } 498 } 499 500 // invalidate in parent 501 if ( parentOrigin && parentOrigin !== sourceOrigin && window.parent ) { 502 rltInvalidateWindowToken( token, window.parent, parentOrigin ); 503 } 504 } 505 506 window.rltInjectToken = function( token, target, origin ) { 507 if ( target && typeof target.postMessage === 'function' ) { 508 try { 509 target.postMessage( JSON.stringify( { 510 type: 'loginMessage', 511 data: { 512 event: 'login', 513 success: true, 514 type: 'rlt', 515 token: token, 516 sourceOrigin: window.location.origin, 517 }, 518 } ), origin ); 519 } catch ( err ) { 520 return; 521 } 522 } 523 }; 524 525 window.rltIsAuthenticated = function() { 526 return !! currentToken; 527 }; 528 529 window.rltGetToken = function() { 530 return currentToken; 531 }; 532 533 window.rltAddInitializationListener = function( listener ) { 534 // if RLT is already initialized, call the listener immediately 535 if ( hasBeenInitialized ) { 536 listener( currentToken ); 537 } else { 538 initializationListeners.push( listener ); 539 } 540 }; 541 542 // store the token in localStorage 543 window.rltStoreToken = function( token ) { 544 currentToken = token; 545 try { 546 if ( window.location === window.parent.location && window.localStorage ) { 547 window.localStorage.setItem( RLT_KEY, token ); 548 } 549 } catch( e ) { 550 console.info("localstorage access denied - probably blocked third-party access", window.location.href); 551 } 552 } 553 554 window.rltInitialize = function( config ) { 555 if ( ! config || typeof window.postMessage !== 'function' ) { 556 return; 557 } 558 559 currentToken = config.token; 560 iframeOrigins = config.iframeOrigins; 561 parentOrigin = config.parentOrigin; // needed? 562 563 // load token from localStorage if possible, but only in top level window 564 try { 565 if ( ! currentToken && window.location === window.parent.location && window.localStorage ) { 566 currentToken = window.localStorage.getItem(RLT_KEY); 567 } 568 } catch( e ) { 569 console.info("localstorage access denied - probably blocked third-party access", window.location.href); 570 } 571 572 // listen for RLT events from approved origins 573 window.addEventListener( 'message', function( e ) { 574 var message = e && e.data; 575 if ( typeof message === 'string' ) { 576 try { 577 message = JSON.parse( message ); 578 } catch ( err ) { 579 return; 580 } 581 } 582 583 var type = message && message.type; 584 var data = message && message.data; 585 586 if ( type !== 'loginMessage' ) { 587 return; 588 } 589 590 if ( data && data.type === 'rlt' && data.token !== currentToken ) { 591 592 // put into localStorage if running in top-level window (not iframe) 593 rltStoreToken( data.token ); 594 595 // send to allowlisted iframes 596 var iframes = document.querySelectorAll("iframe"); 597 for( var i=0; i<iframes.length; i++ ) { 598 var iframe = iframes[i]; 599 if ( rltShouldAuthorizeIframe( iframe ) ) { 600 rltInjectToken( currentToken, iframe.contentWindow, getOriginFromUrl( iframe.src ) ); 601 } 602 } 603 604 // send to the parent, unless the event was sent _by_ the parent 605 if ( parentOrigin && parentOrigin !== data.sourceOrigin && window.parent ) { 606 rltInjectToken( currentToken, window.parent, parentOrigin ); 607 } 608 } 609 } ); 610 611 // listen for RLT events from approved origins 612 window.addEventListener( 'message', function( e ) { 613 var message = e && e.data; 614 if ( typeof message === 'string' ) { 615 try { 616 message = JSON.parse( message ); 617 } catch ( err ) { 618 return; 619 } 620 } 621 622 var type = message && message.type; 623 var data = message && message.data; 624 625 if ( type !== 'rltMessage' ) { 626 return; 627 } 628 629 if ( data && data.event === 'invalidate' && data.token === currentToken ) { 630 rltInvalidateToken( data.token ); 631 } 632 } ); 633 634 if ( iframeOrigins ) { 635 if ( document.readyState !== 'loading' ) { 636 rltMonitorIframes(); 637 } else { 638 window.addEventListener( 'DOMContentLoaded', rltMonitorIframes ); 639 } 640 } 641 642 initializationListeners.forEach( function( listener ) { 643 listener( currentToken ); 644 } ); 645 646 initializationListeners = []; 647 648 hasBeenInitialized = true; 649 }; 650} )(); 651; 652window.__tcfapi=function(){let e=[].slice.call(arguments),t=e[0],n=e[2];"ping"===t?"function"==typeof n&&n({gdprApplies:!1,cmpLoaded:!1,cmpStatus:"stub",displayStatus:"disabled",apiVersion:"2"}):"getTCData"!==t&&"addEventListener"!==t||"function"==typeof n&&n({gdprApplies:!1,tcfPolicyVersion:2,cmpId:258,cmpVersion:1},!0)},window.addEventListener("message",(function(e){let t="string"==typeof e.data,n={};try{n=t?JSON.parse(e.data):e.data}catch(e){}let a=n.__tcfapiCall;a&&window.__tcfapi(a.command,a.version,(function(n,c){let s={__tcfapiReturn:{returnValue:n,success:c,callId:a.callId}};t&&(s=JSON.stringify(s)),e&&e.source&&e.source.postMessage&&e.source.postMessage(s,"*")}),a.parameter)}),!1),document.addEventListener("DOMContentLoaded",(function(){!function(){const e=document.createElement("iframe");e.style.cssText="display:none",e.name="__tcfapiLocator",document.body.appendChild(e)}()}));; 653 654}
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.