katalyst-govuk-formbuilder 1.5.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (174) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/builds/katalyst/govuk/formbuilder.css +534 -453
  3. data/app/assets/builds/katalyst/govuk/formbuilder.js +1865 -1379
  4. data/app/assets/builds/katalyst/govuk/formbuilder.min.js +85 -1
  5. data/app/assets/stylesheets/katalyst/govuk/components/richtextarea/_index.scss +5 -5
  6. data/app/assets/stylesheets/katalyst/govuk/components/richtextarea/_richtextarea.scss +1 -1
  7. data/app/assets/stylesheets/katalyst/govuk/formbuilder.scss +18 -18
  8. data/lib/katalyst/govuk/formbuilder/frontend.rb +2 -1
  9. data/lib/katalyst/govuk/formbuilder.rb +0 -1
  10. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/_base.scss +2 -0
  11. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/all.scss +2 -0
  12. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/_all.scss +8 -4
  13. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/accordion/_accordion.scss +4 -0
  14. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/accordion/_index.scss +19 -45
  15. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/back-link/_back-link.scss +4 -0
  16. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/back-link/_index.scss +18 -34
  17. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/breadcrumbs/_breadcrumbs.scss +4 -0
  18. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/breadcrumbs/_index.scss +22 -35
  19. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/button/_button.scss +4 -0
  20. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/button/_index.scss +56 -91
  21. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/character-count/_character-count.scss +4 -0
  22. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/character-count/_index.scss +3 -1
  23. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/checkboxes/_checkboxes.scss +4 -0
  24. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/checkboxes/_index.scss +69 -91
  25. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/cookie-banner/_cookie-banner.scss +4 -0
  26. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/cookie-banner/_index.scss +3 -2
  27. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/date-input/_date-input.scss +4 -0
  28. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/date-input/_index.scss +2 -0
  29. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/details/_details.scss +4 -0
  30. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/details/_index.scss +134 -0
  31. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/error-message/_error-message.scss +4 -0
  32. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/error-message/_index.scss +2 -0
  33. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/error-summary/_error-summary.scss +4 -0
  34. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/error-summary/_index.scss +5 -3
  35. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/exit-this-page/_exit-this-page.scss +4 -0
  36. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/exit-this-page/_index.scss +92 -0
  37. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/fieldset/_fieldset.scss +4 -0
  38. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/fieldset/_index.scss +18 -11
  39. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/file-upload/_file-upload.scss +4 -0
  40. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/file-upload/_index.scss +3 -6
  41. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/footer/_footer.scss +4 -0
  42. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/footer/_index.scss +16 -57
  43. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/header/_header.scss +4 -0
  44. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/header/_index.scss +55 -75
  45. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/hint/_hint.scss +2 -0
  46. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/hint/_index.scss +3 -0
  47. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/input/_index.scss +12 -35
  48. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/input/_input.scss +2 -0
  49. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/inset-text/_index.scss +2 -0
  50. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/inset-text/_inset-text.scss +4 -0
  51. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/label/_index.scss +12 -7
  52. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/label/_label.scss +2 -0
  53. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/notification-banner/_index.scss +8 -5
  54. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/notification-banner/_notification-banner.scss +4 -0
  55. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/pagination/_index.scss +12 -18
  56. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/pagination/_pagination.scss +4 -0
  57. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/panel/_index.scss +6 -8
  58. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/panel/_panel.scss +2 -0
  59. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/phase-banner/_index.scss +11 -0
  60. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/phase-banner/_phase-banner.scss +4 -0
  61. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/radios/_index.scss +38 -54
  62. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/radios/_radios.scss +4 -0
  63. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/select/_index.scss +4 -11
  64. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/select/_select.scss +4 -0
  65. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/skip-link/_index.scss +2 -0
  66. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/skip-link/_skip-link.scss +4 -0
  67. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/summary-list/_index.scss +20 -19
  68. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/summary-list/_summary-list.scss +4 -0
  69. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/table/_index.scss +10 -16
  70. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/table/_table.scss +2 -0
  71. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/tabs/_index.scss +13 -9
  72. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/tabs/_tabs.scss +2 -0
  73. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/tag/_index.scss +94 -0
  74. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/tag/_tag.scss +2 -0
  75. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/task-list/_index.scss +77 -0
  76. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/task-list/_task-list.scss +4 -0
  77. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/textarea/_index.scss +3 -7
  78. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/textarea/_textarea.scss +4 -0
  79. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/components/warning-text/_index.scss +7 -8
  80. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/components/warning-text/_warning-text.scss +4 -0
  81. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/core/_all.scss +2 -0
  82. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/core/_global-styles.scss +2 -1
  83. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/core/_govuk-frontend-version.scss +3 -1
  84. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/core/_links.scss +8 -1
  85. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/core/_lists.scss +2 -1
  86. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/core/_section-break.scss +2 -7
  87. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/core/_typography.scss +5 -4
  88. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/helpers/_all.scss +2 -0
  89. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/helpers/_clearfix.scss +3 -1
  90. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/helpers/_colour.scss +12 -19
  91. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/helpers/_device-pixels.scss +4 -3
  92. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/helpers/_focused.scss +22 -6
  93. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/helpers/_font-faces.scss +41 -0
  94. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/helpers/_grid.scss +2 -0
  95. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/helpers/_links.scss +36 -74
  96. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/helpers/_media-queries.scss +3 -12
  97. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/helpers/_shape-arrow.scss +2 -0
  98. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/helpers/_spacing.scss +12 -10
  99. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/helpers/_typography.scss +12 -33
  100. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/helpers/_visually-hidden.scss +33 -0
  101. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/objects/_all.scss +2 -0
  102. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/objects/_button-group.scss +7 -12
  103. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/objects/_form-group.scss +2 -0
  104. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/objects/_grid.scss +4 -2
  105. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/objects/_main-wrapper.scss +2 -0
  106. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/objects/_template.scss +22 -1
  107. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/objects/_width-container.scss +2 -9
  108. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/overrides/_all.scss +2 -0
  109. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/overrides/_display.scss +2 -0
  110. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/overrides/_spacing.scss +3 -19
  111. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/overrides/_text-align.scss +2 -0
  112. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/overrides/_typography.scss +2 -0
  113. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/overrides/_width.scss +2 -0
  114. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/settings/_all.scss +2 -3
  115. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/settings/_assets.scss +2 -0
  116. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/settings/_colours-applied.scss +9 -7
  117. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/settings/_colours-organisations.scss +4 -2
  118. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/settings/_colours-palette.scss +37 -0
  119. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/settings/_global-styles.scss +2 -0
  120. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/settings/_links.scss +3 -20
  121. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/settings/_measurements.scss +17 -5
  122. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/settings/_media-queries.scss +4 -2
  123. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/settings/_spacing.scss +2 -0
  124. data/vendor/assets/stylesheets/govuk-frontend/dist/govuk/settings/_typography-font.scss +52 -0
  125. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/settings/_typography-responsive.scss +2 -39
  126. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/settings/_warnings.scss +25 -5
  127. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/tools/_all.scss +2 -2
  128. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/tools/_exports.scss +2 -0
  129. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/tools/_font-url.scss +3 -0
  130. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/tools/_image-url.scss +3 -0
  131. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/tools/_px-to-em.scss +2 -0
  132. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/tools/_px-to-rem.scss +2 -0
  133. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/utilities/_all.scss +2 -0
  134. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/utilities/_clearfix.scss +2 -0
  135. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/utilities/_visually-hidden.scss +2 -0
  136. data/vendor/assets/stylesheets/govuk-frontend/{govuk → dist/govuk}/vendor/_sass-mq.scss +3 -1
  137. metadata +130 -133
  138. data/lib/katalyst/govuk/formbuilder/version.rb +0 -9
  139. data/vendor/assets/stylesheets/govuk-frontend/govuk/all-ie8.scss +0 -14
  140. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/accordion/_accordion.scss +0 -2
  141. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/back-link/_back-link.scss +0 -2
  142. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/breadcrumbs/_breadcrumbs.scss +0 -2
  143. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/button/_button.scss +0 -2
  144. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/character-count/_character-count.scss +0 -2
  145. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/checkboxes/_checkboxes.scss +0 -2
  146. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/cookie-banner/_cookie-banner.scss +0 -2
  147. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/date-input/_date-input.scss +0 -2
  148. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/details/_details.scss +0 -2
  149. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/details/_index.scss +0 -88
  150. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/error-message/_error-message.scss +0 -2
  151. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/error-summary/_error-summary.scss +0 -2
  152. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/fieldset/_fieldset.scss +0 -2
  153. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/file-upload/_file-upload.scss +0 -2
  154. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/footer/_footer.scss +0 -2
  155. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/header/_header.scss +0 -2
  156. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/inset-text/_inset-text.scss +0 -2
  157. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/notification-banner/_notification-banner.scss +0 -2
  158. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/pagination/_pagination.scss +0 -2
  159. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/phase-banner/_phase-banner.scss +0 -2
  160. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/radios/_radios.scss +0 -2
  161. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/select/_select.scss +0 -2
  162. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/skip-link/_skip-link.scss +0 -2
  163. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/summary-list/_summary-list.scss +0 -2
  164. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/tag/_index.scss +0 -81
  165. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/textarea/_textarea.scss +0 -2
  166. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/warning-text/_warning-text.scss +0 -2
  167. data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_font-faces.scss +0 -41
  168. data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_colours-palette.scss +0 -120
  169. data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_compatibility.scss +0 -100
  170. data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_ie8.scss +0 -34
  171. data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_typography-font-families.scss +0 -32
  172. data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_typography-font.scss +0 -112
  173. data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_compatibility.scss +0 -50
  174. data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_ie8.scss +0 -87
