PageSourceSearch

https://festivalforpoetry.com/_static/??/wp-content/js/rlt-proxy.j…/js/cmp/v2/cmp-non-gdpr.js?m=1780567333j

js festivalforpoetry.com collected 2026-10-02 06:57:57 UTC 16,717 bytes, 526 lines download raw bytes

1// listen for rlt authentication events and pass them to children of this document.
2( function() {
3	var currentToken;
4	var parentOrigin;
5	var iframeOrigins;
6	var registeredIframes = [];
7	var initializationListeners = [];
8	var hasBeenInitialized = false;
9	var RLT_KEY = 'jetpack:wpcomRLT';
10
11	// should we inject RLT into this iframe?
12	function rltShouldAuthorizeIframe( frameOrigin ) {
13		if ( ! Array.isArray( iframeOrigins ) ) {
14			return false;
15		}
16		return iframeOrigins.includes( frameOrigin );
17	}
18
19	function rltInvalidateWindowToken( token, target, origin ) {
20		if ( target && typeof target.postMessage === 'function' ) {
21			try {
22				target.postMessage( JSON.stringify( {
23					type: 'rltMessage',
24					data: {
25						event: 'invalidate',
26						token: token,
27						sourceOrigin: window.location.origin,
28					},
29				} ), origin );
30			} catch ( err ) {
31				return;
32			}
33		}
34	}
35
36	/**
37	 * PUBLIC METHODS
38	 */
39	window.rltInvalidateToken = function( token, sourceOrigin ) {
40		// invalidate in current context
41		if ( token === currentToken ) {
42			currentToken = null;
43		}
44
45		// remove from localstorage, but only if in a top level window, not iframe
46		try {
47			if ( window.location === window.parent.location && window.localStorage ) {
48				if ( window.localStorage.getItem(RLT_KEY) === token ) {
49					window.localStorage.removeItem(RLT_KEY);
50				}
51			}
52		} catch( e ) {
53			console.info("localstorage access for invalidate denied - probably blocked third-party access", window.location.href);
54		}
55
56		// invalidate in registered iframes
57		for ( const [ frameOrigin, frameWindow ] of registeredIframes ) {
58			if ( frameOrigin !== sourceOrigin ) {
59				rltInvalidateWindowToken( token, frameWindow, frameOrigin );
60			}
61		}
62
63		// invalidate in parent
64		if ( parentOrigin && parentOrigin !== sourceOrigin && window.parent ) {
65			rltInvalidateWindowToken( token, window.parent, parentOrigin );
66		}
67	}
68
69	window.rltInjectToken = function( token, target, origin ) {
70		if ( target && typeof target.postMessage === 'function' ) {
71			try {
72				target.postMessage( JSON.stringify( {
73					type: 'loginMessage',
74					data: {
75						event: 'login',
76						success: true,
77						type: 'rlt',
78						token: token,
79						sourceOrigin: window.location.origin,
80					},
81				} ), origin );
82			} catch ( err ) {
83				return;
84			}
85		}
86	};
87
88	window.rltIsAuthenticated = function() {
89		return !! currentToken;
90	};
91
92	window.rltGetToken = function() {
93		return currentToken;
94	};
95
96	window.rltAddInitializationListener = function( listener ) {
97		// if RLT is already initialized, call the listener immediately
98		if ( hasBeenInitialized ) {
99			listener( currentToken );
100		} else {
101			initializationListeners.push( listener );
102		}
103	};
104
105	// store the token in localStorage
106	window.rltStoreToken = function( token ) {
107		currentToken = token;
108		try {
109			if ( window.location === window.parent.location && window.localStorage ) {
110				window.localStorage.setItem( RLT_KEY, token );
111			}
112		} catch( e ) {
113			console.info("localstorage access denied - probably blocked third-party access", window.location.href);
114		}
115	}
116
117	window.rltInitialize = function( config ) {
118		if ( ! config || typeof window.postMessage !== 'function' ) {
119			return;
120		}
121
122		currentToken  = config.token;
123		iframeOrigins = config.iframeOrigins;
124		parentOrigin  = config.parentOrigin; // needed?
125
126		// load token from localStorage if possible, but only in top level window
127		try {
128			if ( ! currentToken && window.location === window.parent.location && window.localStorage ) {
129				currentToken = window.localStorage.getItem(RLT_KEY);
130			}
131		} catch( e ) {
132			console.info("localstorage access denied - probably blocked third-party access", window.location.href);
133		}
134
135		// listen for RLT events from approved origins
136		window.addEventListener( 'message', function( e ) {
137			var message = e && e.data;
138			if ( typeof message === 'string' ) {
139				try {
140					message = JSON.parse( message );
141				} catch ( err ) {
142					return;
143				}
144			}
145
146			var type = message && message.type;
147			var data = message && message.data;
148
149			if ( type === 'loginMessage' ) {
150				if ( data && data.type === 'rlt' && data.token !== currentToken ) {
151					// put into localStorage if running in top-level window (not iframe)
152					rltStoreToken( data.token );
153
154					// send to registered iframes
155					for ( const [ frameOrigin, frameWindow ] of registeredIframes ) {
156						rltInjectToken( currentToken, frameWindow, frameOrigin );
157					}
158
159					// send to the parent, unless the event was sent _by_ the parent
160					if ( parentOrigin && parentOrigin !== data.sourceOrigin && window.parent ) {
161						rltInjectToken( currentToken, window.parent, parentOrigin );
162					}
163				}
164			}
165
166			if ( type === 'rltMessage' ) {
167				if ( data && data.event === 'invalidate' && data.token === currentToken ) {
168					rltInvalidateToken( data.token );
169				}
170
171				if ( data && data.event === 'register' ) {
172					if ( rltShouldAuthorizeIframe( e.origin ) ) {
173						registeredIframes.push( [ e.origin, e.source ] );
174						if ( currentToken ) {
175							rltInjectToken( currentToken, e.source, e.origin );
176						}
177					}
178				}
179			}
180		} );
181
182		initializationListeners.forEach( function( listener ) {
183			listener( currentToken );
184		} );
185
186		initializationListeners = [];
187
188		// inform the parent that we are ready to receive the RLT token
189		window.parent.postMessage( {
190			type: 'rltMessage',
191			data: {
192				event: 'register'
193			},
194		}, '*' );
195
196		hasBeenInitialized = true;
197	};
198} )();
199;
200/**
201* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
202*/
203;(function(window, document) {
204/*jshint evil:true */
205  /** version */
206  var version = '3.7.3';
207
208  /** Preset options */
209  var options = window.html5 || {};
210
211  /** Used to skip problem elements */
212  var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
213
214  /** Not all elements can be cloned in IE **/
215  var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
216
217  /** Detect whether the browser supports default html5 styles */
218  var supportsHtml5Styles;
219
220  /** Name of the expando, to work with multiple documents or to re-shiv one document */
221  var expando = '_html5shiv';
222
223  /** The id for the the documents expando */
224  var expanID = 0;
225
226  /** Cached data for each document */
227  var expandoData = {};
228
229  /** Detect whether the browser supports unknown elements */
230  var supportsUnknownElements;
231
232  (function() {
233    try {
234        var a = document.createElement('a');
235        a.innerHTML = '<xyz></xyz>';
236        //if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
237        supportsHtml5Styles = ('hidden' in a);
238
239        supportsUnknownElements = a.childNodes.length == 1 || (function() {
240          // assign a false positive if unable to shiv
241          (document.createElement)('a');
242          var frag = document.createDocumentFragment();
243          return (
244            typeof frag.cloneNode == 'undefined' ||
245            typeof frag.createDocumentFragment == 'undefined' ||
246            typeof frag.createElement == 'undefined'
247          );
248        }());
249    } catch(e) {
250      // assign a false positive if detection fails => unable to shiv
251      supportsHtml5Styles = true;
252      supportsUnknownElements = true;
253    }
254
255  }());
256
257  /*--------------------------------------------------------------------------*/
258
259  /**
260   * Creates a style sheet with the given CSS text and adds it to the document.
261   * @private
262   * @param {Document} ownerDocument The document.
263   * @param {String} cssText The CSS text.
264   * @returns {StyleSheet} The style element.
265   */
266  function addStyleSheet(ownerDocument, cssText) {
267    var p = ownerDocument.createElement('p'),
268        parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
269
270    p.innerHTML = 'x<style>' + cssText + '</style>';
271    return parent.insertBefore(p.lastChild, parent.firstChild);
272  }
273
274  /**
275   * Returns the value of `html5.elements` as an array.
276   * @private
277   * @returns {Array} An array of shived element node names.
278   */
279  function getElements() {
280    var elements = html5.elements;
281    return typeof elements == 'string' ? elements.split(' ') : elements;
282  }
283
284  /**
285   * Extends the built-in list of html5 elements
286   * @memberOf html5
287   * @param {String|Array} newElements whitespace separated list or array of new element names to shiv
288   * @param {Document} ownerDocument The context document.
289   */
290  function addElements(newElements, ownerDocument) {
291    var elements = html5.elements;
292    if(typeof elements != 'string'){
293      elements = elements.join(' ');
294    }
295    if(typeof newElements != 'string'){
296      newElements = newElements.join(' ');
297    }
298    html5.elements = elements +' '+ newElements;
299    shivDocument(ownerDocument);
300  }
301
302   /**
303   * Returns the data associated to the given document
304   * @private
305   * @param {Document} ownerDocument The document.
306   * @returns {Object} An object of data.
307   */
308  function getExpandoData(ownerDocument) {
309    var data = expandoData[ownerDocument[expando]];
310    if (!data) {
311        data = {};
312        expanID++;
313        ownerDocument[expando] = expanID;
314        expandoData[expanID] = data;
315    }
316    return data;
317  }
318
319  /**
320   * returns a shived element for the given nodeName and document
321   * @memberOf html5
322   * @param {String}
vendor: 4,255 bytes, lines 322-449
322 nodeName name of the element
323   * @param {Document|DocumentFragment} ownerDocument The context document.
324   * @returns {Object} The shived element.
325   */
326  function createElement(nodeName, ownerDocument, data){
327    if (!ownerDocument) {
328        ownerDocument = document;
329    }
330    if(supportsUnknownElements){
331        return ownerDocument.createElement(nodeName);
332    }
333    if (!data) {
334        data = getExpandoData(ownerDocument);
335    }
336    var node;
337
338    if (data.cache[nodeName]) {
339        node = data.cache[nodeName].cloneNode();
340    } else if (saveClones.test(nodeName)) {
341        node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
342    } else {
343        node = data.createElem(nodeName);
344    }
345
346    // Avoid adding some elements to fragments in IE < 9 because
347    // * Attributes like `name` or `type` cannot be set/changed once an element
348    //   is inserted into a document/fragment
349    // * Link elements with `src` attributes that are inaccessible, as with
350    //   a 403 response, will cause the tab/window to crash
351    // * Script elements appended to fragments will execute when their `src`
352    //   or `text` property is set
353    return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;
354  }
355
356  /**
357   * returns a shived DocumentFragment for the given document
358   * @memberOf html5
359   * @param {Document} ownerDocument The context document.
360   * @returns {Object} The shived DocumentFragment.
361   */
362  function createDocumentFragment(ownerDocument, data){
363    if (!ownerDocument) {
364        ownerDocument = document;
365    }
366    if(supportsUnknownElements){
367        return ownerDocument.createDocumentFragment();
368    }
369    data = data || getExpandoData(ownerDocument);
370    var clone = data.frag.cloneNode(),
371        i = 0,
372        elems = getElements(),
373        l = elems.length;
374    for(;i<l;i++){
375        clone.createElement(elems[i]);
376    }
377    return clone;
378  }
379
380  /**
381   * Shivs the `createElement` and `createDocumentFragment` methods of the document.
382   * @private
383   * @param {Document|DocumentFragment} ownerDocument The document.
384   * @param {Object} data of the document.
385   */
386  function shivMethods(ownerDocument, data) {
387    if (!data.cache) {
388        data.cache = {};
389        data.createElem = ownerDocument.createElement;
390        data.createFrag = ownerDocument.createDocumentFragment;
391        data.frag = data.createFrag();
392    }
393
394
395    ownerDocument.createElement = function(nodeName) {
396      //abort shiv
397      if (!html5.shivMethods) {
398          return data.createElem(nodeName);
399      }
400      return createElement(nodeName, ownerDocument, data);
401    };
402
403    ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
404      'var n=f.cloneNode(),c=n.createElement;' +
405      'h.shivMethods&&(' +
406        // unroll the `createElement` calls
407        getElements().join().replace(/[\w\-:]+/g, function(nodeName) {
408          data.createElem(nodeName);
409          data.frag.createElement(nodeName);
410          return 'c("' + nodeName + '")';
411        }) +
412      ');return n}'
413    )(html5, data.frag);
414  }
415
416  /*--------------------------------------------------------------------------*/
417
418  /**
419   * Shivs the given document.
420   * @memberOf html5
421   * @param {Document} ownerDocument The document to shiv.
422   * @returns {Document} The shived document.
423   */
424  function shivDocument(ownerDocument) {
425    if (!ownerDocument) {
426        ownerDocument = document;
427    }
428    var data = getExpandoData(ownerDocument);
429
430    if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
431      data.hasCSS = !!addStyleSheet(ownerDocument,
432        // corrects block display not defined in IE6/7/8/9
433        'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
434        // adds styling not present in IE6/7/8/9
435        'mark{background:#FF0;color:#000}' +
436        // hides non-rendered elements
437        'template{display:none}'
438      );
439    }
440    if (!supportsUnknownElements) {
441      shivMethods(ownerDocument, data);
442    }
443    return ownerDocument;
444  }
445
446  /*--------------------------------------------------------------------------*/
447
448  /**
449   * The `html5` object is exposed so that more elements can be shived and
450   * existing shiving can be detected on iframes.
451   * @type Object
452   * @example
453   *
454   * // options can be changed before the script is included
455   * html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
456   */
457  var html5 = {
458
459    /**
460     * An array or space separated string of node names of the elements to shiv.
461     * @memberOf html5
462     * @type Array|String
463     */
464    'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video',
465
466    /**
467     * current version of html5shiv
468     */
469    'version': version,
470
471    /**
472     * A flag to indicate that the HTML5 style sheet should be inserted.
473     * @memberOf html5
474     * @type Boolean
475     */
476    'shivCSS': (options.shivCSS !== false),
477
478    /**
479     * Is equal to true if a browser supports creating unknown/HTML5 elements
480     * @memberOf html5
481     * @type boolean
482     */
483    'supportsUnknownElements': supportsUnknownElements,
484
485    /**
486     * A flag to indicate that the document's `createElement` and `createDocumentFragment`
487     * methods should be overwritten.
488     * @memberOf html5
489     * @type Boolean
490     */
491    'shivMethods': (options.shivMethods !== false),
492
493    /**
494     * A string to describe the type of `html5` object ("default" or "default print").
495     * @memberOf html5
496     * @type String
497     */
498    'type': 'default',
499
500    // shivs the document according to the specified `html5` object options
501    'shivDocument': shivDocument,
502
503    //creates a shived element
504    createElement: createElement,
505
506    //creates a shived documentFragment
507    createDocumentFragment: createDocumentFragment,
508
509    //extends list of elements
510    addElements: addElements
511  };
512
513  /*--------------------------------------------------------------------------*/
514
515  // expose html5
516  window.html5 = html5;
517
518  // shiv the document
519  shivDocument(document);
520
521  if(typeof module == 'object' && module.exports){
522    module.exports = html5;
523  }
524
525}(typeof window !== "undefined" ? window : this, document));;
526!function(){function e(){const e=document.createElement("iframe");e.style.cssText="display:none",e.name="__tcfapiLocator",document.body.appendChild(e)}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:5,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 i={__tcfapiReturn:{returnValue:n,success:c,callId:a.callId}};t&&(i=JSON.stringify(i)),e&&e.source&&e.source.postMessage&&e.source.postMessage(i,"*")}),a.parameter)}),!1),"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e)}();;

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.