1if(!String.prototype.endsWith){String.prototype.endsWith=function(e,t){if(t===undefined||t>this.length){t=this.length}return this.substring(t-e.length,t)===e}}(function(){"use strict";var e=this;if(typeof e.GOVUK==="undefined"){e.GOVUK={}}GOVUK.cookie=function(e,t,r){if(typeof t!=="undefined"){if(t===false||t===null){return GOVUK.setCookie(e,"",{days:-1})}else{return GOVUK.setCookie(e,t,r)}}else{return GOVUK.getCookie(e)}};GOVUK.setCookie=function(e,t,r){if(typeof r==="undefined"){r={}}var n=e+"="+t+"; path=/";if(r.days){var o=new Date;o.setTime(o.getTime()+r.days*24*60*60*1e3);n=n+"; expires="+o.toGMTString()}if(document.location.protocol=="https:"){n=n+"; Secure"}document.cookie=n};GOVUK.getCookie=function(e){var t=e+"=";var r=document.cookie.split(";");for(var n=0,o=r.length;n<o;n++){var i=r[n];while(i.charAt(0)==" "){i=i.substring(1,i.length)}if(i.indexOf(t)===0){return decodeURIComponent(i.substring(t.length))}}return null}}).call(this);(function(){"use strict";var e=this;if(typeof e.GOVUK==="undefined"){e.GOVUK={}}GOVUK.addCookieMessage=function(){var e=document.getElementById("global-cookie-message"),t=e&&GOVUK.cookie("seen_cookie_message")===null;if(t){e.style.display="block";GOVUK.cookie("seen_cookie_message","yes",{days:28})}}}).call(this);(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?module.exports=t():typeof define==="function"&&define.amd?define(t):e.ES6Promise=t()})(this,function(){"use strict";function n(e){var t=typeof e;return e!==null&&(t==="object"||t==="function")}function u(e){return typeof e==="function"}var e=void 0;if(Array.isArray){e=Array.isArray}else{e=function(e){return Object.prototype.toString.call(e)==="[object Array]"}}var r=e;var o=0;var t=void 0;var i=void 0;var s=function e(t,r){p[o]=t;p[o+1]=r;o+=2;if(o===2){if(i){i(y)}else{g()}}};function a(e){i=e}function c(e){s=e}var l=typeof window!=="undefined"?window:undefined;var f=l||{};var d=f.MutationObserver||f.WebKitMutationObserver;var h=typeof self==="undefined"&&typeof process!=="undefined"&&{}.toString.call(process)==="[object process]";var v=typeof Uint8ClampedArray!=="undefined"&&typeof importScripts!=="undefined"&&typeof MessageChannel!=="undefined";function x(){return function(){return process.nextTick(y)}}function z(){if(typeof t!=="undefined"){return function(){t(y)}}return m()}function q(){var e=0;var t=new d(y);var r=document.createTextNode("");t.observe(r,{characterData:true});return function(){r.data=e=++e%2}}function I(){var e=new MessageChannel;e.port1.onmessage=y;return function(){return e.port2.postMessage(0)}}function m(){var e=setTimeout;return function(){return e(y,1)}}var p=new Array(1e3);function y(){for(var e=0;e<o;e+=2){var t=p[e];var r=p[e+1];t(r);p[e]=undefined;p[e+1]=undefined}o=0}function L(){try{var e=Function("return this")().require("vertx");t=e.runOnLoop||e.runOnContext;return z()}catch(e){return m()}}var g=void 0;if(h){g=x()}else if(d){g=q()}else if(v){g=I()}else if(l===undefined&&typeof require==="function"){g=L()}else{g=m()}function _(e,t){var r=this;var n=new this.constructor(k);if(n[b]===undefined){V(n)}var o=r._state;if(o){var i=arguments[o-1];s(function(){return G(o,n,i,r._result)})}else{M(r,n,e,t)}return n}function w(e){var t=this;if(e&&typeof e==="object"&&e.constructor===t){return e}var r=new t(k);S(r,e);return r}var b=Math.random().toString(36).substring(2);function k(){}var E=void 0;var A=1;var C=2;function Q(){return new TypeError("You cannot resolve a promise with itself")}function D(){return new TypeError("A promises callback cannot return that same promise.")}function W(e,t,r,n){try{e.call(t,r,n)}catch(e){return e}}function B(e,n,o){s(function(t){var r=false;var e=W(o,n,function(e){if(r){return}r=true;if(n!==e){S(t,e)}else{T(t,e)}},function(e){if(r){return}r=true;j(t,e)},"Settle: "+(t._label||" unknown promise"));if(!r&&e){r=true;j(t,e)}},e)}function F(t,e){if(e._state===A){T(t,e._result)}else if(e._state===C){j(t,e._result)}else{M(e,undefined,function(e){return S(t,e)},function(e){return j(t,e)})}}function O(e,t,r){if(t.constructor===e.constructor&&r===_&&t.constructor.resolve===w){F(e,t)}else{if(r===undefined){T(e,t)}else if(u(r)){B(e,t,r)}else{T(e,t)}}}function S(t,e){if(t===e){j(t,Q())}else if(n(e)){var r=void 0;try{r=e.then}catch(e){j(t,e);return}O(t,e,r)}else{T(t,e)}}
vendor: 2,929 bytes, line 1
1function Y(e){if(e._onerror){e._onerror(e._result)}U(e)}function T(e,t){if(e._state!==E){return}e._result=t;e._state=A;if(e._subscribers.length!==0){s(U,e)}}function j(e,t){if(e._state!==E){return}e._state=C;e._result=t;s(Y,e)}function M(e,t,r,n){var o=e._subscribers;var i=o.length;e._onerror=null;o[i]=t;o[i+A]=r;o[i+C]=n;if(i===0&&e._state){s(U,e)}}function U(e){var t=e._subscribers;var r=e._state;if(t.length===0){return}var n=void 0,o=void 0,i=e._result;for(var s=0;s<t.length;s+=3){n=t[s];o=t[s+r];if(n){G(r,n,o,i)}else{o(i)}}e._subscribers.length=0}function G(e,t,r,n){var o=u(r),i=void 0,s=void 0,a=true;if(o){try{i=r(n)}catch(e){a=false;s=e}if(t===i){j(t,D());return}}else{i=n}if(t._state!==E){}else if(o&&a){S(t,i)}else if(a===false){j(t,s)}else if(e===A){T(t,i)}else if(e===C){j(t,i)}}function $(r,e){try{e(function e(t){S(r,t)},function e(t){j(r,t)})}catch(e){j(r,e)}}var K=0;function R(){return K++}function V(e){e[b]=K++;e._state=undefined;e._result=undefined;e._subscribers=[]}function N(){return new Error("Array Methods must be provided an Array")}var H=function(){function e(e,t){this._instanceConstructor=e;this.promise=new e(k);if(!this.promise[b]){V(this.promise)}if(r(t)){this.length=t.length;this._remaining=t.length;this._result=new Array(this.length);if(this.length===0){T(this.promise,this._result)}else{this.length=this.length||0;this._enumerate(t);if(this._remaining===0){T(this.promise,this._result)}}}else{j(this.promise,N())}}e.prototype._enumerate=function e(t){for(var r=0;this._state===E&&r<t.length;r++){this._eachEntry(t[r],r)}};e.prototype._eachEntry=function e(t,r){var n=this._instanceConstructor;var o=n.resolve;if(o===w){var i=void 0;var s=void 0;var a=false;try{i=t.then}catch(e){a=true;s=e}if(i===_&&t._state!==E){this._settledAt(t._state,r,t._result)}else if(typeof i!=="function"){this._remaining--;this._result[r]=t}else if(n===P){var u=new n(k);if(a){j(u,s)}else{O(u,t,i)}this._willSettleAt(u,r)}else{this._willSettleAt(new n(function(e){return e(t)}),r)}}else{this._willSettleAt(o(t),r)}};e.prototype._settledAt=function e(t,r,n){var o=this.promise;if(o._state===E){this._remaining--;if(t===C){j(o,n)}else{this._result[r]=n}}if(this._remaining===0){T(o,this._result)}};e.prototype._willSettleAt=function e(t,r){var n=this;M(t,undefined,function(e){return n._settledAt(A,r,e)},function(e){return n._settledAt(C,r,e)})};return e}();function J(e){return new H(this,e).promise}function X(o){var i=this;if(!r(o)){return new i(function(e,t){return t(new TypeError("You must pass an array to race."))})}else{return new i(function(e,t){var r=o.length;for(var n=0;n<r;n++){i.resolve(o[n]).then(e,t)}})}}function Z(e){var t=this;var r=new t(k);j(r,e);return r}function ee(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function te(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object c
1onstructor cannot be called as a function.")}var P=function(){function t(e){this[b]=R();this._result=this._state=undefined;this._subscribers=[];if(k!==e){typeof e!=="function"&&ee();this instanceof t?$(this,e):te()}}t.prototype.catch=function e(t){return this.then(null,t)};t.prototype.finally=function e(t){var r=this;var n=r.constructor;if(u(t)){return r.then(function(e){return n.resolve(t()).then(function(){return e})},function(e){return n.resolve(t()).then(function(){throw e})})}return r.then(t,t)};return t}();P.prototype.then=_;P.all=J;P.race=X;P.resolve=w;P.reject=Z;P._setScheduler=a;P._setAsap=c;P._asap=s;function re(){var e=void 0;if(typeof global!=="undefined"){e=global}else if(typeof self!=="undefined"){e=self}else{try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(e){}if(r==="[object Promise]"&&!t.cast){return}}e.Promise=P}P.polyfill=re;P.Promise=P;P.polyfill();return P});jQuery(function(s){"use strict";s(".js-categories-dropdown").change(function(e){var t=parseInt(this.value,10);if(t===0){location.href="/"}else{location.href="/?cat="+t}});var e=s("#comment"),t=s(".js-comment-extra"),r=e.height();t.hide();e.height(r/4);e.focus(function(){e.animate({height:r});t.slideDown()});var n=s(window).width();if(n<768){s(".widget_categories ul").each(function(){var e=s(this),t=s(document.createElement("select")).insertBefore(s(this).hide()).addClass("category-list").change(function(){window.location.href=s(this).val()});s('<option selected="selected">Select Category</option>').appendTo(t);s(">li a",this).each(function(){var e=s(document.createElement("option")).appendTo(t).val(this.href).html(s(this).html())});e.remove()})}s(window).resize(function(){if(s(window).width()<768){s(".widget_categories ul").not("hidden-mobile").each(function(){var e=s(this),t=s(document.createElement("select")).insertBefore(s(this).hide()).addClass("category-list").change(function(){window.location.href=s(this).val()});s('<option selected="selected">Select Category</option>').appendTo(t);s(">li a",this).each(function(){var e=s(document.createElement("option")).appendTo(t).val(this.href).html(s(this).html())});e.remove()})}else{s("select.category-list").parent().append('<ul class="categories"></ul>');s("select.category-list option:first-child").remove();s("select.category-list option").each(function(){s("ul.categories").append('<li class="cat-item"><a href="'+s(this).val()+'">'+s(this).text()+"</a></li>")});s("select.category-list").remove()}});s(".embedly-embed").css({position:"relative"}).parent().css({"padding-top":"0","padding-bottom":"0",height:"auto"});s(document).ready(function(){var e=GOVUK.getCookie("no-more-survey");if(e!="true"){s("#user-satisfaction-survey").show()}if(s("#user-satisfaction-survey").hasClass("non-dismissable")){s("#user-satisfaction-survey").show()}});s("#survey-no-thanks").click(function(){GOVUK.cookie("no-more-survey","true",{days:365});s("#user-satisfaction-survey").hide()});s("#take-survey").click(function(){GOVUK.cookie("no-more-survey","true",{days:365})});s("a").click(function(e){var t=s(e.currentTarget).attr("href");var r=new URL(t,document.location.href);var n=r.protocol==="https:";var o=r.hostname==="blog.gov.uk"||r.hostname.endsWith(".blog.gov.uk");if(n&&o){return}if(typeof ga!=="function"){return}var i=new Promise(function(e,t){setTimeout(t,500);ga("send","event","outbound","click",r.href,{transport:"beacon",hitCallback:e})});i.finally(function(){console.log("hi")})})});function scrollToId(e){var t=jQuery(e);jQuery("html,body").animate({scrollTop:t.offset().top},"slow")}function inputEmpty(e){if(e.hasClass("required")&&e.val()==""){return true}return false}function validEmail(e){var t=/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/i;return t.test(e)}
1function invalidEmailInput(e){if(e.hasClass("required")&&!validEmail(e.val())){return true}return false}function addErrorPanel(e){jQuery("#comment-validation").remove();var t='<div id="comment-validation" class="govuk-error-summary" tabindex="-1" data-module="govuk-error-summary">';t+='<div role="alert">';t+='<h3 id="error-summary-title" class="govuk-error-summary__title">Please complete the required fields</h3><div class="govuk-error-summary__body"><ul class="govuk-list govuk-error-summary__list">';e.forEach(function(e){t+="<li>"+e+"</li>"});t+="</ul></div></div></div>";jQuery("#respond header").after(t)}function addErrorMarker(e,t){e.parent("div.govuk-form-group").addClass("govuk-form-group--error");e.siblings("label").append("<p class='govuk-error-message'>"+t+"</p>")}function removeErrorMarker(e){e.siblings("label").find("p.govuk-error-message").remove();e.parent("div.govuk-form-group").removeClass("govuk-form-group--error")}jQuery(function(i){"use strict";i("#commentform .govuk-button").click(function(){var e=[];var t=i("#commentform #comment");var r=i("#commentform #author");var n=i("#commentform #email");removeErrorMarker(t);removeErrorMarker(r);removeErrorMarker(n);if(inputEmpty(t)){var o="Please enter comment text";e.push("<a href='#comment_field'>"+o+"</a>");addErrorMarker(t,o)}if(inputEmpty(r)){var o="Please enter a name";e.push("<a href='#name_field'>"+o+"</a>");addErrorMarker(r,o)}if(invalidEmailInput(n)){var o="Please enter a valid email address";e.push("<a href='#email_field'>"+o+"</a>");addErrorMarker(n,o)}if(e.length>0){addErrorPanel(e);scrollToId("#comment-validation");return false}})});(function(){window.addEventListener("DOMContentLoaded",()=>{const e=Array.from(document.querySelectorAll(".wp-govuk-buttons .wp-element-button"));e.forEach(e=>{e.setAttribute("role","button")})})})();(function(){window.addEventListener("DOMContentLoaded",()=>{const e=Array.from(document.querySelectorAll(".govuk-accordion"));e.forEach(e=>{const t=e.querySelectorAll(".govuk-accordion__section-content");t.forEach((e,t)=>{e.id=`accordion-default-content-${t+1}`})})})})(); 2//# sourceMappingURL=main.min.js.map
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.