(function(e){"Window"inthis||!function(e){e.constructor?e.Window=e.constructor:(e.Window=e.constructor=newFunction("return function Window() {}")()).prototype=this}(this),"Document"inthis||(this.HTMLDocument?this.Document=this.HTMLDocument:(this.Document=this.HTMLDocument=document.constructor=newFunction("return function Document() {}")(),this.Document.prototype=document)),"Element"inthis&&"HTMLElement"inthis||!function(){functione(){returns--||clearTimeout(t),document.body&&!document.body.prototype&&/(complete|interactive)/.test(document.readyState)?(a(document,!0),t&&document.body.prototype&&clearTimeout(t),!!document.body.prototype):!1}if(window.Element&&!window.HTMLElement)returnvoid(window.HTMLElement=window.Element);window.Element=window.HTMLElement=newFunction("return function Element() {}")();vart,n=document.appendChild(document.createElement("body")),o=n.appendChild(document.createElement("iframe")),r=o.contentWindow.document,i=Element.prototype=r.appendChild(r.createElement("*")),c={},a=function(e,t){varn,o,r,i=e.childNodes||[],u=-1;if(1===e.nodeType&&e.constructor!==Element){e.constructor=Element;for(ninc)o=c[n],e[n]=o}for(;r=t&&i[++u];)a(r,t);returne},u=document.getElementsByTagName("*"),l=document.createElement,s=100;i.attachEvent("onpropertychange",function(e){for(vart,n=e.propertyName,o=!c.hasOwnProperty(n),r=i[n],a=c[n],l=-1;t=u[++l];)1===t.nodeType&&(o||t[n]===a)&&(t[n]=r);c[n]=r}),i.constructor=Element,i.hasAttribute||(i.hasAttribute=function(e){returnnull!==this.getAttribute(e)}),e(!0)||(document.onreadystatechange=e,t=setInterval(e,25)),document.createElement=function(e){vart=l(String(e).toLowerCase());returna(t)},document.removeChild(n)}(),"defineProperty"inObject&&function(){try{vare={};returnObject.defineProperty(e,"test",{value:42}),!0}catch(t){return!1}}()||!function(e){vart=Object.prototype.hasOwnProperty("__defineGetter__"),n="Getters & setters cannot be defined on this javascript engine",o="A property cannot both have accessors and be writable or have a value";Object.defineProperty=function(r,i,c){if(e&&(r===window||r===document||r===Element.prototype||rinstanceofElement))returne(r,i,c);if(null===r||!(rinstanceofObject||"object"==typeofr))thrownewTypeError("Object must be an object (Object.defineProperty polyfill)");if(!(cinstanceofObject))thrownewTypeError("Descriptor must be an object (Object.defineProperty polyfill)");vara=String(i),u="value"inc||"writable"inc,l="get"inc&&typeofc.get,s="set"inc&&typeofc.set;if(l){if("function"!==l)thrownewTypeError("Getter expected a function (Object.defineProperty polyfill)");if(!t)thrownewTypeError(n);if(u)thrownewTypeError(o);r.__defineGetter__(a,c.get)}elser[a]=c.value;if(s){if("function"!==s)thrownewTypeError("Setter expected a function (Object.defineProperty polyfill)");if(!t)thrownewTypeError(n);if(u)thrownewTypeError(o);r.__defineSetter__(a,c.set)}return"value"inc&&(r[a]=c.value),r}}(Object.defineProperty),function(e){if(!("Event"ine))return!1;if("function"==typeofe.Event)return!0;try{returnnewEvent("click"),!0}catch(t){return!1}}(this)||!function(){functiont(e,t){for(varn=-1,o=e.length;++n<o;)if(nine&&e[n]===t)returnn;return-1}varn={click:1,dblclick:1,keyup:1,keypress:1,keydown:1,mousedown:1,mouseup:1,mousemove:1,mouseover:1,mouseenter:1,mouseleave:1,mouseout:1,storage:1,storagecommit:1,textinput:1},o=window.Event&&window.Event.prototype||null;window.Event=Window.prototype.Event=function(t,n){if(!t)thrownewError("Not enough arguments");if("createEvent"indocument){varo=document.createEvent("Event"),r=n&&n.bubbles!==e?n.bubbles:!1,i=n&&n.cancelable!==e?n.cancelable:!1;returno.initEvent(t,r,i),o}varo=document.createEventObject();returno.type=t,o.bubbles=n&&n.bubbles!==e?n.bubbles:!1,o.cancelable=n&&n.cancelable!==e?n.cancelable:!1,o},o&&Object.defineProperty(window.Event,"prototype",{configurable:!1,enumerable:!1,writable:!0,value:o}),"createEvent"indocument||(window.addEventListener=Window.prototype.addEventListener=Document.prototype.addEventListener=Element.prototype.addEventListener=function(){vare=this,o=arguments[0],r=arguments[1];if(e===window&&oinn)thrownewError("In IE8 the event: "+o+" is not available on the window object. Please see https://github.com/Financial-Times/polyfill-service/issues/317 for more information.");e._events||(e._events={}),e._events[o]||(e._events[o]=function(n){varo,r=e._events[n.type].list,i=r.slice(),c=-1,a=i.length;for(n.preventDefault=function(){n.cancelable!==!1&&(n.returnValue=!1)},n.stopPropagation=function(){n.cancelBubble=!0},n.stopImmediatePropagation=function(){n.cancelBubble=!0,n.cancelImmediate=!0},n.currentTarget=e,n.relatedTarget=n.fromElement||null,n.target=n.target||n.srcElement||e,n.timeStamp=(newDate).getTime(),n.clientX&&(n.pageX=n.clientX+document.documentElement.scrollLeft,n.pageY=n.clientY+document.documentElement.scrollTop);++c<a&&!n.cancelImmediate;)cini&&(o=i[c],-1!==t(r,o)&&"function"==typeofo&&o.call(e,n))},e._events[o].list=[],e.attachEvent&&e.attachEvent("on"+o,e._events[o])),e._events[o].list.push(r)},window.removeEventListener=Window.prototype.removeEventListener=Document.prototype.removeEventListener=Element.prototype.removeEventListener=function(){vare,n=this,o=arguments[0],r=arguments[1];n._events&&n._events[o]&&n._events[o].list&&(e=t(n._events[o].list,r),-1!==e&&(n._events[o].list.splice(e,1),n._events[o].list.length||(n.detachEvent&&n.detachEvent("on"+o,n._events[o]),deleten._events[o])))},window.dispatchEvent=Window.prototype.dispatchEvent=Document.prototype.dispatchEvent=Element.prototype.dispatchEvent=function(e){if(!arguments.length)thrownewError("Not enough arguments");if(!e||"string"!=typeofe.type)thrownewError("DOM Events Exception 0");vart=this,n=e.type;try{if(!e.bubbles){e.cancelBubble=!0;varo=function(e){e.cancelBubble=!0,(t||window).detachEvent("on"+n,o)};this.attachEvent("on"+n,o)}this.fireEvent("on"+n,e)}catch(r){e.target=t;doe.currentTarget=t,"_events"int&&"function"==typeoft._events[n]&&t._events[n].call(t,e),"function"==typeoft["on"+n]&&t["on"+n].call(t,e),t=9===t.nodeType?t.parentWindow:t.parentNode;while(t&&!e.cancelBubble)}return!0},document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&document.dispatchEvent(newEvent("DOMContentLoaded",{bubbles:!0}))}))}()}).call("object"==typeofwindow&&window||"object"==typeofself&&self||"object"==typeofglobal&&global||{});