( function ( g ) {

  var t = {
      PLATFORM_WINDOWS: 'windows',
      PLATFORM_IPHONE: 'iphone',
      PLATFORM_IPOD: 'ipod',
      PLATFORM_IPAD: 'ipad',
      PLATFORM_BLACKBERRY: 'blackberry',
      PLATFORM_BLACKBERRY_10: 'blackberry_10',
      PLATFORM_SYMBIAN: 'symbian_series60',
      PLATFORM_SYMBIAN_S40: 'symbian_series40',
      PLATFORM_J2ME_MIDP: 'j2me_midp',
      PLATFORM_ANDROID: 'android',
      PLATFORM_ANDROID_TABLET: 'android_tablet',
      PLATFORM_FIREFOX_OS: 'firefoxOS',
      PLATFORM_MOBILE_GENERIC: 'mobile_generic',

      userAgent : false, // Shortcut to the browser User Agent String.
      matchedPlatformName : false, // Matched platform name. False otherwise.
      matchedUserAgentName : false, // Matched UA String. False otherwise.

      init: function() {
        try {
          t.userAgent = g.navigator.userAgent.toLowerCase();
          t.getPlatformName();
          t.getMobileUserAgentName();
        }	catch ( e ) {
          console.error( e );
        }
      },

      initForTest: function( userAgent ) {
        t.matchedPlatformName = false;
        t.matchedUserAgentName = false;
        try {
          t.userAgent = userAgent.toLowerCase();
          t.getPlatformName();
          t.getMobileUserAgentName();
        }	catch ( e ) {
          console.error( e );
        }
      },

      /**
       * This method detects the mobile User Agent name.
       */
      getMobileUserAgentName: function() {
        if ( t.matchedUserAgentName !== false )
          return t.matchedUserAgentName;

        if ( t.userAgent === false )
          return false;

        if ( t.isChromeForIOS() )
          t.matchedUserAgentName = 'chrome-for-ios';
        else if ( t.isTwitterForIpad() )
          t.matchedUserAgentName =  'twitter-for-ipad';
        else if ( t.isTwitterForIphone() )
          t.matchedUserAgentName =  'twitter-for-iphone';
        else if ( t.isIPhoneOrIPod() )
          t.matchedUserAgentName = 'iphone';
        else if ( t.isIPad() )
          t.matchedUserAgentName = 'ipad';
        else if ( t.isAndroidTablet() )
          t.matchedUserAgentName = 'android_tablet';
        else if ( t.isAndroid() )
          t.matchedUserAgentName = 'android';
        else if ( t.isBlackberry10() )
          t.matchedUserAgentName = 'blackberry_10';
        else if ( has( 'blackberry' ) )
          t.matchedUserAgentName = 'blackberry';
        else if ( t.isBlackberryTablet() )
          t.matchedUserAgentName = 'blackberry_tablet';
        else if ( t.isWindowsPhone7() )
          t.matchedUserAgentName = 'win7';
        else if ( t.isWindowsPhone8() )
          t.matchedUserAgentName = 'winphone8';
        else if ( t.isOperaMini() )
          t.matchedUserAgentName = 'opera-mini';
        else if ( t.isOperaMobile() )
          t.matchedUserAgentName = 'opera-mobi';
        else if ( t.isKindleFire() )
          t.matchedUserAgentName = 'kindle-fire';
        else if ( t.isSymbianPlatform() )
          t.matchedUserAgentName = 'series60';
        else if ( t.isFirefoxMobile() )
          t.matchedUserAgentName = 'firefox_mobile';
        else if ( t.isFirefoxOS() )
          t.matchedUserAgentName = 'firefoxOS';
        else if ( t.isFacebookForIphone() )
          t.matchedUserAgentName = 'facebook-for-iphone';
        else if ( t.isFacebookForIpad() )
          t.matchedUserAgentName = 'facebook-for-ipad';
        else if ( t.isWordPressForIos() )
          t.matchedUserAgentName = 'ios-app';
        else if ( has( 'iphone' ) )
          t.matchedUserAgentName = 'iphone-unknown';
        else if ( has( 'ipad' ) )
          t.matchedUserAgentName = 'ipad-unknown';

        return t.matchedUserAgentName;
      },

      /**
       * This method detects the mobile platform name.
       */
      getPlatformName : function() {
        if ( t.matchedPlatformName !== false )
          return t.matchedPlatformName;

        if ( t.userAgent === false )
          return false;

        if ( has( 'windows ce' ) || has( 'windows phone' ) ) {
          t.matchedPlatformName = t.PLATFORM_WINDOWS;
        } else if ( has( 'ipad' ) ) {
          t.matchedPlatformName = t.PLATFORM_IPAD;
        } else if ( has( 'ipod' ) ) {
          t.matchedPlatformName = t.PLATFORM_IPOD;
        } else if ( has( 'iphone' ) ) {
          t.matchedPlatformName = t.PLATFORM_IPHONE;
        } else if ( has( 'android' ) ) {
          if ( t.isAndroidTablet() )
            t.matchedPlatformName = t.PLATFORM_ANDROID_TABLET;
          else
            t.matchedPlatformName = t.PLATFORM_ANDROID;
        } else if ( t.isKindleFire() ) {
          t.matchedPlatformName = t.PLATFORM_ANDROID_TABLET;
        } else if ( t.isBlackberry10() ) {
          t.matchedPlatformName = t.PLATFORM_BLACKBERRY_10;
        } else if ( has( 'blackberry' ) ) {
          t.matchedPlatformName = t.PLATFORM_BLACKBERRY;
        } else if ( t.isBlackberryTablet() ) {
          t.matchedPlatformName = t.PLATFORM_BLACKBERRY;
        } else if ( t.isSymbianPlatform() ) {
          t.matchedPlatformName = t.PLATFORM_SYMBIAN;
        } else if ( t.isSymbianS40Platform() ) {
          t.matchedPlatformName = t.PLATFORM_SYMBIAN_S40;
        } else if ( t.isJ2MEPlatform() ) {
          t.matchedPlatformName = t.PLATFORM_J2ME_MIDP;
        } else if ( t.isFirefoxOS() ) {
          t.matchedPlatformName = t.PLATFORM_FIREFOX_OS;
        } else if ( t.isFirefoxMobile() ) {
          t.matchedPlatformName = t.PLATFORM_MOBILE_GENERIC;
        }

        return t.matchedPlatformName;
      },


      /**
       * Detect the BlackBerry OS version.
       *
       * Note: This is for smartphones only. Does not work on BB tablets.
       */
      getBlackBerryOSVersion : check( function() {
        if ( t.isBlackberry10() )
          return '10';

        if ( ! has( 'blackberry' ) )
          return false;

        var rv = -1; // Return value assumes failure.
        var re;

        if ( has( 'webkit' ) ) { // Detecting the BB OS version for devices running OS 6.0 or higher
          re = /Version\/([\d\.]+)/i;
        } else {
          // BlackBerry devices <= 5.XX
          re = /BlackBerry\w+\/([\d\.]+)/i;
        }
        if ( re.exec( t.userAgent ) != null )
          rv =  RegExp.$1.toString();

        return rv === -1 ? false : rv;
      } ),

      /**
       * Detects if the current UA is iPhone Mobile Safari or another iPhone or iPod Touch Browser.
       */
      isIPhoneOrIPod : check( function() {
        return has( 'safari' ) && ( has( 'iphone' ) || has( 'ipod' ) );
      } ),

      /**
       * Detects if the current device is an iPad.
       */
      isIPad : check( function() {
        return has( 'ipad' ) && has( 'safari' );
      } ),


      /**
      *  Detects if the current UA is Chrome for iOS
      */
      isChromeForIOS : check( function() {
        return t.isIPhoneOrIPod() && has( 'crios/' );
      } ),

      /**
       * Detects if the current browser is the Native Android browser.
       */
      isAndroid : check( function() {
        if ( has( 'android' ) ) {
          return ! ( t.isOperaMini() || t.isOperaMobile() || t.isFirefoxMobile() );
        }
      } ),

      /**
       * Detects if the current browser is the Native Android Tablet browser.
       */
       isAndroidTablet : check( function() {
        if ( has( 'android' ) && ! has( 'mobile' ) ) {
          return ! ( t.isOperaMini() || t.isOperaMobile() || t.isFirefoxMobile() );
        }
      } ),


      /**
       * Detects if the current browser is Opera Mobile
       */
      isOperaMobile : check( function() {
        return has( 'opera' ) && has( 'mobi' );
      } ),

      /**
       * Detects if the current browser is Opera Mini
       */
      isOperaMini : check( function() {
        return has( 'opera' ) && has( 'mini' );
      } ),


      /**
       * isBlackberry10() can be used to check the User Agent for a BlackBerry 10 device.
       */
      isBlackberry10 : check( function() {
        return has( 'bb10' ) && has( 'mobile' );
      } ),

      /**
       * isBlackberryTablet() can be used to check the User Agent for a RIM blackberry tablet
       */
      isBlackberryTablet : check( function() {
        return has( 'playbook' ) && has( 'rim tablet' );
      } ),

      /**
       * Detects if the current browser is a Windows Phone 7 device.
       */
      isWindowsPhone7 : check( function () {
        return has( 'windows phone os 7' );
      } ),

      /**
       * Detects if the current browser is a Windows Phone 8 device.
       */
      isWindowsPhone8 : check( function () {
        return has( 'windows phone 8' );
      } ),

      /**
       * Detects if the device platform is J2ME.
       */
      isJ2MEPlatform : check( function () {
        return has( 'j2me/midp' ) || ( has( 'midp' ) && has( 'cldc' ) );
      } ),


      /**
       * Detects if the device platform is the Symbian Series 40.
       */
      isSymbianS40Platform : check( function() {
        if ( has( 'series40' ) ) {
          return has( 'nokia' ) || has( 'ovibrowser' ) || has( 'nokiabrowser' );
        }
      } ),


      /**
       * Detects if the device platform is the Symbian Series 60.
       */
      isSymbianPlatform : check( function() {
        if ( has( 'webkit' ) ) {
          // First, test for WebKit, then make sure it's either Symbian or S60.
          return has( 'symbian' ) || has( 'series60' );
        } else if ( has( 'symbianos' ) && has( 'series60' ) ) {
          return true;
        } else if ( has( 'nokia' ) && has( 'series60' ) ) {
          return true;
        } else if ( has( 'opera mini' ) ) {
          return has( 'symbianos' ) || has( 'symbos' ) || has( 'series 60' );
        }
      } ),


      /**
       * Detects if the current browser is the Kindle Fire Native browser.
       */
      isKindleFire : check( function() {
        return has( 'silk/' ) && has( 'silk-accelerated=' );
      } ),

      /**
       * Detects if the current browser is Firefox Mobile (Fennec)
       */
      isFirefoxMobile : check( function() {
        return has( 'fennec' );
      } ),


      /**
       * Detects if the current browser is the native FirefoxOS browser
       */
      isFirefoxOS : check( function() {
        return has( 'mozilla' ) && has( 'mobile' ) && has( 'gecko' ) && has( 'firefox' );
      } ),


      /**
       * Detects if the current UA is Facebook for iPad
       */
      isFacebookForIpad : check( function() {
        if ( ! has( 'ipad' ) )
          return false;

        return has( 'facebook' ) || has( 'fbforiphone' ) || has( 'fban/fbios;' );
      } ),

      /**
       * Detects if the current UA is Facebook for iPhone
       */
      isFacebookForIphone : check( function() {
        if ( ! has( 'iphone' ) )
          return false;

        return ( has( 'facebook' ) && ! has( 'ipad' ) ) ||
          ( has( 'fbforiphone' ) && ! has( 'tablet' ) ) ||
          ( has( 'fban/fbios;' ) && ! has( 'tablet' ) ); // FB app v5.0 or higher
      } ),

      /**
       * Detects if the current UA is Twitter for iPhone
       */
      isTwitterForIphone : check( function() {
        if ( has( 'ipad' ) )
          return false;

        return has( 'twitter for iphone' );
      } ),

      /**
       * Detects if the current UA is Twitter for iPad
       */
      isTwitterForIpad : check( function() {
        return has( 'twitter for ipad' ) || ( has( 'ipad' ) && has( 'twitter for iphone' ) );
      } ),


      /**
       * Detects if the current UA is WordPress for iOS
       */
      isWordPressForIos : check( function() {
        return has( 'wp-iphone' );
      } )
  };

  function has( str ) {
    return t.userAgent.indexOf( str ) != -1;
  }

  function check( fn ) {
    return function() {
      return t.userAgent === false ? false : fn() || false;
    }
  }

  g.wpcom_mobile_user_agent_info = t;

} )( typeof window !== 'undefined' ? window : this );
;
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VideoPressIframeApi=t():e.VideoPressIframeApi=t()}(this,()=>(()=>{"use strict";var e={d:(t,n)=>{for(var s in n)e.o(n,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:n[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};function n(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}e.d(t,{default:()=>s});const s=(e,t=null)=>{const s="channel_init",a=new class{constructor(e,t=null){n(this,"initListener",()=>{let e=0;const t=Math.random().toString(36),n=()=>{window.removeEventListener("message",s),clearInterval(a)},s=e=>{e.source===this.iframe.contentWindow&&e.data&&e.data.uid===t&&"iframe_ack_response"===e.data.event&&(n(),this.onIframeLoaded())};window.addEventListener("message",s);const a=setInterval(()=>{e>40?n():this.iframe.contentWindow&&(this.iframe.contentWindow.postMessage({event:"iframe_ack",uid:t},"*"),e++)},300);this.iframe.addEventListener("load",()=>{n(),this.onIframeLoaded()})}),n(this,"onIframeLoaded",()=>{this.channel||(this.channel=new MessageChannel,this.channel.port1.onmessage=e=>this.onMessageReceived(e),this.iframe.contentWindow.postMessage({event:s},"*",[this.channel.port2]))}),n(this,"onChannelInitialized",()=>{this.onReadyCallback&&this.onReadyCallback()}),n(this,"postMessage",(e,t=null,n=null)=>{if(null===this.channel)return;const s={event:e};null!==t&&Array.isArray(t)&&(s.args=t),null!==n&&(s.xchgId=n),this.channel.port1.postMessage(s)}),n(this,"generateXchgId",()=>++this.currentXchgId),n(this,"generateListenerId",()=>++this.currentEventListenerId),n(this,"callMethod",(e,t=null)=>{const n=this.generateXchgId();return new Promise((s,a)=>{this.pendingResolvers[n]={resolve:s,reject:a},this.postMessage(e,t,n)})}),n(this,"listen",(e,t)=>{if(!this.eventListenersByEvent[e])return!1;const n=this.generateListenerId();return this.eventListenersById[n]={event:e,callback:t},this.eventListenersByEvent[e].push(n),n}),n(this,"stopListening",e=>{if(e=Number(e),this.eventListenersById[e]){const t=this.eventListenersById[e],n=this.eventListenersByEvent[t.event].findIndex(t=>e===t);void 0!==n&&this.eventListenersByEvent[t.event].splice(n,1),delete this.eventListenersById[e]}}),n(this,"onMessageReceived",e=>{const t=e.data.event??!1;if(!t)return;if(s===t)return void this.onChannelInitialized();const n=e.data.xchgId??0;n?this.onMessageReceivedWithXchgId(n,t,e):"event"===t&&this.onEventReceived(e)}),n(this,"onEventReceived",e=>{const t=e.data.type??"";if(!t||!this.eventListenersByEvent[t])return;const n=e.data.args??[];this.eventListenersByEvent[t].forEach(e=>{const t=this.eventListenersById[e]??null;t&&t.callback(...n)})}),n(this,"onMessageReceivedWithXchgId",(e,t,n)=>{if(!this.pendingResolvers[e])return;const s=this.pendingResolvers[e];delete this.pendingResolvers[e],"error"===t?s.reject(n.data.code,n.data.message):"result"===t&&s.resolve(n.data.message.result)}),this.currentXchgId=0,this.currentEventListenerId=0,this.pendingResolvers={},this.eventListenersById={},this.eventListenersByEvent={"info.infoUpdated":[],"info.dimensionsChanged":[],"status.fullscreenChanged":[],"status.playerStatusChanged":[],"status.playbackTimeUpdated":[],"status.timeUpdate":[],"status.chaptersChapterChange":[],"status.chaptersTrackChange":[],"status.borderColorsChanged":[],"status.error":[],"status.segmentsWatched":[],"status.playbackRateUpdate":[]},this.onReadyCallback=t,this.channel=null,this.iframe=e,this.initListener()}}(e,t);return{controls:{play:()=>new Promise((e,t)=>a.callMethod("controls.play",[]).then(e).catch(t)),pause:()=>new Promise((e,t)=>a.callMethod("controls.pause",[]).then(e).catch(t)),seek:e=>new Promise((t,n)=>{if(e=Number(e),!isNaN(e))return a.callMethod("controls.seek",[e]).then(t).catch(n);n("Invalid argument provided for timeMs")}),volume:e=>new Promise((t,n)=>{if(e=Number(e),!isNaN(e))return a.callMethod("controls.volume",[e]).then(t).catch(n);n("Invalid argument provided for volume")}),mute:e=>new Promise((t,n)=>(e=(!("toLowerCase"in Object(e))||"false"!==e.toLowerCase()&&"0"!==e)&&Boolean(e),a.callMethod("controls.mute",[e]).then(t).catch(n))),fullscreen:e=>new Promise((t,n)=>(e=(!("toLowerCase"in Object(e))||"false"!==e.toLowerCase()&&"0"!==e)&&Boolean(e),a.callMethod("controls.fullscreen",[e]).then(t).catch(n))),setChapters:e=>new Promise((t,n)=>{if(Array.isArray(e))return a.callMethod("controls.setChapters",[e]).then(t).catch(n);n("Invalid argument provided for chapters")})},customize:{get:e=>new Promise((t,n)=>(e=String(e),a.callMethod("customize.get",[e]).then(t).catch(n))),set:e=>new Promise((t,n)=>{if("object"==typeof e)return a.callMethod("customize.set",[e]).then(t).catch(n);n("Invalid argument provided for options")})},info:{onInfoUpdated:e=>a.listen("info.infoUpdated",e),offInfoUpdated:e=>a.stopListening(e),duration:(e=JSON.parse(!1))=>new Promise((t,n)=>(e=(!("toLowerCase"in Object(e))||"false"!==e.toLowerCase()&&"0"!==e)&&Boolean(e),a.callMethod("info.duration",[e]).then(t).catch(n))),dimensions:()=>new Promise((e,t)=>a.callMethod("info.dimensions",[]).then(e).catch(t)),onDimensionsChanged:e=>a.listen("info.dimensionsChanged",e),offDimensionsChanged:e=>a.stopListening(e),guid:()=>new Promise((e,t)=>a.callMethod("info.guid",[]).then(e).catch(t)),title:()=>new Promise((e,t)=>a.callMethod("info.title",[]).then(e).catch(t)),poster:()=>new Promise((e,t)=>a.callMethod("info.poster",[]).then(e).catch(t)),privacy:()=>new Promise((e,t)=>a.callMethod("info.privacy",[]).then(e).catch(t)),getThumbnailSample:e=>new Promise((t,n)=>{if(e=Number(e),!isNaN(e))return a.callMethod("info.getThumbnailSample",[e]).then(t).catch(n);n("Invalid argument provided for count")}),enableWatchedSegments:()=>new Promise((e,t)=>a.callMethod("info.enableWatchedSegments",[]).then(e).catch(t)),disableWatchedSegments:()=>new Promise((e,t)=>a.callMethod("info.disableWatchedSegments",[]).then(e).catch(t)),toggleWatchedSegments:()=>new Promise((e,t)=>a.callMethod("info.toggleWatchedSegments",[]).then(e).catch(t)),watched:()=>new Promise((e,t)=>a.callMethod("info.watched",[]).then(e).catch(t)),resetWatched:()=>new Promise((e,t)=>a.callMethod("info.resetWatched",[]).then(e).catch(t))},status:{fullscreen:()=>new Promise((e,t)=>a.callMethod("status.fullscreen",[]).then(e).catch(t)),onFullscreenChanged:e=>a.listen("status.fullscreenChanged",e),offFullscreenChanged:e=>a.stopListening(e),player:()=>new Promise((e,t)=>a.callMethod("status.player",[]).then(e).catch(t)),onPlayerStatusChanged:e=>a.listen("status.playerStatusChanged",e),offPlayerStatusChanged:e=>a.stopListening(e),audio:()=>new Promise((e,t)=>a.callMethod("status.audio",[]).then(e).catch(t)),playbackTime:()=>new Promise((e,t)=>a.callMethod("status.playbackTime",[]).then(e).catch(t)),onPlaybackTimeUpdated:e=>a.listen("status.playbackTimeUpdated",e),offPlaybackTimeUpdated:e=>a.stopListening(e),onTimeUpdate:e=>a.listen("status.timeUpdate",e),offTimeUpdate:e=>a.stopListening(e),onChaptersChapterChange:e=>a.listen("status.chaptersChapterChange",e),offChaptersChapterChange:e=>a.stopListening(e),onChaptersTrackChange:e=>a.listen("status.chaptersTrackChange",e),offChaptersTrackChange:e=>a.stopListening(e),onBorderColorsChanged:e=>a.listen("status.borderColorsChanged",e),offBorderColorsChanged:e=>a.stopListening(e),borderColors:()=>new Promise((e,t)=>a.callMethod("status.borderColors",[]).then(e).catch(t)),onError:e=>a.listen("status.error",e),offError:e=>a.stopListening(e),onSegmentsWatched:e=>a.listen("status.segmentsWatched",e),offSegmentsWatched:e=>a.stopListening(e),onPlaybackRateUpdate:e=>a.listen("status.playbackRateUpdate",e),offPlaybackRateUpdate:e=>a.stopListening(e)}}};return t.default})());;
// listen for rlt authentication events and pass them to children of this document.
( function() {
	var currentToken;
	var parentOrigin;
	var iframeOrigins;
	var registeredIframes = [];
	var initializationListeners = [];
	var hasBeenInitialized = false;
	var RLT_KEY = 'jetpack:wpcomRLT';

	// should we inject RLT into this iframe?
	function rltShouldAuthorizeIframe( frameOrigin ) {
		if ( ! Array.isArray( iframeOrigins ) ) {
			return false;
		}
		return iframeOrigins.includes( frameOrigin );
	}

	function rltInvalidateWindowToken( token, target, origin ) {
		if ( target && typeof target.postMessage === 'function' ) {
			try {
				target.postMessage( JSON.stringify( {
					type: 'rltMessage',
					data: {
						event: 'invalidate',
						token: token,
						sourceOrigin: window.location.origin,
					},
				} ), origin );
			} catch ( err ) {
				return;
			}
		}
	}

	/**
	 * PUBLIC METHODS
	 */
	window.rltInvalidateToken = function( token, sourceOrigin ) {
		// invalidate in current context
		if ( token === currentToken ) {
			currentToken = null;
		}

		// remove from localstorage, but only if in a top level window, not iframe
		try {
			if ( window.location === window.parent.location && window.localStorage ) {
				if ( window.localStorage.getItem(RLT_KEY) === token ) {
					window.localStorage.removeItem(RLT_KEY);
				}
			}
		} catch( e ) {
			console.info("localstorage access for invalidate denied - probably blocked third-party access", window.location.href);
		}

		// invalidate in registered iframes
		for ( const [ frameOrigin, frameWindow ] of registeredIframes ) {
			if ( frameOrigin !== sourceOrigin ) {
				rltInvalidateWindowToken( token, frameWindow, frameOrigin );
			}
		}

		// invalidate in parent
		if ( parentOrigin && parentOrigin !== sourceOrigin && window.parent ) {
			rltInvalidateWindowToken( token, window.parent, parentOrigin );
		}
	}

	window.rltInjectToken = function( token, target, origin ) {
		if ( target && typeof target.postMessage === 'function' ) {
			try {
				target.postMessage( JSON.stringify( {
					type: 'loginMessage',
					data: {
						event: 'login',
						success: true,
						type: 'rlt',
						token: token,
						sourceOrigin: window.location.origin,
					},
				} ), origin );
			} catch ( err ) {
				return;
			}
		}
	};

	window.rltIsAuthenticated = function() {
		return !! currentToken;
	};

	window.rltGetToken = function() {
		return currentToken;
	};

	window.rltAddInitializationListener = function( listener ) {
		// if RLT is already initialized, call the listener immediately
		if ( hasBeenInitialized ) {
			listener( currentToken );
		} else {
			initializationListeners.push( listener );
		}
	};

	// store the token in localStorage
	window.rltStoreToken = function( token ) {
		currentToken = token;
		try {
			if ( window.location === window.parent.location && window.localStorage ) {
				window.localStorage.setItem( RLT_KEY, token );
			}
		} catch( e ) {
			console.info("localstorage access denied - probably blocked third-party access", window.location.href);
		}
	}

	window.rltInitialize = function( config ) {
		if ( ! config || typeof window.postMessage !== 'function' ) {
			return;
		}

		currentToken  = config.token;
		iframeOrigins = config.iframeOrigins;
		parentOrigin  = config.parentOrigin; // needed?

		// load token from localStorage if possible, but only in top level window
		try {
			if ( ! currentToken && window.location === window.parent.location && window.localStorage ) {
				currentToken = window.localStorage.getItem(RLT_KEY);
			}
		} catch( e ) {
			console.info("localstorage access denied - probably blocked third-party access", window.location.href);
		}

		// listen for RLT events from approved origins
		window.addEventListener( 'message', function( e ) {
			var message = e && e.data;
			if ( typeof message === 'string' ) {
				try {
					message = JSON.parse( message );
				} catch ( err ) {
					return;
				}
			}

			var type = message && message.type;
			var data = message && message.data;

			if ( type === 'loginMessage' ) {
				if ( data && data.type === 'rlt' && data.token !== currentToken ) {
					// put into localStorage if running in top-level window (not iframe)
					rltStoreToken( data.token );

					// send to registered iframes
					for ( const [ frameOrigin, frameWindow ] of registeredIframes ) {
						rltInjectToken( currentToken, frameWindow, frameOrigin );
					}

					// send to the parent, unless the event was sent _by_ the parent
					if ( parentOrigin && parentOrigin !== data.sourceOrigin && window.parent ) {
						rltInjectToken( currentToken, window.parent, parentOrigin );
					}
				}
			}

			if ( type === 'rltMessage' ) {
				if ( data && data.event === 'invalidate' && data.token === currentToken ) {
					rltInvalidateToken( data.token );
				}

				if ( data && data.event === 'register' ) {
					if ( rltShouldAuthorizeIframe( e.origin ) ) {
						registeredIframes.push( [ e.origin, e.source ] );
						if ( currentToken ) {
							rltInjectToken( currentToken, e.source, e.origin );
						}
					}
				}
			}
		} );

		initializationListeners.forEach( function( listener ) {
			listener( currentToken );
		} );

		initializationListeners = [];

		// inform the parent that we are ready to receive the RLT token
		window.parent.postMessage( {
			type: 'rltMessage',
			data: {
				event: 'register'
			},
		}, '*' );

		hasBeenInitialized = true;
	};
} )();
;
window.__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)}()}));;
