diff --git a/Gruntfile.js b/Gruntfile.js index 4152a4c..7fcb4d7 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -13,9 +13,6 @@ module.exports = function(grunt) { browserify: { dist: { - options: { - transform: ['browserify-shim'], - }, src: 'src/<%= pkg.name %>.js', dest: 'dist/<%= pkg.name %>.js' } diff --git a/README.md b/README.md index f334b0e..d8860f1 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,11 @@ on a fixed-width site it'll stay fixed width as it is loaded and initialised in an asynchronous fashion. * __Lightweight__: The script is self-contained and has no external dependencies. It weighs only 5.38 kB when minified and gzipped. -* __Browser support__: This has been tested on IE8+ and all recent modern browsers. +* __Browser support__: This has been tested on IE9+ and all recent modern browsers. + +## v1.1.0 Changes +In this version, legacy polyfills for older browsers (IE8 and below) were removed to reduce file size and +prevent the polyfills from interfering with native browser APIs. ## Installation / Usage @@ -146,10 +150,10 @@ CSS font-family value for text in the container. ## Building from source -Development is based on `npm`, `bower` and `grunt` so make sure you have these +Development is based on `npm` and `grunt` so make sure you have these installed globally. Then install project dependencies: -`npm install && bower install` +`npm install` Then run the build via diff --git a/bower.json b/bower.json deleted file mode 100644 index 703928d..0000000 --- a/bower.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "implied-consent", - "version": "0.3.0", - "private": true, - "homepage": "https://github.com/dennisinteractive/implied-consent", - "authors": [ - "Attila Beregszaszi " - ], - "license": "MIT", - "private": true, - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ], - "dependencies": { - "eventlistener-polyfill": "~1.0.0" - } -} diff --git a/dist/implied-consent.js b/dist/implied-consent.js index aa11411..08095dc 100644 --- a/dist/implied-consent.js +++ b/dist/implied-consent.js @@ -1,179 +1,4 @@ (function(f) { f() }(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 0; i--) { - listener = listenerList[i]; - - if ((!selector || selector === listener.selector) && (!handler || handler === listener.handler)) { - listenerList.splice(i, 1); - } - } - - // All listeners removed - if (!listenerList.length) { - delete listenerMap[eventType]; - - // Remove the main handler - if (this.rootElement) { - this.rootElement.removeEventListener(eventType, this.handle, useCapture); - } - } - - return this; -}; - - -/** - * Handle an arbitrary event. - * - * @param {Event} event - */ -Delegate.prototype.handle = function(event) { - var i, l, type = event.type, root, phase, listener, returned, listenerList = [], target, /** @const */ EVENTIGNORE = 'ftLabsDelegateIgnore'; - - if (event[EVENTIGNORE] === true) { - return; - } - - target = event.target; - - // Hardcode value of Node.TEXT_NODE - // as not defined in IE8 - if (target.nodeType === 3) { - target = target.parentNode; - } - - root = this.rootElement; - - phase = event.eventPhase || ( event.target !== event.currentTarget ? 3 : 2 ); - - switch (phase) { - case 1: //Event.CAPTURING_PHASE: - listenerList = this.listenerMap[1][type]; - break; - case 2: //Event.AT_TARGET: - if (this.listenerMap[0] && this.listenerMap[0][type]) listenerList = listenerList.concat(this.listenerMap[0][type]); - if (this.listenerMap[1] && this.listenerMap[1][type]) listenerList = listenerList.concat(this.listenerMap[1][type]); - break; - case 3: //Event.BUBBLING_PHASE: - listenerList = this.listenerMap[0][type]; - break; - } - - // Need to continuously check - // that the specific list is - // still populated in case one - // of the callbacks actually - // causes the list to be destroyed. - l = listenerList.length; - while (target && l) { - for (i = 0; i < l; i++) { - listener = listenerList[i]; - - // Bail from this loop if - // the length changed and - // no more listeners are - // defined between i and l. - if (!listener) { - break; - } - - // Check for match and fire - // the event if there's one - // - // TODO:MCG:20120117: Need a way - // to check if event#stopImmediatePropagation - // was called. If so, break both loops. - if (listener.matcher.call(target, listener.matcherParam, target)) { - returned = this.fire(event, target, listener); - } - - // Stop propagation to subsequent - // callbacks if the callback returned - // false - if (returned === false) { - event[EVENTIGNORE] = true; - event.preventDefault(); - return; - } - } - - // TODO:MCG:20120117: Need a way to - // check if event#stopPropagation - // was called. If so, break looping - // through the DOM. Stop if the - // delegation root has been reached - if (target === root) { - break; - } - - l = listenerList.length; - target = target.parentElement; - } -}; - -/** - * Fire a listener on a target. - * - * @param {Event} event - * @param {Node} target - * @param {Object} listener - * @returns {boolean} - */ -Delegate.prototype.fire = function(event, target, listener) { - return listener.handler.call(target, event, target); -}; - -/** - * Check whether an element - * matches a generic selector. - * - * @type function() - * @param {string} selector A CSS selector - */ -var matches = (function(el) { - if (!el) return; - var p = el.prototype; - return (p.matches || p.matchesSelector || p.webkitMatchesSelector || p.mozMatchesSelector || p.msMatchesSelector || p.oMatchesSelector); -}(Element)); - -/** - * Check whether an element - * matches a tag selector. - * - * Tags are NOT case-sensitive, - * except in XML (and XML-based - * languages such as XHTML). - * - * @param {string} tagName The tag name to test against - * @param {Element} element The element to test with - * @returns boolean - */ -function matchesTag(tagName, element) { - return tagName.toLowerCase() === element.tagName.toLowerCase(); -} - -/** - * Check whether an element - * matches the root. - * - * @param {?String} selector In this case this is always passed through as null and not used - * @param {Element} element The element to test with - * @returns boolean - */ -function matchesRoot(selector, element) { - /*jshint validthis:true*/ - if (this.rootElement === window) return element === document; - return this.rootElement === element; -} - -/** - * Check whether the ID of - * the element in 'this' - * matches the given ID. - * - * IDs are case-sensitive. - * - * @param {string} id The ID to test against - * @param {Element} element The element to test with - * @returns boolean - */ -function matchesId(id, element) { - return id === element.id; -} - -/** - * Short hand for off() - * and root(), ie both - * with no parameters - * - * @return void - */ -Delegate.prototype.destroy = function() { - this.off(); - this.root(); -}; - -},{}],6:[function(require,module,exports){ -/*jshint browser:true, node:true*/ - -'use strict'; - -/** - * @preserve Create and manage a DOM event delegator. - * - * @version 0.3.0 - * @codingstandard ftlabs-jsv2 - * @copyright The Financial Times Limited [All Rights Reserved] - * @license MIT License (see LICENSE.txt) - */ -var Delegate = require('./delegate'); - -module.exports = function(root) { - return new Delegate(root); -}; - -module.exports.Delegate = Delegate; - -},{"./delegate":5}],7:[function(require,module,exports){ +},{}],3:[function(require,module,exports){ /*! * domready (c) Dustin Diaz 2012 - License MIT */ @@ -884,138 +268,12 @@ module.exports.Delegate = Delegate; }) }) -},{}],8:[function(require,module,exports){ -var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; -var slice = Array.prototype.slice; -var toStr = Object.prototype.toString; -var funcType = '[object Function]'; - -module.exports = function bind(that) { - var target = this; - if (typeof target !== 'function' || toStr.call(target) !== funcType) { - throw new TypeError(ERROR_MESSAGE + target); - } - var args = slice.call(arguments, 1); - - var binder = function () { - if (this instanceof bound) { - var result = target.apply( - this, - args.concat(slice.call(arguments)) - ); - if (Object(result) === result) { - return result; - } - return this; - } else { - return target.apply( - that, - args.concat(slice.call(arguments)) - ); - } - }; - - var boundLength = Math.max(0, target.length - args.length); - var boundArgs = []; - for (var i = 0; i < boundLength; i++) { - boundArgs.push('$' + i); - } - - var bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); - - if (target.prototype) { - var Empty = function Empty() {}; - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - Empty.prototype = null; - } - - return bound; -}; - - -},{}],9:[function(require,module,exports){ -/* jshint bitwise: false */ - -// Production steps of ECMA-262, Edition 5, 15.4.4.14 -// Reference: http://es5.github.io/#x15.4.4.14 -if (!Array.prototype.indexOf) { - Array.prototype.indexOf = function(searchElement, fromIndex) { - - var k; - - // 1. Let O be the result of calling ToObject passing - // the this value as the argument. - if (this === null) { - throw new TypeError('"this" is null or not defined'); - } - - var O = Object(this); - - // 2. Let lenValue be the result of calling the Get - // internal method of O with the argument "length". - // 3. Let len be ToUint32(lenValue). - var len = O.length >>> 0; - - // 4. If len is 0, return -1. - if (len === 0) { - return -1; - } - - // 5. If argument fromIndex was passed let n be - // ToInteger(fromIndex); else let n be 0. - var n = +fromIndex || 0; - - if (Math.abs(n) === Infinity) { - n = 0; - } - - // 6. If n >= len, return -1. - if (n >= len) { - return -1; - } - - // 7. If n >= 0, then Let k be n. - // 8. Else, n<0, Let k be len - abs(n). - // If k is less than 0, then let k be 0. - k = Math.max(n >= 0 ? n : len - Math.abs(n), 0); - - // 9. Repeat, while k < len - while (k < len) { - // a. Let Pk be ToString(k). - // This is implicit for LHS operands of the in operator - // b. Let kPresent be the result of calling the - // HasProperty internal method of O with argument Pk. - // This step can be combined with c - // c. If kPresent is true, then - // i. Let elementK be the result of calling the Get - // internal method of O with the argument ToString(k). - // ii. Let same be the result of applying the - // Strict Equality Comparison Algorithm to - // searchElement and elementK. - // iii. If same is true, return k. - if (k in O && O[k] === searchElement) { - return k; - } - k++; - } - return -1; - }; -} - -},{}],10:[function(require,module,exports){ +},{}],4:[function(require,module,exports){ (function(exports, undefined) { - // Some polyfills & shims. - require('eventlistener-polyfill'); - require('prototype-indexof-shim'); - var forEach = require('array-foreach'); - Function.prototype.bind = require('function-bind'); - // Other dependencies. var aug = require('aug'); var Cookies = require('cookies-js'); - var Delegate = require('dom-delegate'); var domReady = require('domready'); /** @@ -1134,28 +392,26 @@ if (!Array.prototype.indexOf) { /** * Launch events on page interaction. */ - function validateByClick() { - ic.delegate = new Delegate(document); - // Specify the listener targets one by one to retain old IE8 compatibility. - ic.delegate.on('click', 'a', validateByClickHandler); - ic.delegate.on('click', 'button', validateByClickHandler); - ic.delegate.on('click', 'input', validateByClickHandler); + function validateByClick(wrapper) { + wrapper.addEventListener('click', validateByClickHandler); } /** * Event handler to monitor page interaction and perform acknowledgement if * needed. */ - function validateByClickHandler() { - switch (this.tagName) { + function validateByClickHandler(e) { + var target = e.target; + + switch (target.tagName) { case 'A': - if (!!this.href.match(/^#/) || !!this.href.match(/^\//) || !!this.href.match(hostnamePattern)) { + if (!!target.href.match(/^#/) || !!target.href.match(/^\//) || !!target.href.match(hostnamePattern)) { return agree(); } break; case 'INPUT': - if (this.type === 'submit') { + if (target.type === 'submit') { return agree(); } break; @@ -1165,13 +421,6 @@ if (!Array.prototype.indexOf) { } } - /** - * Close button click handler. - */ - function buttonHandler() { - agree(); - } - /** * Perform acknowledgement. * @@ -1194,7 +443,6 @@ if (!Array.prototype.indexOf) { var wrapper = document.createElement('div'); var container = document.createElement('div'); var body = document.body; - var activeButton; // Embed styles. s.type = 'text/css'; @@ -1246,13 +494,12 @@ if (!Array.prototype.indexOf) { body = document.body; body.insertBefore(wrapper, body.firstChild); - // Set up click listener on the notice button. - activeButton = document.querySelector('#__ic-continue-button'); - activeButton.addEventListener('click', buttonHandler); - // Add validate by click if set. if (config.validateByClick) { - validateByClick(); + validateByClick(wrapper); + } else { + var activeButton = document.getElementById('__ic-continue-button'); + activeButton.addEventListener('click', agree); } ic.status = true; @@ -1262,12 +509,8 @@ if (!Array.prototype.indexOf) { * Remove any event listeners set and the notice container. */ function destroy() { - var button = document.querySelector('#__ic-continue-button'); - button.removeEventListener('click', buttonHandler); - ic.delegate && ic.delegate.destroy(); - // Destroy notice element. - var el = document.querySelector('#__ic-notice-container'); + var el = document.getElementById('__ic-notice-container'); el.parentElement.removeChild(el); ic.status = false; } @@ -1301,7 +544,9 @@ if (!Array.prototype.indexOf) { // Process initial queue items. if (queue instanceof Array) { - forEach(queue, root.impliedConsent.q.push); + for (var i = 0; i < queue.length; i++) { + root.impliedConsent.q.push(queue[i]); + } } } @@ -1311,5 +556,5 @@ if (!Array.prototype.indexOf) { }(typeof exports === 'object' && exports || this)); -},{"array-foreach":2,"aug":3,"cookies-js":4,"dom-delegate":6,"domready":7,"eventlistener-polyfill":1,"function-bind":8,"prototype-indexof-shim":9}]},{},[10]); +},{"aug":1,"cookies-js":2,"domready":3}]},{},[4]); })); \ No newline at end of file diff --git a/dist/implied-consent.min.js b/dist/implied-consent.min.js index 0021766..052c1bb 100644 --- a/dist/implied-consent.min.js +++ b/dist/implied-consent.min.js @@ -1,7 +1,7 @@ /*! - * Implied Consent version 1.0.0 - a Cookie Notice plugin + * Implied Consent version 1.1.0 - a Cookie Notice plugin * * Copyright Dennis Publishing * Released under MIT license */ -!function(a){a()}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};a[g][0].call(k.exports,function(b){var c=a[g][1][b];return e(c?c:b)},k,k.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ge;e++){var g=a[e];for(var h in g)"deep"==c&&"object"==typeof g[h]&&"undefined"!=typeof b[h]?d(c,b[h],g[h]):("strict"!=c||"strict"==c&&"undefined"!=typeof b[h])&&(b[h]=g[h])}return b};"undefined"!=typeof c?c.exports=d:("function"==typeof a&&a.amd&&a(function(){return d}),b.aug=d)}(this)},{}],4:[function(b,c,d){!function(b,e){"use strict";var f=function(a){if("object"!=typeof a.document)throw new Error("Cookies.js requires a `window` with a `document` object");var b=function(a,c,d){return 1===arguments.length?b.get(a):b.set(a,c,d)};return b._document=a.document,b._cacheKeyPrefix="cookey.",b._maxExpireDate=new Date("Fri, 31 Dec 9999 23:59:59 UTC"),b.defaults={path:"/",secure:!1},b.get=function(a){return b._cachedDocumentCookie!==b._document.cookie&&b._renewCache(),b._cache[b._cacheKeyPrefix+a]},b.set=function(a,c,d){return d=b._getExtendedOptions(d),d.expires=b._getExpiresDate(c===e?-1:d.expires),b._document.cookie=b._generateCookieString(a,c,d),b},b.expire=function(a,c){return b.set(a,e,c)},b._getExtendedOptions=function(a){return{path:a&&a.path||b.defaults.path,domain:a&&a.domain||b.defaults.domain,expires:a&&a.expires||b.defaults.expires,secure:a&&a.secure!==e?a.secure:b.defaults.secure}},b._isValidDate=function(a){return"[object Date]"===Object.prototype.toString.call(a)&&!isNaN(a.getTime())},b._getExpiresDate=function(a,c){if(c=c||new Date,"number"==typeof a?a=a===1/0?b._maxExpireDate:new Date(c.getTime()+1e3*a):"string"==typeof a&&(a=new Date(a)),a&&!b._isValidDate(a))throw new Error("`expires` parameter cannot be converted to a valid Date instance");return a},b._generateCookieString=function(a,b,c){a=a.replace(/[^#$&+\^`|]/g,encodeURIComponent),a=a.replace(/\(/g,"%28").replace(/\)/g,"%29"),b=(b+"").replace(/[^!#$&-+\--:<-\[\]-~]/g,encodeURIComponent),c=c||{};var d=a+"="+b;return d+=c.path?";path="+c.path:"",d+=c.domain?";domain="+c.domain:"",d+=c.expires?";expires="+c.expires.toUTCString():"",d+=c.secure?";secure":""},b._getCacheFromString=function(a){for(var c={},d=a?a.split("; "):[],f=0;fb?a.length:b,{key:decodeURIComponent(a.substr(0,b)),value:decodeURIComponent(a.substr(b+1))}},b._renewCache=function(){b._cache=b._getCacheFromString(b._document.cookie),b._cachedDocumentCookie=b._document.cookie},b._areEnabled=function(){var a="cookies.js",c="1"===b.set(a,1).get(a);return b.expire(a),c},b.enabled=b._areEnabled(),b},g="object"==typeof b.document?f(b):f;"function"==typeof a&&a.amd?a(function(){return g}):"object"==typeof d?("object"==typeof c&&"object"==typeof c.exports&&(d=c.exports=g),d.Cookies=g):b.Cookies=g}("undefined"==typeof window?this:window)},{}],5:[function(a,b){"use strict";function c(a){this.listenerMap=[{},{}],a&&this.root(a),this.handle=c.prototype.handle.bind(this)}function d(a,b){return a.toLowerCase()===b.tagName.toLowerCase()}function e(a,b){return this.rootElement===window?b===document:this.rootElement===b}function f(a,b){return a===b.id}b.exports=c,c.prototype.root=function(a){var b,c=this.listenerMap;if(this.rootElement){for(b in c[1])c[1].hasOwnProperty(b)&&this.rootElement.removeEventListener(b,this.handle,!0);for(b in c[0])c[0].hasOwnProperty(b)&&this.rootElement.removeEventListener(b,this.handle,!1)}if(!a||!a.addEventListener)return this.rootElement&&delete this.rootElement,this;this.rootElement=a;for(b in c[1])c[1].hasOwnProperty(b)&&this.rootElement.addEventListener(b,this.handle,!0);for(b in c[0])c[0].hasOwnProperty(b)&&this.rootElement.addEventListener(b,this.handle,!1);return this},c.prototype.captureForType=function(a){return-1!==["blur","error","focus","load","resize","scroll"].indexOf(a)},c.prototype.on=function(a,b,c,h){var i,j,k,l;if(!a)throw new TypeError("Invalid event type: "+a);if("function"==typeof b&&(h=c,c=b,b=null),void 0===h&&(h=this.captureForType(a)),"function"!=typeof c)throw new TypeError("Handler must be a type of Function");return i=this.rootElement,j=this.listenerMap[h?1:0],j[a]||(i&&i.addEventListener(a,this.handle,h),j[a]=[]),b?/^[a-z]+$/i.test(b)?(l=b,k=d):/^#[a-z0-9\-_]+$/i.test(b)?(l=b.slice(1),k=f):(l=b,k=g):(l=null,k=e.bind(this)),j[a].push({selector:b,handler:c,matcher:k,matcherParam:l}),this},c.prototype.off=function(a,b,c,d){var e,f,g,h,i;if("function"==typeof b&&(d=c,c=b,b=null),void 0===d)return this.off(a,b,c,!0),this.off(a,b,c,!1),this;if(g=this.listenerMap[d?1:0],!a){for(i in g)g.hasOwnProperty(i)&&this.off(i,b,c);return this}if(h=g[a],!h||!h.length)return this;for(e=h.length-1;e>=0;e--)f=h[e],b&&b!==f.selector||c&&c!==f.handler||h.splice(e,1);return h.length||(delete g[a],this.rootElement&&this.rootElement.removeEventListener(a,this.handle,d)),this},c.prototype.handle=function(a){var b,c,d,e,f,g,h,i=a.type,j=[],k="ftLabsDelegateIgnore";if(a[k]!==!0){switch(h=a.target,3===h.nodeType&&(h=h.parentNode),d=this.rootElement,e=a.eventPhase||(a.target!==a.currentTarget?3:2)){case 1:j=this.listenerMap[1][i];break;case 2:this.listenerMap[0]&&this.listenerMap[0][i]&&(j=j.concat(this.listenerMap[0][i])),this.listenerMap[1]&&this.listenerMap[1][i]&&(j=j.concat(this.listenerMap[1][i]));break;case 3:j=this.listenerMap[0][i]}for(c=j.length;h&&c;){for(b=0;c>b&&(f=j[b],f);b++)if(f.matcher.call(h,f.matcherParam,h)&&(g=this.fire(a,h,f)),g===!1)return a[k]=!0,void a.preventDefault();if(h===d)break;c=j.length,h=h.parentElement}}},c.prototype.fire=function(a,b,c){return c.handler.call(b,a,b)};var g=function(a){if(a){var b=a.prototype;return b.matches||b.matchesSelector||b.webkitMatchesSelector||b.mozMatchesSelector||b.msMatchesSelector||b.oMatchesSelector}}(Element);c.prototype.destroy=function(){this.off(),this.root()}},{}],6:[function(a,b){"use strict";var c=a("./delegate");b.exports=function(a){return new c(a)},b.exports.Delegate=c},{"./delegate":5}],7:[function(b,c){!function(b,d){"undefined"!=typeof c?c.exports=d():"function"==typeof a&&"object"==typeof a.amd?a(d):this[b]=d()}("domready",function(a){function b(a){for(n=1;a=d.shift();)a()}var c,d=[],e=!1,f=document,g=f.documentElement,h=g.doScroll,i="DOMContentLoaded",j="addEventListener",k="onreadystatechange",l="readyState",m=h?/^loaded|^c/:/^loaded|c/,n=m.test(f[l]);return f[j]&&f[j](i,c=function(){f.removeEventListener(i,c,e),b()},e),h&&f.attachEvent(k,c=function(){/^c/.test(f[l])&&(f.detachEvent(k,c),b())}),a=h?function(b){self!=top?n?b():d.push(b):function(){try{g.doScroll("left")}catch(c){return setTimeout(function(){a(b)},50)}b()}()}:function(a){n?a():d.push(a)}})},{}],8:[function(a,b){var c="Function.prototype.bind called on incompatible ",d=Array.prototype.slice,e=Object.prototype.toString,f="[object Function]";b.exports=function(a){var b=this;if("function"!=typeof b||e.call(b)!==f)throw new TypeError(c+b);for(var g=d.call(arguments,1),h=function(){if(this instanceof l){var c=b.apply(this,g.concat(d.call(arguments)));return Object(c)===c?c:this}return b.apply(a,g.concat(d.call(arguments)))},i=Math.max(0,b.length-g.length),j=[],k=0;i>k;k++)j.push("$"+k);var l=Function("binder","return function ("+j.join(",")+"){ return binder.apply(this,arguments); }")(h);if(b.prototype){var m=function(){};m.prototype=b.prototype,l.prototype=new m,m.prototype=null}return l}},{}],9:[function(){Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){var c;if(null===this)throw new TypeError('"this" is null or not defined');var d=Object(this),e=d.length>>>0;if(0===e)return-1;var f=+b||0;if(Math.abs(f)===1/0&&(f=0),f>=e)return-1;for(c=Math.max(f>=0?f:e-Math.abs(f),0);e>c;){if(c in d&&d[c]===a)return c;c++}return-1})},{}],10:[function(a,b,c){!function(b,c){function d(){v.delegate=new o(document),v.delegate.on("click","a",e),v.delegate.on("click","button",e),v.delegate.on("click","input",e)}function e(){switch(this.tagName){case"A":if(this.href.match(/^#/)||this.href.match(/^\//)||this.href.match(u))return g();break;case"INPUT":if("submit"===this.type)return g();break;case"BUTTON":return g()}}function f(){g()}function g(){n.set(l.cookieNamePrefix+t,"true"),i()}function h(){var a,b="#__ic-notice > * { display: inline; text-decoration: none; } #__ic-notice a, #__ic-notice a:link, #__ic-notice a:visited { color: "+l.linkColor+"}",c=document.createElement("style"),e=document.head||document.getElementsByTagName("head")[0],g=document.createElement("button"),h=document.createElement("div"),i=document.createElement("div"),j=document.createElement("div"),k=document.body;c.type="text/css",c.styleSheet?c.styleSheet.cssText=b:c.appendChild(document.createTextNode(b)),e.appendChild(c),g.id="__ic-continue-button",g.title=l.confirmText,g.innerHTML=l.confirmText,g.style.backgroundColor=l.buttonBackgroundColor,g.style.color=l.buttonColor,g.style.cursor="pointer",g.style.fontSize=l.fontSize,g.style.fontFamily=l.fontFamily,g.style.borderWidth=0,g.style.padding="3px 6px",g.style.marginLeft="15px",h.innerHTML=l.noticeText,h.id="__ic-notice",h.style.margin=0,h.style.padding="8px",h.style.textAlign="center",j.id="__ic-notice-container",j.style.position="relative",i.id="__ic-notice",i.style.position="relative",i.style.backgroundColor=l.backgroundColor,i.style.color=l.textColor,i.style.fontSize=l.fontSize,i.style.fontFamily=l.fontFamily,i.style.zIndex=999999,h.appendChild(g),j.appendChild(h),i.appendChild(j),k=document.body,k.insertBefore(i,k.firstChild),a=document.querySelector("#__ic-continue-button"),a.addEventListener("click",f),l.validateByClick&&d(),v.status=!0}function i(){var a=document.querySelector("#__ic-continue-button");a.removeEventListener("click",f),v.delegate&&v.delegate.destroy();var b=document.querySelector("#__ic-notice-container");b.parentElement.removeChild(b),v.status=!1}function j(){var a,b="undefined"!=typeof window?window:this;b.impliedConsent=b.impliedConsent||{},b.impliedConsent.q=b.impliedConsent.q||[],a=b.impliedConsent.q,b.impliedConsent.q.push=function(a){if(v.status||!(a instanceof Array)||!a[0]||"function"!=typeof v[a[0]])return!1;var b=a[1]||{};v[a[0]].apply(this,[b])},a instanceof Array&&k(a,b.impliedConsent.q.push)}a("eventlistener-polyfill"),a("prototype-indexof-shim");var k=a("array-foreach");Function.prototype.bind=a("function-bind");var l,m=a("aug"),n=a("cookies-js"),o=a("dom-delegate"),p=a("domready"),q=function(a){return a.toLowerCase().replace(/\.(.)/g,function(a,b){return b.toUpperCase()})},r=function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},s={noticeText:"We use cookies as set out in our privacy policy. By using this website, you agree we may place these cookies on your device.",confirmText:"Close",validateByClick:!0,cookieExpiresIn:365,cookieNamePrefix:"__ic_",backgroundColor:"#222",textColor:"#eee",linkColor:"#acf",buttonBackgroundColor:"#555",buttonColor:"#fff",fontSize:"12px",fontFamily:"sans-serif"},t=q(this.location.hostname),u=new RegExp("^https?://"+r(window.location.hostname)),v={status:!1,delegate:null};v.init=function(a){l=m(s,a),n.defaults={path:"/",expires:24*l.cookieExpiresIn*60*60},n.get(l.cookieNamePrefix+t)===c&&p(function(){h()})},j(),b.impliedConsent=v}("object"==typeof c&&c||this)},{"array-foreach":2,aug:3,"cookies-js":4,"dom-delegate":6,domready:7,"eventlistener-polyfill":1,"function-bind":8,"prototype-indexof-shim":9}]},{},[10])}); \ No newline at end of file +!function(a){a()}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};a[g][0].call(k.exports,function(b){var c=a[g][1][b];return e(c?c:b)},k,k.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ge;e++){var g=a[e];for(var h in g)"deep"==c&&"object"==typeof g[h]&&"undefined"!=typeof b[h]?d(c,b[h],g[h]):("strict"!=c||"strict"==c&&"undefined"!=typeof b[h])&&(b[h]=g[h])}return b};"undefined"!=typeof c?c.exports=d:("function"==typeof a&&a.amd&&a(function(){return d}),b.aug=d)}(this)},{}],2:[function(b,c,d){!function(b,e){"use strict";var f=function(a){if("object"!=typeof a.document)throw new Error("Cookies.js requires a `window` with a `document` object");var b=function(a,c,d){return 1===arguments.length?b.get(a):b.set(a,c,d)};return b._document=a.document,b._cacheKeyPrefix="cookey.",b._maxExpireDate=new Date("Fri, 31 Dec 9999 23:59:59 UTC"),b.defaults={path:"/",secure:!1},b.get=function(a){b._cachedDocumentCookie!==b._document.cookie&&b._renewCache();var c=b._cache[b._cacheKeyPrefix+a];return c===e?e:decodeURIComponent(c)},b.set=function(a,c,d){return d=b._getExtendedOptions(d),d.expires=b._getExpiresDate(c===e?-1:d.expires),b._document.cookie=b._generateCookieString(a,c,d),b},b.expire=function(a,c){return b.set(a,e,c)},b._getExtendedOptions=function(a){return{path:a&&a.path||b.defaults.path,domain:a&&a.domain||b.defaults.domain,expires:a&&a.expires||b.defaults.expires,secure:a&&a.secure!==e?a.secure:b.defaults.secure}},b._isValidDate=function(a){return"[object Date]"===Object.prototype.toString.call(a)&&!isNaN(a.getTime())},b._getExpiresDate=function(a,c){if(c=c||new Date,"number"==typeof a?a=a===1/0?b._maxExpireDate:new Date(c.getTime()+1e3*a):"string"==typeof a&&(a=new Date(a)),a&&!b._isValidDate(a))throw new Error("`expires` parameter cannot be converted to a valid Date instance");return a},b._generateCookieString=function(a,b,c){a=a.replace(/[^#$&+\^`|]/g,encodeURIComponent),a=a.replace(/\(/g,"%28").replace(/\)/g,"%29"),b=(b+"").replace(/[^!#$&-+\--:<-\[\]-~]/g,encodeURIComponent),c=c||{};var d=a+"="+b;return d+=c.path?";path="+c.path:"",d+=c.domain?";domain="+c.domain:"",d+=c.expires?";expires="+c.expires.toUTCString():"",d+=c.secure?";secure":""},b._getCacheFromString=function(a){for(var c={},d=a?a.split("; "):[],f=0;fb?a.length:b;var c,d=a.substr(0,b);try{c=decodeURIComponent(d)}catch(e){console&&"function"==typeof console.error&&console.error('Could not decode cookie with key "'+d+'"',e)}return{key:c,value:a.substr(b+1)}},b._renewCache=function(){b._cache=b._getCacheFromString(b._document.cookie),b._cachedDocumentCookie=b._document.cookie},b._areEnabled=function(){var a="cookies.js",c="1"===b.set(a,1).get(a);return b.expire(a),c},b.enabled=b._areEnabled(),b},g=b&&"object"==typeof b.document?f(b):f;"function"==typeof a&&a.amd?a(function(){return g}):"object"==typeof d?("object"==typeof c&&"object"==typeof c.exports&&(d=c.exports=g),d.Cookies=g):b.Cookies=g}("undefined"==typeof window?this:window)},{}],3:[function(b,c){!function(b,d){"undefined"!=typeof c?c.exports=d():"function"==typeof a&&"object"==typeof a.amd?a(d):this[b]=d()}("domready",function(a){function b(a){for(n=1;a=d.shift();)a()}var c,d=[],e=!1,f=document,g=f.documentElement,h=g.doScroll,i="DOMContentLoaded",j="addEventListener",k="onreadystatechange",l="readyState",m=h?/^loaded|^c/:/^loaded|c/,n=m.test(f[l]);return f[j]&&f[j](i,c=function(){f.removeEventListener(i,c,e),b()},e),h&&f.attachEvent(k,c=function(){/^c/.test(f[l])&&(f.detachEvent(k,c),b())}),a=h?function(b){self!=top?n?b():d.push(b):function(){try{g.doScroll("left")}catch(c){return setTimeout(function(){a(b)},50)}b()}()}:function(a){n?a():d.push(a)}})},{}],4:[function(a,b,c){!function(b,c){function d(a){a.addEventListener("click",e)}function e(a){var b=a.target;switch(b.tagName){case"A":if(b.href.match(/^#/)||b.href.match(/^\//)||b.href.match(r))return f();break;case"INPUT":if("submit"===b.type)return f();break;case"BUTTON":return f()}}function f(){l.set(j.cookieNamePrefix+q,"true"),h()}function g(){var a="#__ic-notice > * { display: inline; text-decoration: none; } #__ic-notice a, #__ic-notice a:link, #__ic-notice a:visited { color: "+j.linkColor+"}",b=document.createElement("style"),c=document.head||document.getElementsByTagName("head")[0],e=document.createElement("button"),g=document.createElement("div"),h=document.createElement("div"),i=document.createElement("div"),k=document.body;if(b.type="text/css",b.styleSheet?b.styleSheet.cssText=a:b.appendChild(document.createTextNode(a)),c.appendChild(b),e.id="__ic-continue-button",e.title=j.confirmText,e.innerHTML=j.confirmText,e.style.backgroundColor=j.buttonBackgroundColor,e.style.color=j.buttonColor,e.style.cursor="pointer",e.style.fontSize=j.fontSize,e.style.fontFamily=j.fontFamily,e.style.borderWidth=0,e.style.padding="3px 6px",e.style.marginLeft="15px",g.innerHTML=j.noticeText,g.id="__ic-notice",g.style.margin=0,g.style.padding="8px",g.style.textAlign="center",i.id="__ic-notice-container",i.style.position="relative",h.id="__ic-notice",h.style.position="relative",h.style.backgroundColor=j.backgroundColor,h.style.color=j.textColor,h.style.fontSize=j.fontSize,h.style.fontFamily=j.fontFamily,h.style.zIndex=999999,g.appendChild(e),i.appendChild(g),h.appendChild(i),k=document.body,k.insertBefore(h,k.firstChild),j.validateByClick)d(h);else{var l=document.getElementById("__ic-continue-button");l.addEventListener("click",f)}s.status=!0}function h(){var a=document.getElementById("__ic-notice-container");a.parentElement.removeChild(a),s.status=!1}function i(){var a,b="undefined"!=typeof window?window:this;if(b.impliedConsent=b.impliedConsent||{},b.impliedConsent.q=b.impliedConsent.q||[],a=b.impliedConsent.q,b.impliedConsent.q.push=function(a){if(s.status||!(a instanceof Array)||!a[0]||"function"!=typeof s[a[0]])return!1;var b=a[1]||{};s[a[0]].apply(this,[b])},a instanceof Array)for(var c=0;c