katalyst-govuk-formbuilder 1.3.2 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/app/assets/builds/katalyst/govuk/formbuilder.css +58 -5
- data/app/assets/builds/katalyst/govuk/formbuilder.js +98 -64
- data/app/assets/builds/katalyst/govuk/formbuilder.min.js +1 -1
- data/app/assets/stylesheets/katalyst/govuk/components/richtextarea/_index.scss +7 -6
- data/app/assets/stylesheets/katalyst/govuk/formbuilder.scss +1 -1
- data/lib/katalyst/govuk/formbuilder/engine.rb +1 -0
- data/lib/katalyst/govuk/formbuilder/version.rb +1 -1
- data/vendor/assets/stylesheets/govuk-frontend/govuk/_base.scss +3 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/all-ie8.scss +14 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/all.scss +9 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/_all.scss +34 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/accordion/_accordion.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/accordion/_index.scss +392 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/back-link/_back-link.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/back-link/_index.scss +99 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/breadcrumbs/_breadcrumbs.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/breadcrumbs/_index.scss +147 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/button/_button.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/button/_index.scss +297 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/character-count/_character-count.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/character-count/_index.scss +34 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/checkboxes/_checkboxes.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/checkboxes/_index.scss +335 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/cookie-banner/_cookie-banner.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/cookie-banner/_index.scss +49 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/date-input/_date-input.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/date-input/_index.scss +26 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/details/_details.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/details/_index.scss +88 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/error-message/_error-message.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/error-message/_index.scss +12 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/error-summary/_error-summary.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/error-summary/_index.scss +43 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/fieldset/_fieldset.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/fieldset/_index.scss +64 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/file-upload/_file-upload.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/file-upload/_index.scss +55 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/footer/_footer.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/footer/_index.scss +193 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/header/_header.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/header/_index.scss +349 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/hint/_hint.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/hint/_index.scss +42 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/input/_index.scss +193 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/input/_input.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/inset-text/_index.scss +24 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/inset-text/_inset-text.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/label/_index.scss +41 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/label/_label.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/notification-banner/_index.scss +89 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/notification-banner/_notification-banner.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/pagination/_index.scss +247 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/pagination/_pagination.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/panel/_index.scss +56 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/panel/_panel.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/phase-banner/_index.scss +27 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/phase-banner/_phase-banner.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/radios/_index.scss +349 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/radios/_radios.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/select/_index.scss +66 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/select/_select.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/skip-link/_index.scss +47 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/skip-link/_skip-link.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/summary-list/_index.scss +276 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/summary-list/_summary-list.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/table/_index.scss +71 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/table/_table.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/tabs/_index.scss +130 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/tabs/_tabs.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/tag/_index.scss +81 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/tag/_tag.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/textarea/_index.scss +54 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/textarea/_textarea.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/warning-text/_index.scss +66 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/components/warning-text/_warning-text.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/core/_all.scss +6 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/core/_global-styles.scss +19 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/core/_govuk-frontend-version.scss +5 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/core/_links.scss +35 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/core/_lists.scss +66 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/core/_section-break.scss +56 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/core/_typography.scss +186 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_all.scss +12 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_clearfix.scss +15 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_colour.scss +98 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_device-pixels.scss +37 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_focused.scss +33 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_font-faces.scss +41 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_grid.scss +61 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_links.scss +429 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_media-queries.scss +91 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_shape-arrow.scss +80 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_spacing.scss +171 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_typography.scss +214 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_visually-hidden.scss +84 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/objects/_all.scss +6 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/objects/_button-group.scss +85 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/objects/_form-group.scss +23 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/objects/_grid.scss +24 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/objects/_main-wrapper.scss +53 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/objects/_template.scss +32 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/objects/_width-container.scss +84 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/overrides/_all.scss +5 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/overrides/_display.scss +24 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/overrides/_spacing.scss +102 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/overrides/_text-align.scss +14 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/overrides/_typography.scss +21 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/overrides/_width.scss +46 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_all.scss +24 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_assets.scss +82 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_colours-applied.scss +155 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_colours-organisations.scss +146 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_colours-palette.scss +120 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_compatibility.scss +100 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_global-styles.scss +13 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_ie8.scss +34 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_links.scss +66 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_measurements.scss +95 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_media-queries.scss +23 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_spacing.scss +76 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_typography-font-families.scss +32 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_typography-font.scss +112 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_typography-responsive.scss +195 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_warnings.scss +53 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_all.scss +7 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_compatibility.scss +50 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_exports.scss +33 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_font-url.scss +25 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_ie8.scss +87 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_image-url.scss +25 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_px-to-em.scss +20 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_px-to-rem.scss +20 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/utilities/_all.scss +2 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/utilities/_clearfix.scss +5 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/utilities/_visually-hidden.scss +9 -0
- data/vendor/assets/stylesheets/govuk-frontend/govuk/vendor/_sass-mq.scss +347 -0
- metadata +132 -4
- data/app/assets/builds/katalyst/govuk/formbuilder.min.css +0 -1
@@ -1 +1 @@
|
|
1
|
-
function t(t,e){if(window.NodeList.prototype.forEach)return t.forEach(e);for(var n=0;n<t.length;n++)e.call(window,t[n],n,t)}function e(){for(var t=function(t){var e={},n=function(t,o){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var r=t[i],a=o?o+"."+i:i;"object"==typeof r?n(r,a):e[a]=r}};return n(t),e},e={},n=0;n<arguments.length;n++){var o=t(arguments[n]);for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(e[i]=o[i])}return e}function n(t){if("string"!=typeof t)return t;var e=t.trim();return"true"===e||"false"!==e&&(e.length>0&&isFinite(e)?Number(e):t)}function o(t){var e={};for(var o in t)e[o]=n(t[o]);return e}(function(t){var e,n,o,i;"defineProperty"in Object&&function(){try{return Object.defineProperty({},"test",{value:42}),!0}catch(t){return!1}}()||(e=Object.defineProperty,n=Object.prototype.hasOwnProperty("__defineGetter__"),o="Getters & setters cannot be defined on this javascript engine",i="A property cannot both have accessors and be writable or have a value",Object.defineProperty=function(t,r,a){if(e&&(t===window||t===document||t===Element.prototype||t instanceof Element))return e(t,r,a);if(null===t||!(t instanceof Object||"object"==typeof t))throw new TypeError("Object.defineProperty called on non-object");if(!(a instanceof Object))throw new TypeError("Property description must be an object");var s=String(r),c="value"in a||"writable"in a,l="get"in a&&typeof a.get,u="set"in a&&typeof a.set;if(l){if("function"!==l)throw new TypeError("Getter must be a function");if(!n)throw new TypeError(o);if(c)throw new TypeError(i);Object.__defineGetter__.call(t,s,a.get)}else t[s]=a.value;if(u){if("function"!==u)throw new TypeError("Setter must be a function");if(!n)throw new TypeError(o);if(c)throw new TypeError(i);Object.__defineSetter__.call(t,s,a.set)}return"value"in a&&(t[s]=a.value),t})}).call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"Document"in this||"undefined"==typeof WorkerGlobalScope&&"function"!=typeof importScripts&&(this.HTMLDocument?this.Document=this.HTMLDocument:(this.Document=this.HTMLDocument=document.constructor=new Function("return function Document() {}")(),this.Document.prototype=document))}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"Element"in this&&"HTMLElement"in this||function(){if(!window.Element||window.HTMLElement){window.Element=window.HTMLElement=new Function("return function Element() {}")();var t,e=document.appendChild(document.createElement("body")),n=e.appendChild(document.createElement("iframe")).contentWindow.document,o=Element.prototype=n.appendChild(n.createElement("*")),i={},r=function(t,e){var n,o,a,s=t.childNodes||[],c=-1;if(1===t.nodeType&&t.constructor!==Element)for(n in t.constructor=Element,i)o=i[n],t[n]=o;for(;a=e&&s[++c];)r(a,e);return t},a=document.getElementsByTagName("*"),s=document.createElement,c=100;o.attachEvent("onpropertychange",(function(t){for(var e,n=t.propertyName,r=!i.hasOwnProperty(n),s=o[n],c=i[n],l=-1;e=a[++l];)1===e.nodeType&&(r||e[n]===c)&&(e[n]=s);i[n]=s})),o.constructor=Element,o.hasAttribute||(o.hasAttribute=function(t){return null!==this.getAttribute(t)}),l()||(document.onreadystatechange=l,t=setInterval(l,25)),document.createElement=function(t){var e=s(String(t).toLowerCase());return r(e)},document.removeChild(e)}else window.HTMLElement=window.Element;function l(){return c--||clearTimeout(t),!(!document.body||document.body.prototype||!/(complete|interactive)/.test(document.readyState))&&(r(document,!0),t&&document.body.prototype&&clearTimeout(t),!!document.body.prototype)}}()}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){(function(){if(!document.documentElement.dataset)return!1;var t=document.createElement("div");return t.setAttribute("data-a-b","c"),t.dataset&&"c"==t.dataset.aB})()||Object.defineProperty(Element.prototype,"dataset",{get:function(){for(var t=this.attributes,e={},n=0;n<t.length;n++){var o=t[n];if(o&&o.name&&/^data-\w[.\w-]*$/.test(o.name)){var i=o.name,r=o.value,a=i.substr(5).replace(/-./g,(function(t){return t.charAt(1).toUpperCase()}));"__defineGetter__"in Object.prototype&&"__defineSetter__"in Object.prototype?Object.defineProperty(e,a,{enumerable:!0,get:function(){return this.value}.bind({value:r||""}),set:function(t,e){void 0!==e?this.setAttribute(t,e):this.removeAttribute(t)}.bind(this,i)}):e[a]=r}}return e}})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"trim"in String.prototype||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"Window"in this||"undefined"==typeof WorkerGlobalScope&&"function"!=typeof importScripts&&function(t){t.constructor?t.Window=t.constructor:(t.Window=t.constructor=new Function("return function Window() {}")()).prototype=this}(this)}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){(function(t){if(!("Event"in t))return!1;if("function"==typeof t.Event)return!0;try{return new Event("click"),!0}catch(t){return!1}})(this)||function(){var e={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};if("undefined"!=typeof document&&"undefined"!=typeof window){var n=window.Event&&window.Event.prototype||null;window.Event=Window.prototype.Event=function(e,n){if(!e)throw new Error("Not enough arguments");var o;if("createEvent"in document){o=document.createEvent("Event");var i=!(!n||n.bubbles===t)&&n.bubbles,r=!(!n||n.cancelable===t)&&n.cancelable;return o.initEvent(e,i,r),o}return(o=document.createEventObject()).type=e,o.bubbles=!(!n||n.bubbles===t)&&n.bubbles,o.cancelable=!(!n||n.cancelable===t)&&n.cancelable,o},n&&Object.defineProperty(window.Event,"prototype",{configurable:!1,enumerable:!1,writable:!0,value:n}),"createEvent"in document||(window.addEventListener=Window.prototype.addEventListener=Document.prototype.addEventListener=Element.prototype.addEventListener=function(){var t=this,n=arguments[0],i=arguments[1];if(t===window&&n in e)throw new Error("In IE8 the event: "+n+" is not available on the window object. Please see https://github.com/Financial-Times/polyfill-service/issues/317 for more information.");t._events||(t._events={}),t._events[n]||(t._events[n]=function(e){var n,i=t._events[e.type].list,r=i.slice(),a=-1,s=r.length;for(e.preventDefault=function(){!1!==e.cancelable&&(e.returnValue=!1)},e.stopPropagation=function(){e.cancelBubble=!0},e.stopImmediatePropagation=function(){e.cancelBubble=!0,e.cancelImmediate=!0},e.currentTarget=t,e.relatedTarget=e.fromElement||null,e.target=e.target||e.srcElement||t,e.timeStamp=(new Date).getTime(),e.clientX&&(e.pageX=e.clientX+document.documentElement.scrollLeft,e.pageY=e.clientY+document.documentElement.scrollTop);++a<s&&!e.cancelImmediate;)a in r&&-1!==o(i,n=r[a])&&"function"==typeof n&&n.call(t,e)},t._events[n].list=[],t.attachEvent&&t.attachEvent("on"+n,t._events[n])),t._events[n].list.push(i)},window.removeEventListener=Window.prototype.removeEventListener=Document.prototype.removeEventListener=Element.prototype.removeEventListener=function(){var t,e=this,n=arguments[0],i=arguments[1];e._events&&e._events[n]&&e._events[n].list&&-1!==(t=o(e._events[n].list,i))&&(e._events[n].list.splice(t,1),e._events[n].list.length||(e.detachEvent&&e.detachEvent("on"+n,e._events[n]),delete e._events[n]))},window.dispatchEvent=Window.prototype.dispatchEvent=Document.prototype.dispatchEvent=Element.prototype.dispatchEvent=function(t){if(!arguments.length)throw new Error("Not enough arguments");if(!t||"string"!=typeof t.type)throw new Error("DOM Events Exception 0");var e=this,n=t.type;try{if(!t.bubbles){t.cancelBubble=!0;var o=function(t){t.cancelBubble=!0,(e||window).detachEvent("on"+n,o)};this.attachEvent("on"+n,o)}this.fireEvent("on"+n,t)}catch(o){t.target=e;do{t.currentTarget=e,"_events"in e&&"function"==typeof e._events[n]&&e._events[n].call(e,t),"function"==typeof e["on"+n]&&e["on"+n].call(e,t),e=9===e.nodeType?e.parentWindow:e.parentNode}while(e&&!t.cancelBubble)}return!0},document.attachEvent("onreadystatechange",(function(){"complete"===document.readyState&&document.dispatchEvent(new Event("DOMContentLoaded",{bubbles:!0}))})))}function o(t,e){for(var n=-1,o=t.length;++n<o;)if(n in t&&t[n]===e)return n;return-1}}()}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"bind"in Function.prototype||Object.defineProperty(Function.prototype,"bind",{value:function(t){var e,n=Array,o=Object,i=o.prototype,r=n.prototype,a=function(){},s=i.toString,c="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,l=Function.prototype.toString;e=function(t){if("function"!=typeof t)return!1;if(c)return function(t){try{return l.call(t),!0}catch(t){return!1}}(t);var e=s.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e};var u=r.slice,d=r.concat,p=r.push,h=Math.max,f=this;if(!e(f))throw new TypeError("Function.prototype.bind called on incompatible "+f);for(var m,v=u.call(arguments,1),b=h(0,f.length-v.length),y=[],g=0;g<b;g++)p.call(y,"$"+g);return m=Function("binder","return function ("+y.join(",")+"){ return binder.apply(this, arguments); }")((function(){if(this instanceof m){var e=f.apply(this,d.call(v,u.call(arguments)));return o(e)===e?e:this}return f.apply(t,d.call(v,u.call(arguments)))})),f.prototype&&(a.prototype=f.prototype,m.prototype=new a,a.prototype=null),m}})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{});function i(t,n){if(!t)return this;this.$module=t,this.debounceFormSubmitTimer=null;this.config=e({preventDoubleClick:!1},n||{},o(t.dataset))}function r(t,e){var n=t.closest("["+e+"]");if(n)return n.getAttribute(e)}function a(t,e){this.translations=t||{},this.locale=e&&e.locale||document.documentElement.lang||"en"}i.prototype.init=function(){this.$module&&(this.$module.addEventListener("keydown",this.handleKeyDown),this.$module.addEventListener("click",this.debounce.bind(this)))},i.prototype.handleKeyDown=function(t){var e=t.target;"button"===e.getAttribute("role")&&32===t.keyCode&&(t.preventDefault(),e.click())},i.prototype.debounce=function(t){if(this.config.preventDoubleClick)return this.debounceFormSubmitTimer?(t.preventDefault(),!1):void(this.debounceFormSubmitTimer=setTimeout(function(){this.debounceFormSubmitTimer=null}.bind(this),1e3))},function(t){"document"in this&&"matches"in document.documentElement||(Element.prototype.matches=Element.prototype.webkitMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.mozMatchesSelector||function(t){for(var e=this,n=(e.document||e.ownerDocument).querySelectorAll(t),o=0;n[o]&&n[o]!==e;)++o;return!!n[o]})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"document"in this&&"closest"in document.documentElement||(Element.prototype.closest=function(t){for(var e=this;e;){if(e.matches(t))return e;e="SVGElement"in window&&e instanceof SVGElement?e.parentNode:e.parentElement}return null})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),a.prototype.t=function(t,e){if(!t)throw new Error("i18n: lookup key missing");if(e&&void 0!==e.count&&(t=t+"."+this.getPluralSuffix(t,e.count)),t in this.translations){var n=this.translations[t];if(n.match(/%{(.\S+)}/)){if(!e)throw new Error("i18n: cannot replace placeholders in string if no option data provided");return this.replacePlaceholders(n,e)}return n}return t},a.prototype.replacePlaceholders=function(t,e){var n;return this.hasIntlNumberFormatSupport()&&(n=new Intl.NumberFormat(this.locale)),t.replace(/%{(.\S+)}/g,(function(t,o){if(Object.prototype.hasOwnProperty.call(e,o)){var i=e[o];return!1===i?"":"number"==typeof i&&n?n.format(i):i}throw new Error("i18n: no data found to replace "+t+" placeholder in string")}))},a.prototype.hasIntlPluralRulesSupport=function(){return Boolean(window.Intl&&"PluralRules"in window.Intl&&Intl.PluralRules.supportedLocalesOf(this.locale).length)},a.prototype.hasIntlNumberFormatSupport=function(){return Boolean(window.Intl&&"NumberFormat"in window.Intl&&Intl.NumberFormat.supportedLocalesOf(this.locale).length)},a.prototype.getPluralSuffix=function(t,e){if(e=Number(e),!isFinite(e))return"other";var n;if(t+"."+(n=this.hasIntlPluralRulesSupport()?new Intl.PluralRules(this.locale).select(e):this.selectPluralFormUsingFallbackRules(e))in this.translations)return n;if(t+".other"in this.translations)return console&&"warn"in console&&console.warn('i18n: Missing plural form ".'+n+'" for "'+this.locale+'" locale. Falling back to ".other".'),"other";throw new Error('i18n: Plural form ".other" is required for "'+this.locale+'" locale')},a.prototype.selectPluralFormUsingFallbackRules=function(t){t=Math.abs(Math.floor(t));var e=this.getPluralRulesForLocale();return e?a.pluralRules[e](t):"other"},a.prototype.getPluralRulesForLocale=function(){var t=this.locale,e=t.split("-")[0];for(var n in a.pluralRulesMap)if(Object.prototype.hasOwnProperty.call(a.pluralRulesMap,n))for(var o=a.pluralRulesMap[n],i=0;i<o.length;i++)if(o[i]===t||o[i]===e)return n},a.pluralRulesMap={arabic:["ar"],chinese:["my","zh","id","ja","jv","ko","ms","th","vi"],french:["hy","bn","fr","gu","hi","fa","pa","zu"],german:["af","sq","az","eu","bg","ca","da","nl","en","et","fi","ka","de","el","hu","lb","no","so","sw","sv","ta","te","tr","ur"],irish:["ga"],russian:["ru","uk"],scottish:["gd"],spanish:["pt-PT","it","es"],welsh:["cy"]},a.pluralRules={arabic:function(t){return 0===t?"zero":1===t?"one":2===t?"two":t%100>=3&&t%100<=10?"few":t%100>=11&&t%100<=99?"many":"other"},chinese:function(){return"other"},french:function(t){return 0===t||1===t?"one":"other"},german:function(t){return 1===t?"one":"other"},irish:function(t){return 1===t?"one":2===t?"two":t>=3&&t<=6?"few":t>=7&&t<=10?"many":"other"},russian:function(t){var e=t%100,n=e%10;return 1===n&&11!==e?"one":n>=2&&n<=4&&!(e>=12&&e<=14)?"few":0===n||n>=5&&n<=9||e>=11&&e<=14?"many":"other"},scottish:function(t){return 1===t||11===t?"one":2===t||12===t?"two":t>=3&&t<=10||t>=13&&t<=19?"few":"other"},spanish:function(t){return 1===t?"one":t%1e6==0&&0!==t?"many":"other"},welsh:function(t){return 0===t?"zero":1===t?"one":2===t?"two":3===t?"few":6===t?"many":"other"}},function(t){"Date"in self&&"now"in self.Date&&"getTime"in self.Date.prototype||(Date.now=function(){return(new Date).getTime()})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){var e;"DOMTokenList"in this&&(!("classList"in(e=document.createElement("x")))||!e.classList.toggle("x",!1)&&!e.className)||function(e){var n;"DOMTokenList"in e&&e.DOMTokenList&&(!document.createElementNS||!document.createElementNS("http://www.w3.org/2000/svg","svg")||document.createElementNS("http://www.w3.org/2000/svg","svg").classList instanceof DOMTokenList)||(e.DOMTokenList=function(){var e=!0,n=function(t,n,o,i){Object.defineProperty?Object.defineProperty(t,n,{configurable:!1===e||!!i,get:o}):t.__defineGetter__(n,o)};try{n({},"support")}catch(t){e=!1}return function(e,o){var i=this,r=[],a={},s=0,c=0,l=function(t){n(i,t,(function(){return d(),r[t]}),!1)},u=function(){if(s>=c)for(;c<s;++c)l(c)},d=function(){var t,n,i=arguments,c=/\s+/;if(i.length)for(n=0;n<i.length;++n)if(c.test(i[n]))throw(t=new SyntaxError('String "'+i[n]+'" contains an invalid character')).code=5,t.name="InvalidCharacterError",t;for(""===(r="object"==typeof e[o]?(""+e[o].baseVal).replace(/^\s+|\s+$/g,"").split(c):(""+e[o]).replace(/^\s+|\s+$/g,"").split(c))[0]&&(r=[]),a={},n=0;n<r.length;++n)a[r[n]]=!0;s=r.length,u()};return d(),n(i,"length",(function(){return d(),s})),i.toLocaleString=i.toString=function(){return d(),r.join(" ")},i.item=function(t){return d(),r[t]},i.contains=function(t){return d(),!!a[t]},i.add=function(){d.apply(i,t=arguments);for(var t,n,c=0,l=t.length;c<l;++c)a[n=t[c]]||(r.push(n),a[n]=!0);s!==r.length&&(s=r.length>>>0,"object"==typeof e[o]?e[o].baseVal=r.join(" "):e[o]=r.join(" "),u())},i.remove=function(){d.apply(i,t=arguments);for(var t,n={},c=0,l=[];c<t.length;++c)n[t[c]]=!0,delete a[t[c]];for(c=0;c<r.length;++c)n[r[c]]||l.push(r[c]);r=l,s=l.length>>>0,"object"==typeof e[o]?e[o].baseVal=r.join(" "):e[o]=r.join(" "),u()},i.toggle=function(e,n){return d.apply(i,[e]),t!==n?n?(i.add(e),!0):(i.remove(e),!1):a[e]?(i.remove(e),!1):(i.add(e),!0)},i}}()),"classList"in(n=document.createElement("span"))&&(n.classList.toggle("x",!1),n.classList.contains("x")&&(n.classList.constructor.prototype.toggle=function(e){var n=arguments[1];if(n===t){var o=!this.contains(e);return this[o?"add":"remove"](e),o}return this[(n=!!n)?"add":"remove"](e),n})),function(){var t=document.createElement("span");if("classList"in t&&(t.classList.add("a","b"),!t.classList.contains("b"))){var e=t.classList.constructor.prototype.add;t.classList.constructor.prototype.add=function(){for(var t=arguments,n=arguments.length,o=0;o<n;o++)e.call(this,t[o])}}}(),function(){var t=document.createElement("span");if("classList"in t&&(t.classList.add("a"),t.classList.add("b"),t.classList.remove("a","b"),t.classList.contains("b"))){var e=t.classList.constructor.prototype.remove;t.classList.constructor.prototype.remove=function(){for(var t=arguments,n=arguments.length,o=0;o<n;o++)e.call(this,t[o])}}}()}(this)}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){var e;"document"in this&&"classList"in document.documentElement&&"Element"in this&&"classList"in Element.prototype&&((e=document.createElement("span")).classList.add("a","b"),e.classList.contains("b"))||function(t){var e=!0,n=function(t,n,o,i){Object.defineProperty?Object.defineProperty(t,n,{configurable:!1===e||!!i,get:o}):t.__defineGetter__(n,o)};try{n({},"support")}catch(t){e=!1}var o=function(t,i,r){n(t.prototype,i,(function(){var t,a=this,s="__defineGetter__DEFINE_PROPERTY"+i;if(a[s])return t;if(a[s]=!0,!1===e){for(var c,l=o.mirror||document.createElement("div"),u=l.childNodes,d=u.length,p=0;p<d;++p)if(u[p]._R===a){c=u[p];break}c||(c=l.appendChild(document.createElement("div"))),t=DOMTokenList.call(c,a,r)}else t=new DOMTokenList(a,r);return n(a,i,(function(){return t})),delete a[s],t}),!0)};o(t.Element,"classList","className"),o(t.HTMLElement,"classList","className"),o(t.HTMLLinkElement,"relList","rel"),o(t.HTMLAnchorElement,"relList","rel"),o(t.HTMLAreaElement,"relList","rel")}(this)}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{});var s={charactersUnderLimit:{one:"You have %{count} character remaining",other:"You have %{count} characters remaining"},charactersAtLimit:"You have 0 characters remaining",charactersOverLimit:{one:"You have %{count} character too many",other:"You have %{count} characters too many"},wordsUnderLimit:{one:"You have %{count} word remaining",other:"You have %{count} words remaining"},wordsAtLimit:"You have 0 words remaining",wordsOverLimit:{one:"You have %{count} word too many",other:"You have %{count} words too many"},textareaDescription:{other:""}};function c(t,n){if(!t)return this;var i={threshold:0,i18n:s},c=o(t.dataset),l={};if(("maxwords"in c||"maxlength"in c)&&(l={maxlength:!1,maxwords:!1}),this.config=e(i,n||{},l,c),this.i18n=new a(function(t,e){if(!t||"object"!=typeof t)throw new Error('Provide a `configObject` of type "object".');if(!e||"string"!=typeof e)throw new Error('Provide a `namespace` of type "string" to filter the `configObject` by.');var n={};for(var o in t){var i=o.split(".");Object.prototype.hasOwnProperty.call(t,o)&&i[0]===e&&(i.length>1&&i.shift(),n[i.join(".")]=t[o])}return n}(this.config,"i18n"),{locale:r(t,"lang")}),this.config.maxwords)this.maxLength=this.config.maxwords;else{if(!this.config.maxlength)return;this.maxLength=this.config.maxlength}this.$module=t,this.$textarea=t.querySelector(".govuk-js-character-count"),this.$visibleCountMessage=null,this.$screenReaderCountMessage=null,this.lastInputTimestamp=null}function l(t){this.$module=t,this.$inputs=t.querySelectorAll('input[type="checkbox"]')}function u(t,n){if(!t)return this;this.$module=t;this.config=e({disableAutoFocus:!1},n||{},o(t.dataset))}function d(t){this.$module=t,this.$inputs=t.querySelectorAll('input[type="radio"]')}function p(e){const n=void 0!==(e=void 0!==e?e:{}).scope?e.scope:document;t(n.querySelectorAll('[data-module="govuk-button"]'),(function(t){new i(t).init()}));t(n.querySelectorAll('[data-module="govuk-character-count"]'),(function(t){new c(t).init()}));t(n.querySelectorAll('[data-module="govuk-checkboxes"]'),(function(t){new l(t).init()}));new u(n.querySelector('[data-module="govuk-error-summary"]')).init();t(n.querySelectorAll('[data-module="govuk-radios"]'),(function(t){new d(t).init()}))}c.prototype.init=function(){if(this.$textarea){var t=this.$textarea,e=document.getElementById(t.id+"-info");e.innerText.match(/^\s*$/)&&(e.innerText=this.i18n.t("textareaDescription",{count:this.maxLength})),t.insertAdjacentElement("afterend",e);var n=document.createElement("div");n.className="govuk-character-count__sr-status govuk-visually-hidden",n.setAttribute("aria-live","polite"),this.$screenReaderCountMessage=n,e.insertAdjacentElement("afterend",n);var o=document.createElement("div");o.className=e.className,o.classList.add("govuk-character-count__status"),o.setAttribute("aria-hidden","true"),this.$visibleCountMessage=o,e.insertAdjacentElement("afterend",o),e.classList.add("govuk-visually-hidden"),t.removeAttribute("maxlength"),this.bindChangeEvents(),"onpageshow"in window?window.addEventListener("pageshow",this.updateCountMessage.bind(this)):window.addEventListener("DOMContentLoaded",this.updateCountMessage.bind(this)),this.updateCountMessage()}},c.prototype.bindChangeEvents=function(){var t=this.$textarea;t.addEventListener("keyup",this.handleKeyUp.bind(this)),t.addEventListener("focus",this.handleFocus.bind(this)),t.addEventListener("blur",this.handleBlur.bind(this))},c.prototype.handleKeyUp=function(){this.updateVisibleCountMessage(),this.lastInputTimestamp=Date.now()},c.prototype.handleFocus=function(){this.valueChecker=setInterval(function(){(!this.lastInputTimestamp||Date.now()-500>=this.lastInputTimestamp)&&this.updateIfValueChanged()}.bind(this),1e3)},c.prototype.handleBlur=function(){clearInterval(this.valueChecker)},c.prototype.updateIfValueChanged=function(){this.$textarea.oldValue||(this.$textarea.oldValue=""),this.$textarea.value!==this.$textarea.oldValue&&(this.$textarea.oldValue=this.$textarea.value,this.updateCountMessage())},c.prototype.updateCountMessage=function(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()},c.prototype.updateVisibleCountMessage=function(){var t=this.$textarea,e=this.$visibleCountMessage,n=this.maxLength-this.count(t.value);this.isOverThreshold()?e.classList.remove("govuk-character-count__message--disabled"):e.classList.add("govuk-character-count__message--disabled"),n<0?(t.classList.add("govuk-textarea--error"),e.classList.remove("govuk-hint"),e.classList.add("govuk-error-message")):(t.classList.remove("govuk-textarea--error"),e.classList.remove("govuk-error-message"),e.classList.add("govuk-hint")),e.innerText=this.getCountMessage()},c.prototype.updateScreenReaderCountMessage=function(){var t=this.$screenReaderCountMessage;this.isOverThreshold()?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden",!0),t.innerText=this.getCountMessage()},c.prototype.count=function(t){return this.config.maxwords?(t.match(/\S+/g)||[]).length:t.length},c.prototype.getCountMessage=function(){var t=this.maxLength-this.count(this.$textarea.value),e=this.config.maxwords?"words":"characters";return this.formatCountMessage(t,e)},c.prototype.formatCountMessage=function(t,e){if(0===t)return this.i18n.t(e+"AtLimit");var n=t<0?"OverLimit":"UnderLimit";return this.i18n.t(e+n,{count:Math.abs(t)})},c.prototype.isOverThreshold=function(){if(!this.config.threshold)return!0;var t=this.$textarea,e=this.count(t.value);return this.maxLength*this.config.threshold/100<=e},l.prototype.init=function(){var e=this.$module;t(this.$inputs,(function(t){var e=t.getAttribute("data-aria-controls");e&&document.getElementById(e)&&(t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls"))})),"onpageshow"in window?window.addEventListener("pageshow",this.syncAllConditionalReveals.bind(this)):window.addEventListener("DOMContentLoaded",this.syncAllConditionalReveals.bind(this)),this.syncAllConditionalReveals(),e.addEventListener("click",this.handleClick.bind(this))},l.prototype.syncAllConditionalReveals=function(){t(this.$inputs,this.syncConditionalRevealWithInputState.bind(this))},l.prototype.syncConditionalRevealWithInputState=function(t){var e=document.getElementById(t.getAttribute("aria-controls"));if(e&&e.classList.contains("govuk-checkboxes__conditional")){var n=t.checked;t.setAttribute("aria-expanded",n),e.classList.toggle("govuk-checkboxes__conditional--hidden",!n)}},l.prototype.unCheckAllInputsExcept=function(e){t(document.querySelectorAll('input[type="checkbox"][name="'+e.name+'"]'),function(t){e.form===t.form&&t!==e&&(t.checked=!1,this.syncConditionalRevealWithInputState(t))}.bind(this))},l.prototype.unCheckExclusiveInputs=function(e){t(document.querySelectorAll('input[data-behaviour="exclusive"][type="checkbox"][name="'+e.name+'"]'),function(t){e.form===t.form&&(t.checked=!1,this.syncConditionalRevealWithInputState(t))}.bind(this))},l.prototype.handleClick=function(t){var e=t.target;"checkbox"===e.type&&(e.getAttribute("aria-controls")&&this.syncConditionalRevealWithInputState(e),e.checked&&("exclusive"===e.getAttribute("data-behaviour")?this.unCheckAllInputsExcept(e):this.unCheckExclusiveInputs(e)))},u.prototype.init=function(){var t=this.$module;t&&(this.setFocus(),t.addEventListener("click",this.handleClick.bind(this)))},u.prototype.setFocus=function(){var t=this.$module;this.config.disableAutoFocus||(t.setAttribute("tabindex","-1"),t.addEventListener("blur",(function(){t.removeAttribute("tabindex")})),t.focus())},u.prototype.handleClick=function(t){var e=t.target;this.focusTarget(e)&&t.preventDefault()},u.prototype.focusTarget=function(t){if("A"!==t.tagName||!1===t.href)return!1;var e=this.getFragmentFromUrl(t.href),n=document.getElementById(e);if(!n)return!1;var o=this.getAssociatedLegendOrLabel(n);return!!o&&(o.scrollIntoView(),n.focus({preventScroll:!0}),!0)},u.prototype.getFragmentFromUrl=function(t){return-1!==t.indexOf("#")&&t.split("#").pop()},u.prototype.getAssociatedLegendOrLabel=function(t){var e=t.closest("fieldset");if(e){var n=e.getElementsByTagName("legend");if(n.length){var o=n[0];if("checkbox"===t.type||"radio"===t.type)return o;var i=o.getBoundingClientRect().top,r=t.getBoundingClientRect();if(r.height&&window.innerHeight)if(r.top+r.height-i<window.innerHeight/2)return o}}return document.querySelector("label[for='"+t.getAttribute("id")+"']")||t.closest("label")},d.prototype.init=function(){var e=this.$module;t(this.$inputs,(function(t){var e=t.getAttribute("data-aria-controls");e&&document.getElementById(e)&&(t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls"))})),"onpageshow"in window?window.addEventListener("pageshow",this.syncAllConditionalReveals.bind(this)):window.addEventListener("DOMContentLoaded",this.syncAllConditionalReveals.bind(this)),this.syncAllConditionalReveals(),e.addEventListener("click",this.handleClick.bind(this))},d.prototype.syncAllConditionalReveals=function(){t(this.$inputs,this.syncConditionalRevealWithInputState.bind(this))},d.prototype.syncConditionalRevealWithInputState=function(t){var e=document.getElementById(t.getAttribute("aria-controls"));if(e&&e.classList.contains("govuk-radios__conditional")){var n=t.checked;t.setAttribute("aria-expanded",n),e.classList.toggle("govuk-radios__conditional--hidden",!n)}},d.prototype.handleClick=function(e){var n=e.target;"radio"===n.type&&t(document.querySelectorAll('input[type="radio"][aria-controls]'),function(t){var e=t.form===n.form;t.name===n.name&&e&&this.syncConditionalRevealWithInputState(t)}.bind(this))};export{i as Button,c as CharacterCount,l as Checkboxes,u as ErrorSummary,d as Radios,p as initAll};
|
1
|
+
function t(t,e){if(window.NodeList.prototype.forEach)return t.forEach(e);for(var n=0;n<t.length;n++)e.call(window,t[n],n,t)}function e(){for(var t=function(t){var e={},n=function(t,o){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var r=t[i],a=o?o+"."+i:i;"object"==typeof r?n(r,a):e[a]=r}};return n(t),e},e={},n=0;n<arguments.length;n++){var o=t(arguments[n]);for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(e[i]=o[i])}return e}function n(t){if("string"!=typeof t)return t;var e=t.trim();return"true"===e||"false"!==e&&(e.length>0&&isFinite(Number(e))?Number(e):t)}function o(t){var e={};for(var o in t)e[o]=n(t[o]);return e}(function(t){var e,n,o,i;"defineProperty"in Object&&function(){try{return Object.defineProperty({},"test",{value:42}),!0}catch(t){return!1}}()||(e=Object.defineProperty,n=Object.prototype.hasOwnProperty("__defineGetter__"),o="Getters & setters cannot be defined on this javascript engine",i="A property cannot both have accessors and be writable or have a value",Object.defineProperty=function(t,r,a){if(e&&(t===window||t===document||t===Element.prototype||t instanceof Element))return e(t,r,a);if(null===t||!(t instanceof Object||"object"==typeof t))throw new TypeError("Object.defineProperty called on non-object");if(!(a instanceof Object))throw new TypeError("Property description must be an object");var s=String(r),c="value"in a||"writable"in a,l="get"in a&&typeof a.get,u="set"in a&&typeof a.set;if(l){if("function"!==l)throw new TypeError("Getter must be a function");if(!n)throw new TypeError(o);if(c)throw new TypeError(i);Object.__defineGetter__.call(t,s,a.get)}else t[s]=a.value;if(u){if("function"!==u)throw new TypeError("Setter must be a function");if(!n)throw new TypeError(o);if(c)throw new TypeError(i);Object.__defineSetter__.call(t,s,a.set)}return"value"in a&&(t[s]=a.value),t})}).call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"Document"in this||"undefined"==typeof WorkerGlobalScope&&"function"!=typeof importScripts&&(this.HTMLDocument?this.Document=this.HTMLDocument:(this.Document=this.HTMLDocument=document.constructor=new Function("return function Document() {}")(),this.Document.prototype=document))}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"Element"in this&&"HTMLElement"in this||function(){if(!window.Element||window.HTMLElement){window.Element=window.HTMLElement=new Function("return function Element() {}")();var t,e=document.appendChild(document.createElement("body")),n=e.appendChild(document.createElement("iframe")).contentWindow.document,o=Element.prototype=n.appendChild(n.createElement("*")),i={},r=function(t,e){var n,o,a,s=t.childNodes||[],c=-1;if(1===t.nodeType&&t.constructor!==Element)for(n in t.constructor=Element,i)o=i[n],t[n]=o;for(;a=e&&s[++c];)r(a,e);return t},a=document.getElementsByTagName("*"),s=document.createElement,c=100;o.attachEvent("onpropertychange",(function(t){for(var e,n=t.propertyName,r=!i.hasOwnProperty(n),s=o[n],c=i[n],l=-1;e=a[++l];)1===e.nodeType&&(r||e[n]===c)&&(e[n]=s);i[n]=s})),o.constructor=Element,o.hasAttribute||(o.hasAttribute=function(t){return null!==this.getAttribute(t)}),l()||(document.onreadystatechange=l,t=setInterval(l,25)),document.createElement=function(t){var e=s(String(t).toLowerCase());return r(e)},document.removeChild(e)}else window.HTMLElement=window.Element;function l(){return c--||clearTimeout(t),!(!document.body||document.body.prototype||!/(complete|interactive)/.test(document.readyState))&&(r(document,!0),t&&document.body.prototype&&clearTimeout(t),!!document.body.prototype)}}()}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){(function(){if(!document.documentElement.dataset)return!1;var t=document.createElement("div");return t.setAttribute("data-a-b","c"),t.dataset&&"c"==t.dataset.aB})()||Object.defineProperty(Element.prototype,"dataset",{get:function(){for(var t=this.attributes,e={},n=0;n<t.length;n++){var o=t[n];if(o&&o.name&&/^data-\w[.\w-]*$/.test(o.name)){var i=o.name,r=o.value,a=i.substr(5).replace(/-./g,(function(t){return t.charAt(1).toUpperCase()}));"__defineGetter__"in Object.prototype&&"__defineSetter__"in Object.prototype?Object.defineProperty(e,a,{enumerable:!0,get:function(){return this.value}.bind({value:r||""}),set:function(t,e){void 0!==e?this.setAttribute(t,e):this.removeAttribute(t)}.bind(this,i)}):e[a]=r}}return e}})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"trim"in String.prototype||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"Window"in this||"undefined"==typeof WorkerGlobalScope&&"function"!=typeof importScripts&&function(t){t.constructor?t.Window=t.constructor:(t.Window=t.constructor=new Function("return function Window() {}")()).prototype=this}(this)}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){(function(t){if(!("Event"in t))return!1;if("function"==typeof t.Event)return!0;try{return new Event("click"),!0}catch(t){return!1}})(this)||function(){var e={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};if("undefined"!=typeof document&&"undefined"!=typeof window){var n=window.Event&&window.Event.prototype||null;window.Event=Window.prototype.Event=function(e,n){if(!e)throw new Error("Not enough arguments");var o;if("createEvent"in document){o=document.createEvent("Event");var i=!(!n||n.bubbles===t)&&n.bubbles,r=!(!n||n.cancelable===t)&&n.cancelable;return o.initEvent(e,i,r),o}return(o=document.createEventObject()).type=e,o.bubbles=!(!n||n.bubbles===t)&&n.bubbles,o.cancelable=!(!n||n.cancelable===t)&&n.cancelable,o},n&&Object.defineProperty(window.Event,"prototype",{configurable:!1,enumerable:!1,writable:!0,value:n}),"createEvent"in document||(window.addEventListener=Window.prototype.addEventListener=Document.prototype.addEventListener=Element.prototype.addEventListener=function(){var t=this,n=arguments[0],i=arguments[1];if(t===window&&n in e)throw new Error("In IE8 the event: "+n+" is not available on the window object. Please see https://github.com/Financial-Times/polyfill-service/issues/317 for more information.");t._events||(t._events={}),t._events[n]||(t._events[n]=function(e){var n,i=t._events[e.type].list,r=i.slice(),a=-1,s=r.length;for(e.preventDefault=function(){!1!==e.cancelable&&(e.returnValue=!1)},e.stopPropagation=function(){e.cancelBubble=!0},e.stopImmediatePropagation=function(){e.cancelBubble=!0,e.cancelImmediate=!0},e.currentTarget=t,e.relatedTarget=e.fromElement||null,e.target=e.target||e.srcElement||t,e.timeStamp=(new Date).getTime(),e.clientX&&(e.pageX=e.clientX+document.documentElement.scrollLeft,e.pageY=e.clientY+document.documentElement.scrollTop);++a<s&&!e.cancelImmediate;)a in r&&-1!==o(i,n=r[a])&&"function"==typeof n&&n.call(t,e)},t._events[n].list=[],t.attachEvent&&t.attachEvent("on"+n,t._events[n])),t._events[n].list.push(i)},window.removeEventListener=Window.prototype.removeEventListener=Document.prototype.removeEventListener=Element.prototype.removeEventListener=function(){var t,e=this,n=arguments[0],i=arguments[1];e._events&&e._events[n]&&e._events[n].list&&-1!==(t=o(e._events[n].list,i))&&(e._events[n].list.splice(t,1),e._events[n].list.length||(e.detachEvent&&e.detachEvent("on"+n,e._events[n]),delete e._events[n]))},window.dispatchEvent=Window.prototype.dispatchEvent=Document.prototype.dispatchEvent=Element.prototype.dispatchEvent=function(t){if(!arguments.length)throw new Error("Not enough arguments");if(!t||"string"!=typeof t.type)throw new Error("DOM Events Exception 0");var e=this,n=t.type;try{if(!t.bubbles){t.cancelBubble=!0;var o=function(t){t.cancelBubble=!0,(e||window).detachEvent("on"+n,o)};this.attachEvent("on"+n,o)}this.fireEvent("on"+n,t)}catch(o){t.target=e;do{t.currentTarget=e,"_events"in e&&"function"==typeof e._events[n]&&e._events[n].call(e,t),"function"==typeof e["on"+n]&&e["on"+n].call(e,t),e=9===e.nodeType?e.parentWindow:e.parentNode}while(e&&!t.cancelBubble)}return!0},document.attachEvent("onreadystatechange",(function(){"complete"===document.readyState&&document.dispatchEvent(new Event("DOMContentLoaded",{bubbles:!0}))})))}function o(t,e){for(var n=-1,o=t.length;++n<o;)if(n in t&&t[n]===e)return n;return-1}}()}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"bind"in Function.prototype||Object.defineProperty(Function.prototype,"bind",{value:function(t){var e,n=Array,o=Object,i=o.prototype,r=n.prototype,a=function(){},s=i.toString,c="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,l=Function.prototype.toString;e=function(t){if("function"!=typeof t)return!1;if(c)return function(t){try{return l.call(t),!0}catch(t){return!1}}(t);var e=s.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e};var u=r.slice,d=r.concat,p=r.push,f=Math.max,h=this;if(!e(h))throw new TypeError("Function.prototype.bind called on incompatible "+h);for(var m,v=u.call(arguments,1),y=f(0,h.length-v.length),b=[],g=0;g<y;g++)p.call(b,"$"+g);return m=Function("binder","return function ("+b.join(",")+"){ return binder.apply(this, arguments); }")((function(){if(this instanceof m){var e=h.apply(this,d.call(v,u.call(arguments)));return o(e)===e?e:this}return h.apply(t,d.call(v,u.call(arguments)))})),h.prototype&&(a.prototype=h.prototype,m.prototype=new a,a.prototype=null),m}})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{});function i(t,n){if(!(t instanceof HTMLElement))return this;this.$module=t,this.debounceFormSubmitTimer=null;this.config=e({preventDoubleClick:!1},n||{},o(t.dataset))}function r(t,e){this.translations=t||{},this.locale=e&&e.locale||document.documentElement.lang||"en"}i.prototype.init=function(){this.$module&&(this.$module.addEventListener("keydown",this.handleKeyDown),this.$module.addEventListener("click",this.debounce.bind(this)))},i.prototype.handleKeyDown=function(t){var e=t.target;32===t.keyCode&&e instanceof HTMLElement&&"button"===e.getAttribute("role")&&(t.preventDefault(),e.click())},i.prototype.debounce=function(t){if(this.config.preventDoubleClick)return this.debounceFormSubmitTimer?(t.preventDefault(),!1):void(this.debounceFormSubmitTimer=setTimeout(function(){this.debounceFormSubmitTimer=null}.bind(this),1e3))},function(t){"document"in this&&"matches"in document.documentElement||(Element.prototype.matches=Element.prototype.webkitMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.mozMatchesSelector||function(t){for(var e=this,n=(e.document||e.ownerDocument).querySelectorAll(t),o=0;n[o]&&n[o]!==e;)++o;return!!n[o]})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"document"in this&&"closest"in document.documentElement||(Element.prototype.closest=function(t){for(var e=this;e;){if(e.matches(t))return e;e="SVGElement"in window&&e instanceof SVGElement?e.parentNode:e.parentElement}return null})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),r.prototype.t=function(t,e){if(!t)throw new Error("i18n: lookup key missing");e&&"number"==typeof e.count&&(t=t+"."+this.getPluralSuffix(t,e.count));var n=this.translations[t];if("string"==typeof n){if(n.match(/%{(.\S+)}/)){if(!e)throw new Error("i18n: cannot replace placeholders in string if no option data provided");return this.replacePlaceholders(n,e)}return n}return t},r.prototype.replacePlaceholders=function(t,e){var n;return this.hasIntlNumberFormatSupport()&&(n=new Intl.NumberFormat(this.locale)),t.replace(/%{(.\S+)}/g,(function(t,o){if(Object.prototype.hasOwnProperty.call(e,o)){var i=e[o];return!1===i||"number"!=typeof i&&"string"!=typeof i?"":"number"==typeof i?n?n.format(i):i.toString():i}throw new Error("i18n: no data found to replace "+t+" placeholder in string")}))},r.prototype.hasIntlPluralRulesSupport=function(){return Boolean(window.Intl&&"PluralRules"in window.Intl&&Intl.PluralRules.supportedLocalesOf(this.locale).length)},r.prototype.hasIntlNumberFormatSupport=function(){return Boolean(window.Intl&&"NumberFormat"in window.Intl&&Intl.NumberFormat.supportedLocalesOf(this.locale).length)},r.prototype.getPluralSuffix=function(t,e){if(e=Number(e),!isFinite(e))return"other";var n;if(t+"."+(n=this.hasIntlPluralRulesSupport()?new Intl.PluralRules(this.locale).select(e):this.selectPluralFormUsingFallbackRules(e))in this.translations)return n;if(t+".other"in this.translations)return console&&"warn"in console&&console.warn('i18n: Missing plural form ".'+n+'" for "'+this.locale+'" locale. Falling back to ".other".'),"other";throw new Error('i18n: Plural form ".other" is required for "'+this.locale+'" locale')},r.prototype.selectPluralFormUsingFallbackRules=function(t){t=Math.abs(Math.floor(t));var e=this.getPluralRulesForLocale();return e?r.pluralRules[e](t):"other"},r.prototype.getPluralRulesForLocale=function(){var t=this.locale,e=t.split("-")[0];for(var n in r.pluralRulesMap)if(Object.prototype.hasOwnProperty.call(r.pluralRulesMap,n))for(var o=r.pluralRulesMap[n],i=0;i<o.length;i++)if(o[i]===t||o[i]===e)return n},r.pluralRulesMap={arabic:["ar"],chinese:["my","zh","id","ja","jv","ko","ms","th","vi"],french:["hy","bn","fr","gu","hi","fa","pa","zu"],german:["af","sq","az","eu","bg","ca","da","nl","en","et","fi","ka","de","el","hu","lb","no","so","sw","sv","ta","te","tr","ur"],irish:["ga"],russian:["ru","uk"],scottish:["gd"],spanish:["pt-PT","it","es"],welsh:["cy"]},r.pluralRules={arabic:function(t){return 0===t?"zero":1===t?"one":2===t?"two":t%100>=3&&t%100<=10?"few":t%100>=11&&t%100<=99?"many":"other"},chinese:function(){return"other"},french:function(t){return 0===t||1===t?"one":"other"},german:function(t){return 1===t?"one":"other"},irish:function(t){return 1===t?"one":2===t?"two":t>=3&&t<=6?"few":t>=7&&t<=10?"many":"other"},russian:function(t){var e=t%100,n=e%10;return 1===n&&11!==e?"one":n>=2&&n<=4&&!(e>=12&&e<=14)?"few":0===n||n>=5&&n<=9||e>=11&&e<=14?"many":"other"},scottish:function(t){return 1===t||11===t?"one":2===t||12===t?"two":t>=3&&t<=10||t>=13&&t<=19?"few":"other"},spanish:function(t){return 1===t?"one":t%1e6==0&&0!==t?"many":"other"},welsh:function(t){return 0===t?"zero":1===t?"one":2===t?"two":3===t?"few":6===t?"many":"other"}},function(t){"Date"in self&&"now"in self.Date&&"getTime"in self.Date.prototype||(Date.now=function(){return(new Date).getTime()})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){var e;"DOMTokenList"in this&&(!("classList"in(e=document.createElement("x")))||!e.classList.toggle("x",!1)&&!e.className)||function(e){var n;"DOMTokenList"in e&&e.DOMTokenList&&(!document.createElementNS||!document.createElementNS("http://www.w3.org/2000/svg","svg")||document.createElementNS("http://www.w3.org/2000/svg","svg").classList instanceof DOMTokenList)||(e.DOMTokenList=function(){var e=!0,n=function(t,n,o,i){Object.defineProperty?Object.defineProperty(t,n,{configurable:!1===e||!!i,get:o}):t.__defineGetter__(n,o)};try{n({},"support")}catch(t){e=!1}return function(e,o){var i=this,r=[],a={},s=0,c=0,l=function(t){n(i,t,(function(){return d(),r[t]}),!1)},u=function(){if(s>=c)for(;c<s;++c)l(c)},d=function(){var t,n,i=arguments,c=/\s+/;if(i.length)for(n=0;n<i.length;++n)if(c.test(i[n]))throw(t=new SyntaxError('String "'+i[n]+'" contains an invalid character')).code=5,t.name="InvalidCharacterError",t;for(""===(r="object"==typeof e[o]?(""+e[o].baseVal).replace(/^\s+|\s+$/g,"").split(c):(""+e[o]).replace(/^\s+|\s+$/g,"").split(c))[0]&&(r=[]),a={},n=0;n<r.length;++n)a[r[n]]=!0;s=r.length,u()};return d(),n(i,"length",(function(){return d(),s})),i.toLocaleString=i.toString=function(){return d(),r.join(" ")},i.item=function(t){return d(),r[t]},i.contains=function(t){return d(),!!a[t]},i.add=function(){d.apply(i,t=arguments);for(var t,n,c=0,l=t.length;c<l;++c)a[n=t[c]]||(r.push(n),a[n]=!0);s!==r.length&&(s=r.length>>>0,"object"==typeof e[o]?e[o].baseVal=r.join(" "):e[o]=r.join(" "),u())},i.remove=function(){d.apply(i,t=arguments);for(var t,n={},c=0,l=[];c<t.length;++c)n[t[c]]=!0,delete a[t[c]];for(c=0;c<r.length;++c)n[r[c]]||l.push(r[c]);r=l,s=l.length>>>0,"object"==typeof e[o]?e[o].baseVal=r.join(" "):e[o]=r.join(" "),u()},i.toggle=function(e,n){return d.apply(i,[e]),t!==n?n?(i.add(e),!0):(i.remove(e),!1):a[e]?(i.remove(e),!1):(i.add(e),!0)},i}}()),"classList"in(n=document.createElement("span"))&&(n.classList.toggle("x",!1),n.classList.contains("x")&&(n.classList.constructor.prototype.toggle=function(e){var n=arguments[1];if(n===t){var o=!this.contains(e);return this[o?"add":"remove"](e),o}return this[(n=!!n)?"add":"remove"](e),n})),function(){var t=document.createElement("span");if("classList"in t&&(t.classList.add("a","b"),!t.classList.contains("b"))){var e=t.classList.constructor.prototype.add;t.classList.constructor.prototype.add=function(){for(var t=arguments,n=arguments.length,o=0;o<n;o++)e.call(this,t[o])}}}(),function(){var t=document.createElement("span");if("classList"in t&&(t.classList.add("a"),t.classList.add("b"),t.classList.remove("a","b"),t.classList.contains("b"))){var e=t.classList.constructor.prototype.remove;t.classList.constructor.prototype.remove=function(){for(var t=arguments,n=arguments.length,o=0;o<n;o++)e.call(this,t[o])}}}()}(this)}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){var e;"document"in this&&"classList"in document.documentElement&&"Element"in this&&"classList"in Element.prototype&&((e=document.createElement("span")).classList.add("a","b"),e.classList.contains("b"))||function(t){var e=!0,n=function(t,n,o,i){Object.defineProperty?Object.defineProperty(t,n,{configurable:!1===e||!!i,get:o}):t.__defineGetter__(n,o)};try{n({},"support")}catch(t){e=!1}var o=function(t,i,r){n(t.prototype,i,(function(){var t,a=this,s="__defineGetter__DEFINE_PROPERTY"+i;if(a[s])return t;if(a[s]=!0,!1===e){for(var c,l=o.mirror||document.createElement("div"),u=l.childNodes,d=u.length,p=0;p<d;++p)if(u[p]._R===a){c=u[p];break}c||(c=l.appendChild(document.createElement("div"))),t=DOMTokenList.call(c,a,r)}else t=new DOMTokenList(a,r);return n(a,i,(function(){return t})),delete a[s],t}),!0)};o(t.Element,"classList","className"),o(t.HTMLElement,"classList","className"),o(t.HTMLLinkElement,"relList","rel"),o(t.HTMLAnchorElement,"relList","rel"),o(t.HTMLAreaElement,"relList","rel")}(this)}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{});var a={charactersUnderLimit:{one:"You have %{count} character remaining",other:"You have %{count} characters remaining"},charactersAtLimit:"You have 0 characters remaining",charactersOverLimit:{one:"You have %{count} character too many",other:"You have %{count} characters too many"},wordsUnderLimit:{one:"You have %{count} word remaining",other:"You have %{count} words remaining"},wordsAtLimit:"You have 0 words remaining",wordsOverLimit:{one:"You have %{count} word too many",other:"You have %{count} words too many"},textareaDescription:{other:""}};function s(t,n){if(!(t instanceof HTMLElement))return this;var i=t.querySelector(".govuk-js-character-count");if(!(i instanceof HTMLTextAreaElement||i instanceof HTMLInputElement))return this;var s,c,l,u={threshold:0,i18n:a},d=o(t.dataset),p={};if(("maxwords"in d||"maxlength"in d)&&(p={maxlength:!1,maxwords:!1}),this.config=e(u,n||{},p,d),this.i18n=new r(function(t,e){if(!t||"object"!=typeof t)throw new Error('Provide a `configObject` of type "object".');if(!e||"string"!=typeof e)throw new Error('Provide a `namespace` of type "string" to filter the `configObject` by.');var n={};for(var o in t){var i=o.split(".");Object.prototype.hasOwnProperty.call(t,o)&&i[0]===e&&(i.length>1&&i.shift(),n[i.join(".")]=t[o])}return n}(this.config,"i18n"),{locale:(s=t,c="lang",l=s.closest("["+c+"]"),l?l.getAttribute(c):null)}),this.maxLength=1/0,"maxwords"in this.config&&this.config.maxwords)this.maxLength=this.config.maxwords;else{if(!("maxlength"in this.config)||!this.config.maxlength)return;this.maxLength=this.config.maxlength}this.$module=t,this.$textarea=i,this.$visibleCountMessage=null,this.$screenReaderCountMessage=null,this.lastInputTimestamp=null,this.lastInputValue="",this.valueChecker=null}function c(t){if(!(t instanceof HTMLElement))return this;var e=t.querySelectorAll('input[type="checkbox"]');if(!e.length)return this;this.$module=t,this.$inputs=e}function l(t,n){if(!(t instanceof HTMLElement))return this;this.$module=t;this.config=e({disableAutoFocus:!1},n||{},o(t.dataset))}function u(t){if(!(t instanceof HTMLElement))return this;var e=t.querySelectorAll('input[type="radio"]');if(!e.length)return this;this.$module=t,this.$inputs=e}function d(e){const n=void 0!==(e=void 0!==e?e:{}).scope?e.scope:document;t(n.querySelectorAll('[data-module="govuk-button"]'),(function(t){new i(t).init()}));t(n.querySelectorAll('[data-module="govuk-character-count"]'),(function(t){new s(t).init()}));t(n.querySelectorAll('[data-module="govuk-checkboxes"]'),(function(t){new c(t).init()}));new l(n.querySelector('[data-module="govuk-error-summary"]')).init();t(n.querySelectorAll('[data-module="govuk-radios"]'),(function(t){new u(t).init()}))}s.prototype.init=function(){if(this.$module&&this.$textarea){var t=this.$textarea,e=document.getElementById(t.id+"-info");if(e){e.innerText.match(/^\s*$/)&&(e.innerText=this.i18n.t("textareaDescription",{count:this.maxLength})),t.insertAdjacentElement("afterend",e);var n=document.createElement("div");n.className="govuk-character-count__sr-status govuk-visually-hidden",n.setAttribute("aria-live","polite"),this.$screenReaderCountMessage=n,e.insertAdjacentElement("afterend",n);var o=document.createElement("div");o.className=e.className,o.classList.add("govuk-character-count__status"),o.setAttribute("aria-hidden","true"),this.$visibleCountMessage=o,e.insertAdjacentElement("afterend",o),e.classList.add("govuk-visually-hidden"),t.removeAttribute("maxlength"),this.bindChangeEvents(),window.addEventListener("onpageshow"in window?"pageshow":"DOMContentLoaded",this.updateCountMessage.bind(this)),this.updateCountMessage()}}},s.prototype.bindChangeEvents=function(){var t=this.$textarea;t.addEventListener("keyup",this.handleKeyUp.bind(this)),t.addEventListener("focus",this.handleFocus.bind(this)),t.addEventListener("blur",this.handleBlur.bind(this))},s.prototype.handleKeyUp=function(){this.updateVisibleCountMessage(),this.lastInputTimestamp=Date.now()},s.prototype.handleFocus=function(){this.valueChecker=setInterval(function(){(!this.lastInputTimestamp||Date.now()-500>=this.lastInputTimestamp)&&this.updateIfValueChanged()}.bind(this),1e3)},s.prototype.handleBlur=function(){clearInterval(this.valueChecker)},s.prototype.updateIfValueChanged=function(){this.$textarea.value!==this.lastInputValue&&(this.lastInputValue=this.$textarea.value,this.updateCountMessage())},s.prototype.updateCountMessage=function(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()},s.prototype.updateVisibleCountMessage=function(){var t=this.$textarea,e=this.$visibleCountMessage,n=this.maxLength-this.count(t.value);this.isOverThreshold()?e.classList.remove("govuk-character-count__message--disabled"):e.classList.add("govuk-character-count__message--disabled"),n<0?(t.classList.add("govuk-textarea--error"),e.classList.remove("govuk-hint"),e.classList.add("govuk-error-message")):(t.classList.remove("govuk-textarea--error"),e.classList.remove("govuk-error-message"),e.classList.add("govuk-hint")),e.innerText=this.getCountMessage()},s.prototype.updateScreenReaderCountMessage=function(){var t=this.$screenReaderCountMessage;this.isOverThreshold()?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden","true"),t.innerText=this.getCountMessage()},s.prototype.count=function(t){return"maxwords"in this.config&&this.config.maxwords?(t.match(/\S+/g)||[]).length:t.length},s.prototype.getCountMessage=function(){var t=this.maxLength-this.count(this.$textarea.value),e="maxwords"in this.config&&this.config.maxwords?"words":"characters";return this.formatCountMessage(t,e)},s.prototype.formatCountMessage=function(t,e){if(0===t)return this.i18n.t(e+"AtLimit");var n=t<0?"OverLimit":"UnderLimit";return this.i18n.t(e+n,{count:Math.abs(t)})},s.prototype.isOverThreshold=function(){if(!this.config.threshold)return!0;var t=this.$textarea,e=this.count(t.value);return this.maxLength*this.config.threshold/100<=e},c.prototype.init=function(){if(this.$module&&this.$inputs){var e=this.$module;t(this.$inputs,(function(t){var e=t.getAttribute("data-aria-controls");e&&document.getElementById(e)&&(t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls"))})),window.addEventListener("onpageshow"in window?"pageshow":"DOMContentLoaded",this.syncAllConditionalReveals.bind(this)),this.syncAllConditionalReveals(),e.addEventListener("click",this.handleClick.bind(this))}},c.prototype.syncAllConditionalReveals=function(){t(this.$inputs,this.syncConditionalRevealWithInputState.bind(this))},c.prototype.syncConditionalRevealWithInputState=function(t){var e=t.getAttribute("aria-controls");if(e){var n=document.getElementById(e);if(n&&n.classList.contains("govuk-checkboxes__conditional")){var o=t.checked;t.setAttribute("aria-expanded",o.toString()),n.classList.toggle("govuk-checkboxes__conditional--hidden",!o)}}},c.prototype.unCheckAllInputsExcept=function(e){var n=this;t(document.querySelectorAll('input[type="checkbox"][name="'+e.name+'"]'),(function(t){e.form===t.form&&t!==e&&(t.checked=!1,n.syncConditionalRevealWithInputState(t))}))},c.prototype.unCheckExclusiveInputs=function(e){var n=this;t(document.querySelectorAll('input[data-behaviour="exclusive"][type="checkbox"][name="'+e.name+'"]'),(function(t){e.form===t.form&&(t.checked=!1,n.syncConditionalRevealWithInputState(t))}))},c.prototype.handleClick=function(t){var e=t.target;e instanceof HTMLInputElement&&"checkbox"===e.type&&(e.getAttribute("aria-controls")&&this.syncConditionalRevealWithInputState(e),e.checked&&("exclusive"===e.getAttribute("data-behaviour")?this.unCheckAllInputsExcept(e):this.unCheckExclusiveInputs(e)))},l.prototype.init=function(){if(this.$module){var t=this.$module;this.setFocus(),t.addEventListener("click",this.handleClick.bind(this))}},l.prototype.setFocus=function(){var t=this.$module;this.config.disableAutoFocus||(t.setAttribute("tabindex","-1"),t.addEventListener("blur",(function(){t.removeAttribute("tabindex")})),t.focus())},l.prototype.handleClick=function(t){var e=t.target;this.focusTarget(e)&&t.preventDefault()},l.prototype.focusTarget=function(t){if(!(t instanceof HTMLAnchorElement))return!1;var e=this.getFragmentFromUrl(t.href);if(!e)return!1;var n=document.getElementById(e);if(!n)return!1;var o=this.getAssociatedLegendOrLabel(n);return!!o&&(o.scrollIntoView(),n.focus({preventScroll:!0}),!0)},l.prototype.getFragmentFromUrl=function(t){if(-1!==t.indexOf("#"))return t.split("#").pop()},l.prototype.getAssociatedLegendOrLabel=function(t){var e=t.closest("fieldset");if(e){var n=e.getElementsByTagName("legend");if(n.length){var o=n[0];if(t instanceof HTMLInputElement&&("checkbox"===t.type||"radio"===t.type))return o;var i=o.getBoundingClientRect().top,r=t.getBoundingClientRect();if(r.height&&window.innerHeight)if(r.top+r.height-i<window.innerHeight/2)return o}}return document.querySelector("label[for='"+t.getAttribute("id")+"']")||t.closest("label")},u.prototype.init=function(){if(this.$module&&this.$inputs){var e=this.$module;t(this.$inputs,(function(t){var e=t.getAttribute("data-aria-controls");e&&document.getElementById(e)&&(t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls"))})),window.addEventListener("onpageshow"in window?"pageshow":"DOMContentLoaded",this.syncAllConditionalReveals.bind(this)),this.syncAllConditionalReveals(),e.addEventListener("click",this.handleClick.bind(this))}},u.prototype.syncAllConditionalReveals=function(){t(this.$inputs,this.syncConditionalRevealWithInputState.bind(this))},u.prototype.syncConditionalRevealWithInputState=function(t){var e=t.getAttribute("aria-controls");if(e){var n=document.getElementById(e);if(n&&n.classList.contains("govuk-radios__conditional")){var o=t.checked;t.setAttribute("aria-expanded",o.toString()),n.classList.toggle("govuk-radios__conditional--hidden",!o)}}},u.prototype.handleClick=function(e){var n=this,o=e.target;if(o instanceof HTMLInputElement&&"radio"===o.type){var i=document.querySelectorAll('input[type="radio"][aria-controls]'),r=o.form,a=o.name;t(i,(function(t){var e=t.form===r;t.name===a&&e&&n.syncConditionalRevealWithInputState(t)}))}};export{i as Button,s as CharacterCount,c as Checkboxes,l as ErrorSummary,u as Radios,d as initAll};
|
@@ -29,16 +29,17 @@
|
|
29
29
|
// this instead of changing `border-width` (which changes element size) and
|
30
30
|
// since `outline` is already used for the yellow focus state.
|
31
31
|
box-shadow: inset 0 0 0 $govuk-border-width-form-element;
|
32
|
+
}
|
32
33
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
34
|
+
&:disabled {
|
35
|
+
opacity: .5;
|
36
|
+
color: inherit;
|
37
|
+
background-color: transparent;
|
38
|
+
cursor: not-allowed;
|
38
39
|
}
|
39
40
|
}
|
40
41
|
|
41
|
-
.govuk-
|
42
|
+
.govuk-textarea--error {
|
42
43
|
border-color: $govuk-error-colour;
|
43
44
|
|
44
45
|
&:focus {
|
@@ -8,6 +8,7 @@ module Katalyst
|
|
8
8
|
initializer "katalyst-govuk-formbuilder.assets" do
|
9
9
|
config.after_initialize do |app|
|
10
10
|
if app.config.respond_to?(:assets)
|
11
|
+
app.config.assets.paths << root.join("vendor/assets/stylesheets")
|
11
12
|
app.config.assets.precompile += %w(katalyst-govuk-formbuilder.js)
|
12
13
|
end
|
13
14
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
// Ignore IE8 related warnings whilst we continue to generate IE8 specific
|
2
|
+
// stylesheets for the review app or dist versions of GOV.UK Frontend
|
3
|
+
$govuk-suppressed-warnings: if(
|
4
|
+
variable-exists(govuk-suppressed-warnings),
|
5
|
+
append($govuk-suppressed-warnings, "ie8"),
|
6
|
+
("ie8")
|
7
|
+
);
|
8
|
+
|
9
|
+
// By setting $govuk-is-ie8 to true, we create a version of the stylesheet that
|
10
|
+
// targets IE8 – e.g. conditionally including or excluding styles, and
|
11
|
+
// rasterizing media queries.
|
12
|
+
$govuk-is-ie8: true;
|
13
|
+
|
14
|
+
@import "all";
|
@@ -0,0 +1,34 @@
|
|
1
|
+
@import "../base";
|
2
|
+
|
3
|
+
@import "accordion/index";
|
4
|
+
@import "back-link/index";
|
5
|
+
@import "breadcrumbs/index";
|
6
|
+
@import "button/index";
|
7
|
+
@import "checkboxes/index";
|
8
|
+
@import "character-count/index";
|
9
|
+
@import "cookie-banner/index";
|
10
|
+
@import "date-input/index";
|
11
|
+
@import "details/index";
|
12
|
+
@import "error-message/index";
|
13
|
+
@import "error-summary/index";
|
14
|
+
@import "fieldset/index";
|
15
|
+
@import "file-upload/index";
|
16
|
+
@import "footer/index";
|
17
|
+
@import "hint/index";
|
18
|
+
@import "header/index";
|
19
|
+
@import "input/index";
|
20
|
+
@import "inset-text/index";
|
21
|
+
@import "label/index";
|
22
|
+
@import "notification-banner/index";
|
23
|
+
@import "pagination/index";
|
24
|
+
@import "panel/index";
|
25
|
+
@import "phase-banner/index";
|
26
|
+
@import "tabs/index";
|
27
|
+
@import "tag/index";
|
28
|
+
@import "radios/index";
|
29
|
+
@import "select/index";
|
30
|
+
@import "skip-link/index";
|
31
|
+
@import "summary-list/index";
|
32
|
+
@import "table/index";
|
33
|
+
@import "textarea/index";
|
34
|
+
@import "warning-text/index";
|