@@ -1 +1,85 @@
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};
1
+ function t(...t){function e(t){const e={};return function t(s,i){for(const[n,o]of Object.entries(s)){const s=i?`${i}.${n}`:n;o&&"object"==typeof o?t(o,s):e[s]=o}}(t),e}const s={};for(const i of t){const t=e(i);for(const[e,i]of Object.entries(t))s[e]=i}return s}function e(t,e){const s={};for(const[i,n]of Object.entries(t)){const t=i.split(".");if(t[0]===e){t.length>1&&t.shift();s[t.join(".")]=n}}return s}function s(t){if(t.includes("#"))return t.split("#").pop()}function i(t=document.body){return!!t&&t.classList.contains("govuk-frontend-supported")}function n(t){if("string"!=typeof t)return t;const e=t.trim();return"true"===e||"false"!==e&&(e.length>0&&isFinite(Number(e))?Number(e):t)}function o(t){const e={};for(const[s,i]of Object.entries(t))e[s]=n(i);return e}class a extends Error{constructor(...t){super(...t),this.name="GOVUKFrontendError"}}class r extends a{constructor(t=document.body){const e="noModule"in HTMLScriptElement.prototype?'GOV.UK Frontend initialised without `<body class="govuk-frontend-supported">` from template `<script>` snippet':"GOV.UK Frontend is not supported in this browser";super(t?e:'GOV.UK Frontend initialised without `<script type="module">`'),this.name="SupportError"}}class l extends a{constructor(...t){super(...t),this.name="ConfigError"}}class h extends a{constructor(t){let e="string"==typeof t?t:"";if("object"==typeof t){const{componentName:s,identifier:i,element:n,expectedType:o}=t;e=`${s}: ${i}`,e+=n?` is not of type ${null!=o?o:"HTMLElement"}`:" not found"}super(e),this.name="ElementError"}}class c{constructor(){this.checkSupport()}checkSupport(){if(!i())throw new r}}class d{constructor(t={},e={}){var s;this.translations=void 0,this.locale=void 0,this.translations=t,this.locale=null!=(s=e.locale)?s:document.documentElement.lang||"en"}t(t,e){if(!t)throw new Error("i18n: lookup key missing");"number"==typeof(null==e?void 0:e.count)&&(t=`${t}.${this.getPluralSuffix(t,e.count)}`);const s=this.translations[t];if("string"==typeof s){if(s.match(/%{(.\S+)}/)){if(!e)throw new Error("i18n: cannot replace placeholders in string if no option data provided");return this.replacePlaceholders(s,e)}return s}return t}replacePlaceholders(t,e){const s=Intl.NumberFormat.supportedLocalesOf(this.locale).length?new Intl.NumberFormat(this.locale):void 0;return t.replace(/%{(.\S+)}/g,(function(t,i){if(Object.prototype.hasOwnProperty.call(e,i)){const t=e[i];return!1===t||"number"!=typeof t&&"string"!=typeof t?"":"number"==typeof t?s?s.format(t):`${t}`:t}throw new Error(`i18n: no data found to replace ${t} placeholder in string`)}))}hasIntlPluralRulesSupport(){return Boolean("PluralRules"in window.Intl&&Intl.PluralRules.supportedLocalesOf(this.locale).length)}getPluralSuffix(t,e){if(e=Number(e),!isFinite(e))return"other";const s=this.hasIntlPluralRulesSupport()?new Intl.PluralRules(this.locale).select(e):this.selectPluralFormUsingFallbackRules(e);if(`${t}.${s}`in this.translations)return s;if(`${t}.other`in this.translations)return console.warn(`i18n: Missing plural form ".${s}" for "${this.locale}" locale. Falling back to ".other".`),"other";throw new Error(`i18n: Plural form ".other" is required for "${this.locale}" locale`)}selectPluralFormUsingFallbackRules(t){t=Math.abs(Math.floor(t));const e=this.getPluralRulesForLocale();return e?d.pluralRules[e](t):"other"}getPluralRulesForLocale(){const t=this.locale.split("-")[0];for(const e in d.pluralRulesMap){const s=d.pluralRulesMap[e];if(s.includes(this.locale)||s.includes(t))return e}}}d.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"]},d.pluralRules={arabic:t=>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:()=>"other",french:t=>0===t||1===t?"one":"other",german:t=>1===t?"one":"other",irish:t=>1===t?"one":2===t?"two":t>=3&&t<=6?"few":t>=7&&t<=10?"many":"other",russian(t){const e=t%100,s=e%10;return 1===s&&11!==e?"one":s>=2&&s<=4&&!(e>=12&&e<=14)?"few":0===s||s>=5&&s<=9||e>=11&&e<=14?"many":"other"},scottish:t=>1===t||11===t?"one":2===t||12===t?"two":t>=3&&t<=10||t>=13&&t<=19?"few":"other",spanish:t=>1===t?"one":t%1e6==0&&0!==t?"many":"other",welsh:t=>0===t?"zero":1===t?"one":2===t?"two":3===t?"few":6===t?"many":"other"};
2
+ /**
3
+ * Accordion component
4
+ *
5
+ * This allows a collection of sections to be collapsed by default, showing only
6
+ * their headers. Sections can be expanded or collapsed individually by clicking
7
+ * their headers. A "Show all sections" button is also added to the top of the
8
+ * accordion, which switches to "Hide all sections" when all the sections are
9
+ * expanded.
10
+ *
11
+ * The state of each section is saved to the DOM via the `aria-expanded`
12
+ * attribute, which also provides accessibility.
13
+ *
14
+ * @preserve
15
+ */
16
+ class u extends c{constructor(s,i={}){if(super(),this.$module=void 0,this.config=void 0,this.i18n=void 0,this.controlsClass="govuk-accordion__controls",this.showAllClass="govuk-accordion__show-all",this.showAllTextClass="govuk-accordion__show-all-text",this.sectionClass="govuk-accordion__section",this.sectionExpandedClass="govuk-accordion__section--expanded",this.sectionButtonClass="govuk-accordion__section-button",this.sectionHeaderClass="govuk-accordion__section-header",this.sectionHeadingClass="govuk-accordion__section-heading",this.sectionHeadingDividerClass="govuk-accordion__section-heading-divider",this.sectionHeadingTextClass="govuk-accordion__section-heading-text",this.sectionHeadingTextFocusClass="govuk-accordion__section-heading-text-focus",this.sectionShowHideToggleClass="govuk-accordion__section-toggle",this.sectionShowHideToggleFocusClass="govuk-accordion__section-toggle-focus",this.sectionShowHideTextClass="govuk-accordion__section-toggle-text",this.upChevronIconClass="govuk-accordion-nav__chevron",this.downChevronIconClass="govuk-accordion-nav__chevron--down",this.sectionSummaryClass="govuk-accordion__section-summary",this.sectionSummaryFocusClass="govuk-accordion__section-summary-focus",this.sectionContentClass="govuk-accordion__section-content",this.$sections=void 0,this.browserSupportsSessionStorage=!1,this.$showAllButton=null,this.$showAllIcon=null,this.$showAllText=null,!(s instanceof HTMLElement))throw new h({componentName:"Accordion",element:s,identifier:"Root element (`$module`)"});this.$module=s,this.config=t(u.defaults,i,o(s.dataset)),this.i18n=new d(e(this.config,"i18n"));const n=this.$module.querySelectorAll(`.${this.sectionClass}`);if(!n.length)throw new h({componentName:"Accordion",identifier:`Sections (\`<div class="${this.sectionClass}">\`)`});this.$sections=n,this.browserSupportsSessionStorage=m.checkForSessionStorage(),this.initControls(),this.initSectionHeaders();const a=this.checkIfAllSectionsOpen();this.updateShowAllButton(a)}initControls(){this.$showAllButton=document.createElement("button"),this.$showAllButton.setAttribute("type","button"),this.$showAllButton.setAttribute("class",this.showAllClass),this.$showAllButton.setAttribute("aria-expanded","false"),this.$showAllIcon=document.createElement("span"),this.$showAllIcon.classList.add(this.upChevronIconClass),this.$showAllButton.appendChild(this.$showAllIcon);const t=document.createElement("div");t.setAttribute("class",this.controlsClass),t.appendChild(this.$showAllButton),this.$module.insertBefore(t,this.$module.firstChild),this.$showAllText=document.createElement("span"),this.$showAllText.classList.add(this.showAllTextClass),this.$showAllButton.appendChild(this.$showAllText),this.$showAllButton.addEventListener("click",(()=>this.onShowOrHideAllToggle())),"onbeforematch"in document&&document.addEventListener("beforematch",(t=>this.onBeforeMatch(t)))}initSectionHeaders(){this.$sections.forEach(((t,e)=>{const s=t.querySelector(`.${this.sectionHeaderClass}`);if(!s)throw new h({componentName:"Accordion",identifier:`Section headers (\`<div class="${this.sectionHeaderClass}">\`)`});this.constructHeaderMarkup(s,e),this.setExpanded(this.isExpanded(t),t),s.addEventListener("click",(()=>this.onSectionToggle(t))),this.setInitialState(t)}))}constructHeaderMarkup(t,e){const s=t.querySelector(`.${this.sectionButtonClass}`),i=t.querySelector(`.${this.sectionHeadingClass}`),n=t.querySelector(`.${this.sectionSummaryClass}`);if(!i)throw new h({componentName:"Accordion",identifier:`Section heading (\`.${this.sectionHeadingClass}\`)`});if(!s)throw new h({componentName:"Accordion",identifier:`Section button placeholder (\`<span class="${this.sectionButtonClass}">\`)`});const o=document.createElement("button");o.setAttribute("type","button"),o.setAttribute("aria-controls",`${this.$module.id}-content-${e+1}`);for(const t of Array.from(s.attributes))"id"!==t.nodeName&&o.setAttribute(t.nodeName,`${t.nodeValue}`);const a=document.createElement("span");a.classList.add(this.sectionHeadingTextClass),a.id=s.id;const r=document.createElement("span");r.classList.add(this.sectionHeadingTextFocusClass),a.appendChild(r),r.innerHTML=s.innerHTML;const l=document.createElement("span");l.classList.add(this.sectionShowHideToggleClass),l.setAttribute("data-nosnippet","");const c=document.createElement("span");c.classList.add(this.sectionShowHideToggleFocusClass),l.appendChild(c);const d=document.createElement("span"),u=document.createElement("span");if(u.classList.add(this.upChevronIconClass),c.appendChild(u),d.classList.add(this.sectionShowHideTextClass),c.appendChild(d),o.appendChild(a),o.appendChild(this.getButtonPunctuationEl()),null!=n&&n.parentNode){const t=document.createElement("span"),e=document.createElement("span");e.classList.add(this.sectionSummaryFocusClass),t.appendChild(e);for(const e of Array.from(n.attributes))t.setAttribute(e.nodeName,`${e.nodeValue}`);e.innerHTML=n.innerHTML,n.parentNode.replaceChild(t,n),o.appendChild(t),o.appendChild(this.getButtonPunctuationEl())}o.appendChild(l),i.removeChild(s),i.appendChild(o)}onBeforeMatch(t){const e=t.target;if(!(e instanceof Element))return;const s=e.closest(`.${this.sectionClass}`);s&&this.setExpanded(!0,s)}onSectionToggle(t){const e=this.isExpanded(t);this.setExpanded(!e,t),this.storeState(t)}onShowOrHideAllToggle(){const t=!this.checkIfAllSectionsOpen();this.$sections.forEach((e=>{this.setExpanded(t,e),this.storeState(e)})),this.updateShowAllButton(t)}setExpanded(t,e){const s=e.querySelector(`.${this.upChevronIconClass}`),i=e.querySelector(`.${this.sectionShowHideTextClass}`),n=e.querySelector(`.${this.sectionButtonClass}`),o=e.querySelector(`.${this.sectionContentClass}`);if(!o)throw new h({componentName:"Accordion",identifier:`Section content (\`<div class="${this.sectionContentClass}">\`)`});if(!s||!i||!n)return;const a=t?this.i18n.t("hideSection"):this.i18n.t("showSection");i.textContent=a,n.setAttribute("aria-expanded",`${t}`);const r=[],l=e.querySelector(`.${this.sectionHeadingTextClass}`);l&&r.push(`${l.textContent}`.trim());const c=e.querySelector(`.${this.sectionSummaryClass}`);c&&r.push(`${c.textContent}`.trim());const d=t?this.i18n.t("hideSectionAriaLabel"):this.i18n.t("showSectionAriaLabel");r.push(d),n.setAttribute("aria-label",r.join(" , ")),t?(o.removeAttribute("hidden"),e.classList.add(this.sectionExpandedClass),s.classList.remove(this.downChevronIconClass)):(o.setAttribute("hidden","until-found"),e.classList.remove(this.sectionExpandedClass),s.classList.add(this.downChevronIconClass));const u=this.checkIfAllSectionsOpen();this.updateShowAllButton(u)}isExpanded(t){return t.classList.contains(this.sectionExpandedClass)}checkIfAllSectionsOpen(){return this.$sections.length===this.$module.querySelectorAll(`.${this.sectionExpandedClass}`).length}updateShowAllButton(t){this.$showAllButton&&this.$showAllText&&this.$showAllIcon&&(this.$showAllButton.setAttribute("aria-expanded",t.toString()),this.$showAllText.textContent=t?this.i18n.t("hideAllSections"):this.i18n.t("showAllSections"),this.$showAllIcon.classList.toggle(this.downChevronIconClass,!t))}storeState(t){if(this.browserSupportsSessionStorage&&this.config.rememberExpanded){const e=t.querySelector(`.${this.sectionButtonClass}`);if(e){const t=e.getAttribute("aria-controls"),s=e.getAttribute("aria-expanded");t&&s&&window.sessionStorage.setItem(t,s)}}}setInitialState(t){if(this.browserSupportsSessionStorage&&this.config.rememberExpanded){const e=t.querySelector(`.${this.sectionButtonClass}`);if(e){const s=e.getAttribute("aria-controls"),i=s?window.sessionStorage.getItem(s):null;null!==i&&this.setExpanded("true"===i,t)}}}getButtonPunctuationEl(){const t=document.createElement("span");return t.classList.add("govuk-visually-hidden",this.sectionHeadingDividerClass),t.innerHTML=", ",t}}u.moduleName="govuk-accordion",u.defaults=Object.freeze({i18n:{hideAllSections:"Hide all sections",hideSection:"Hide",hideSectionAriaLabel:"Hide this section",showAllSections:"Show all sections",showSection:"Show",showSectionAriaLabel:"Show this section"},rememberExpanded:!0});const m={checkForSessionStorage:function(){const t="this is the test string";let e;try{return window.sessionStorage.setItem(t,t),e=window.sessionStorage.getItem(t)===t.toString(),window.sessionStorage.removeItem(t),e}catch(t){return!1}}};
17
+ /**
18
+ * JavaScript enhancements for the Button component
19
+ *
20
+ * @preserve
21
+ */
22
+ class p extends c{constructor(e,s={}){if(super(),this.$module=void 0,this.config=void 0,this.debounceFormSubmitTimer=null,!(e instanceof HTMLElement))throw new h({componentName:"Button",element:e,identifier:"Root element (`$module`)"});this.$module=e,this.config=t(p.defaults,s,o(e.dataset)),this.$module.addEventListener("keydown",(t=>this.handleKeyDown(t))),this.$module.addEventListener("click",(t=>this.debounce(t)))}handleKeyDown(t){const e=t.target;32===t.keyCode&&e instanceof HTMLElement&&"button"===e.getAttribute("role")&&(t.preventDefault(),e.click())}debounce(t){if(this.config.preventDoubleClick)return this.debounceFormSubmitTimer?(t.preventDefault(),!1):void(this.debounceFormSubmitTimer=window.setTimeout((()=>{this.debounceFormSubmitTimer=null}),1e3))}}function g(t,e){const s=t.closest(`[${e}]`);return s?s.getAttribute(e):null}
23
+ /**
24
+ * Character count component
25
+ *
26
+ * Tracks the number of characters or words in the `.govuk-js-character-count`
27
+ * `<textarea>` inside the element. Displays a message with the remaining number
28
+ * of characters/words available, or the number of characters/words in excess.
29
+ *
30
+ * You can configure the message to only appear after a certain percentage
31
+ * of the available characters/words has been entered.
32
+ *
33
+ * @preserve
34
+ */p.moduleName="govuk-button",p.defaults=Object.freeze({preventDoubleClick:!1});class f extends c{constructor(s,i={}){var n,a;if(super(),this.$module=void 0,this.$textarea=void 0,this.$visibleCountMessage=void 0,this.$screenReaderCountMessage=void 0,this.lastInputTimestamp=null,this.lastInputValue="",this.valueChecker=null,this.config=void 0,this.i18n=void 0,this.maxLength=void 0,!(s instanceof HTMLElement))throw new h({componentName:"Character count",element:s,identifier:"Root element (`$module`)"});const r=s.querySelector(".govuk-js-character-count");if(!(r instanceof HTMLTextAreaElement||r instanceof HTMLInputElement))throw new h({componentName:"Character count",element:r,expectedType:"HTMLTextareaElement or HTMLInputElement",identifier:"Form field (`.govuk-js-character-count`)"});const c=o(s.dataset);let u={};("maxwords"in c||"maxlength"in c)&&(u={maxlength:void 0,maxwords:void 0}),this.config=t(f.defaults,i,u,c);const m=function(t,e){const s=[];for(const[i,n]of Object.entries(t)){const t=[];for(const{required:s,errorMessage:i}of n)s.every((t=>!!e[t]))||t.push(i);"anyOf"!==i||n.length-t.length>=1||s.push(...t)}return s}(f.schema,this.config);if(m[0])throw new l(`Character count: ${m[0]}`);this.i18n=new d(e(this.config,"i18n"),{locale:g(s,"lang")}),this.maxLength=null!=(n=null!=(a=this.config.maxwords)?a:this.config.maxlength)?n:1/0,this.$module=s,this.$textarea=r;const p=`${this.$textarea.id}-info`,b=document.getElementById(p);if(!b)throw new h({componentName:"Character count",element:b,identifier:`Count message (\`id="${p}"\`)`});`${b.textContent}`.match(/^\s*$/)&&(b.textContent=this.i18n.t("textareaDescription",{count:this.maxLength})),this.$textarea.insertAdjacentElement("afterend",b);const v=document.createElement("div");v.className="govuk-character-count__sr-status govuk-visually-hidden",v.setAttribute("aria-live","polite"),this.$screenReaderCountMessage=v,b.insertAdjacentElement("afterend",v);const w=document.createElement("div");w.className=b.className,w.classList.add("govuk-character-count__status"),w.setAttribute("aria-hidden","true"),this.$visibleCountMessage=w,b.insertAdjacentElement("afterend",w),b.classList.add("govuk-visually-hidden"),this.$textarea.removeAttribute("maxlength"),this.bindChangeEvents(),window.addEventListener("pageshow",(()=>this.updateCountMessage())),this.updateCountMessage()}bindChangeEvents(){this.$textarea.addEventListener("keyup",(()=>this.handleKeyUp())),this.$textarea.addEventListener("focus",(()=>this.handleFocus())),this.$textarea.addEventListener("blur",(()=>this.handleBlur()))}handleKeyUp(){this.updateVisibleCountMessage(),this.lastInputTimestamp=Date.now()}handleFocus(){this.valueChecker=window.setInterval((()=>{(!this.lastInputTimestamp||Date.now()-500>=this.lastInputTimestamp)&&this.updateIfValueChanged()}),1e3)}handleBlur(){this.valueChecker&&window.clearInterval(this.valueChecker)}updateIfValueChanged(){this.$textarea.value!==this.lastInputValue&&(this.lastInputValue=this.$textarea.value,this.updateCountMessage())}updateCountMessage(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()}updateVisibleCountMessage(){const t=this.maxLength-this.count(this.$textarea.value)<0;this.$visibleCountMessage.classList.toggle("govuk-character-count__message--disabled",!this.isOverThreshold()),this.$textarea.classList.toggle("govuk-textarea--error",t),this.$visibleCountMessage.classList.toggle("govuk-error-message",t),this.$visibleCountMessage.classList.toggle("govuk-hint",!t),this.$visibleCountMessage.textContent=this.getCountMessage()}updateScreenReaderCountMessage(){this.isOverThreshold()?this.$screenReaderCountMessage.removeAttribute("aria-hidden"):this.$screenReaderCountMessage.setAttribute("aria-hidden","true"),this.$screenReaderCountMessage.textContent=this.getCountMessage()}count(t){if(this.config.maxwords){var e;return(null!=(e=t.match(/\S+/g))?e:[]).length}return t.length}getCountMessage(){const t=this.maxLength-this.count(this.$textarea.value),e=this.config.maxwords?"words":"characters";return this.formatCountMessage(t,e)}formatCountMessage(t,e){if(0===t)return this.i18n.t(`${e}AtLimit`);const s=t<0?"OverLimit":"UnderLimit";return this.i18n.t(`${e}${s}`,{count:Math.abs(t)})}isOverThreshold(){if(!this.config.threshold)return!0;const t=this.count(this.$textarea.value);return this.maxLength*this.config.threshold/100<=t}}f.moduleName="govuk-character-count",f.defaults=Object.freeze({threshold:0,i18n:{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:""}}}),f.schema=Object.freeze({anyOf:[{required:["maxwords"],errorMessage:'Either "maxlength" or "maxwords" must be provided'},{required:["maxlength"],errorMessage:'Either "maxlength" or "maxwords" must be provided'}]});
35
+ /**
36
+ * Checkboxes component
37
+ *
38
+ * @preserve
39
+ */
40
+ class b extends c{constructor(t){if(super(),this.$module=void 0,this.$inputs=void 0,!(t instanceof HTMLElement))throw new h({componentName:"Checkboxes",element:t,identifier:"Root element (`$module`)"});const e=t.querySelectorAll('input[type="checkbox"]');if(!e.length)throw new h({componentName:"Checkboxes",identifier:'Form inputs (`<input type="checkbox">`)'});this.$module=t,this.$inputs=e,this.$inputs.forEach((t=>{const e=t.getAttribute("data-aria-controls");if(e){if(!document.getElementById(e))throw new h({componentName:"Checkboxes",identifier:`Conditional reveal (\`id="${e}"\`)`});t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls")}})),window.addEventListener("pageshow",(()=>this.syncAllConditionalReveals())),this.syncAllConditionalReveals(),this.$module.addEventListener("click",(t=>this.handleClick(t)))}syncAllConditionalReveals(){this.$inputs.forEach((t=>this.syncConditionalRevealWithInputState(t)))}syncConditionalRevealWithInputState(t){const e=t.getAttribute("aria-controls");if(!e)return;const s=document.getElementById(e);if(s&&s.classList.contains("govuk-checkboxes__conditional")){const e=t.checked;t.setAttribute("aria-expanded",e.toString()),s.classList.toggle("govuk-checkboxes__conditional--hidden",!e)}}unCheckAllInputsExcept(t){document.querySelectorAll(`input[type="checkbox"][name="${t.name}"]`).forEach((e=>{t.form===e.form&&e!==t&&(e.checked=!1,this.syncConditionalRevealWithInputState(e))}))}unCheckExclusiveInputs(t){document.querySelectorAll(`input[data-behaviour="exclusive"][type="checkbox"][name="${t.name}"]`).forEach((e=>{t.form===e.form&&(e.checked=!1,this.syncConditionalRevealWithInputState(e))}))}handleClick(t){const e=t.target;if(!(e instanceof HTMLInputElement)||"checkbox"!==e.type)return;if(e.getAttribute("aria-controls")&&this.syncConditionalRevealWithInputState(e),!e.checked)return;"exclusive"===e.getAttribute("data-behaviour")?this.unCheckAllInputsExcept(e):this.unCheckExclusiveInputs(e)}}b.moduleName="govuk-checkboxes";
41
+ /**
42
+ * Error summary component
43
+ *
44
+ * Takes focus on initialisation for accessible announcement, unless disabled in
45
+ * configuration.
46
+ *
47
+ * @preserve
48
+ */
49
+ class v extends c{constructor(e,s={}){if(super(),this.$module=void 0,this.config=void 0,!(e instanceof HTMLElement))throw new h({componentName:"Error summary",element:e,identifier:"Root element (`$module`)"});this.$module=e,this.config=t(v.defaults,s,o(e.dataset)),this.setFocus(),this.$module.addEventListener("click",(t=>this.handleClick(t)))}setFocus(){this.config.disableAutoFocus||(this.$module.setAttribute("tabindex","-1"),this.$module.addEventListener("blur",(()=>{this.$module.removeAttribute("tabindex")})),this.$module.focus())}handleClick(t){const e=t.target;e&&this.focusTarget(e)&&t.preventDefault()}focusTarget(t){if(!(t instanceof HTMLAnchorElement))return!1;const e=s(t.href);if(!e)return!1;const i=document.getElementById(e);if(!i)return!1;const n=this.getAssociatedLegendOrLabel(i);return!!n&&(n.scrollIntoView(),i.focus({preventScroll:!0}),!0)}getAssociatedLegendOrLabel(t){var e;const s=t.closest("fieldset");if(s){const e=s.getElementsByTagName("legend");if(e.length){const s=e[0];if(t instanceof HTMLInputElement&&("checkbox"===t.type||"radio"===t.type))return s;const i=s.getBoundingClientRect().top,n=t.getBoundingClientRect();if(n.height&&window.innerHeight){if(n.top+n.height-i<window.innerHeight/2)return s}}}return null!=(e=document.querySelector(`label[for='${t.getAttribute("id")}']`))?e:t.closest("label")}}v.moduleName="govuk-error-summary",v.defaults=Object.freeze({disableAutoFocus:!1});
50
+ /**
51
+ * Exit this page component
52
+ *
53
+ * @preserve
54
+ */
55
+ class w extends c{constructor(s,i={}){if(super(),this.$module=void 0,this.config=void 0,this.i18n=void 0,this.$button=void 0,this.$skiplinkButton=null,this.$updateSpan=null,this.$indicatorContainer=null,this.$overlay=null,this.keypressCounter=0,this.lastKeyWasModified=!1,this.timeoutTime=5e3,this.keypressTimeoutId=null,this.timeoutMessageId=null,!(s instanceof HTMLElement))throw new h({componentName:"Exit this page",element:s,identifier:"Root element (`$module`)"});const n=s.querySelector(".govuk-exit-this-page__button");if(!(n instanceof HTMLAnchorElement))throw new h({componentName:"Exit this page",element:n,expectedType:"HTMLAnchorElement",identifier:"Button (`.govuk-exit-this-page__button`)"});this.config=t(w.defaults,i,o(s.dataset)),this.i18n=new d(e(this.config,"i18n")),this.$module=s,this.$button=n;const a=document.querySelector(".govuk-js-exit-this-page-skiplink");a instanceof HTMLAnchorElement&&(this.$skiplinkButton=a),this.buildIndicator(),this.initUpdateSpan(),this.initButtonClickHandler(),"govukFrontendExitThisPageKeypress"in document.body.dataset||(document.addEventListener("keyup",this.handleKeypress.bind(this),!0),document.body.dataset.govukFrontendExitThisPageKeypress="true"),window.addEventListener("pageshow",this.resetPage.bind(this))}initUpdateSpan(){this.$updateSpan=document.createElement("span"),this.$updateSpan.setAttribute("role","status"),this.$updateSpan.className="govuk-visually-hidden",this.$module.appendChild(this.$updateSpan)}initButtonClickHandler(){this.$button.addEventListener("click",this.handleClick.bind(this)),this.$skiplinkButton&&this.$skiplinkButton.addEventListener("click",this.handleClick.bind(this))}buildIndicator(){this.$indicatorContainer=document.createElement("div"),this.$indicatorContainer.className="govuk-exit-this-page__indicator",this.$indicatorContainer.setAttribute("aria-hidden","true");for(let t=0;t<3;t++){const t=document.createElement("div");t.className="govuk-exit-this-page__indicator-light",this.$indicatorContainer.appendChild(t)}this.$button.appendChild(this.$indicatorContainer)}updateIndicator(){if(!this.$indicatorContainer)return;this.$indicatorContainer.classList.toggle("govuk-exit-this-page__indicator--visible",this.keypressCounter>0);this.$indicatorContainer.querySelectorAll(".govuk-exit-this-page__indicator-light").forEach(((t,e)=>{t.classList.toggle("govuk-exit-this-page__indicator-light--on",e<this.keypressCounter)}))}exitPage(){this.$updateSpan&&(this.$updateSpan.textContent="",document.body.classList.add("govuk-exit-this-page-hide-content"),this.$overlay=document.createElement("div"),this.$overlay.className="govuk-exit-this-page-overlay",this.$overlay.setAttribute("role","alert"),document.body.appendChild(this.$overlay),this.$overlay.textContent=this.i18n.t("activated"),window.location.href=this.$button.href)}handleClick(t){t.preventDefault(),this.exitPage()}handleKeypress(t){this.$updateSpan&&("Shift"!==t.key&&16!==t.keyCode&&16!==t.which||this.lastKeyWasModified?this.keypressTimeoutId&&this.resetKeypressTimer():(this.keypressCounter+=1,this.updateIndicator(),this.timeoutMessageId&&(window.clearTimeout(this.timeoutMessageId),this.timeoutMessageId=null),this.keypressCounter>=3?(this.keypressCounter=0,this.keypressTimeoutId&&(window.clearTimeout(this.keypressTimeoutId),this.keypressTimeoutId=null),this.exitPage()):1===this.keypressCounter?this.$updateSpan.textContent=this.i18n.t("pressTwoMoreTimes"):this.$updateSpan.textContent=this.i18n.t("pressOneMoreTime"),this.setKeypressTimer()),this.lastKeyWasModified=t.shiftKey)}setKeypressTimer(){this.keypressTimeoutId&&window.clearTimeout(this.keypressTimeoutId),this.keypressTimeoutId=window.setTimeout(this.resetKeypressTimer.bind(this),this.timeoutTime)}resetKeypressTimer(){if(!this.$updateSpan)return;this.keypressTimeoutId&&(window.clearTimeout(this.keypressTimeoutId),this.keypressTimeoutId=null);const t=this.$updateSpan;this.keypressCounter=0,t.textContent=this.i18n.t("timedOut"),this.timeoutMessageId=window.setTimeout((()=>{t.textContent=""}),this.timeoutTime),this.updateIndicator()}resetPage(){document.body.classList.remove("govuk-exit-this-page-hide-content"),this.$overlay&&(this.$overlay.remove(),this.$overlay=null),this.$updateSpan&&(this.$updateSpan.setAttribute("role","status"),this.$updateSpan.textContent=""),this.updateIndicator(),this.keypressTimeoutId&&window.clearTimeout(this.keypressTimeoutId),this.timeoutMessageId&&window.clearTimeout(this.timeoutMessageId)}}w.moduleName="govuk-exit-this-page",w.defaults=Object.freeze({i18n:{activated:"Loading.",timedOut:"Exit this page expired.",pressTwoMoreTimes:"Shift, press 2 more times to exit.",pressOneMoreTime:"Shift, press 1 more time to exit."}});(
56
+ /**
57
+ * Header component
58
+ *
59
+ * @preserve
60
+ */
61
+ class extends c{constructor(t){if(super(),this.$module=void 0,this.$menuButton=void 0,this.$menu=void 0,this.menuIsOpen=!1,this.mql=null,!t)throw new h({componentName:"Header",element:t,identifier:"Root element (`$module`)"});this.$module=t;const e=t.querySelector(".govuk-js-header-toggle");if(!e)return this;const s=e.getAttribute("aria-controls");if(!s)throw new h({componentName:"Header",identifier:'Navigation button (`<button class="govuk-js-header-toggle">`) attribute (`aria-controls`)'});const i=document.getElementById(s);if(!i)throw new h({componentName:"Header",element:i,identifier:`Navigation (\`<ul id="${s}">\`)`});this.$menu=i,this.$menuButton=e,this.mql=window.matchMedia("(min-width: 48.0625em)"),"addEventListener"in this.mql?this.mql.addEventListener("change",(()=>this.syncState())):this.mql.addListener((()=>this.syncState())),this.syncState(),this.$menuButton.addEventListener("click",(()=>this.handleMenuButtonClick()))}syncState(){this.mql&&this.$menu&&this.$menuButton&&(this.mql.matches?(this.$menu.removeAttribute("hidden"),this.$menuButton.setAttribute("hidden","")):(this.$menuButton.removeAttribute("hidden"),this.$menuButton.setAttribute("aria-expanded",this.menuIsOpen.toString()),this.menuIsOpen?this.$menu.removeAttribute("hidden"):this.$menu.setAttribute("hidden","")))}handleMenuButtonClick(){this.menuIsOpen=!this.menuIsOpen,this.syncState()}}).moduleName="govuk-header";
62
+ /**
63
+ * Notification Banner component
64
+ *
65
+ * @preserve
66
+ */
67
+ class $ extends c{constructor(e,s={}){if(super(),this.$module=void 0,this.config=void 0,!(e instanceof HTMLElement))throw new h({componentName:"Notification banner",element:e,identifier:"Root element (`$module`)"});this.$module=e,this.config=t($.defaults,s,o(e.dataset)),this.setFocus()}setFocus(){this.config.disableAutoFocus||"alert"===this.$module.getAttribute("role")&&(this.$module.getAttribute("tabindex")||(this.$module.setAttribute("tabindex","-1"),this.$module.addEventListener("blur",(()=>{this.$module.removeAttribute("tabindex")}))),this.$module.focus())}}$.moduleName="govuk-notification-banner",$.defaults=Object.freeze({disableAutoFocus:!1});
68
+ /**
69
+ * Radios component
70
+ *
71
+ * @preserve
72
+ */
73
+ class k extends c{constructor(t){if(super(),this.$module=void 0,this.$inputs=void 0,!(t instanceof HTMLElement))throw new h({componentName:"Radios",element:t,identifier:"Root element (`$module`)"});const e=t.querySelectorAll('input[type="radio"]');if(!e.length)throw new h({componentName:"Radios",identifier:'Form inputs (`<input type="radio">`)'});this.$module=t,this.$inputs=e,this.$inputs.forEach((t=>{const e=t.getAttribute("data-aria-controls");if(e){if(!document.getElementById(e))throw new h({componentName:"Radios",identifier:`Conditional reveal (\`id="${e}"\`)`});t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls")}})),window.addEventListener("pageshow",(()=>this.syncAllConditionalReveals())),this.syncAllConditionalReveals(),this.$module.addEventListener("click",(t=>this.handleClick(t)))}syncAllConditionalReveals(){this.$inputs.forEach((t=>this.syncConditionalRevealWithInputState(t)))}syncConditionalRevealWithInputState(t){const e=t.getAttribute("aria-controls");if(!e)return;const s=document.getElementById(e);if(null!=s&&s.classList.contains("govuk-radios__conditional")){const e=t.checked;t.setAttribute("aria-expanded",e.toString()),s.classList.toggle("govuk-radios__conditional--hidden",!e)}}handleClick(t){const e=t.target;if(!(e instanceof HTMLInputElement)||"radio"!==e.type)return;const s=document.querySelectorAll('input[type="radio"][aria-controls]'),i=e.form,n=e.name;s.forEach((t=>{const e=t.form===i;t.name===n&&e&&this.syncConditionalRevealWithInputState(t)}))}}k.moduleName="govuk-radios";(
74
+ /**
75
+ * Skip link component
76
+ *
77
+ * @preserve
78
+ */
79
+ class extends c{constructor(t){var e;if(super(),this.$module=void 0,this.$linkedElement=void 0,this.linkedElementListener=!1,!(t instanceof HTMLAnchorElement))throw new h({componentName:"Skip link",element:t,expectedType:"HTMLAnchorElement",identifier:"Root element (`$module`)"});this.$module=t;const i=this.$module.hash,n=null!=(e=this.$module.getAttribute("href"))?e:"";let o;try{o=new window.URL(this.$module.href)}catch(t){throw new h(`Skip link: Target link (\`href="${n}"\`) is invalid`)}if(o.origin!==window.location.origin||o.pathname!==window.location.pathname)return;const a=s(i);if(!a)throw new h(`Skip link: Target link (\`href="${n}"\`) has no hash fragment`);const r=document.getElementById(a);if(!r)throw new h({componentName:"Skip link",element:r,identifier:`Target content (\`id="${a}"\`)`});this.$linkedElement=r,this.$module.addEventListener("click",(()=>this.focusLinkedElement()))}focusLinkedElement(){this.$linkedElement&&(this.$linkedElement.getAttribute("tabindex")||(this.$linkedElement.setAttribute("tabindex","-1"),this.$linkedElement.classList.add("govuk-skip-link-focused-element"),this.linkedElementListener||(this.$linkedElement.addEventListener("blur",(()=>this.removeFocusProperties())),this.linkedElementListener=!0)),this.$linkedElement.focus())}removeFocusProperties(){this.$linkedElement&&(this.$linkedElement.removeAttribute("tabindex"),this.$linkedElement.classList.remove("govuk-skip-link-focused-element"))}}).moduleName="govuk-skip-link";function C(t){let e;if(t=void 0!==t?t:{},!i())return void console.log(new r);const s=[[p,t.button],[f,t.characterCount],[b],[v,t.errorSummary],[k]],n=null!=(e=t.scope)?e:document;s.forEach((([t,e])=>{n.querySelectorAll(`[data-module="${t.moduleName}"]`).forEach((s=>{try{"defaults"in t?new t(s,e):new t(s)}catch(t){console.log(t)}}))}))}(
80
+ /**
81
+ * Tabs component
82
+ *
83
+ * @preserve
84
+ */
85
+ class extends c{constructor(t){if(super(),this.$module=void 0,this.$tabs=void 0,this.$tabList=void 0,this.$tabListItems=void 0,this.keys={left:37,right:39,up:38,down:40},this.jsHiddenClass="govuk-tabs__panel--hidden",this.changingHash=!1,this.boundTabClick=void 0,this.boundTabKeydown=void 0,this.boundOnHashChange=void 0,this.mql=null,!t)throw new h({componentName:"Tabs",element:t,identifier:"Root element (`$module`)"});const e=t.querySelectorAll("a.govuk-tabs__tab");if(!e.length)throw new h({componentName:"Tabs",identifier:'Links (`<a class="govuk-tabs__tab">`)'});this.$module=t,this.$tabs=e,this.boundTabClick=this.onTabClick.bind(this),this.boundTabKeydown=this.onTabKeydown.bind(this),this.boundOnHashChange=this.onHashChange.bind(this);const s=this.$module.querySelector(".govuk-tabs__list"),i=this.$module.querySelectorAll("li.govuk-tabs__list-item");if(!s)throw new h({componentName:"Tabs",identifier:'List (`<ul class="govuk-tabs__list">`)'});if(!i.length)throw new h({componentName:"Tabs",identifier:'List items (`<li class="govuk-tabs__list-item">`)'});this.$tabList=s,this.$tabListItems=i,this.setupResponsiveChecks()}setupResponsiveChecks(){this.mql=window.matchMedia("(min-width: 40.0625em)"),"addEventListener"in this.mql?this.mql.addEventListener("change",(()=>this.checkMode())):this.mql.addListener((()=>this.checkMode())),this.checkMode()}checkMode(){var t;null!=(t=this.mql)&&t.matches?this.setup():this.teardown()}setup(){var t;this.$tabList.setAttribute("role","tablist"),this.$tabListItems.forEach((t=>{t.setAttribute("role","presentation")})),this.$tabs.forEach((t=>{this.setAttributes(t),t.addEventListener("click",this.boundTabClick,!0),t.addEventListener("keydown",this.boundTabKeydown,!0),this.hideTab(t)}));const e=null!=(t=this.getTab(window.location.hash))?t:this.$tabs[0];this.showTab(e),window.addEventListener("hashchange",this.boundOnHashChange,!0)}teardown(){this.$tabList.removeAttribute("role"),this.$tabListItems.forEach((t=>{t.removeAttribute("role")})),this.$tabs.forEach((t=>{t.removeEventListener("click",this.boundTabClick,!0),t.removeEventListener("keydown",this.boundTabKeydown,!0),this.unsetAttributes(t)})),window.removeEventListener("hashchange",this.boundOnHashChange,!0)}onHashChange(){const t=window.location.hash,e=this.getTab(t);if(!e)return;if(this.changingHash)return void(this.changingHash=!1);const s=this.getCurrentTab();s&&(this.hideTab(s),this.showTab(e),e.focus())}hideTab(t){this.unhighlightTab(t),this.hidePanel(t)}showTab(t){this.highlightTab(t),this.showPanel(t)}getTab(t){return this.$module.querySelector(`a.govuk-tabs__tab[href="${t}"]`)}setAttributes(t){const e=s(t.href);if(!e)return;t.setAttribute("id",`tab_${e}`),t.setAttribute("role","tab"),t.setAttribute("aria-controls",e),t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");const i=this.getPanel(t);i&&(i.setAttribute("role","tabpanel"),i.setAttribute("aria-labelledby",t.id),i.classList.add(this.jsHiddenClass))}unsetAttributes(t){t.removeAttribute("id"),t.removeAttribute("role"),t.removeAttribute("aria-controls"),t.removeAttribute("aria-selected"),t.removeAttribute("tabindex");const e=this.getPanel(t);e&&(e.removeAttribute("role"),e.removeAttribute("aria-labelledby"),e.classList.remove(this.jsHiddenClass))}onTabClick(t){const e=this.getCurrentTab(),s=t.currentTarget;e&&s instanceof HTMLAnchorElement&&(t.preventDefault(),this.hideTab(e),this.showTab(s),this.createHistoryEntry(s))}createHistoryEntry(t){const e=this.getPanel(t);if(!e)return;const s=e.id;e.id="",this.changingHash=!0,window.location.hash=s,e.id=s}onTabKeydown(t){switch(t.keyCode){case this.keys.left:case this.keys.up:this.activatePreviousTab(),t.preventDefault();break;case this.keys.right:case this.keys.down:this.activateNextTab(),t.preventDefault()}}activateNextTab(){const t=this.getCurrentTab();if(null==t||!t.parentElement)return;const e=t.parentElement.nextElementSibling;if(!e)return;const s=e.querySelector("a.govuk-tabs__tab");s&&(this.hideTab(t),this.showTab(s),s.focus(),this.createHistoryEntry(s))}activatePreviousTab(){const t=this.getCurrentTab();if(null==t||!t.parentElement)return;const e=t.parentElement.previousElementSibling;if(!e)return;const s=e.querySelector("a.govuk-tabs__tab");s&&(this.hideTab(t),this.showTab(s),s.focus(),this.createHistoryEntry(s))}getPanel(t){const e=s(t.href);return e?this.$module.querySelector(`#${e}`):null}showPanel(t){const e=this.getPanel(t);e&&e.classList.remove(this.jsHiddenClass)}hidePanel(t){const e=this.getPanel(t);e&&e.classList.add(this.jsHiddenClass)}unhighlightTab(t){t.parentElement&&(t.setAttribute("aria-selected","false"),t.parentElement.classList.remove("govuk-tabs__list-item--selected"),t.setAttribute("tabindex","-1"))}highlightTab(t){t.parentElement&&(t.setAttribute("aria-selected","true"),t.parentElement.classList.add("govuk-tabs__list-item--selected"),t.setAttribute("tabindex","0"))}getCurrentTab(){return this.$module.querySelector(".govuk-tabs__list-item--selected a.govuk-tabs__tab")}}).moduleName="govuk-tabs";export{p as Button,f as CharacterCount,b as Checkboxes,v as ErrorSummary,k as Radios,C as initAll};
@@ -1,6 +1,6 @@
1
- @import "govuk-frontend/govuk/components/error-message/index";
2
- @import "govuk-frontend/govuk/components/hint/index";
3
- @import "govuk-frontend/govuk/components/label/index";
1
+ @import "govuk-frontend/dist/govuk/components/error-message/index";
2
+ @import "govuk-frontend/dist/govuk/components/hint/index";
3
+ @import "govuk-frontend/dist/govuk/components/label/index";
4
4
 
5
5
  // Based on components/textarea
6
6
  @include govuk-exports("govuk/component/richtextarea") {
@@ -32,14 +32,14 @@
32
32
  }
33
33
 
34
34
  &:disabled {
35
- opacity: .5;
35
+ opacity: 0.5;
36
36
  color: inherit;
37
37
  background-color: transparent;
38
38
  cursor: not-allowed;
39
39
  }
40
40
  }
41
41
 
42
- .govuk-textarea--error {
42
+ .govuk-richtextarea--error {
43
43
  border-color: $govuk-error-colour;
44
44
 
45
45
  &:focus {
@@ -1,2 +1,2 @@
1
- @import "govuk-frontend/govuk/base";
1
+ @import "govuk-frontend/dist/govuk/base";
2
2
  @import "./index";
@@ -1,26 +1,26 @@
1
1
  $govuk-include-default-font-face: false;
2
2
  $govuk-font-family: "Open Sans", sans-serif !default;
3
3
 
4
- @import "govuk-frontend/govuk/base";
4
+ @import "govuk-frontend/dist/govuk/base";
5
5
 
6
- @import "govuk-frontend/govuk/core/all";
7
- @import "govuk-frontend/govuk/objects/all";
6
+ @import "govuk-frontend/dist/govuk/core/all";
7
+ @import "govuk-frontend/dist/govuk/objects/all";
8
8
 
9
- @import "govuk-frontend/govuk/components/button";
10
- @import "govuk-frontend/govuk/components/checkboxes";
11
- @import "govuk-frontend/govuk/components/date-input";
12
- @import "govuk-frontend/govuk/components/error-message";
13
- @import "govuk-frontend/govuk/components/error-summary";
14
- @import "govuk-frontend/govuk/components/fieldset";
15
- @import "govuk-frontend/govuk/components/file-upload";
16
- @import "govuk-frontend/govuk/components/hint";
17
- @import "govuk-frontend/govuk/components/input";
18
- @import "govuk-frontend/govuk/components/label";
19
- @import "govuk-frontend/govuk/components/radios";
20
- @import "govuk-frontend/govuk/components/select";
21
- @import "govuk-frontend/govuk/components/textarea";
9
+ @import "govuk-frontend/dist/govuk/components/button";
10
+ @import "govuk-frontend/dist/govuk/components/checkboxes";
11
+ @import "govuk-frontend/dist/govuk/components/date-input";
12
+ @import "govuk-frontend/dist/govuk/components/error-message";
13
+ @import "govuk-frontend/dist/govuk/components/error-summary";
14
+ @import "govuk-frontend/dist/govuk/components/fieldset";
15
+ @import "govuk-frontend/dist/govuk/components/file-upload";
16
+ @import "govuk-frontend/dist/govuk/components/hint";
17
+ @import "govuk-frontend/dist/govuk/components/input";
18
+ @import "govuk-frontend/dist/govuk/components/label";
19
+ @import "govuk-frontend/dist/govuk/components/radios";
20
+ @import "govuk-frontend/dist/govuk/components/select";
21
+ @import "govuk-frontend/dist/govuk/components/textarea";
22
22
 
23
- @import "govuk-frontend/govuk/utilities/all";
24
- @import "govuk-frontend/govuk/overrides/all";
23
+ @import "govuk-frontend/dist/govuk/utilities/all";
24
+ @import "govuk-frontend/dist/govuk/overrides/all";
25
25
 
26
26
  @import "components/richtextarea";
@@ -8,7 +8,8 @@ module Katalyst
8
8
  def govuk_formbuilder_init
9
9
  tag.script type: "module", nonce: request.content_security_policy_nonce do
10
10
  <<~JS.html_safe
11
- document.body.classList.add("js-enabled");
11
+ document.body.classList.toggle("js-enabled", true);
12
+ document.body.classList.toggle("govuk-frontend-supported", ('noModule' in HTMLScriptElement.prototype));
12
13
  import {initAll} from "@katalyst/govuk-formbuilder";
13
14
  initAll();
14
15
  JS
@@ -6,7 +6,6 @@ require "govuk_design_system_formbuilder/elements/check_box_field"
6
6
 
7
7
  require "katalyst/govuk/formbuilder/engine"
8
8
  require "katalyst/govuk/formbuilder/frontend"
9
- require "katalyst/govuk/formbuilder/version"
10
9
 
11
10
  module Katalyst
12
11
  module GOVUK
@@ -1,3 +1,5 @@
1
1
  @import "settings/all";
2
2
  @import "tools/all";
3
3
  @import "helpers/all";
4
+
5
+ /*# sourceMappingURL=_base.scss.map */
@@ -7,3 +7,5 @@
7
7
 
8
8
  @import "utilities/all";
9
9
  @import "overrides/all";
10
+
11
+ /*# sourceMappingURL=all.scss.map */
@@ -4,18 +4,19 @@
4
4
  @import "back-link/index";
5
5
  @import "breadcrumbs/index";
6
6
  @import "button/index";
7
- @import "checkboxes/index";
8
7
  @import "character-count/index";
8
+ @import "checkboxes/index";
9
9
  @import "cookie-banner/index";
10
10
  @import "date-input/index";
11
11
  @import "details/index";
12
12
  @import "error-message/index";
13
13
  @import "error-summary/index";
14
+ @import "exit-this-page/index";
14
15
  @import "fieldset/index";
15
16
  @import "file-upload/index";
16
17
  @import "footer/index";
17
- @import "hint/index";
18
18
  @import "header/index";
19
+ @import "hint/index";
19
20
  @import "input/index";
20
21
  @import "inset-text/index";
21
22
  @import "label/index";
@@ -23,12 +24,15 @@
23
24
  @import "pagination/index";
24
25
  @import "panel/index";
25
26
  @import "phase-banner/index";
26
- @import "tabs/index";
27
- @import "tag/index";
28
27
  @import "radios/index";
29
28
  @import "select/index";
30
29
  @import "skip-link/index";
31
30
  @import "summary-list/index";
32
31
  @import "table/index";
32
+ @import "tabs/index";
33
+ @import "tag/index";
34
+ @import "task-list/index";
33
35
  @import "textarea/index";
34
36
  @import "warning-text/index";
37
+
38
+ /*# sourceMappingURL=_all.scss.map */
@@ -0,0 +1,4 @@
1
+ @import "../../base";
2
+ @import "./index";
3
+
4
+ /*# sourceMappingURL=_accordion.scss.map */
@@ -1,6 +1,6 @@
1
1
  @include govuk-exports("govuk/component/accordion") {
2
2
  $govuk-accordion-base-colour: govuk-colour("black");
3
- $govuk-accordion-hover-colour: govuk-colour("light-grey", $legacy: "grey-3");
3
+ $govuk-accordion-hover-colour: govuk-colour("light-grey");
4
4
  $govuk-accordion-icon-focus-colour: $govuk-focus-colour;
5
5
  $govuk-accordion-bottom-border-width: 1px;
6
6
 
@@ -35,8 +35,8 @@
35
35
  margin-bottom: 0;
36
36
  }
37
37
 
38
- // JavaScript enabled
39
- .js-enabled {
38
+ // GOV.UK Frontend JavaScript enabled
39
+ .govuk-frontend-supported {
40
40
  .govuk-accordion {
41
41
  // Border at the bottom of the whole accordion
42
42
  border-bottom: $govuk-accordion-bottom-border-width solid $govuk-border-colour;
@@ -89,7 +89,7 @@
89
89
  cursor: pointer;
90
90
  -webkit-appearance: none;
91
91
 
92
- @include govuk-media-query ($from: tablet) {
92
+ @include govuk-media-query($from: tablet) {
93
93
  margin-bottom: 14px;
94
94
  }
95
95
 
@@ -105,7 +105,9 @@
105
105
  // The GOV.UK Design System focus state adds a box-shadow to the top and bottom of the
106
106
  // button. We add a grey box-shadow on hover too, to make the height of the hover state
107
107
  // match the height of the focus state.
108
- box-shadow: 0 -2px $govuk-accordion-hover-colour, 0 4px $govuk-accordion-hover-colour;
108
+ box-shadow:
109
+ 0 -2px $govuk-accordion-hover-colour,
110
+ 0 4px $govuk-accordion-hover-colour;
109
111
 
110
112
  .govuk-accordion__section-toggle-text {
111
113
  color: $govuk-accordion-base-colour;
@@ -116,7 +118,7 @@
116
118
  background: $govuk-accordion-base-colour;
117
119
  }
118
120
 
119
- .govuk-accordion-nav__chevron:after {
121
+ .govuk-accordion-nav__chevron::after {
120
122
  color: $govuk-accordion-hover-colour;
121
123
  }
122
124
  }
@@ -128,7 +130,7 @@
128
130
  background: $govuk-accordion-base-colour;
129
131
  }
130
132
 
131
- .govuk-accordion-nav__chevron:after {
133
+ .govuk-accordion-nav__chevron::after {
132
134
  color: $govuk-accordion-icon-focus-colour;
133
135
  }
134
136
  }
@@ -154,15 +156,8 @@
154
156
 
155
157
  vertical-align: middle;
156
158
 
157
- // IE8 fallback of icon
158
- @include _govuk-if-ie8 {
159
- display: inline-block;
160
- max-height: 20px;
161
- line-height: 1;
162
- }
163
-
164
159
  // Create inner chevron arrow
165
- &:after {
160
+ &::after {
166
161
  content: "";
167
162
  box-sizing: border-box;
168
163
  display: block;
@@ -174,39 +169,16 @@
174
169
  width: govuk-px-to-rem(6px);
175
170
  height: govuk-px-to-rem(6px);
176
171
 
177
- -webkit-transform: rotate(-45deg);
178
-
179
- -ms-transform: rotate(-45deg);
180
-
181
- transform: rotate(-45deg);
172
+ transform: rotate(-45deg);
182
173
 
183
174
  border-top: govuk-px-to-rem(2px) solid;
184
175
  border-right: govuk-px-to-rem(2px) solid;
185
-
186
- // IE8 fallback of icon with HTML symbol
187
- @include _govuk-if-ie8 {
188
- content: "\25B2"; // "▲"
189
- position: relative;
190
- border: 0;
191
- }
192
176
  }
193
177
  }
194
178
 
195
179
  // Rotate icon to create "Down" version
196
180
  .govuk-accordion-nav__chevron--down {
197
- -webkit-transform: rotate(180deg);
198
- -ms-transform: rotate(180deg);
199
- transform: rotate(180deg);
200
-
201
- // IE8 fallback of arrow icon
202
- @include _govuk-if-ie8 {
203
- &:after {
204
- content: "\25BC"; // "▼"
205
- -webkit-transform: none;
206
- -ms-transform: none;
207
- transform: none;
208
- }
209
- }
181
+ transform: rotate(180deg);
210
182
  }
211
183
 
212
184
  .govuk-accordion__section-button {
@@ -230,7 +202,7 @@
230
202
  cursor: pointer;
231
203
  -webkit-appearance: none;
232
204
 
233
- @include govuk-media-query ($from: tablet) {
205
+ @include govuk-media-query($from: tablet) {
234
206
  padding-bottom: govuk-spacing(2);
235
207
  }
236
208
 
@@ -252,7 +224,7 @@
252
224
  background: $govuk-accordion-base-colour;
253
225
  }
254
226
 
255
- .govuk-accordion-nav__chevron:after {
227
+ .govuk-accordion-nav__chevron::after {
256
228
  color: $govuk-accordion-hover-colour;
257
229
  }
258
230
  }
@@ -273,7 +245,7 @@
273
245
  background: $govuk-accordion-base-colour;
274
246
  }
275
247
 
276
- .govuk-accordion-nav__chevron:after {
248
+ .govuk-accordion-nav__chevron::after {
277
249
  color: $govuk-accordion-icon-focus-colour;
278
250
  }
279
251
  }
@@ -292,7 +264,7 @@
292
264
  padding-bottom: govuk-spacing(3);
293
265
  border-bottom: 0;
294
266
 
295
- @include govuk-media-query ($from: tablet) {
267
+ @include govuk-media-query($from: tablet) {
296
268
  padding-bottom: govuk-spacing(4);
297
269
  }
298
270
  }
@@ -302,7 +274,7 @@
302
274
  .govuk-accordion__section-button:focus .govuk-accordion__section-toggle-focus {
303
275
  padding-bottom: 3px;
304
276
 
305
- @include govuk-media-query ($from: desktop) {
277
+ @include govuk-media-query($from: desktop) {
306
278
  padding-bottom: 2px;
307
279
  }
308
280
  }
@@ -390,3 +362,5 @@
390
362
  }
391
363
  }
392
364
  }
365
+
366
+ /*# sourceMappingURL=_index.scss.map */
@@ -0,0 +1,4 @@
1
+ @import "../../base";
2
+ @import "./index";
3
+
4
+ /*# sourceMappingURL=_back-link.scss.map */