katalyst-govuk-formbuilder 1.21.0 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"formbuilder.min.js","sources":["../../../../../node_modules/govuk-frontend/dist/govuk/common/index.mjs","../../../../../node_modules/govuk-frontend/dist/govuk/errors/index.mjs","../../../../../node_modules/govuk-frontend/dist/govuk/component.mjs","../../../../../node_modules/govuk-frontend/dist/govuk/common/configuration.mjs","../../../../../node_modules/govuk-frontend/dist/govuk/i18n.mjs","../../../../../node_modules/govuk-frontend/dist/govuk/components/button/button.mjs","../../../../../node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs","../../../../../node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs","../../../../../node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.mjs","../../../../../node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs","../../../../../node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs","../../../../../node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.mjs","../../../../../node_modules/govuk-frontend/dist/govuk/components/radios/radios.mjs","../../../../javascript/katalyst/govuk/controllers/file_field_controller.js","../../../../javascript/katalyst/govuk/controllers/index.js","../../../../javascript/katalyst/govuk/controllers/document_field_controller.js","../../../../javascript/katalyst/govuk/controllers/image_field_controller.js","../../../../javascript/katalyst/govuk/formbuilder.js"],"sourcesContent":["function getFragmentFromUrl(url) {\n if (!url.includes('#')) {\n return undefined;\n }\n return url.split('#').pop();\n}\nfunction getBreakpoint(name) {\n const property = `--govuk-breakpoint-${name}`;\n const value = window.getComputedStyle(document.documentElement).getPropertyValue(property);\n return {\n property,\n value: value || undefined\n };\n}\nfunction setFocus($element, options = {}) {\n var _options$onBeforeFocu;\n const isFocusable = $element.getAttribute('tabindex');\n if (!isFocusable) {\n $element.setAttribute('tabindex', '-1');\n }\n function onFocus() {\n $element.addEventListener('blur', onBlur, {\n once: true\n });\n }\n function onBlur() {\n var _options$onBlur;\n (_options$onBlur = options.onBlur) == null || _options$onBlur.call($element);\n if (!isFocusable) {\n $element.removeAttribute('tabindex');\n }\n }\n $element.addEventListener('focus', onFocus, {\n once: true\n });\n (_options$onBeforeFocu = options.onBeforeFocus) == null || _options$onBeforeFocu.call($element);\n $element.focus();\n}\nfunction isInitialised($root, moduleName) {\n return $root instanceof HTMLElement && $root.hasAttribute(`data-${moduleName}-init`);\n}\n\n/**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * Some browsers will load and run our JavaScript but GOV.UK Frontend\n * won't be supported.\n *\n * @param {HTMLElement | null} [$scope] - (internal) `<body>` HTML element checked for browser support\n * @returns {boolean} Whether GOV.UK Frontend is supported on this page\n */\nfunction isSupported($scope = document.body) {\n if (!$scope) {\n return false;\n }\n return $scope.classList.contains('govuk-frontend-supported');\n}\nfunction isArray(option) {\n return Array.isArray(option);\n}\nfunction isObject(option) {\n return !!option && typeof option === 'object' && !isArray(option);\n}\nfunction formatErrorMessage(Component, message) {\n return `${Component.moduleName}: ${message}`;\n}\n/**\n * @typedef ComponentWithModuleName\n * @property {string} moduleName - Name of the component\n */\n/**\n * @import { ObjectNested } from './configuration.mjs'\n */\n\nexport { formatErrorMessage, getBreakpoint, getFragmentFromUrl, isInitialised, isObject, isSupported, setFocus };\n//# sourceMappingURL=index.mjs.map\n","import { formatErrorMessage } from '../common/index.mjs';\n\nclass GOVUKFrontendError extends Error {\n constructor(...args) {\n super(...args);\n this.name = 'GOVUKFrontendError';\n }\n}\nclass SupportError extends GOVUKFrontendError {\n /**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * @param {HTMLElement | null} [$scope] - HTML element `<body>` checked for browser support\n */\n constructor($scope = document.body) {\n const supportMessage = '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';\n super($scope ? supportMessage : 'GOV.UK Frontend initialised without `<script type=\"module\">`');\n this.name = 'SupportError';\n }\n}\nclass ConfigError extends GOVUKFrontendError {\n constructor(...args) {\n super(...args);\n this.name = 'ConfigError';\n }\n}\nclass ElementError extends GOVUKFrontendError {\n constructor(messageOrOptions) {\n let message = typeof messageOrOptions === 'string' ? messageOrOptions : '';\n if (typeof messageOrOptions === 'object') {\n const {\n component,\n identifier,\n element,\n expectedType\n } = messageOrOptions;\n message = identifier;\n message += element ? ` is not of type ${expectedType != null ? expectedType : 'HTMLElement'}` : ' not found';\n message = formatErrorMessage(component, message);\n }\n super(message);\n this.name = 'ElementError';\n }\n}\nclass InitError extends GOVUKFrontendError {\n constructor(componentOrMessage) {\n const message = typeof componentOrMessage === 'string' ? componentOrMessage : formatErrorMessage(componentOrMessage, `Root element (\\`$root\\`) already initialised`);\n super(message);\n this.name = 'InitError';\n }\n}\n/**\n * @import { ComponentWithModuleName } from '../common/index.mjs'\n */\n\nexport { ConfigError, ElementError, GOVUKFrontendError, InitError, SupportError };\n//# sourceMappingURL=index.mjs.map\n","import { isInitialised, isSupported } from './common/index.mjs';\nimport { InitError, ElementError, SupportError } from './errors/index.mjs';\n\nclass Component {\n /**\n * Returns the root element of the component\n *\n * @protected\n * @returns {RootElementType} - the root element of component\n */\n get $root() {\n return this._$root;\n }\n constructor($root) {\n this._$root = void 0;\n const childConstructor = this.constructor;\n if (typeof childConstructor.moduleName !== 'string') {\n throw new InitError(`\\`moduleName\\` not defined in component`);\n }\n if (!($root instanceof childConstructor.elementType)) {\n throw new ElementError({\n element: $root,\n component: childConstructor,\n identifier: 'Root element (`$root`)',\n expectedType: childConstructor.elementType.name\n });\n } else {\n this._$root = $root;\n }\n childConstructor.checkSupport();\n this.checkInitialised();\n const moduleName = childConstructor.moduleName;\n this.$root.setAttribute(`data-${moduleName}-init`, '');\n }\n checkInitialised() {\n const constructor = this.constructor;\n const moduleName = constructor.moduleName;\n if (moduleName && isInitialised(this.$root, moduleName)) {\n throw new InitError(constructor);\n }\n }\n static checkSupport() {\n if (!isSupported()) {\n throw new SupportError();\n }\n }\n}\n\n/**\n * @typedef ChildClass\n * @property {string} moduleName - The module name that'll be looked for in the DOM when initialising the component\n */\n\n/**\n * @typedef {typeof Component & ChildClass} ChildClassConstructor\n */\nComponent.elementType = HTMLElement;\n\nexport { Component };\n//# sourceMappingURL=component.mjs.map\n","import { Component } from '../component.mjs';\nimport { ConfigError } from '../errors/index.mjs';\nimport { isObject, formatErrorMessage } from './index.mjs';\n\nconst configOverride = Symbol.for('configOverride');\nclass ConfigurableComponent extends Component {\n [configOverride](param) {\n return {};\n }\n\n /**\n * Returns the root element of the component\n *\n * @protected\n * @returns {ConfigurationType} - the root element of component\n */\n get config() {\n return this._config;\n }\n constructor($root, config) {\n super($root);\n this._config = void 0;\n const childConstructor = this.constructor;\n if (!isObject(childConstructor.defaults)) {\n throw new ConfigError(formatErrorMessage(childConstructor, 'Config passed as parameter into constructor but no defaults defined'));\n }\n const datasetConfig = normaliseDataset(childConstructor, this._$root.dataset);\n this._config = mergeConfigs(childConstructor.defaults, config != null ? config : {}, this[configOverride](datasetConfig), datasetConfig);\n }\n}\nfunction normaliseString(value, property) {\n const trimmedValue = value ? value.trim() : '';\n let output;\n let outputType = property == null ? void 0 : property.type;\n if (!outputType) {\n if (['true', 'false'].includes(trimmedValue)) {\n outputType = 'boolean';\n }\n if (trimmedValue.length > 0 && isFinite(Number(trimmedValue))) {\n outputType = 'number';\n }\n }\n switch (outputType) {\n case 'boolean':\n output = trimmedValue === 'true';\n break;\n case 'number':\n output = Number(trimmedValue);\n break;\n default:\n output = value;\n }\n return output;\n}\nfunction normaliseDataset(Component, dataset) {\n if (!isObject(Component.schema)) {\n throw new ConfigError(formatErrorMessage(Component, 'Config passed as parameter into constructor but no schema defined'));\n }\n const out = {};\n const entries = Object.entries(Component.schema.properties);\n for (const entry of entries) {\n const [namespace, property] = entry;\n const field = namespace.toString();\n if (field in dataset) {\n out[field] = normaliseString(dataset[field], property);\n }\n if ((property == null ? void 0 : property.type) === 'object') {\n out[field] = extractConfigByNamespace(Component.schema, dataset, namespace);\n }\n }\n return out;\n}\nfunction mergeConfigs(...configObjects) {\n const formattedConfigObject = {};\n for (const configObject of configObjects) {\n for (const key of Object.keys(configObject)) {\n const option = formattedConfigObject[key];\n const override = configObject[key];\n if (isObject(option) && isObject(override)) {\n formattedConfigObject[key] = mergeConfigs(option, override);\n } else {\n formattedConfigObject[key] = override;\n }\n }\n }\n return formattedConfigObject;\n}\nfunction validateConfig(schema, config) {\n const validationErrors = [];\n for (const [name, conditions] of Object.entries(schema)) {\n const errors = [];\n if (Array.isArray(conditions)) {\n for (const {\n required,\n errorMessage\n } of conditions) {\n if (!required.every(key => !!config[key])) {\n errors.push(errorMessage);\n }\n }\n if (name === 'anyOf' && !(conditions.length - errors.length >= 1)) {\n validationErrors.push(...errors);\n }\n }\n }\n return validationErrors;\n}\nfunction extractConfigByNamespace(schema, dataset, namespace) {\n const property = schema.properties[namespace];\n if ((property == null ? void 0 : property.type) !== 'object') {\n return;\n }\n const newObject = {\n [namespace]: {}\n };\n for (const [key, value] of Object.entries(dataset)) {\n let current = newObject;\n const keyParts = key.split('.');\n for (const [index, name] of keyParts.entries()) {\n if (isObject(current)) {\n if (index < keyParts.length - 1) {\n if (!isObject(current[name])) {\n current[name] = {};\n }\n current = current[name];\n } else if (key !== namespace) {\n current[name] = normaliseString(value);\n }\n }\n }\n }\n return newObject[namespace];\n}\n/**\n * Schema for component config\n *\n * @template {Partial<Record<keyof ConfigurationType, unknown>>} ConfigurationType\n * @typedef {object} Schema\n * @property {Record<keyof ConfigurationType, SchemaProperty | undefined>} properties - Schema properties\n * @property {SchemaCondition<ConfigurationType>[]} [anyOf] - List of schema conditions\n */\n/**\n * Schema property for component config\n *\n * @typedef {object} SchemaProperty\n * @property {'string' | 'boolean' | 'number' | 'object'} type - Property type\n */\n/**\n * Schema condition for component config\n *\n * @template {Partial<Record<keyof ConfigurationType, unknown>>} ConfigurationType\n * @typedef {object} SchemaCondition\n * @property {(keyof ConfigurationType)[]} required - List of required config fields\n * @property {string} errorMessage - Error message when required config fields not provided\n */\n/**\n * @template {Partial<Record<keyof ConfigurationType, unknown>>} [ConfigurationType=ObjectNested]\n * @typedef ChildClass\n * @property {string} moduleName - The module name that'll be looked for in the DOM when initialising the component\n * @property {Schema<ConfigurationType>} [schema] - The schema of the component configuration\n * @property {ConfigurationType} [defaults] - The default values of the configuration of the component\n */\n/**\n * @template {Partial<Record<keyof ConfigurationType, unknown>>} [ConfigurationType=ObjectNested]\n * @typedef {typeof Component & ChildClass<ConfigurationType>} ChildClassConstructor<ConfigurationType>\n */\n\nexport { ConfigurableComponent, configOverride, extractConfigByNamespace, mergeConfigs, normaliseDataset, normaliseString, validateConfig };\n//# sourceMappingURL=configuration.mjs.map\n","class I18n {\n constructor(translations = {}, config = {}) {\n var _config$locale;\n this.translations = void 0;\n this.locale = void 0;\n this.translations = translations;\n this.locale = (_config$locale = config.locale) != null ? _config$locale : document.documentElement.lang || 'en';\n }\n t(lookupKey, options) {\n if (!lookupKey) {\n throw new Error('i18n: lookup key missing');\n }\n let translation = this.translations[lookupKey];\n if (typeof (options == null ? void 0 : options.count) === 'number' && typeof translation === 'object') {\n const translationPluralForm = translation[this.getPluralSuffix(lookupKey, options.count)];\n if (translationPluralForm) {\n translation = translationPluralForm;\n }\n }\n if (typeof translation === 'string') {\n if (translation.match(/%{(.\\S+)}/)) {\n if (!options) {\n throw new Error('i18n: cannot replace placeholders in string if no option data provided');\n }\n return this.replacePlaceholders(translation, options);\n }\n return translation;\n }\n return lookupKey;\n }\n replacePlaceholders(translationString, options) {\n const formatter = Intl.NumberFormat.supportedLocalesOf(this.locale).length ? new Intl.NumberFormat(this.locale) : undefined;\n return translationString.replace(/%{(.\\S+)}/g, function (placeholderWithBraces, placeholderKey) {\n if (Object.prototype.hasOwnProperty.call(options, placeholderKey)) {\n const placeholderValue = options[placeholderKey];\n if (placeholderValue === false || typeof placeholderValue !== 'number' && typeof placeholderValue !== 'string') {\n return '';\n }\n if (typeof placeholderValue === 'number') {\n return formatter ? formatter.format(placeholderValue) : `${placeholderValue}`;\n }\n return placeholderValue;\n }\n throw new Error(`i18n: no data found to replace ${placeholderWithBraces} placeholder in string`);\n });\n }\n hasIntlPluralRulesSupport() {\n return Boolean('PluralRules' in window.Intl && Intl.PluralRules.supportedLocalesOf(this.locale).length);\n }\n getPluralSuffix(lookupKey, count) {\n count = Number(count);\n if (!isFinite(count)) {\n return 'other';\n }\n const translation = this.translations[lookupKey];\n const preferredForm = this.hasIntlPluralRulesSupport() ? new Intl.PluralRules(this.locale).select(count) : this.selectPluralFormUsingFallbackRules(count);\n if (typeof translation === 'object') {\n if (preferredForm in translation) {\n return preferredForm;\n } else if ('other' in translation) {\n console.warn(`i18n: Missing plural form \".${preferredForm}\" for \"${this.locale}\" locale. Falling back to \".other\".`);\n return 'other';\n }\n }\n throw new Error(`i18n: Plural form \".other\" is required for \"${this.locale}\" locale`);\n }\n selectPluralFormUsingFallbackRules(count) {\n count = Math.abs(Math.floor(count));\n const ruleset = this.getPluralRulesForLocale();\n if (ruleset) {\n return I18n.pluralRules[ruleset](count);\n }\n return 'other';\n }\n getPluralRulesForLocale() {\n const localeShort = this.locale.split('-')[0];\n for (const pluralRule in I18n.pluralRulesMap) {\n const languages = I18n.pluralRulesMap[pluralRule];\n if (languages.includes(this.locale) || languages.includes(localeShort)) {\n return pluralRule;\n }\n }\n }\n}\nI18n.pluralRulesMap = {\n arabic: ['ar'],\n chinese: ['my', 'zh', 'id', 'ja', 'jv', 'ko', 'ms', 'th', 'vi'],\n french: ['hy', 'bn', 'fr', 'gu', 'hi', 'fa', 'pa', 'zu'],\n 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'],\n irish: ['ga'],\n russian: ['ru', 'uk'],\n scottish: ['gd'],\n spanish: ['pt-PT', 'it', 'es'],\n welsh: ['cy']\n};\nI18n.pluralRules = {\n arabic(n) {\n if (n === 0) {\n return 'zero';\n }\n if (n === 1) {\n return 'one';\n }\n if (n === 2) {\n return 'two';\n }\n if (n % 100 >= 3 && n % 100 <= 10) {\n return 'few';\n }\n if (n % 100 >= 11 && n % 100 <= 99) {\n return 'many';\n }\n return 'other';\n },\n chinese() {\n return 'other';\n },\n french(n) {\n return n === 0 || n === 1 ? 'one' : 'other';\n },\n german(n) {\n return n === 1 ? 'one' : 'other';\n },\n irish(n) {\n if (n === 1) {\n return 'one';\n }\n if (n === 2) {\n return 'two';\n }\n if (n >= 3 && n <= 6) {\n return 'few';\n }\n if (n >= 7 && n <= 10) {\n return 'many';\n }\n return 'other';\n },\n russian(n) {\n const lastTwo = n % 100;\n const last = lastTwo % 10;\n if (last === 1 && lastTwo !== 11) {\n return 'one';\n }\n if (last >= 2 && last <= 4 && !(lastTwo >= 12 && lastTwo <= 14)) {\n return 'few';\n }\n if (last === 0 || last >= 5 && last <= 9 || lastTwo >= 11 && lastTwo <= 14) {\n return 'many';\n }\n return 'other';\n },\n scottish(n) {\n if (n === 1 || n === 11) {\n return 'one';\n }\n if (n === 2 || n === 12) {\n return 'two';\n }\n if (n >= 3 && n <= 10 || n >= 13 && n <= 19) {\n return 'few';\n }\n return 'other';\n },\n spanish(n) {\n if (n === 1) {\n return 'one';\n }\n if (n % 1000000 === 0 && n !== 0) {\n return 'many';\n }\n return 'other';\n },\n welsh(n) {\n if (n === 0) {\n return 'zero';\n }\n if (n === 1) {\n return 'one';\n }\n if (n === 2) {\n return 'two';\n }\n if (n === 3) {\n return 'few';\n }\n if (n === 6) {\n return 'many';\n }\n return 'other';\n }\n};\n\nexport { I18n };\n//# sourceMappingURL=i18n.mjs.map\n","import { ConfigurableComponent } from '../../common/configuration.mjs';\n\nconst DEBOUNCE_TIMEOUT_IN_SECONDS = 1;\n\n/**\n * JavaScript enhancements for the Button component\n *\n * @preserve\n * @augments ConfigurableComponent<ButtonConfig>\n */\nclass Button extends ConfigurableComponent {\n /**\n * @param {Element | null} $root - HTML element to use for button\n * @param {ButtonConfig} [config] - Button config\n */\n constructor($root, config = {}) {\n super($root, config);\n this.debounceFormSubmitTimer = null;\n this.$root.addEventListener('keydown', event => this.handleKeyDown(event));\n this.$root.addEventListener('click', event => this.debounce(event));\n }\n handleKeyDown(event) {\n const $target = event.target;\n if (event.key !== ' ') {\n return;\n }\n if ($target instanceof HTMLElement && $target.getAttribute('role') === 'button') {\n event.preventDefault();\n $target.click();\n }\n }\n debounce(event) {\n if (!this.config.preventDoubleClick) {\n return;\n }\n if (this.debounceFormSubmitTimer) {\n event.preventDefault();\n return false;\n }\n this.debounceFormSubmitTimer = window.setTimeout(() => {\n this.debounceFormSubmitTimer = null;\n }, DEBOUNCE_TIMEOUT_IN_SECONDS * 1000);\n }\n}\n\n/**\n * Button config\n *\n * @typedef {object} ButtonConfig\n * @property {boolean} [preventDoubleClick=false] - Prevent accidental double\n * clicks on submit buttons from submitting forms multiple times.\n */\n\n/**\n * @import { Schema } from '../../common/configuration.mjs'\n */\nButton.moduleName = 'govuk-button';\nButton.defaults = Object.freeze({\n preventDoubleClick: false\n});\nButton.schema = Object.freeze({\n properties: {\n preventDoubleClick: {\n type: 'boolean'\n }\n }\n});\n\nexport { Button };\n//# sourceMappingURL=button.mjs.map\n","function closestAttributeValue($element, attributeName) {\n const $closestElementWithAttribute = $element.closest(`[${attributeName}]`);\n return $closestElementWithAttribute ? $closestElementWithAttribute.getAttribute(attributeName) : null;\n}\n\nexport { closestAttributeValue };\n//# sourceMappingURL=closest-attribute-value.mjs.map\n","import { closestAttributeValue } from '../../common/closest-attribute-value.mjs';\nimport { ConfigurableComponent, configOverride, validateConfig } from '../../common/configuration.mjs';\nimport { formatErrorMessage } from '../../common/index.mjs';\nimport { ElementError, ConfigError } from '../../errors/index.mjs';\nimport { I18n } from '../../i18n.mjs';\n\n/**\n * Character count component\n *\n * Tracks the number of characters or words in the `.govuk-js-character-count`\n * `<textarea>` inside the element. Displays a message with the remaining number\n * of characters/words available, or the number of characters/words in excess.\n *\n * You can configure the message to only appear after a certain percentage\n * of the available characters/words has been entered.\n *\n * @preserve\n * @augments ConfigurableComponent<CharacterCountConfig>\n */\nclass CharacterCount extends ConfigurableComponent {\n [configOverride](datasetConfig) {\n let configOverrides = {};\n if ('maxwords' in datasetConfig || 'maxlength' in datasetConfig) {\n configOverrides = {\n maxlength: undefined,\n maxwords: undefined\n };\n }\n return configOverrides;\n }\n\n /**\n * @param {Element | null} $root - HTML element to use for character count\n * @param {CharacterCountConfig} [config] - Character count config\n */\n constructor($root, config = {}) {\n var _ref, _this$config$maxwords;\n super($root, config);\n this.$textarea = void 0;\n this.$visibleCountMessage = void 0;\n this.$screenReaderCountMessage = void 0;\n this.lastInputTimestamp = null;\n this.lastInputValue = '';\n this.valueChecker = null;\n this.i18n = void 0;\n this.maxLength = void 0;\n const $textarea = this.$root.querySelector('.govuk-js-character-count');\n if (!($textarea instanceof HTMLTextAreaElement || $textarea instanceof HTMLInputElement)) {\n throw new ElementError({\n component: CharacterCount,\n element: $textarea,\n expectedType: 'HTMLTextareaElement or HTMLInputElement',\n identifier: 'Form field (`.govuk-js-character-count`)'\n });\n }\n const errors = validateConfig(CharacterCount.schema, this.config);\n if (errors[0]) {\n throw new ConfigError(formatErrorMessage(CharacterCount, errors[0]));\n }\n this.i18n = new I18n(this.config.i18n, {\n locale: closestAttributeValue(this.$root, 'lang')\n });\n this.maxLength = (_ref = (_this$config$maxwords = this.config.maxwords) != null ? _this$config$maxwords : this.config.maxlength) != null ? _ref : Infinity;\n this.$textarea = $textarea;\n const textareaDescriptionId = `${this.$textarea.id}-info`;\n const $textareaDescription = document.getElementById(textareaDescriptionId);\n if (!$textareaDescription) {\n throw new ElementError({\n component: CharacterCount,\n element: $textareaDescription,\n identifier: `Count message (\\`id=\"${textareaDescriptionId}\"\\`)`\n });\n }\n this.$errorMessage = this.$root.querySelector('.govuk-error-message');\n if (`${$textareaDescription.textContent}`.match(/^\\s*$/)) {\n $textareaDescription.textContent = this.i18n.t('textareaDescription', {\n count: this.maxLength\n });\n }\n this.$textarea.insertAdjacentElement('afterend', $textareaDescription);\n const $screenReaderCountMessage = document.createElement('div');\n $screenReaderCountMessage.className = 'govuk-character-count__sr-status govuk-visually-hidden';\n $screenReaderCountMessage.setAttribute('aria-live', 'polite');\n this.$screenReaderCountMessage = $screenReaderCountMessage;\n $textareaDescription.insertAdjacentElement('afterend', $screenReaderCountMessage);\n const $visibleCountMessage = document.createElement('div');\n $visibleCountMessage.className = $textareaDescription.className;\n $visibleCountMessage.classList.add('govuk-character-count__status');\n $visibleCountMessage.setAttribute('aria-hidden', 'true');\n this.$visibleCountMessage = $visibleCountMessage;\n $textareaDescription.insertAdjacentElement('afterend', $visibleCountMessage);\n $textareaDescription.classList.add('govuk-visually-hidden');\n this.$textarea.removeAttribute('maxlength');\n this.bindChangeEvents();\n window.addEventListener('pageshow', () => this.updateCountMessage());\n this.updateCountMessage();\n }\n bindChangeEvents() {\n this.$textarea.addEventListener('keyup', () => this.handleKeyUp());\n this.$textarea.addEventListener('focus', () => this.handleFocus());\n this.$textarea.addEventListener('blur', () => this.handleBlur());\n }\n handleKeyUp() {\n this.updateVisibleCountMessage();\n this.lastInputTimestamp = Date.now();\n }\n handleFocus() {\n this.valueChecker = window.setInterval(() => {\n if (!this.lastInputTimestamp || Date.now() - 500 >= this.lastInputTimestamp) {\n this.updateIfValueChanged();\n }\n }, 1000);\n }\n handleBlur() {\n if (this.valueChecker) {\n window.clearInterval(this.valueChecker);\n }\n }\n updateIfValueChanged() {\n if (this.$textarea.value !== this.lastInputValue) {\n this.lastInputValue = this.$textarea.value;\n this.updateCountMessage();\n }\n }\n updateCountMessage() {\n this.updateVisibleCountMessage();\n this.updateScreenReaderCountMessage();\n }\n updateVisibleCountMessage() {\n const remainingNumber = this.maxLength - this.count(this.$textarea.value);\n const isError = remainingNumber < 0;\n this.$visibleCountMessage.classList.toggle('govuk-character-count__message--disabled', !this.isOverThreshold());\n if (!this.$errorMessage) {\n this.$textarea.classList.toggle('govuk-textarea--error', isError);\n }\n this.$visibleCountMessage.classList.toggle('govuk-error-message', isError);\n this.$visibleCountMessage.classList.toggle('govuk-hint', !isError);\n this.$visibleCountMessage.textContent = this.getCountMessage();\n }\n updateScreenReaderCountMessage() {\n if (this.isOverThreshold()) {\n this.$screenReaderCountMessage.removeAttribute('aria-hidden');\n } else {\n this.$screenReaderCountMessage.setAttribute('aria-hidden', 'true');\n }\n this.$screenReaderCountMessage.textContent = this.getCountMessage();\n }\n count(text) {\n if (this.config.maxwords) {\n var _text$match;\n const tokens = (_text$match = text.match(/\\S+/g)) != null ? _text$match : [];\n return tokens.length;\n }\n return text.length;\n }\n getCountMessage() {\n const remainingNumber = this.maxLength - this.count(this.$textarea.value);\n const countType = this.config.maxwords ? 'words' : 'characters';\n return this.formatCountMessage(remainingNumber, countType);\n }\n formatCountMessage(remainingNumber, countType) {\n if (remainingNumber === 0) {\n return this.i18n.t(`${countType}AtLimit`);\n }\n const translationKeySuffix = remainingNumber < 0 ? 'OverLimit' : 'UnderLimit';\n return this.i18n.t(`${countType}${translationKeySuffix}`, {\n count: Math.abs(remainingNumber)\n });\n }\n isOverThreshold() {\n if (!this.config.threshold) {\n return true;\n }\n const currentLength = this.count(this.$textarea.value);\n const maxLength = this.maxLength;\n const thresholdValue = maxLength * this.config.threshold / 100;\n return thresholdValue <= currentLength;\n }\n}\n\n/**\n * Character count config\n *\n * @see {@link CharacterCount.defaults}\n * @typedef {object} CharacterCountConfig\n * @property {number} [maxlength] - The maximum number of characters.\n * If maxwords is provided, the maxlength option will be ignored.\n * @property {number} [maxwords] - The maximum number of words. If maxwords is\n * provided, the maxlength option will be ignored.\n * @property {number} [threshold=0] - The percentage value of the limit at\n * which point the count message is displayed. If this attribute is set, the\n * count message will be hidden by default.\n * @property {CharacterCountTranslations} [i18n=CharacterCount.defaults.i18n] - Character count translations\n */\n\n/**\n * Character count translations\n *\n * @see {@link CharacterCount.defaults.i18n}\n * @typedef {object} CharacterCountTranslations\n *\n * Messages shown to users as they type. It provides feedback on how many words\n * or characters they have remaining or if they are over the limit. This also\n * includes a message used as an accessible description for the textarea.\n * @property {TranslationPluralForms} [charactersUnderLimit] - Message displayed\n * when the number of characters is under the configured maximum, `maxlength`.\n * This message is displayed visually and through assistive technologies. The\n * component will replace the `%{count}` placeholder with the number of\n * remaining characters. This is a [pluralised list of\n * messages](https://frontend.design-system.service.gov.uk/localise-govuk-frontend).\n * @property {string} [charactersAtLimit] - Message displayed when the number of\n * characters reaches the configured maximum, `maxlength`. This message is\n * displayed visually and through assistive technologies.\n * @property {TranslationPluralForms} [charactersOverLimit] - Message displayed\n * when the number of characters is over the configured maximum, `maxlength`.\n * This message is displayed visually and through assistive technologies. The\n * component will replace the `%{count}` placeholder with the number of\n * remaining characters. This is a [pluralised list of\n * messages](https://frontend.design-system.service.gov.uk/localise-govuk-frontend).\n * @property {TranslationPluralForms} [wordsUnderLimit] - Message displayed when\n * the number of words is under the configured maximum, `maxlength`. This\n * message is displayed visually and through assistive technologies. The\n * component will replace the `%{count}` placeholder with the number of\n * remaining words. This is a [pluralised list of\n * messages](https://frontend.design-system.service.gov.uk/localise-govuk-frontend).\n * @property {string} [wordsAtLimit] - Message displayed when the number of\n * words reaches the configured maximum, `maxlength`. This message is\n * displayed visually and through assistive technologies.\n * @property {TranslationPluralForms} [wordsOverLimit] - Message displayed when\n * the number of words is over the configured maximum, `maxlength`. This\n * message is displayed visually and through assistive technologies. The\n * component will replace the `%{count}` placeholder with the number of\n * remaining words. This is a [pluralised list of\n * messages](https://frontend.design-system.service.gov.uk/localise-govuk-frontend).\n * @property {TranslationPluralForms} [textareaDescription] - Message made\n * available to assistive technologies, if none is already present in the\n * HTML, to describe that the component accepts only a limited amount of\n * content. It is visible on the page when JavaScript is unavailable. The\n * component will replace the `%{count}` placeholder with the value of the\n * `maxlength` or `maxwords` parameter.\n */\n\n/**\n * @import { Schema } from '../../common/configuration.mjs'\n * @import { TranslationPluralForms } from '../../i18n.mjs'\n */\nCharacterCount.moduleName = 'govuk-character-count';\nCharacterCount.defaults = Object.freeze({\n threshold: 0,\n i18n: {\n charactersUnderLimit: {\n one: 'You have %{count} character remaining',\n other: 'You have %{count} characters remaining'\n },\n charactersAtLimit: 'You have 0 characters remaining',\n charactersOverLimit: {\n one: 'You have %{count} character too many',\n other: 'You have %{count} characters too many'\n },\n wordsUnderLimit: {\n one: 'You have %{count} word remaining',\n other: 'You have %{count} words remaining'\n },\n wordsAtLimit: 'You have 0 words remaining',\n wordsOverLimit: {\n one: 'You have %{count} word too many',\n other: 'You have %{count} words too many'\n },\n textareaDescription: {\n other: ''\n }\n }\n});\nCharacterCount.schema = Object.freeze({\n properties: {\n i18n: {\n type: 'object'\n },\n maxwords: {\n type: 'number'\n },\n maxlength: {\n type: 'number'\n },\n threshold: {\n type: 'number'\n }\n },\n anyOf: [{\n required: ['maxwords'],\n errorMessage: 'Either \"maxlength\" or \"maxwords\" must be provided'\n }, {\n required: ['maxlength'],\n errorMessage: 'Either \"maxlength\" or \"maxwords\" must be provided'\n }]\n});\n\nexport { CharacterCount };\n//# sourceMappingURL=character-count.mjs.map\n","import { Component } from '../../component.mjs';\nimport { ElementError } from '../../errors/index.mjs';\n\n/**\n * Checkboxes component\n *\n * @preserve\n */\nclass Checkboxes extends Component {\n /**\n * Checkboxes can be associated with a 'conditionally revealed' content block\n * – for example, a checkbox for 'Phone' could reveal an additional form field\n * for the user to enter their phone number.\n *\n * These associations are made using a `data-aria-controls` attribute, which\n * is promoted to an aria-controls attribute during initialisation.\n *\n * We also need to restore the state of any conditional reveals on the page\n * (for example if the user has navigated back), and set up event handlers to\n * keep the reveal in sync with the checkbox state.\n *\n * @param {Element | null} $root - HTML element to use for checkboxes\n */\n constructor($root) {\n super($root);\n this.$inputs = void 0;\n const $inputs = this.$root.querySelectorAll('input[type=\"checkbox\"]');\n if (!$inputs.length) {\n throw new ElementError({\n component: Checkboxes,\n identifier: 'Form inputs (`<input type=\"checkbox\">`)'\n });\n }\n this.$inputs = $inputs;\n this.$inputs.forEach($input => {\n const targetId = $input.getAttribute('data-aria-controls');\n if (!targetId) {\n return;\n }\n if (!document.getElementById(targetId)) {\n throw new ElementError({\n component: Checkboxes,\n identifier: `Conditional reveal (\\`id=\"${targetId}\"\\`)`\n });\n }\n $input.setAttribute('aria-controls', targetId);\n $input.removeAttribute('data-aria-controls');\n });\n window.addEventListener('pageshow', () => this.syncAllConditionalReveals());\n this.syncAllConditionalReveals();\n this.$root.addEventListener('click', event => this.handleClick(event));\n }\n syncAllConditionalReveals() {\n this.$inputs.forEach($input => this.syncConditionalRevealWithInputState($input));\n }\n syncConditionalRevealWithInputState($input) {\n const targetId = $input.getAttribute('aria-controls');\n if (!targetId) {\n return;\n }\n const $target = document.getElementById(targetId);\n if ($target != null && $target.classList.contains('govuk-checkboxes__conditional')) {\n const inputIsChecked = $input.checked;\n $input.setAttribute('aria-expanded', inputIsChecked.toString());\n $target.classList.toggle('govuk-checkboxes__conditional--hidden', !inputIsChecked);\n }\n }\n unCheckAllInputsExcept($input) {\n const allInputsWithSameName = document.querySelectorAll(`input[type=\"checkbox\"][name=\"${$input.name}\"]`);\n allInputsWithSameName.forEach($inputWithSameName => {\n const hasSameFormOwner = $input.form === $inputWithSameName.form;\n if (hasSameFormOwner && $inputWithSameName !== $input) {\n $inputWithSameName.checked = false;\n this.syncConditionalRevealWithInputState($inputWithSameName);\n }\n });\n }\n unCheckExclusiveInputs($input) {\n const allInputsWithSameNameAndExclusiveBehaviour = document.querySelectorAll(`input[data-behaviour=\"exclusive\"][type=\"checkbox\"][name=\"${$input.name}\"]`);\n allInputsWithSameNameAndExclusiveBehaviour.forEach($exclusiveInput => {\n const hasSameFormOwner = $input.form === $exclusiveInput.form;\n if (hasSameFormOwner) {\n $exclusiveInput.checked = false;\n this.syncConditionalRevealWithInputState($exclusiveInput);\n }\n });\n }\n handleClick(event) {\n const $clickedInput = event.target;\n if (!($clickedInput instanceof HTMLInputElement) || $clickedInput.type !== 'checkbox') {\n return;\n }\n const hasAriaControls = $clickedInput.getAttribute('aria-controls');\n if (hasAriaControls) {\n this.syncConditionalRevealWithInputState($clickedInput);\n }\n if (!$clickedInput.checked) {\n return;\n }\n const hasBehaviourExclusive = $clickedInput.getAttribute('data-behaviour') === 'exclusive';\n if (hasBehaviourExclusive) {\n this.unCheckAllInputsExcept($clickedInput);\n } else {\n this.unCheckExclusiveInputs($clickedInput);\n }\n }\n}\nCheckboxes.moduleName = 'govuk-checkboxes';\n\nexport { Checkboxes };\n//# sourceMappingURL=checkboxes.mjs.map\n","import { ConfigurableComponent } from '../../common/configuration.mjs';\nimport { setFocus, getFragmentFromUrl } from '../../common/index.mjs';\n\n/**\n * Error summary component\n *\n * Takes focus on initialisation for accessible announcement, unless disabled in\n * configuration.\n *\n * @preserve\n * @augments ConfigurableComponent<ErrorSummaryConfig>\n */\nclass ErrorSummary extends ConfigurableComponent {\n /**\n * @param {Element | null} $root - HTML element to use for error summary\n * @param {ErrorSummaryConfig} [config] - Error summary config\n */\n constructor($root, config = {}) {\n super($root, config);\n if (!this.config.disableAutoFocus) {\n setFocus(this.$root);\n }\n this.$root.addEventListener('click', event => this.handleClick(event));\n }\n handleClick(event) {\n const $target = event.target;\n if ($target && this.focusTarget($target)) {\n event.preventDefault();\n }\n }\n focusTarget($target) {\n if (!($target instanceof HTMLAnchorElement)) {\n return false;\n }\n const inputId = getFragmentFromUrl($target.href);\n if (!inputId) {\n return false;\n }\n const $input = document.getElementById(inputId);\n if (!$input) {\n return false;\n }\n const $legendOrLabel = this.getAssociatedLegendOrLabel($input);\n if (!$legendOrLabel) {\n return false;\n }\n $legendOrLabel.scrollIntoView();\n $input.focus({\n preventScroll: true\n });\n return true;\n }\n getAssociatedLegendOrLabel($input) {\n var _document$querySelect;\n const $fieldset = $input.closest('fieldset');\n if ($fieldset) {\n const $legends = $fieldset.getElementsByTagName('legend');\n if ($legends.length) {\n const $candidateLegend = $legends[0];\n if ($input instanceof HTMLInputElement && ($input.type === 'checkbox' || $input.type === 'radio')) {\n return $candidateLegend;\n }\n const legendTop = $candidateLegend.getBoundingClientRect().top;\n const inputRect = $input.getBoundingClientRect();\n if (inputRect.height && window.innerHeight) {\n const inputBottom = inputRect.top + inputRect.height;\n if (inputBottom - legendTop < window.innerHeight / 2) {\n return $candidateLegend;\n }\n }\n }\n }\n return (_document$querySelect = document.querySelector(`label[for='${$input.getAttribute('id')}']`)) != null ? _document$querySelect : $input.closest('label');\n }\n}\n\n/**\n * Error summary config\n *\n * @typedef {object} ErrorSummaryConfig\n * @property {boolean} [disableAutoFocus=false] - If set to `true` the error\n * summary will not be focussed when the page loads.\n */\n\n/**\n * @import { Schema } from '../../common/configuration.mjs'\n */\nErrorSummary.moduleName = 'govuk-error-summary';\nErrorSummary.defaults = Object.freeze({\n disableAutoFocus: false\n});\nErrorSummary.schema = Object.freeze({\n properties: {\n disableAutoFocus: {\n type: 'boolean'\n }\n }\n});\n\nexport { ErrorSummary };\n//# sourceMappingURL=error-summary.mjs.map\n","import { closestAttributeValue } from '../../common/closest-attribute-value.mjs';\nimport { ConfigurableComponent } from '../../common/configuration.mjs';\nimport { formatErrorMessage } from '../../common/index.mjs';\nimport { ElementError } from '../../errors/index.mjs';\nimport { I18n } from '../../i18n.mjs';\n\n/**\n * File upload component\n *\n * @preserve\n * @augments ConfigurableComponent<FileUploadConfig>\n */\nclass FileUpload extends ConfigurableComponent {\n /**\n * @param {Element | null} $root - File input element\n * @param {FileUploadConfig} [config] - File Upload config\n */\n constructor($root, config = {}) {\n super($root, config);\n this.$input = void 0;\n this.$button = void 0;\n this.$status = void 0;\n this.i18n = void 0;\n this.id = void 0;\n this.$announcements = void 0;\n this.enteredAnotherElement = void 0;\n const $input = this.$root.querySelector('input');\n if ($input === null) {\n throw new ElementError({\n component: FileUpload,\n identifier: 'File inputs (`<input type=\"file\">`)'\n });\n }\n if ($input.type !== 'file') {\n throw new ElementError(formatErrorMessage(FileUpload, 'File input (`<input type=\"file\">`) attribute (`type`) is not `file`'));\n }\n this.$input = $input;\n this.$input.setAttribute('hidden', 'true');\n if (!this.$input.id) {\n throw new ElementError({\n component: FileUpload,\n identifier: 'File input (`<input type=\"file\">`) attribute (`id`)'\n });\n }\n this.id = this.$input.id;\n this.i18n = new I18n(this.config.i18n, {\n locale: closestAttributeValue(this.$root, 'lang')\n });\n const $label = this.findLabel();\n if (!$label.id) {\n $label.id = `${this.id}-label`;\n }\n this.$input.id = `${this.id}-input`;\n const $button = document.createElement('button');\n $button.classList.add('govuk-file-upload-button');\n $button.type = 'button';\n $button.id = this.id;\n $button.classList.add('govuk-file-upload-button--empty');\n const ariaDescribedBy = this.$input.getAttribute('aria-describedby');\n if (ariaDescribedBy) {\n $button.setAttribute('aria-describedby', ariaDescribedBy);\n }\n const $status = document.createElement('span');\n $status.className = 'govuk-body govuk-file-upload-button__status';\n $status.setAttribute('aria-live', 'polite');\n $status.innerText = this.i18n.t('noFileChosen');\n $button.appendChild($status);\n const commaSpan = document.createElement('span');\n commaSpan.className = 'govuk-visually-hidden';\n commaSpan.innerText = ', ';\n commaSpan.id = `${this.id}-comma`;\n $button.appendChild(commaSpan);\n const containerSpan = document.createElement('span');\n containerSpan.className = 'govuk-file-upload-button__pseudo-button-container';\n const buttonSpan = document.createElement('span');\n buttonSpan.className = 'govuk-button govuk-button--secondary govuk-file-upload-button__pseudo-button';\n buttonSpan.innerText = this.i18n.t('chooseFilesButton');\n containerSpan.appendChild(buttonSpan);\n containerSpan.insertAdjacentText('beforeend', ' ');\n const instructionSpan = document.createElement('span');\n instructionSpan.className = 'govuk-body govuk-file-upload-button__instruction';\n instructionSpan.innerText = this.i18n.t('dropInstruction');\n containerSpan.appendChild(instructionSpan);\n $button.appendChild(containerSpan);\n $button.setAttribute('aria-labelledby', `${$label.id} ${commaSpan.id} ${$button.id}`);\n $button.addEventListener('click', this.onClick.bind(this));\n $button.addEventListener('dragover', event => {\n event.preventDefault();\n });\n this.$root.insertAdjacentElement('afterbegin', $button);\n this.$input.setAttribute('tabindex', '-1');\n this.$input.setAttribute('aria-hidden', 'true');\n this.$button = $button;\n this.$status = $status;\n this.$input.addEventListener('change', this.onChange.bind(this));\n this.updateDisabledState();\n this.observeDisabledState();\n this.$announcements = document.createElement('span');\n this.$announcements.classList.add('govuk-file-upload-announcements');\n this.$announcements.classList.add('govuk-visually-hidden');\n this.$announcements.setAttribute('aria-live', 'assertive');\n this.$root.insertAdjacentElement('afterend', this.$announcements);\n this.$button.addEventListener('drop', this.onDrop.bind(this));\n document.addEventListener('dragenter', this.updateDropzoneVisibility.bind(this));\n document.addEventListener('dragenter', () => {\n this.enteredAnotherElement = true;\n });\n document.addEventListener('dragleave', () => {\n if (!this.enteredAnotherElement && !this.$button.disabled) {\n this.hideDraggingState();\n this.$announcements.innerText = this.i18n.t('leftDropZone');\n }\n this.enteredAnotherElement = false;\n });\n }\n updateDropzoneVisibility(event) {\n if (this.$button.disabled) return;\n if (event.target instanceof Node) {\n if (this.$root.contains(event.target)) {\n if (event.dataTransfer && isContainingFiles(event.dataTransfer)) {\n if (!this.$button.classList.contains('govuk-file-upload-button--dragging')) {\n this.showDraggingState();\n this.$announcements.innerText = this.i18n.t('enteredDropZone');\n }\n }\n } else {\n if (this.$button.classList.contains('govuk-file-upload-button--dragging')) {\n this.hideDraggingState();\n this.$announcements.innerText = this.i18n.t('leftDropZone');\n }\n }\n }\n }\n showDraggingState() {\n this.$button.classList.add('govuk-file-upload-button--dragging');\n }\n hideDraggingState() {\n this.$button.classList.remove('govuk-file-upload-button--dragging');\n }\n onDrop(event) {\n event.preventDefault();\n if (event.dataTransfer && isContainingFiles(event.dataTransfer)) {\n this.$input.files = event.dataTransfer.files;\n this.$input.dispatchEvent(new CustomEvent('change'));\n this.hideDraggingState();\n }\n }\n onChange() {\n const fileCount = this.$input.files.length;\n if (fileCount === 0) {\n this.$status.innerText = this.i18n.t('noFileChosen');\n this.$button.classList.add('govuk-file-upload-button--empty');\n } else {\n if (fileCount === 1) {\n this.$status.innerText = this.$input.files[0].name;\n } else {\n this.$status.innerText = this.i18n.t('multipleFilesChosen', {\n count: fileCount\n });\n }\n this.$button.classList.remove('govuk-file-upload-button--empty');\n }\n }\n findLabel() {\n const $label = document.querySelector(`label[for=\"${this.$input.id}\"]`);\n if (!$label) {\n throw new ElementError({\n component: FileUpload,\n identifier: `Field label (\\`<label for=${this.$input.id}>\\`)`\n });\n }\n return $label;\n }\n onClick() {\n this.$input.click();\n }\n observeDisabledState() {\n const observer = new MutationObserver(mutationList => {\n for (const mutation of mutationList) {\n if (mutation.type === 'attributes' && mutation.attributeName === 'disabled') {\n this.updateDisabledState();\n }\n }\n });\n observer.observe(this.$input, {\n attributes: true\n });\n }\n updateDisabledState() {\n this.$button.disabled = this.$input.disabled;\n this.$root.classList.toggle('govuk-drop-zone--disabled', this.$button.disabled);\n }\n}\nFileUpload.moduleName = 'govuk-file-upload';\nFileUpload.defaults = Object.freeze({\n i18n: {\n chooseFilesButton: 'Choose file',\n dropInstruction: 'or drop file',\n noFileChosen: 'No file chosen',\n multipleFilesChosen: {\n one: '%{count} file chosen',\n other: '%{count} files chosen'\n },\n enteredDropZone: 'Entered drop zone',\n leftDropZone: 'Left drop zone'\n }\n});\nFileUpload.schema = Object.freeze({\n properties: {\n i18n: {\n type: 'object'\n }\n }\n});\nfunction isContainingFiles(dataTransfer) {\n const hasNoTypesInfo = dataTransfer.types.length === 0;\n const isDraggingFiles = dataTransfer.types.some(type => type === 'Files');\n return hasNoTypesInfo || isDraggingFiles;\n}\n\n/**\n * @typedef {HTMLInputElement & {files: FileList}} HTMLFileInputElement\n */\n\n/**\n * File upload config\n *\n * @see {@link FileUpload.defaults}\n * @typedef {object} FileUploadConfig\n * @property {FileUploadTranslations} [i18n=FileUpload.defaults.i18n] - File upload translations\n */\n\n/**\n * File upload translations\n *\n * @see {@link FileUpload.defaults.i18n}\n * @typedef {object} FileUploadTranslations\n *\n * Messages used by the component\n * @property {string} [chooseFile] - The text of the button that opens the file picker\n * @property {string} [dropInstruction] - The text informing users they can drop files\n * @property {TranslationPluralForms} [multipleFilesChosen] - The text displayed when multiple files\n * have been chosen by the user\n * @property {string} [noFileChosen] - The text to displayed when no file has been chosen by the user\n * @property {string} [enteredDropZone] - The text announced by assistive technology\n * when user drags files and enters the drop zone\n * @property {string} [leftDropZone] - The text announced by assistive technology\n * when user drags files and leaves the drop zone without dropping\n */\n\n/**\n * @import { Schema } from '../../common/configuration.mjs'\n * @import { TranslationPluralForms } from '../../i18n.mjs'\n */\n\nexport { FileUpload };\n//# sourceMappingURL=file-upload.mjs.map\n","import { closestAttributeValue } from '../../common/closest-attribute-value.mjs';\nimport { ConfigurableComponent } from '../../common/configuration.mjs';\nimport { ElementError } from '../../errors/index.mjs';\nimport { I18n } from '../../i18n.mjs';\n\n/**\n * Password input component\n *\n * @preserve\n * @augments ConfigurableComponent<PasswordInputConfig>\n */\nclass PasswordInput extends ConfigurableComponent {\n /**\n * @param {Element | null} $root - HTML element to use for password input\n * @param {PasswordInputConfig} [config] - Password input config\n */\n constructor($root, config = {}) {\n super($root, config);\n this.i18n = void 0;\n this.$input = void 0;\n this.$showHideButton = void 0;\n this.$screenReaderStatusMessage = void 0;\n const $input = this.$root.querySelector('.govuk-js-password-input-input');\n if (!($input instanceof HTMLInputElement)) {\n throw new ElementError({\n component: PasswordInput,\n element: $input,\n expectedType: 'HTMLInputElement',\n identifier: 'Form field (`.govuk-js-password-input-input`)'\n });\n }\n if ($input.type !== 'password') {\n throw new ElementError('Password input: Form field (`.govuk-js-password-input-input`) must be of type `password`.');\n }\n const $showHideButton = this.$root.querySelector('.govuk-js-password-input-toggle');\n if (!($showHideButton instanceof HTMLButtonElement)) {\n throw new ElementError({\n component: PasswordInput,\n element: $showHideButton,\n expectedType: 'HTMLButtonElement',\n identifier: 'Button (`.govuk-js-password-input-toggle`)'\n });\n }\n if ($showHideButton.type !== 'button') {\n throw new ElementError('Password input: Button (`.govuk-js-password-input-toggle`) must be of type `button`.');\n }\n this.$input = $input;\n this.$showHideButton = $showHideButton;\n this.i18n = new I18n(this.config.i18n, {\n locale: closestAttributeValue(this.$root, 'lang')\n });\n this.$showHideButton.removeAttribute('hidden');\n const $screenReaderStatusMessage = document.createElement('div');\n $screenReaderStatusMessage.className = 'govuk-password-input__sr-status govuk-visually-hidden';\n $screenReaderStatusMessage.setAttribute('aria-live', 'polite');\n this.$screenReaderStatusMessage = $screenReaderStatusMessage;\n this.$input.insertAdjacentElement('afterend', $screenReaderStatusMessage);\n this.$showHideButton.addEventListener('click', this.toggle.bind(this));\n if (this.$input.form) {\n this.$input.form.addEventListener('submit', () => this.hide());\n }\n window.addEventListener('pageshow', event => {\n if (event.persisted && this.$input.type !== 'password') {\n this.hide();\n }\n });\n this.hide();\n }\n toggle(event) {\n event.preventDefault();\n if (this.$input.type === 'password') {\n this.show();\n return;\n }\n this.hide();\n }\n show() {\n this.setType('text');\n }\n hide() {\n this.setType('password');\n }\n setType(type) {\n if (type === this.$input.type) {\n return;\n }\n this.$input.setAttribute('type', type);\n const isHidden = type === 'password';\n const prefixButton = isHidden ? 'show' : 'hide';\n const prefixStatus = isHidden ? 'passwordHidden' : 'passwordShown';\n this.$showHideButton.innerText = this.i18n.t(`${prefixButton}Password`);\n this.$showHideButton.setAttribute('aria-label', this.i18n.t(`${prefixButton}PasswordAriaLabel`));\n this.$screenReaderStatusMessage.innerText = this.i18n.t(`${prefixStatus}Announcement`);\n }\n}\n\n/**\n * Password input config\n *\n * @typedef {object} PasswordInputConfig\n * @property {PasswordInputTranslations} [i18n=PasswordInput.defaults.i18n] - Password input translations\n */\n\n/**\n * Password input translations\n *\n * @see {@link PasswordInput.defaults.i18n}\n * @typedef {object} PasswordInputTranslations\n *\n * Messages displayed to the user indicating the state of the show/hide toggle.\n * @property {string} [showPassword] - Visible text of the button when the\n * password is currently hidden. Plain text only.\n * @property {string} [hidePassword] - Visible text of the button when the\n * password is currently visible. Plain text only.\n * @property {string} [showPasswordAriaLabel] - aria-label of the button when\n * the password is currently hidden. Plain text only.\n * @property {string} [hidePasswordAriaLabel] - aria-label of the button when\n * the password is currently visible. Plain text only.\n * @property {string} [passwordShownAnnouncement] - Screen reader\n * announcement to make when the password has just become visible.\n * Plain text only.\n * @property {string} [passwordHiddenAnnouncement] - Screen reader\n * announcement to make when the password has just been hidden.\n * Plain text only.\n */\n\n/**\n * @import { Schema } from '../../common/configuration.mjs'\n */\nPasswordInput.moduleName = 'govuk-password-input';\nPasswordInput.defaults = Object.freeze({\n i18n: {\n showPassword: 'Show',\n hidePassword: 'Hide',\n showPasswordAriaLabel: 'Show password',\n hidePasswordAriaLabel: 'Hide password',\n passwordShownAnnouncement: 'Your password is visible',\n passwordHiddenAnnouncement: 'Your password is hidden'\n }\n});\nPasswordInput.schema = Object.freeze({\n properties: {\n i18n: {\n type: 'object'\n }\n }\n});\n\nexport { PasswordInput };\n//# sourceMappingURL=password-input.mjs.map\n","import { Component } from '../../component.mjs';\nimport { ElementError } from '../../errors/index.mjs';\n\n/**\n * Radios component\n *\n * @preserve\n */\nclass Radios extends Component {\n /**\n * Radios can be associated with a 'conditionally revealed' content block –\n * for example, a radio for 'Phone' could reveal an additional form field for\n * the user to enter their phone number.\n *\n * These associations are made using a `data-aria-controls` attribute, which\n * is promoted to an aria-controls attribute during initialisation.\n *\n * We also need to restore the state of any conditional reveals on the page\n * (for example if the user has navigated back), and set up event handlers to\n * keep the reveal in sync with the radio state.\n *\n * @param {Element | null} $root - HTML element to use for radios\n */\n constructor($root) {\n super($root);\n this.$inputs = void 0;\n const $inputs = this.$root.querySelectorAll('input[type=\"radio\"]');\n if (!$inputs.length) {\n throw new ElementError({\n component: Radios,\n identifier: 'Form inputs (`<input type=\"radio\">`)'\n });\n }\n this.$inputs = $inputs;\n this.$inputs.forEach($input => {\n const targetId = $input.getAttribute('data-aria-controls');\n if (!targetId) {\n return;\n }\n if (!document.getElementById(targetId)) {\n throw new ElementError({\n component: Radios,\n identifier: `Conditional reveal (\\`id=\"${targetId}\"\\`)`\n });\n }\n $input.setAttribute('aria-controls', targetId);\n $input.removeAttribute('data-aria-controls');\n });\n window.addEventListener('pageshow', () => this.syncAllConditionalReveals());\n this.syncAllConditionalReveals();\n this.$root.addEventListener('click', event => this.handleClick(event));\n }\n syncAllConditionalReveals() {\n this.$inputs.forEach($input => this.syncConditionalRevealWithInputState($input));\n }\n syncConditionalRevealWithInputState($input) {\n const targetId = $input.getAttribute('aria-controls');\n if (!targetId) {\n return;\n }\n const $target = document.getElementById(targetId);\n if ($target != null && $target.classList.contains('govuk-radios__conditional')) {\n const inputIsChecked = $input.checked;\n $input.setAttribute('aria-expanded', inputIsChecked.toString());\n $target.classList.toggle('govuk-radios__conditional--hidden', !inputIsChecked);\n }\n }\n handleClick(event) {\n const $clickedInput = event.target;\n if (!($clickedInput instanceof HTMLInputElement) || $clickedInput.type !== 'radio') {\n return;\n }\n const $allInputs = document.querySelectorAll('input[type=\"radio\"][aria-controls]');\n const $clickedInputForm = $clickedInput.form;\n const $clickedInputName = $clickedInput.name;\n $allInputs.forEach($input => {\n const hasSameFormOwner = $input.form === $clickedInputForm;\n const hasSameName = $input.name === $clickedInputName;\n if (hasSameName && hasSameFormOwner) {\n this.syncConditionalRevealWithInputState($input);\n }\n });\n }\n}\nRadios.moduleName = 'govuk-radios';\n\nexport { Radios };\n//# sourceMappingURL=radios.mjs.map\n","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class FileFieldController extends Controller {\n static targets = [\"preview\", \"destroy\"];\n static values = {\n mimeTypes: Array,\n };\n\n connect() {\n this.counter = 0;\n this.initialPreviewContent = null;\n this.onUploadFlag = false;\n }\n\n onUpload(event) {\n this.onUploadFlag = true;\n\n // Set the file to be destroyed only if it is already persisted\n if (this.hasDestroyTarget) {\n this.destroyTarget.value = false;\n }\n this.previewTarget.removeAttribute(\"hidden\");\n\n // Show preview only if a file has been selected in the file picker popup. If cancelled, show previous file or do\n // not show preview at all\n if (this.hasPreviewTarget) {\n if (event.currentTarget.files.length > 0) {\n this.showPreview(event.currentTarget.files[0]);\n } else {\n this.setPreviewContent(this.initialPreviewContent);\n }\n }\n }\n\n setDestroy(event) {\n event.preventDefault();\n\n // If the data is already persisted and another image has been picked from the file picker popup, but the new image\n // is removed, show the original image\n if (this.initialPreviewContent && this.onUploadFlag) {\n this.onUploadFlag = false;\n this.setPreviewContent(this.initialPreviewContent);\n } else {\n // Set image to be destroyed, hide preview and remove image url\n if (this.hasDestroyTarget) {\n this.destroyTarget.value = true;\n }\n if (this.hasPreviewTarget) {\n this.previewTarget.setAttribute(\"hidden\", \"\");\n this.setPreviewContent(\"\");\n }\n if (this.previousInput) {\n this.previousInput.toggleAttribute(\"disabled\", true);\n }\n }\n\n this.fileInput.value = \"\";\n }\n\n setPreviewContent(content) {\n if (this.filenameTag) {\n this.filenameTag.innerText = text;\n }\n }\n\n drop(event) {\n event.preventDefault();\n\n const file = this.fileForEvent(event, this.mimeTypesValue);\n if (file) {\n const dT = new DataTransfer();\n dT.items.add(file);\n this.fileInput.files = dT.files;\n this.fileInput.dispatchEvent(new Event(\"change\"));\n }\n\n this.counter = 0;\n this.element.classList.remove(\"droppable\");\n }\n\n dragover(event) {\n event.preventDefault();\n }\n\n dragenter(event) {\n event.preventDefault();\n\n if (this.counter === 0) {\n this.element.classList.add(\"droppable\");\n }\n this.counter++;\n }\n\n dragleave(event) {\n event.preventDefault();\n\n this.counter--;\n if (this.counter === 0) {\n this.element.classList.remove(\"droppable\");\n }\n }\n\n get fileInput() {\n return this.element.querySelector(\"input[type='file']\");\n }\n\n get previousInput() {\n return this.element.querySelector(\n `input[type='hidden'][name='${this.fileInput.name}']`,\n );\n }\n\n get filenameTag() {\n if (!this.hasPreviewTarget) return null;\n\n return this.previewTarget.querySelector(\"p.preview-filename\");\n }\n\n showPreview(file) {\n const reader = new FileReader();\n\n reader.onload = (e) => {\n if (this.filenameTag) {\n this.filenameTag.innerText = file.name;\n }\n };\n reader.readAsDataURL(file);\n }\n\n /**\n * Given a drop event, find the first acceptable file.\n * @param event {DropEvent}\n * @param mimeTypes {String[]}\n * @returns {File}\n */\n fileForEvent(event, mimeTypes) {\n const accept = (file) => mimeTypes.indexOf(file.type) > -1;\n\n let file;\n\n if (event.dataTransfer.items) {\n const item = [...event.dataTransfer.items].find(accept);\n if (item) {\n file = item.getAsFile();\n }\n } else {\n file = [...event.dataTransfer.files].find(accept);\n }\n\n return file;\n }\n}\n","import DocumentFieldController from \"./document_field_controller\";\nimport ImageFieldController from \"./image_field_controller\";\n\nconst Definitions = [\n {\n identifier: \"govuk-document-field\",\n controllerConstructor: DocumentFieldController,\n },\n {\n identifier: \"govuk-image-field\",\n controllerConstructor: ImageFieldController,\n },\n];\n\nexport { Definitions as default };\n","import FileFieldController from \"./file_field_controller\";\n\nexport default class DocumentFieldController extends FileFieldController {\n connect() {\n super.connect();\n\n this.initialPreviewContent = this.filenameTag.text;\n }\n\n setPreviewContent(content) {\n this.filenameTag.innerText = content;\n }\n\n showPreview(file) {\n const reader = new FileReader();\n\n reader.onload = (e) => {\n if (this.filenameTag) {\n this.filenameTag.innerText = file.name;\n }\n };\n reader.readAsDataURL(file);\n }\n\n get filenameTag() {\n return this.previewTarget.querySelector(\"p.preview-filename\");\n }\n}\n","import FileFieldController from \"./file_field_controller\";\n\nexport default class ImageFieldController extends FileFieldController {\n connect() {\n super.connect();\n\n this.initialPreviewContent = this.imageTag.getAttribute(\"src\");\n }\n\n setPreviewContent(content) {\n this.imageTag.src = content;\n }\n\n showPreview(file) {\n const reader = new FileReader();\n\n reader.onload = (e) => {\n this.imageTag.src = e.target.result;\n };\n reader.readAsDataURL(file);\n }\n\n get imageTag() {\n return this.previewTarget.querySelector(\"img\");\n }\n}\n","import {\n Button,\n CharacterCount,\n Checkboxes,\n ErrorSummary,\n FileUpload,\n PasswordInput,\n Radios,\n} from \"govuk-frontend/dist/govuk/all.mjs\";\nimport { SupportError } from \"govuk-frontend/dist/govuk/errors/index.mjs\";\nimport { isSupported } from \"govuk-frontend/dist/govuk/common/index.mjs\";\n\nfunction initAll(config) {\n let _config$scope;\n config = typeof config !== \"undefined\" ? config : {};\n if (!isSupported()) {\n console.log(new SupportError());\n return;\n }\n const components = [\n [Button, config.button],\n [CharacterCount, config.characterCount],\n [Checkboxes],\n [ErrorSummary, config.errorSummary],\n [FileUpload, config.fileUpload],\n [Radios],\n [PasswordInput, config.passwordInput],\n ];\n const $scope =\n (_config$scope = config.scope) != null ? _config$scope : document;\n components.forEach(([Component, config]) => {\n const $elements = $scope.querySelectorAll(\n `[data-module=\"${Component.moduleName}\"]`,\n );\n $elements.forEach(($element) => {\n try {\n \"defaults\" in Component\n ? new Component($element, config)\n : new Component($element);\n } catch (error) {\n console.log(error);\n }\n });\n });\n}\n\n// stimulus controllers\nimport controllers from \"./controllers\";\n\nexport {\n controllers as default,\n initAll,\n Button,\n CharacterCount,\n Checkboxes,\n ErrorSummary,\n PasswordInput,\n Radios,\n};\n"],"names":["isSupported","$scope","document","body","classList","contains","isObject","option","Array","isArray","formatErrorMessage","Component","message","moduleName","GOVUKFrontendError","Error","constructor","args","super","this","name","SupportError","supportMessage","HTMLScriptElement","prototype","ConfigError","ElementError","messageOrOptions","component","identifier","element","expectedType","InitError","componentOrMessage","$root","_$root","childConstructor","elementType","checkSupport","checkInitialised","setAttribute","HTMLElement","hasAttribute","isInitialised","configOverride","Symbol","for","ConfigurableComponent","param","config","_config","defaults","datasetConfig","dataset","schema","out","entries","Object","properties","entry","namespace","property","field","toString","normaliseString","type","extractConfigByNamespace","normaliseDataset","mergeConfigs","value","trimmedValue","trim","output","outputType","includes","length","isFinite","Number","configObjects","formattedConfigObject","configObject","key","keys","override","newObject","current","keyParts","split","index","I18n","translations","_config$locale","locale","documentElement","lang","t","lookupKey","options","translation","count","translationPluralForm","getPluralSuffix","match","replacePlaceholders","translationString","formatter","Intl","NumberFormat","supportedLocalesOf","undefined","replace","placeholderWithBraces","placeholderKey","hasOwnProperty","call","placeholderValue","format","hasIntlPluralRulesSupport","Boolean","window","PluralRules","preferredForm","select","selectPluralFormUsingFallbackRules","console","warn","Math","abs","floor","ruleset","getPluralRulesForLocale","pluralRules","localeShort","pluralRule","pluralRulesMap","languages","arabic","chinese","french","german","irish","russian","scottish","spanish","welsh","n","lastTwo","last","Button","debounceFormSubmitTimer","addEventListener","event","handleKeyDown","debounce","$target","target","getAttribute","preventDefault","click","preventDoubleClick","setTimeout","DEBOUNCE_TIMEOUT_IN_SECONDS","closestAttributeValue","$element","attributeName","$closestElementWithAttribute","closest","freeze","CharacterCount","configOverrides","maxlength","maxwords","_ref","_this$config$maxwords","$textarea","$visibleCountMessage","$screenReaderCountMessage","lastInputTimestamp","lastInputValue","valueChecker","i18n","maxLength","querySelector","HTMLTextAreaElement","HTMLInputElement","errors","validationErrors","conditions","required","errorMessage","every","push","validateConfig","Infinity","textareaDescriptionId","id","$textareaDescription","getElementById","$errorMessage","textContent","insertAdjacentElement","createElement","className","add","removeAttribute","bindChangeEvents","updateCountMessage","handleKeyUp","handleFocus","handleBlur","updateVisibleCountMessage","Date","now","setInterval","updateIfValueChanged","clearInterval","updateScreenReaderCountMessage","isError","toggle","isOverThreshold","getCountMessage","text","_text$match","remainingNumber","countType","formatCountMessage","translationKeySuffix","threshold","currentLength","charactersUnderLimit","one","other","charactersAtLimit","charactersOverLimit","wordsUnderLimit","wordsAtLimit","wordsOverLimit","textareaDescription","anyOf","Checkboxes","$inputs","querySelectorAll","forEach","$input","targetId","syncAllConditionalReveals","handleClick","syncConditionalRevealWithInputState","inputIsChecked","checked","unCheckAllInputsExcept","$inputWithSameName","form","unCheckExclusiveInputs","$exclusiveInput","$clickedInput","ErrorSummary","disableAutoFocus","_options$onBeforeFocu","isFocusable","onBlur","_options$onBlur","once","onBeforeFocus","focus","setFocus","focusTarget","HTMLAnchorElement","inputId","url","pop","getFragmentFromUrl","href","$legendOrLabel","getAssociatedLegendOrLabel","scrollIntoView","preventScroll","_document$querySelect","$fieldset","$legends","getElementsByTagName","$candidateLegend","legendTop","getBoundingClientRect","top","inputRect","height","innerHeight","FileUpload","$button","$status","$announcements","enteredAnotherElement","$label","findLabel","ariaDescribedBy","innerText","appendChild","commaSpan","containerSpan","buttonSpan","insertAdjacentText","instructionSpan","onClick","bind","onChange","updateDisabledState","observeDisabledState","onDrop","updateDropzoneVisibility","disabled","hideDraggingState","Node","dataTransfer","isContainingFiles","showDraggingState","remove","files","dispatchEvent","CustomEvent","fileCount","MutationObserver","mutationList","mutation","observe","attributes","hasNoTypesInfo","types","isDraggingFiles","some","chooseFilesButton","dropInstruction","noFileChosen","multipleFilesChosen","enteredDropZone","leftDropZone","PasswordInput","$showHideButton","$screenReaderStatusMessage","HTMLButtonElement","hide","persisted","show","setType","isHidden","prefixButton","prefixStatus","showPassword","hidePassword","showPasswordAriaLabel","hidePasswordAriaLabel","passwordShownAnnouncement","passwordHiddenAnnouncement","Radios","$allInputs","$clickedInputForm","$clickedInputName","hasSameFormOwner","FileFieldController","Controller","static","mimeTypes","connect","counter","initialPreviewContent","onUploadFlag","onUpload","hasDestroyTarget","destroyTarget","previewTarget","hasPreviewTarget","currentTarget","showPreview","setPreviewContent","setDestroy","previousInput","toggleAttribute","fileInput","content","filenameTag","drop","file","fileForEvent","mimeTypesValue","dT","DataTransfer","items","Event","dragover","dragenter","dragleave","reader","FileReader","onload","e","readAsDataURL","accept","indexOf","item","find","getAsFile","Definitions","controllerConstructor","imageTag","src","result","initAll","_config$scope","log","components","button","characterCount","errorSummary","fileUpload","passwordInput","scope","error"],"mappings":"gDAmDA,SAASA,EAAYC,EAASC,SAASC,MACrC,QAAKF,GAGEA,EAAOG,UAAUC,SAAS,2BACnC,CAIA,SAASC,EAASC,GAChB,QAASA,GAA4B,iBAAXA,IAJ5B,SAAiBA,GACf,OAAOC,MAAMC,QAAQF,EACvB,CAEoDE,CAAQF,EAC5D,CACA,SAASG,EAAmBC,EAAWC,GACrC,MAAO,GAAGD,EAAUE,eAAeD,GACrC,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O6P,GACPpS,QAAQ4R,IAAIQ,EACd,KAGN","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12]}
1
+ {"version":3,"file":"formbuilder.min.js","sources":["../../../../../node_modules/govuk-frontend/dist/govuk/common/index.mjs","../../../../../node_modules/govuk-frontend/dist/govuk/errors/index.mjs","../../../../../node_modules/govuk-frontend/dist/govuk/component.mjs","../../../../../node_modules/govuk-frontend/dist/govuk/common/configuration.mjs","../../../../../node_modules/govuk-frontend/dist/govuk/i18n.mjs","../../../../../node_modules/govuk-frontend/dist/govuk/components/button/button.mjs","../../../../../node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs","../../../../../node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs","../../../../../node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.mjs","../../../../../node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs","../../../../../node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs","../../../../../node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.mjs","../../../../../node_modules/govuk-frontend/dist/govuk/components/radios/radios.mjs","../../../../javascript/katalyst/govuk/controllers/file_field_controller.js","../../../../javascript/katalyst/govuk/controllers/index.js","../../../../javascript/katalyst/govuk/controllers/document_field_controller.js","../../../../javascript/katalyst/govuk/controllers/image_field_controller.js","../../../../javascript/katalyst/govuk/formbuilder.js"],"sourcesContent":["function getBreakpoint(name) {\n const property = `--govuk-breakpoint-${name}`;\n const value = window.getComputedStyle(document.documentElement).getPropertyValue(property);\n return {\n property,\n value: value || undefined\n };\n}\nfunction setFocus($element, options = {}) {\n var _options$onBeforeFocu;\n const isFocusable = $element.getAttribute('tabindex');\n if (!isFocusable) {\n $element.setAttribute('tabindex', '-1');\n }\n function onFocus() {\n $element.addEventListener('blur', onBlur, {\n once: true\n });\n }\n function onBlur() {\n var _options$onBlur;\n (_options$onBlur = options.onBlur) == null || _options$onBlur.call($element);\n if (!isFocusable) {\n $element.removeAttribute('tabindex');\n }\n }\n $element.addEventListener('focus', onFocus, {\n once: true\n });\n (_options$onBeforeFocu = options.onBeforeFocus) == null || _options$onBeforeFocu.call($element);\n $element.focus();\n}\nfunction isInitialised($root, moduleName) {\n return $root instanceof HTMLElement && $root.hasAttribute(`data-${moduleName}-init`);\n}\n\n/**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * Some browsers will load and run our JavaScript but GOV.UK Frontend\n * won't be supported.\n *\n * @param {HTMLElement | null} [$scope] - (internal) `<body>` HTML element checked for browser support\n * @returns {boolean} Whether GOV.UK Frontend is supported on this page\n */\nfunction isSupported($scope = document.body) {\n if (!$scope) {\n return false;\n }\n return $scope.classList.contains('govuk-frontend-supported');\n}\nfunction isArray(option) {\n return Array.isArray(option);\n}\nfunction isObject(option) {\n return !!option && typeof option === 'object' && !isArray(option);\n}\nfunction isScope($scope) {\n return !!$scope && ($scope instanceof Element || $scope instanceof Document);\n}\nfunction formatErrorMessage(Component, message) {\n return `${Component.moduleName}: ${message}`;\n}\n/**\n * @typedef ComponentWithModuleName\n * @property {string} moduleName - Name of the component\n */\n\nexport { formatErrorMessage, getBreakpoint, isInitialised, isObject, isScope, isSupported, setFocus };\n//# sourceMappingURL=index.mjs.map\n","import { isObject, formatErrorMessage } from '../common/index.mjs';\n\nclass GOVUKFrontendError extends Error {\n constructor(...args) {\n super(...args);\n this.name = 'GOVUKFrontendError';\n }\n}\nclass SupportError extends GOVUKFrontendError {\n /**\n * Checks if GOV.UK Frontend is supported on this page\n *\n * @param {HTMLElement | null} [$scope] - HTML element `<body>` checked for browser support\n */\n constructor($scope = document.body) {\n const supportMessage = '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';\n super($scope ? supportMessage : 'GOV.UK Frontend initialised without `<script type=\"module\">`');\n this.name = 'SupportError';\n }\n}\nclass ConfigError extends GOVUKFrontendError {\n constructor(...args) {\n super(...args);\n this.name = 'ConfigError';\n }\n}\nclass ElementError extends GOVUKFrontendError {\n constructor(messageOrOptions) {\n let message = typeof messageOrOptions === 'string' ? messageOrOptions : '';\n if (isObject(messageOrOptions)) {\n const {\n component,\n identifier,\n element,\n expectedType\n } = messageOrOptions;\n message = identifier;\n message += element ? ` is not of type ${expectedType != null ? expectedType : 'HTMLElement'}` : ' not found';\n if (component) {\n message = formatErrorMessage(component, message);\n }\n }\n super(message);\n this.name = 'ElementError';\n }\n}\nclass InitError extends GOVUKFrontendError {\n constructor(componentOrMessage) {\n const message = typeof componentOrMessage === 'string' ? componentOrMessage : formatErrorMessage(componentOrMessage, `Root element (\\`$root\\`) already initialised`);\n super(message);\n this.name = 'InitError';\n }\n}\n/**\n * @import { ComponentWithModuleName } from '../common/index.mjs'\n */\n\nexport { ConfigError, ElementError, GOVUKFrontendError, InitError, SupportError };\n//# sourceMappingURL=index.mjs.map\n","import { isInitialised, isSupported } from './common/index.mjs';\nimport { InitError, ElementError, SupportError } from './errors/index.mjs';\n\nclass Component {\n /**\n * Returns the root element of the component\n *\n * @protected\n * @returns {RootElementType} - the root element of component\n */\n get $root() {\n return this._$root;\n }\n constructor($root) {\n this._$root = void 0;\n const childConstructor = this.constructor;\n if (typeof childConstructor.moduleName !== 'string') {\n throw new InitError(`\\`moduleName\\` not defined in component`);\n }\n if (!($root instanceof childConstructor.elementType)) {\n throw new ElementError({\n element: $root,\n component: childConstructor,\n identifier: 'Root element (`$root`)',\n expectedType: childConstructor.elementType.name\n });\n } else {\n this._$root = $root;\n }\n childConstructor.checkSupport();\n this.checkInitialised();\n const moduleName = childConstructor.moduleName;\n this.$root.setAttribute(`data-${moduleName}-init`, '');\n }\n checkInitialised() {\n const constructor = this.constructor;\n const moduleName = constructor.moduleName;\n if (moduleName && isInitialised(this.$root, moduleName)) {\n throw new InitError(constructor);\n }\n }\n static checkSupport() {\n if (!isSupported()) {\n throw new SupportError();\n }\n }\n}\n\n/**\n * @typedef ChildClass\n * @property {string} moduleName - The module name that'll be looked for in the DOM when initialising the component\n */\n\n/**\n * @typedef {typeof Component & ChildClass} ChildClassConstructor\n */\nComponent.elementType = HTMLElement;\n\nexport { Component };\n//# sourceMappingURL=component.mjs.map\n","import { Component } from '../component.mjs';\nimport { ConfigError } from '../errors/index.mjs';\nimport { isObject, formatErrorMessage, isScope } from './index.mjs';\n\nconst configOverride = Symbol.for('configOverride');\nclass ConfigurableComponent extends Component {\n [configOverride](param) {\n return {};\n }\n\n /**\n * Returns the root element of the component\n *\n * @protected\n * @returns {ConfigurationType} - the root element of component\n */\n get config() {\n return this._config;\n }\n constructor($root, config) {\n super($root);\n this._config = void 0;\n const childConstructor = this.constructor;\n if (!isObject(childConstructor.defaults)) {\n throw new ConfigError(formatErrorMessage(childConstructor, 'Config passed as parameter into constructor but no defaults defined'));\n }\n const datasetConfig = normaliseDataset(childConstructor, this._$root.dataset);\n this._config = mergeConfigs(childConstructor.defaults, config != null ? config : {}, this[configOverride](datasetConfig), datasetConfig);\n }\n}\nfunction normaliseString(value, property) {\n const trimmedValue = value ? value.trim() : '';\n let output;\n let outputType = property == null ? void 0 : property.type;\n if (!outputType) {\n if (['true', 'false'].includes(trimmedValue)) {\n outputType = 'boolean';\n }\n if (trimmedValue.length > 0 && isFinite(Number(trimmedValue))) {\n outputType = 'number';\n }\n }\n switch (outputType) {\n case 'boolean':\n output = trimmedValue === 'true';\n break;\n case 'number':\n output = Number(trimmedValue);\n break;\n default:\n output = value;\n }\n return output;\n}\nfunction normaliseDataset(Component, dataset) {\n if (!isObject(Component.schema)) {\n throw new ConfigError(formatErrorMessage(Component, 'Config passed as parameter into constructor but no schema defined'));\n }\n const out = {};\n const entries = Object.entries(Component.schema.properties);\n for (const entry of entries) {\n const [namespace, property] = entry;\n const field = namespace.toString();\n if (field in dataset) {\n out[field] = normaliseString(dataset[field], property);\n }\n if ((property == null ? void 0 : property.type) === 'object') {\n out[field] = extractConfigByNamespace(Component.schema, dataset, namespace);\n }\n }\n return out;\n}\nfunction normaliseOptions(scopeOrOptions) {\n let $scope = document;\n let onError;\n if (isObject(scopeOrOptions)) {\n const options = scopeOrOptions;\n if (isScope(options.scope) || options.scope === null) {\n $scope = options.scope;\n }\n if (typeof options.onError === 'function') {\n onError = options.onError;\n }\n }\n if (isScope(scopeOrOptions)) {\n $scope = scopeOrOptions;\n } else if (scopeOrOptions === null) {\n $scope = null;\n } else if (typeof scopeOrOptions === 'function') {\n onError = scopeOrOptions;\n }\n return {\n scope: $scope,\n onError\n };\n}\nfunction mergeConfigs(...configObjects) {\n const formattedConfigObject = {};\n for (const configObject of configObjects) {\n for (const key of Object.keys(configObject)) {\n const option = formattedConfigObject[key];\n const override = configObject[key];\n if (isObject(option) && isObject(override)) {\n formattedConfigObject[key] = mergeConfigs(option, override);\n } else {\n formattedConfigObject[key] = override;\n }\n }\n }\n return formattedConfigObject;\n}\nfunction validateConfig(schema, config) {\n const validationErrors = [];\n for (const [name, conditions] of Object.entries(schema)) {\n const errors = [];\n if (Array.isArray(conditions)) {\n for (const {\n required,\n errorMessage\n } of conditions) {\n if (!required.every(key => !!config[key])) {\n errors.push(errorMessage);\n }\n }\n if (name === 'anyOf' && !(conditions.length - errors.length >= 1)) {\n validationErrors.push(...errors);\n }\n }\n }\n return validationErrors;\n}\nfunction extractConfigByNamespace(schema, dataset, namespace) {\n const property = schema.properties[namespace];\n if ((property == null ? void 0 : property.type) !== 'object') {\n return;\n }\n const newObject = {\n [namespace]: {}\n };\n for (const [key, value] of Object.entries(dataset)) {\n let current = newObject;\n const keyParts = key.split('.');\n for (const [index, name] of keyParts.entries()) {\n if (isObject(current)) {\n if (index < keyParts.length - 1) {\n if (!isObject(current[name])) {\n current[name] = {};\n }\n current = current[name];\n } else if (key !== namespace) {\n current[name] = normaliseString(value);\n }\n }\n }\n }\n return newObject[namespace];\n}\n/**\n * Schema for component config\n *\n * @template {Partial<Record<keyof ConfigurationType, unknown>>} ConfigurationType\n * @typedef {object} Schema\n * @property {Record<keyof ConfigurationType, SchemaProperty | undefined>} properties - Schema properties\n * @property {SchemaCondition<ConfigurationType>[]} [anyOf] - List of schema conditions\n */\n/**\n * Schema property for component config\n *\n * @typedef {object} SchemaProperty\n * @property {'string' | 'boolean' | 'number' | 'object'} type - Property type\n */\n/**\n * Schema condition for component config\n *\n * @template {Partial<Record<keyof ConfigurationType, unknown>>} ConfigurationType\n * @typedef {object} SchemaCondition\n * @property {(keyof ConfigurationType)[]} required - List of required config fields\n * @property {string} errorMessage - Error message when required config fields not provided\n */\n/**\n * @template {Partial<Record<keyof ConfigurationType, unknown>>} [ConfigurationType=ObjectNested]\n * @typedef ChildClass\n * @property {string} moduleName - The module name that'll be looked for in the DOM when initialising the component\n * @property {Schema<ConfigurationType>} [schema] - The schema of the component configuration\n * @property {ConfigurationType} [defaults] - The default values of the configuration of the component\n */\n/**\n * @template {Partial<Record<keyof ConfigurationType, unknown>>} [ConfigurationType=ObjectNested]\n * @typedef {typeof Component & ChildClass<ConfigurationType>} ChildClassConstructor<ConfigurationType>\n */\n/**\n * @import { CompatibleClass, Config, CreateAllOptions, OnErrorCallback } from '../init.mjs'\n */\n\nexport { ConfigurableComponent, configOverride, extractConfigByNamespace, mergeConfigs, normaliseDataset, normaliseOptions, normaliseString, validateConfig };\n//# sourceMappingURL=configuration.mjs.map\n","import { isObject } from './common/index.mjs';\n\nclass I18n {\n constructor(translations = {}, config = {}) {\n var _config$locale;\n this.translations = void 0;\n this.locale = void 0;\n this.translations = translations;\n this.locale = (_config$locale = config.locale) != null ? _config$locale : document.documentElement.lang || 'en';\n }\n t(lookupKey, options) {\n if (!lookupKey) {\n throw new Error('i18n: lookup key missing');\n }\n let translation = this.translations[lookupKey];\n if (typeof (options == null ? void 0 : options.count) === 'number' && isObject(translation)) {\n const translationPluralForm = translation[this.getPluralSuffix(lookupKey, options.count)];\n if (translationPluralForm) {\n translation = translationPluralForm;\n }\n }\n if (typeof translation === 'string') {\n if (translation.match(/%{(.\\S+)}/)) {\n if (!options) {\n throw new Error('i18n: cannot replace placeholders in string if no option data provided');\n }\n return this.replacePlaceholders(translation, options);\n }\n return translation;\n }\n return lookupKey;\n }\n replacePlaceholders(translationString, options) {\n const formatter = Intl.NumberFormat.supportedLocalesOf(this.locale).length ? new Intl.NumberFormat(this.locale) : undefined;\n return translationString.replace(/%{(.\\S+)}/g, function (placeholderWithBraces, placeholderKey) {\n if (Object.prototype.hasOwnProperty.call(options, placeholderKey)) {\n const placeholderValue = options[placeholderKey];\n if (placeholderValue === false || typeof placeholderValue !== 'number' && typeof placeholderValue !== 'string') {\n return '';\n }\n if (typeof placeholderValue === 'number') {\n return formatter ? formatter.format(placeholderValue) : `${placeholderValue}`;\n }\n return placeholderValue;\n }\n throw new Error(`i18n: no data found to replace ${placeholderWithBraces} placeholder in string`);\n });\n }\n hasIntlPluralRulesSupport() {\n return Boolean('PluralRules' in window.Intl && Intl.PluralRules.supportedLocalesOf(this.locale).length);\n }\n getPluralSuffix(lookupKey, count) {\n count = Number(count);\n if (!isFinite(count)) {\n return 'other';\n }\n const translation = this.translations[lookupKey];\n const preferredForm = this.hasIntlPluralRulesSupport() ? new Intl.PluralRules(this.locale).select(count) : this.selectPluralFormUsingFallbackRules(count);\n if (isObject(translation)) {\n if (preferredForm in translation) {\n return preferredForm;\n } else if ('other' in translation) {\n console.warn(`i18n: Missing plural form \".${preferredForm}\" for \"${this.locale}\" locale. Falling back to \".other\".`);\n return 'other';\n }\n }\n throw new Error(`i18n: Plural form \".other\" is required for \"${this.locale}\" locale`);\n }\n selectPluralFormUsingFallbackRules(count) {\n count = Math.abs(Math.floor(count));\n const ruleset = this.getPluralRulesForLocale();\n if (ruleset) {\n return I18n.pluralRules[ruleset](count);\n }\n return 'other';\n }\n getPluralRulesForLocale() {\n const localeShort = this.locale.split('-')[0];\n for (const pluralRule in I18n.pluralRulesMap) {\n const languages = I18n.pluralRulesMap[pluralRule];\n if (languages.includes(this.locale) || languages.includes(localeShort)) {\n return pluralRule;\n }\n }\n }\n}\nI18n.pluralRulesMap = {\n arabic: ['ar'],\n chinese: ['my', 'zh', 'id', 'ja', 'jv', 'ko', 'ms', 'th', 'vi'],\n french: ['hy', 'bn', 'fr', 'gu', 'hi', 'fa', 'pa', 'zu'],\n 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'],\n irish: ['ga'],\n russian: ['ru', 'uk'],\n scottish: ['gd'],\n spanish: ['pt-PT', 'it', 'es'],\n welsh: ['cy']\n};\nI18n.pluralRules = {\n arabic(n) {\n if (n === 0) {\n return 'zero';\n }\n if (n === 1) {\n return 'one';\n }\n if (n === 2) {\n return 'two';\n }\n if (n % 100 >= 3 && n % 100 <= 10) {\n return 'few';\n }\n if (n % 100 >= 11 && n % 100 <= 99) {\n return 'many';\n }\n return 'other';\n },\n chinese() {\n return 'other';\n },\n french(n) {\n return n === 0 || n === 1 ? 'one' : 'other';\n },\n german(n) {\n return n === 1 ? 'one' : 'other';\n },\n irish(n) {\n if (n === 1) {\n return 'one';\n }\n if (n === 2) {\n return 'two';\n }\n if (n >= 3 && n <= 6) {\n return 'few';\n }\n if (n >= 7 && n <= 10) {\n return 'many';\n }\n return 'other';\n },\n russian(n) {\n const lastTwo = n % 100;\n const last = lastTwo % 10;\n if (last === 1 && lastTwo !== 11) {\n return 'one';\n }\n if (last >= 2 && last <= 4 && !(lastTwo >= 12 && lastTwo <= 14)) {\n return 'few';\n }\n if (last === 0 || last >= 5 && last <= 9 || lastTwo >= 11 && lastTwo <= 14) {\n return 'many';\n }\n return 'other';\n },\n scottish(n) {\n if (n === 1 || n === 11) {\n return 'one';\n }\n if (n === 2 || n === 12) {\n return 'two';\n }\n if (n >= 3 && n <= 10 || n >= 13 && n <= 19) {\n return 'few';\n }\n return 'other';\n },\n spanish(n) {\n if (n === 1) {\n return 'one';\n }\n if (n % 1000000 === 0 && n !== 0) {\n return 'many';\n }\n return 'other';\n },\n welsh(n) {\n if (n === 0) {\n return 'zero';\n }\n if (n === 1) {\n return 'one';\n }\n if (n === 2) {\n return 'two';\n }\n if (n === 3) {\n return 'few';\n }\n if (n === 6) {\n return 'many';\n }\n return 'other';\n }\n};\n\nexport { I18n };\n//# sourceMappingURL=i18n.mjs.map\n","import { ConfigurableComponent } from '../../common/configuration.mjs';\n\nconst DEBOUNCE_TIMEOUT_IN_SECONDS = 1;\n\n/**\n * JavaScript enhancements for the Button component\n *\n * @preserve\n * @augments ConfigurableComponent<ButtonConfig>\n */\nclass Button extends ConfigurableComponent {\n /**\n * @param {Element | null} $root - HTML element to use for button\n * @param {ButtonConfig} [config] - Button config\n */\n constructor($root, config = {}) {\n super($root, config);\n this.debounceFormSubmitTimer = null;\n this.$root.addEventListener('keydown', event => this.handleKeyDown(event));\n this.$root.addEventListener('click', event => this.debounce(event));\n }\n handleKeyDown(event) {\n const $target = event.target;\n if (event.key !== ' ') {\n return;\n }\n if ($target instanceof HTMLElement && $target.getAttribute('role') === 'button') {\n event.preventDefault();\n $target.click();\n }\n }\n debounce(event) {\n if (!this.config.preventDoubleClick) {\n return;\n }\n if (this.debounceFormSubmitTimer) {\n event.preventDefault();\n return false;\n }\n this.debounceFormSubmitTimer = window.setTimeout(() => {\n this.debounceFormSubmitTimer = null;\n }, DEBOUNCE_TIMEOUT_IN_SECONDS * 1000);\n }\n}\n\n/**\n * Button config\n *\n * @typedef {object} ButtonConfig\n * @property {boolean} [preventDoubleClick=false] - Prevent accidental double\n * clicks on submit buttons from submitting forms multiple times.\n */\n\n/**\n * @import { Schema } from '../../common/configuration.mjs'\n */\nButton.moduleName = 'govuk-button';\nButton.defaults = Object.freeze({\n preventDoubleClick: false\n});\nButton.schema = Object.freeze({\n properties: {\n preventDoubleClick: {\n type: 'boolean'\n }\n }\n});\n\nexport { Button };\n//# sourceMappingURL=button.mjs.map\n","function closestAttributeValue($element, attributeName) {\n const $closestElementWithAttribute = $element.closest(`[${attributeName}]`);\n return $closestElementWithAttribute ? $closestElementWithAttribute.getAttribute(attributeName) : null;\n}\n\nexport { closestAttributeValue };\n//# sourceMappingURL=closest-attribute-value.mjs.map\n","import { closestAttributeValue } from '../../common/closest-attribute-value.mjs';\nimport { ConfigurableComponent, configOverride, validateConfig } from '../../common/configuration.mjs';\nimport { formatErrorMessage } from '../../common/index.mjs';\nimport { ElementError, ConfigError } from '../../errors/index.mjs';\nimport { I18n } from '../../i18n.mjs';\n\n/**\n * Character count component\n *\n * Tracks the number of characters or words in the `.govuk-js-character-count`\n * `<textarea>` inside the element. Displays a message with the remaining number\n * of characters/words available, or the number of characters/words in excess.\n *\n * You can configure the message to only appear after a certain percentage\n * of the available characters/words has been entered.\n *\n * @preserve\n * @augments ConfigurableComponent<CharacterCountConfig>\n */\nclass CharacterCount extends ConfigurableComponent {\n [configOverride](datasetConfig) {\n let configOverrides = {};\n if ('maxwords' in datasetConfig || 'maxlength' in datasetConfig) {\n configOverrides = {\n maxlength: undefined,\n maxwords: undefined\n };\n }\n return configOverrides;\n }\n\n /**\n * @param {Element | null} $root - HTML element to use for character count\n * @param {CharacterCountConfig} [config] - Character count config\n */\n constructor($root, config = {}) {\n var _ref, _this$config$maxwords;\n super($root, config);\n this.$textarea = void 0;\n this.$visibleCountMessage = void 0;\n this.$screenReaderCountMessage = void 0;\n this.lastInputTimestamp = null;\n this.lastInputValue = '';\n this.valueChecker = null;\n this.i18n = void 0;\n this.maxLength = void 0;\n const $textarea = this.$root.querySelector('.govuk-js-character-count');\n if (!($textarea instanceof HTMLTextAreaElement || $textarea instanceof HTMLInputElement)) {\n throw new ElementError({\n component: CharacterCount,\n element: $textarea,\n expectedType: 'HTMLTextareaElement or HTMLInputElement',\n identifier: 'Form field (`.govuk-js-character-count`)'\n });\n }\n const errors = validateConfig(CharacterCount.schema, this.config);\n if (errors[0]) {\n throw new ConfigError(formatErrorMessage(CharacterCount, errors[0]));\n }\n this.i18n = new I18n(this.config.i18n, {\n locale: closestAttributeValue(this.$root, 'lang')\n });\n this.maxLength = (_ref = (_this$config$maxwords = this.config.maxwords) != null ? _this$config$maxwords : this.config.maxlength) != null ? _ref : Infinity;\n this.$textarea = $textarea;\n const textareaDescriptionId = `${this.$textarea.id}-info`;\n const $textareaDescription = document.getElementById(textareaDescriptionId);\n if (!$textareaDescription) {\n throw new ElementError({\n component: CharacterCount,\n element: $textareaDescription,\n identifier: `Count message (\\`id=\"${textareaDescriptionId}\"\\`)`\n });\n }\n this.$errorMessage = this.$root.querySelector('.govuk-error-message');\n if ($textareaDescription.textContent.match(/^\\s*$/)) {\n $textareaDescription.textContent = this.i18n.t('textareaDescription', {\n count: this.maxLength\n });\n }\n this.$textarea.insertAdjacentElement('afterend', $textareaDescription);\n const $screenReaderCountMessage = document.createElement('div');\n $screenReaderCountMessage.className = 'govuk-character-count__sr-status govuk-visually-hidden';\n $screenReaderCountMessage.setAttribute('aria-live', 'polite');\n this.$screenReaderCountMessage = $screenReaderCountMessage;\n $textareaDescription.insertAdjacentElement('afterend', $screenReaderCountMessage);\n const $visibleCountMessage = document.createElement('div');\n $visibleCountMessage.className = $textareaDescription.className;\n $visibleCountMessage.classList.add('govuk-character-count__status');\n $visibleCountMessage.setAttribute('aria-hidden', 'true');\n this.$visibleCountMessage = $visibleCountMessage;\n $textareaDescription.insertAdjacentElement('afterend', $visibleCountMessage);\n $textareaDescription.classList.add('govuk-visually-hidden');\n this.$textarea.removeAttribute('maxlength');\n this.bindChangeEvents();\n window.addEventListener('pageshow', () => this.updateCountMessage());\n this.updateCountMessage();\n }\n bindChangeEvents() {\n this.$textarea.addEventListener('keyup', () => this.handleKeyUp());\n this.$textarea.addEventListener('focus', () => this.handleFocus());\n this.$textarea.addEventListener('blur', () => this.handleBlur());\n }\n handleKeyUp() {\n this.updateVisibleCountMessage();\n this.lastInputTimestamp = Date.now();\n }\n handleFocus() {\n this.valueChecker = window.setInterval(() => {\n if (!this.lastInputTimestamp || Date.now() - 500 >= this.lastInputTimestamp) {\n this.updateIfValueChanged();\n }\n }, 1000);\n }\n handleBlur() {\n if (this.valueChecker) {\n window.clearInterval(this.valueChecker);\n }\n }\n updateIfValueChanged() {\n if (this.$textarea.value !== this.lastInputValue) {\n this.lastInputValue = this.$textarea.value;\n this.updateCountMessage();\n }\n }\n updateCountMessage() {\n this.updateVisibleCountMessage();\n this.updateScreenReaderCountMessage();\n }\n updateVisibleCountMessage() {\n const remainingNumber = this.maxLength - this.count(this.$textarea.value);\n const isError = remainingNumber < 0;\n this.$visibleCountMessage.classList.toggle('govuk-character-count__message--disabled', !this.isOverThreshold());\n if (!this.$errorMessage) {\n this.$textarea.classList.toggle('govuk-textarea--error', isError);\n }\n this.$visibleCountMessage.classList.toggle('govuk-error-message', isError);\n this.$visibleCountMessage.classList.toggle('govuk-hint', !isError);\n this.$visibleCountMessage.textContent = this.getCountMessage();\n }\n updateScreenReaderCountMessage() {\n if (this.isOverThreshold()) {\n this.$screenReaderCountMessage.removeAttribute('aria-hidden');\n } else {\n this.$screenReaderCountMessage.setAttribute('aria-hidden', 'true');\n }\n this.$screenReaderCountMessage.textContent = this.getCountMessage();\n }\n count(text) {\n if (this.config.maxwords) {\n var _text$match;\n const tokens = (_text$match = text.match(/\\S+/g)) != null ? _text$match : [];\n return tokens.length;\n }\n return text.length;\n }\n getCountMessage() {\n const remainingNumber = this.maxLength - this.count(this.$textarea.value);\n const countType = this.config.maxwords ? 'words' : 'characters';\n return this.formatCountMessage(remainingNumber, countType);\n }\n formatCountMessage(remainingNumber, countType) {\n if (remainingNumber === 0) {\n return this.i18n.t(`${countType}AtLimit`);\n }\n const translationKeySuffix = remainingNumber < 0 ? 'OverLimit' : 'UnderLimit';\n return this.i18n.t(`${countType}${translationKeySuffix}`, {\n count: Math.abs(remainingNumber)\n });\n }\n isOverThreshold() {\n if (!this.config.threshold) {\n return true;\n }\n const currentLength = this.count(this.$textarea.value);\n const maxLength = this.maxLength;\n const thresholdValue = maxLength * this.config.threshold / 100;\n return thresholdValue <= currentLength;\n }\n}\n\n/**\n * Character count config\n *\n * @see {@link CharacterCount.defaults}\n * @typedef {object} CharacterCountConfig\n * @property {number} [maxlength] - The maximum number of characters.\n * If maxwords is provided, the maxlength option will be ignored.\n * @property {number} [maxwords] - The maximum number of words. If maxwords is\n * provided, the maxlength option will be ignored.\n * @property {number} [threshold=0] - The percentage value of the limit at\n * which point the count message is displayed. If this attribute is set, the\n * count message will be hidden by default.\n * @property {CharacterCountTranslations} [i18n=CharacterCount.defaults.i18n] - Character count translations\n */\n\n/**\n * Character count translations\n *\n * @see {@link CharacterCount.defaults.i18n}\n * @typedef {object} CharacterCountTranslations\n *\n * Messages shown to users as they type. It provides feedback on how many words\n * or characters they have remaining or if they are over the limit. This also\n * includes a message used as an accessible description for the textarea.\n * @property {TranslationPluralForms} [charactersUnderLimit] - Message displayed\n * when the number of characters is under the configured maximum, `maxlength`.\n * This message is displayed visually and through assistive technologies. The\n * component will replace the `%{count}` placeholder with the number of\n * remaining characters. This is a [pluralised list of\n * messages](https://frontend.design-system.service.gov.uk/localise-govuk-frontend).\n * @property {string} [charactersAtLimit] - Message displayed when the number of\n * characters reaches the configured maximum, `maxlength`. This message is\n * displayed visually and through assistive technologies.\n * @property {TranslationPluralForms} [charactersOverLimit] - Message displayed\n * when the number of characters is over the configured maximum, `maxlength`.\n * This message is displayed visually and through assistive technologies. The\n * component will replace the `%{count}` placeholder with the number of\n * remaining characters. This is a [pluralised list of\n * messages](https://frontend.design-system.service.gov.uk/localise-govuk-frontend).\n * @property {TranslationPluralForms} [wordsUnderLimit] - Message displayed when\n * the number of words is under the configured maximum, `maxlength`. This\n * message is displayed visually and through assistive technologies. The\n * component will replace the `%{count}` placeholder with the number of\n * remaining words. This is a [pluralised list of\n * messages](https://frontend.design-system.service.gov.uk/localise-govuk-frontend).\n * @property {string} [wordsAtLimit] - Message displayed when the number of\n * words reaches the configured maximum, `maxlength`. This message is\n * displayed visually and through assistive technologies.\n * @property {TranslationPluralForms} [wordsOverLimit] - Message displayed when\n * the number of words is over the configured maximum, `maxlength`. This\n * message is displayed visually and through assistive technologies. The\n * component will replace the `%{count}` placeholder with the number of\n * remaining words. This is a [pluralised list of\n * messages](https://frontend.design-system.service.gov.uk/localise-govuk-frontend).\n * @property {TranslationPluralForms} [textareaDescription] - Message made\n * available to assistive technologies, if none is already present in the\n * HTML, to describe that the component accepts only a limited amount of\n * content. It is visible on the page when JavaScript is unavailable. The\n * component will replace the `%{count}` placeholder with the value of the\n * `maxlength` or `maxwords` parameter.\n */\n\n/**\n * @import { Schema } from '../../common/configuration.mjs'\n * @import { TranslationPluralForms } from '../../i18n.mjs'\n */\nCharacterCount.moduleName = 'govuk-character-count';\nCharacterCount.defaults = Object.freeze({\n threshold: 0,\n i18n: {\n charactersUnderLimit: {\n one: 'You have %{count} character remaining',\n other: 'You have %{count} characters remaining'\n },\n charactersAtLimit: 'You have 0 characters remaining',\n charactersOverLimit: {\n one: 'You have %{count} character too many',\n other: 'You have %{count} characters too many'\n },\n wordsUnderLimit: {\n one: 'You have %{count} word remaining',\n other: 'You have %{count} words remaining'\n },\n wordsAtLimit: 'You have 0 words remaining',\n wordsOverLimit: {\n one: 'You have %{count} word too many',\n other: 'You have %{count} words too many'\n },\n textareaDescription: {\n other: ''\n }\n }\n});\nCharacterCount.schema = Object.freeze({\n properties: {\n i18n: {\n type: 'object'\n },\n maxwords: {\n type: 'number'\n },\n maxlength: {\n type: 'number'\n },\n threshold: {\n type: 'number'\n }\n },\n anyOf: [{\n required: ['maxwords'],\n errorMessage: 'Either \"maxlength\" or \"maxwords\" must be provided'\n }, {\n required: ['maxlength'],\n errorMessage: 'Either \"maxlength\" or \"maxwords\" must be provided'\n }]\n});\n\nexport { CharacterCount };\n//# sourceMappingURL=character-count.mjs.map\n","import { Component } from '../../component.mjs';\nimport { ElementError } from '../../errors/index.mjs';\n\n/**\n * Checkboxes component\n *\n * @preserve\n */\nclass Checkboxes extends Component {\n /**\n * Checkboxes can be associated with a 'conditionally revealed' content block\n * – for example, a checkbox for 'Phone' could reveal an additional form field\n * for the user to enter their phone number.\n *\n * These associations are made using a `data-aria-controls` attribute, which\n * is promoted to an aria-controls attribute during initialisation.\n *\n * We also need to restore the state of any conditional reveals on the page\n * (for example if the user has navigated back), and set up event handlers to\n * keep the reveal in sync with the checkbox state.\n *\n * @param {Element | null} $root - HTML element to use for checkboxes\n */\n constructor($root) {\n super($root);\n this.$inputs = void 0;\n const $inputs = this.$root.querySelectorAll('input[type=\"checkbox\"]');\n if (!$inputs.length) {\n throw new ElementError({\n component: Checkboxes,\n identifier: 'Form inputs (`<input type=\"checkbox\">`)'\n });\n }\n this.$inputs = $inputs;\n this.$inputs.forEach($input => {\n const targetId = $input.getAttribute('data-aria-controls');\n if (!targetId) {\n return;\n }\n if (!document.getElementById(targetId)) {\n throw new ElementError({\n component: Checkboxes,\n identifier: `Conditional reveal (\\`id=\"${targetId}\"\\`)`\n });\n }\n $input.setAttribute('aria-controls', targetId);\n $input.removeAttribute('data-aria-controls');\n });\n window.addEventListener('pageshow', () => this.syncAllConditionalReveals());\n this.syncAllConditionalReveals();\n this.$root.addEventListener('click', event => this.handleClick(event));\n }\n syncAllConditionalReveals() {\n this.$inputs.forEach($input => this.syncConditionalRevealWithInputState($input));\n }\n syncConditionalRevealWithInputState($input) {\n const targetId = $input.getAttribute('aria-controls');\n if (!targetId) {\n return;\n }\n const $target = document.getElementById(targetId);\n if ($target != null && $target.classList.contains('govuk-checkboxes__conditional')) {\n const inputIsChecked = $input.checked;\n $input.setAttribute('aria-expanded', inputIsChecked.toString());\n $target.classList.toggle('govuk-checkboxes__conditional--hidden', !inputIsChecked);\n }\n }\n unCheckAllInputsExcept($input) {\n const allInputsWithSameName = document.querySelectorAll(`input[type=\"checkbox\"][name=\"${$input.name}\"]`);\n allInputsWithSameName.forEach($inputWithSameName => {\n const hasSameFormOwner = $input.form === $inputWithSameName.form;\n if (hasSameFormOwner && $inputWithSameName !== $input) {\n $inputWithSameName.checked = false;\n this.syncConditionalRevealWithInputState($inputWithSameName);\n }\n });\n }\n unCheckExclusiveInputs($input) {\n const allInputsWithSameNameAndExclusiveBehaviour = document.querySelectorAll(`input[data-behaviour=\"exclusive\"][type=\"checkbox\"][name=\"${$input.name}\"]`);\n allInputsWithSameNameAndExclusiveBehaviour.forEach($exclusiveInput => {\n const hasSameFormOwner = $input.form === $exclusiveInput.form;\n if (hasSameFormOwner) {\n $exclusiveInput.checked = false;\n this.syncConditionalRevealWithInputState($exclusiveInput);\n }\n });\n }\n handleClick(event) {\n const $clickedInput = event.target;\n if (!($clickedInput instanceof HTMLInputElement) || $clickedInput.type !== 'checkbox') {\n return;\n }\n const hasAriaControls = $clickedInput.getAttribute('aria-controls');\n if (hasAriaControls) {\n this.syncConditionalRevealWithInputState($clickedInput);\n }\n if (!$clickedInput.checked) {\n return;\n }\n const hasBehaviourExclusive = $clickedInput.getAttribute('data-behaviour') === 'exclusive';\n if (hasBehaviourExclusive) {\n this.unCheckAllInputsExcept($clickedInput);\n } else {\n this.unCheckExclusiveInputs($clickedInput);\n }\n }\n}\nCheckboxes.moduleName = 'govuk-checkboxes';\n\nexport { Checkboxes };\n//# sourceMappingURL=checkboxes.mjs.map\n","import { ConfigurableComponent } from '../../common/configuration.mjs';\nimport { setFocus } from '../../common/index.mjs';\n\n/**\n * Error summary component\n *\n * Takes focus on initialisation for accessible announcement, unless disabled in\n * configuration.\n *\n * @preserve\n * @augments ConfigurableComponent<ErrorSummaryConfig>\n */\nclass ErrorSummary extends ConfigurableComponent {\n /**\n * @param {Element | null} $root - HTML element to use for error summary\n * @param {ErrorSummaryConfig} [config] - Error summary config\n */\n constructor($root, config = {}) {\n super($root, config);\n if (!this.config.disableAutoFocus) {\n setFocus(this.$root);\n }\n this.$root.addEventListener('click', event => this.handleClick(event));\n }\n handleClick(event) {\n const $target = event.target;\n if ($target && this.focusTarget($target)) {\n event.preventDefault();\n }\n }\n focusTarget($target) {\n if (!($target instanceof HTMLAnchorElement)) {\n return false;\n }\n const inputId = $target.hash.replace('#', '');\n if (!inputId) {\n return false;\n }\n const $input = document.getElementById(inputId);\n if (!$input) {\n return false;\n }\n const $legendOrLabel = this.getAssociatedLegendOrLabel($input);\n if (!$legendOrLabel) {\n return false;\n }\n $legendOrLabel.scrollIntoView();\n $input.focus({\n preventScroll: true\n });\n return true;\n }\n getAssociatedLegendOrLabel($input) {\n var _document$querySelect;\n const $fieldset = $input.closest('fieldset');\n if ($fieldset) {\n const $legends = $fieldset.getElementsByTagName('legend');\n if ($legends.length) {\n const $candidateLegend = $legends[0];\n if ($input instanceof HTMLInputElement && ($input.type === 'checkbox' || $input.type === 'radio')) {\n return $candidateLegend;\n }\n const legendTop = $candidateLegend.getBoundingClientRect().top;\n const inputRect = $input.getBoundingClientRect();\n if (inputRect.height && window.innerHeight) {\n const inputBottom = inputRect.top + inputRect.height;\n if (inputBottom - legendTop < window.innerHeight / 2) {\n return $candidateLegend;\n }\n }\n }\n }\n return (_document$querySelect = document.querySelector(`label[for='${$input.getAttribute('id')}']`)) != null ? _document$querySelect : $input.closest('label');\n }\n}\n\n/**\n * Error summary config\n *\n * @typedef {object} ErrorSummaryConfig\n * @property {boolean} [disableAutoFocus=false] - If set to `true` the error\n * summary will not be focussed when the page loads.\n */\n\n/**\n * @import { Schema } from '../../common/configuration.mjs'\n */\nErrorSummary.moduleName = 'govuk-error-summary';\nErrorSummary.defaults = Object.freeze({\n disableAutoFocus: false\n});\nErrorSummary.schema = Object.freeze({\n properties: {\n disableAutoFocus: {\n type: 'boolean'\n }\n }\n});\n\nexport { ErrorSummary };\n//# sourceMappingURL=error-summary.mjs.map\n","import { closestAttributeValue } from '../../common/closest-attribute-value.mjs';\nimport { ConfigurableComponent } from '../../common/configuration.mjs';\nimport { formatErrorMessage } from '../../common/index.mjs';\nimport { ElementError } from '../../errors/index.mjs';\nimport { I18n } from '../../i18n.mjs';\n\n/**\n * File upload component\n *\n * @preserve\n * @augments ConfigurableComponent<FileUploadConfig>\n */\nclass FileUpload extends ConfigurableComponent {\n /**\n * @param {Element | null} $root - File input element\n * @param {FileUploadConfig} [config] - File Upload config\n */\n constructor($root, config = {}) {\n super($root, config);\n this.$input = void 0;\n this.$button = void 0;\n this.$status = void 0;\n this.i18n = void 0;\n this.id = void 0;\n this.$announcements = void 0;\n this.enteredAnotherElement = void 0;\n const $input = this.$root.querySelector('input');\n if ($input === null) {\n throw new ElementError({\n component: FileUpload,\n identifier: 'File inputs (`<input type=\"file\">`)'\n });\n }\n if ($input.type !== 'file') {\n throw new ElementError(formatErrorMessage(FileUpload, 'File input (`<input type=\"file\">`) attribute (`type`) is not `file`'));\n }\n this.$input = $input;\n if (!this.$input.id) {\n throw new ElementError({\n component: FileUpload,\n identifier: 'File input (`<input type=\"file\">`) attribute (`id`)'\n });\n }\n this.id = this.$input.id;\n this.i18n = new I18n(this.config.i18n, {\n locale: closestAttributeValue(this.$root, 'lang')\n });\n const $label = this.findLabel();\n if (!$label.id) {\n $label.id = `${this.id}-label`;\n }\n this.$input.id = `${this.id}-input`;\n this.$input.setAttribute('hidden', 'true');\n const $button = document.createElement('button');\n $button.classList.add('govuk-file-upload-button');\n $button.type = 'button';\n $button.id = this.id;\n $button.classList.add('govuk-file-upload-button--empty');\n const ariaDescribedBy = this.$input.getAttribute('aria-describedby');\n if (ariaDescribedBy) {\n $button.setAttribute('aria-describedby', ariaDescribedBy);\n }\n const $status = document.createElement('span');\n $status.className = 'govuk-body govuk-file-upload-button__status';\n $status.setAttribute('aria-live', 'polite');\n $status.innerText = this.i18n.t('noFileChosen');\n $button.appendChild($status);\n const commaSpan = document.createElement('span');\n commaSpan.className = 'govuk-visually-hidden';\n commaSpan.innerText = ', ';\n commaSpan.id = `${this.id}-comma`;\n $button.appendChild(commaSpan);\n const containerSpan = document.createElement('span');\n containerSpan.className = 'govuk-file-upload-button__pseudo-button-container';\n const buttonSpan = document.createElement('span');\n buttonSpan.className = 'govuk-button govuk-button--secondary govuk-file-upload-button__pseudo-button';\n buttonSpan.innerText = this.i18n.t('chooseFilesButton');\n containerSpan.appendChild(buttonSpan);\n containerSpan.insertAdjacentText('beforeend', ' ');\n const instructionSpan = document.createElement('span');\n instructionSpan.className = 'govuk-body govuk-file-upload-button__instruction';\n instructionSpan.innerText = this.i18n.t('dropInstruction');\n containerSpan.appendChild(instructionSpan);\n $button.appendChild(containerSpan);\n $button.setAttribute('aria-labelledby', `${$label.id} ${commaSpan.id} ${$button.id}`);\n $button.addEventListener('click', this.onClick.bind(this));\n $button.addEventListener('dragover', event => {\n event.preventDefault();\n });\n this.$root.insertAdjacentElement('afterbegin', $button);\n this.$input.setAttribute('tabindex', '-1');\n this.$input.setAttribute('aria-hidden', 'true');\n this.$button = $button;\n this.$status = $status;\n this.$input.addEventListener('change', this.onChange.bind(this));\n this.updateDisabledState();\n this.observeDisabledState();\n this.$announcements = document.createElement('span');\n this.$announcements.classList.add('govuk-file-upload-announcements');\n this.$announcements.classList.add('govuk-visually-hidden');\n this.$announcements.setAttribute('aria-live', 'assertive');\n this.$root.insertAdjacentElement('afterend', this.$announcements);\n this.$button.addEventListener('drop', this.onDrop.bind(this));\n document.addEventListener('dragenter', this.updateDropzoneVisibility.bind(this));\n document.addEventListener('dragenter', () => {\n this.enteredAnotherElement = true;\n });\n document.addEventListener('dragleave', () => {\n if (!this.enteredAnotherElement && !this.$button.disabled) {\n this.hideDraggingState();\n this.$announcements.innerText = this.i18n.t('leftDropZone');\n }\n this.enteredAnotherElement = false;\n });\n }\n updateDropzoneVisibility(event) {\n if (this.$button.disabled) return;\n if (event.target instanceof Node) {\n if (this.$root.contains(event.target)) {\n if (event.dataTransfer && isContainingFiles(event.dataTransfer)) {\n if (!this.$button.classList.contains('govuk-file-upload-button--dragging')) {\n this.showDraggingState();\n this.$announcements.innerText = this.i18n.t('enteredDropZone');\n }\n }\n } else {\n if (this.$button.classList.contains('govuk-file-upload-button--dragging')) {\n this.hideDraggingState();\n this.$announcements.innerText = this.i18n.t('leftDropZone');\n }\n }\n }\n }\n showDraggingState() {\n this.$button.classList.add('govuk-file-upload-button--dragging');\n }\n hideDraggingState() {\n this.$button.classList.remove('govuk-file-upload-button--dragging');\n }\n onDrop(event) {\n event.preventDefault();\n if (event.dataTransfer && isContainingFiles(event.dataTransfer)) {\n this.$input.files = event.dataTransfer.files;\n this.$input.dispatchEvent(new CustomEvent('change'));\n this.hideDraggingState();\n }\n }\n onChange() {\n const fileCount = this.$input.files.length;\n if (fileCount === 0) {\n this.$status.innerText = this.i18n.t('noFileChosen');\n this.$button.classList.add('govuk-file-upload-button--empty');\n } else {\n if (fileCount === 1) {\n this.$status.innerText = this.$input.files[0].name;\n } else {\n this.$status.innerText = this.i18n.t('multipleFilesChosen', {\n count: fileCount\n });\n }\n this.$button.classList.remove('govuk-file-upload-button--empty');\n }\n }\n findLabel() {\n const $label = document.querySelector(`label[for=\"${this.$input.id}\"]`);\n if (!$label) {\n throw new ElementError({\n component: FileUpload,\n identifier: `Field label (\\`<label for=${this.$input.id}>\\`)`\n });\n }\n return $label;\n }\n onClick() {\n this.$input.click();\n }\n observeDisabledState() {\n const observer = new MutationObserver(mutationList => {\n for (const mutation of mutationList) {\n if (mutation.type === 'attributes' && mutation.attributeName === 'disabled') {\n this.updateDisabledState();\n }\n }\n });\n observer.observe(this.$input, {\n attributes: true\n });\n }\n updateDisabledState() {\n this.$button.disabled = this.$input.disabled;\n this.$root.classList.toggle('govuk-drop-zone--disabled', this.$button.disabled);\n }\n}\nFileUpload.moduleName = 'govuk-file-upload';\nFileUpload.defaults = Object.freeze({\n i18n: {\n chooseFilesButton: 'Choose file',\n dropInstruction: 'or drop file',\n noFileChosen: 'No file chosen',\n multipleFilesChosen: {\n one: '%{count} file chosen',\n other: '%{count} files chosen'\n },\n enteredDropZone: 'Entered drop zone',\n leftDropZone: 'Left drop zone'\n }\n});\nFileUpload.schema = Object.freeze({\n properties: {\n i18n: {\n type: 'object'\n }\n }\n});\nfunction isContainingFiles(dataTransfer) {\n const hasNoTypesInfo = dataTransfer.types.length === 0;\n const isDraggingFiles = dataTransfer.types.some(type => type === 'Files');\n return hasNoTypesInfo || isDraggingFiles;\n}\n\n/**\n * @typedef {HTMLInputElement & {files: FileList}} HTMLFileInputElement\n */\n\n/**\n * File upload config\n *\n * @see {@link FileUpload.defaults}\n * @typedef {object} FileUploadConfig\n * @property {FileUploadTranslations} [i18n=FileUpload.defaults.i18n] - File upload translations\n */\n\n/**\n * File upload translations\n *\n * @see {@link FileUpload.defaults.i18n}\n * @typedef {object} FileUploadTranslations\n *\n * Messages used by the component\n * @property {string} [chooseFile] - The text of the button that opens the file picker\n * @property {string} [dropInstruction] - The text informing users they can drop files\n * @property {TranslationPluralForms} [multipleFilesChosen] - The text displayed when multiple files\n * have been chosen by the user\n * @property {string} [noFileChosen] - The text to displayed when no file has been chosen by the user\n * @property {string} [enteredDropZone] - The text announced by assistive technology\n * when user drags files and enters the drop zone\n * @property {string} [leftDropZone] - The text announced by assistive technology\n * when user drags files and leaves the drop zone without dropping\n */\n\n/**\n * @import { Schema } from '../../common/configuration.mjs'\n * @import { TranslationPluralForms } from '../../i18n.mjs'\n */\n\nexport { FileUpload };\n//# sourceMappingURL=file-upload.mjs.map\n","import { closestAttributeValue } from '../../common/closest-attribute-value.mjs';\nimport { ConfigurableComponent } from '../../common/configuration.mjs';\nimport { ElementError } from '../../errors/index.mjs';\nimport { I18n } from '../../i18n.mjs';\n\n/**\n * Password input component\n *\n * @preserve\n * @augments ConfigurableComponent<PasswordInputConfig>\n */\nclass PasswordInput extends ConfigurableComponent {\n /**\n * @param {Element | null} $root - HTML element to use for password input\n * @param {PasswordInputConfig} [config] - Password input config\n */\n constructor($root, config = {}) {\n super($root, config);\n this.i18n = void 0;\n this.$input = void 0;\n this.$showHideButton = void 0;\n this.$screenReaderStatusMessage = void 0;\n const $input = this.$root.querySelector('.govuk-js-password-input-input');\n if (!($input instanceof HTMLInputElement)) {\n throw new ElementError({\n component: PasswordInput,\n element: $input,\n expectedType: 'HTMLInputElement',\n identifier: 'Form field (`.govuk-js-password-input-input`)'\n });\n }\n if ($input.type !== 'password') {\n throw new ElementError('Password input: Form field (`.govuk-js-password-input-input`) must be of type `password`.');\n }\n const $showHideButton = this.$root.querySelector('.govuk-js-password-input-toggle');\n if (!($showHideButton instanceof HTMLButtonElement)) {\n throw new ElementError({\n component: PasswordInput,\n element: $showHideButton,\n expectedType: 'HTMLButtonElement',\n identifier: 'Button (`.govuk-js-password-input-toggle`)'\n });\n }\n if ($showHideButton.type !== 'button') {\n throw new ElementError('Password input: Button (`.govuk-js-password-input-toggle`) must be of type `button`.');\n }\n this.$input = $input;\n this.$showHideButton = $showHideButton;\n this.i18n = new I18n(this.config.i18n, {\n locale: closestAttributeValue(this.$root, 'lang')\n });\n this.$showHideButton.removeAttribute('hidden');\n const $screenReaderStatusMessage = document.createElement('div');\n $screenReaderStatusMessage.className = 'govuk-password-input__sr-status govuk-visually-hidden';\n $screenReaderStatusMessage.setAttribute('aria-live', 'polite');\n this.$screenReaderStatusMessage = $screenReaderStatusMessage;\n this.$input.insertAdjacentElement('afterend', $screenReaderStatusMessage);\n this.$showHideButton.addEventListener('click', this.toggle.bind(this));\n if (this.$input.form) {\n this.$input.form.addEventListener('submit', () => this.hide());\n }\n window.addEventListener('pageshow', event => {\n if (event.persisted && this.$input.type !== 'password') {\n this.hide();\n }\n });\n this.hide();\n }\n toggle(event) {\n event.preventDefault();\n if (this.$input.type === 'password') {\n this.show();\n return;\n }\n this.hide();\n }\n show() {\n this.setType('text');\n }\n hide() {\n this.setType('password');\n }\n setType(type) {\n if (type === this.$input.type) {\n return;\n }\n this.$input.setAttribute('type', type);\n const isHidden = type === 'password';\n const prefixButton = isHidden ? 'show' : 'hide';\n const prefixStatus = isHidden ? 'passwordHidden' : 'passwordShown';\n this.$showHideButton.innerText = this.i18n.t(`${prefixButton}Password`);\n this.$showHideButton.setAttribute('aria-label', this.i18n.t(`${prefixButton}PasswordAriaLabel`));\n this.$screenReaderStatusMessage.innerText = this.i18n.t(`${prefixStatus}Announcement`);\n }\n}\n\n/**\n * Password input config\n *\n * @typedef {object} PasswordInputConfig\n * @property {PasswordInputTranslations} [i18n=PasswordInput.defaults.i18n] - Password input translations\n */\n\n/**\n * Password input translations\n *\n * @see {@link PasswordInput.defaults.i18n}\n * @typedef {object} PasswordInputTranslations\n *\n * Messages displayed to the user indicating the state of the show/hide toggle.\n * @property {string} [showPassword] - Visible text of the button when the\n * password is currently hidden. Plain text only.\n * @property {string} [hidePassword] - Visible text of the button when the\n * password is currently visible. Plain text only.\n * @property {string} [showPasswordAriaLabel] - aria-label of the button when\n * the password is currently hidden. Plain text only.\n * @property {string} [hidePasswordAriaLabel] - aria-label of the button when\n * the password is currently visible. Plain text only.\n * @property {string} [passwordShownAnnouncement] - Screen reader\n * announcement to make when the password has just become visible.\n * Plain text only.\n * @property {string} [passwordHiddenAnnouncement] - Screen reader\n * announcement to make when the password has just been hidden.\n * Plain text only.\n */\n\n/**\n * @import { Schema } from '../../common/configuration.mjs'\n */\nPasswordInput.moduleName = 'govuk-password-input';\nPasswordInput.defaults = Object.freeze({\n i18n: {\n showPassword: 'Show',\n hidePassword: 'Hide',\n showPasswordAriaLabel: 'Show password',\n hidePasswordAriaLabel: 'Hide password',\n passwordShownAnnouncement: 'Your password is visible',\n passwordHiddenAnnouncement: 'Your password is hidden'\n }\n});\nPasswordInput.schema = Object.freeze({\n properties: {\n i18n: {\n type: 'object'\n }\n }\n});\n\nexport { PasswordInput };\n//# sourceMappingURL=password-input.mjs.map\n","import { Component } from '../../component.mjs';\nimport { ElementError } from '../../errors/index.mjs';\n\n/**\n * Radios component\n *\n * @preserve\n */\nclass Radios extends Component {\n /**\n * Radios can be associated with a 'conditionally revealed' content block –\n * for example, a radio for 'Phone' could reveal an additional form field for\n * the user to enter their phone number.\n *\n * These associations are made using a `data-aria-controls` attribute, which\n * is promoted to an aria-controls attribute during initialisation.\n *\n * We also need to restore the state of any conditional reveals on the page\n * (for example if the user has navigated back), and set up event handlers to\n * keep the reveal in sync with the radio state.\n *\n * @param {Element | null} $root - HTML element to use for radios\n */\n constructor($root) {\n super($root);\n this.$inputs = void 0;\n const $inputs = this.$root.querySelectorAll('input[type=\"radio\"]');\n if (!$inputs.length) {\n throw new ElementError({\n component: Radios,\n identifier: 'Form inputs (`<input type=\"radio\">`)'\n });\n }\n this.$inputs = $inputs;\n this.$inputs.forEach($input => {\n const targetId = $input.getAttribute('data-aria-controls');\n if (!targetId) {\n return;\n }\n if (!document.getElementById(targetId)) {\n throw new ElementError({\n component: Radios,\n identifier: `Conditional reveal (\\`id=\"${targetId}\"\\`)`\n });\n }\n $input.setAttribute('aria-controls', targetId);\n $input.removeAttribute('data-aria-controls');\n });\n window.addEventListener('pageshow', () => this.syncAllConditionalReveals());\n this.syncAllConditionalReveals();\n this.$root.addEventListener('click', event => this.handleClick(event));\n }\n syncAllConditionalReveals() {\n this.$inputs.forEach($input => this.syncConditionalRevealWithInputState($input));\n }\n syncConditionalRevealWithInputState($input) {\n const targetId = $input.getAttribute('aria-controls');\n if (!targetId) {\n return;\n }\n const $target = document.getElementById(targetId);\n if ($target != null && $target.classList.contains('govuk-radios__conditional')) {\n const inputIsChecked = $input.checked;\n $input.setAttribute('aria-expanded', inputIsChecked.toString());\n $target.classList.toggle('govuk-radios__conditional--hidden', !inputIsChecked);\n }\n }\n handleClick(event) {\n const $clickedInput = event.target;\n if (!($clickedInput instanceof HTMLInputElement) || $clickedInput.type !== 'radio') {\n return;\n }\n const $allInputs = document.querySelectorAll('input[type=\"radio\"][aria-controls]');\n const $clickedInputForm = $clickedInput.form;\n const $clickedInputName = $clickedInput.name;\n $allInputs.forEach($input => {\n const hasSameFormOwner = $input.form === $clickedInputForm;\n const hasSameName = $input.name === $clickedInputName;\n if (hasSameName && hasSameFormOwner) {\n this.syncConditionalRevealWithInputState($input);\n }\n });\n }\n}\nRadios.moduleName = 'govuk-radios';\n\nexport { Radios };\n//# sourceMappingURL=radios.mjs.map\n","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class FileFieldController extends Controller {\n static targets = [\"preview\", \"destroy\"];\n static values = {\n mimeTypes: Array,\n };\n\n connect() {\n this.counter = 0;\n this.initialPreviewContent = null;\n this.onUploadFlag = false;\n }\n\n onUpload(event) {\n this.onUploadFlag = true;\n\n // Set the file to be destroyed only if it is already persisted\n if (this.hasDestroyTarget) {\n this.destroyTarget.value = false;\n }\n this.previewTarget.removeAttribute(\"hidden\");\n\n // Show preview only if a file has been selected in the file picker popup. If cancelled, show previous file or do\n // not show preview at all\n if (this.hasPreviewTarget) {\n if (event.currentTarget.files.length > 0) {\n this.showPreview(event.currentTarget.files[0]);\n } else {\n this.setPreviewContent(this.initialPreviewContent);\n }\n }\n }\n\n setDestroy(event) {\n event.preventDefault();\n\n // If the data is already persisted and another image has been picked from the file picker popup, but the new image\n // is removed, show the original image\n if (this.initialPreviewContent && this.onUploadFlag) {\n this.onUploadFlag = false;\n this.setPreviewContent(this.initialPreviewContent);\n } else {\n // Set image to be destroyed, hide preview and remove image url\n if (this.hasDestroyTarget) {\n this.destroyTarget.value = true;\n }\n if (this.hasPreviewTarget) {\n this.previewTarget.setAttribute(\"hidden\", \"\");\n this.setPreviewContent(\"\");\n }\n if (this.previousInput) {\n this.previousInput.toggleAttribute(\"disabled\", true);\n }\n }\n\n this.fileInput.value = \"\";\n }\n\n setPreviewContent(content) {\n if (this.filenameTag) {\n this.filenameTag.innerText = text;\n }\n }\n\n drop(event) {\n event.preventDefault();\n\n const file = this.fileForEvent(event, this.mimeTypesValue);\n if (file) {\n const dT = new DataTransfer();\n dT.items.add(file);\n this.fileInput.files = dT.files;\n this.fileInput.dispatchEvent(new Event(\"change\"));\n }\n\n this.counter = 0;\n this.element.classList.remove(\"droppable\");\n }\n\n dragover(event) {\n event.preventDefault();\n }\n\n dragenter(event) {\n event.preventDefault();\n\n if (this.counter === 0) {\n this.element.classList.add(\"droppable\");\n }\n this.counter++;\n }\n\n dragleave(event) {\n event.preventDefault();\n\n this.counter--;\n if (this.counter === 0) {\n this.element.classList.remove(\"droppable\");\n }\n }\n\n get fileInput() {\n return this.element.querySelector(\"input[type='file']\");\n }\n\n get previousInput() {\n return this.element.querySelector(\n `input[type='hidden'][name='${this.fileInput.name}']`,\n );\n }\n\n get filenameTag() {\n if (!this.hasPreviewTarget) return null;\n\n return this.previewTarget.querySelector(\"p.preview-filename\");\n }\n\n showPreview(file) {\n const reader = new FileReader();\n\n reader.onload = (e) => {\n if (this.filenameTag) {\n this.filenameTag.innerText = file.name;\n }\n };\n reader.readAsDataURL(file);\n }\n\n /**\n * Given a drop event, find the first acceptable file.\n * @param event {DropEvent}\n * @param mimeTypes {String[]}\n * @returns {File}\n */\n fileForEvent(event, mimeTypes) {\n const accept = (file) => mimeTypes.indexOf(file.type) > -1;\n\n let file;\n\n if (event.dataTransfer.items) {\n const item = [...event.dataTransfer.items].find(accept);\n if (item) {\n file = item.getAsFile();\n }\n } else {\n file = [...event.dataTransfer.files].find(accept);\n }\n\n return file;\n }\n}\n","import DocumentFieldController from \"./document_field_controller\";\nimport ImageFieldController from \"./image_field_controller\";\n\nconst Definitions = [\n {\n identifier: \"govuk-document-field\",\n controllerConstructor: DocumentFieldController,\n },\n {\n identifier: \"govuk-image-field\",\n controllerConstructor: ImageFieldController,\n },\n];\n\nexport { Definitions as default };\n","import FileFieldController from \"./file_field_controller\";\n\nexport default class DocumentFieldController extends FileFieldController {\n connect() {\n super.connect();\n\n this.initialPreviewContent = this.filenameTag.text;\n }\n\n setPreviewContent(content) {\n this.filenameTag.innerText = content;\n }\n\n showPreview(file) {\n const reader = new FileReader();\n\n reader.onload = (e) => {\n if (this.filenameTag) {\n this.filenameTag.innerText = file.name;\n }\n };\n reader.readAsDataURL(file);\n }\n\n get filenameTag() {\n return this.previewTarget.querySelector(\"p.preview-filename\");\n }\n}\n","import FileFieldController from \"./file_field_controller\";\n\nexport default class ImageFieldController extends FileFieldController {\n connect() {\n super.connect();\n\n this.initialPreviewContent = this.imageTag.getAttribute(\"src\");\n }\n\n setPreviewContent(content) {\n this.imageTag.src = content;\n }\n\n showPreview(file) {\n const reader = new FileReader();\n\n reader.onload = (e) => {\n this.imageTag.src = e.target.result;\n };\n reader.readAsDataURL(file);\n }\n\n get imageTag() {\n return this.previewTarget.querySelector(\"img\");\n }\n}\n","import {\n Button,\n CharacterCount,\n Checkboxes,\n ErrorSummary,\n FileUpload,\n PasswordInput,\n Radios,\n} from \"govuk-frontend/dist/govuk/all.mjs\";\nimport { SupportError } from \"govuk-frontend/dist/govuk/errors/index.mjs\";\nimport { isSupported } from \"govuk-frontend/dist/govuk/common/index.mjs\";\n\nfunction initAll(config) {\n let _config$scope;\n config = typeof config !== \"undefined\" ? config : {};\n if (!isSupported()) {\n console.log(new SupportError());\n return;\n }\n const components = [\n [Button, config.button],\n [CharacterCount, config.characterCount],\n [Checkboxes],\n [ErrorSummary, config.errorSummary],\n [FileUpload, config.fileUpload],\n [Radios],\n [PasswordInput, config.passwordInput],\n ];\n const $scope =\n (_config$scope = config.scope) != null ? _config$scope : document;\n components.forEach(([Component, config]) => {\n const $elements = $scope.querySelectorAll(\n `[data-module=\"${Component.moduleName}\"]`,\n );\n $elements.forEach(($element) => {\n try {\n \"defaults\" in Component\n ? new Component($element, config)\n : new Component($element);\n } catch (error) {\n console.log(error);\n }\n });\n });\n}\n\n// stimulus controllers\nimport controllers from \"./controllers\";\n\nexport {\n controllers as default,\n initAll,\n Button,\n CharacterCount,\n Checkboxes,\n ErrorSummary,\n PasswordInput,\n Radios,\n};\n"],"names":["isSupported","$scope","document","body","classList","contains","isObject","option","Array","isArray","formatErrorMessage","Component","message","moduleName","GOVUKFrontendError","Error","constructor","args","super","this","name","SupportError","supportMessage","HTMLScriptElement","prototype","ConfigError","ElementError","messageOrOptions","component","identifier","element","expectedType","InitError","componentOrMessage","$root","_$root","childConstructor","elementType","checkSupport","checkInitialised","setAttribute","HTMLElement","hasAttribute","isInitialised","configOverride","Symbol","for","ConfigurableComponent","param","config","_config","defaults","datasetConfig","dataset","schema","out","entries","Object","properties","entry","namespace","property","field","toString","normaliseString","type","extractConfigByNamespace","normaliseDataset","mergeConfigs","value","trimmedValue","trim","output","outputType","includes","length","isFinite","Number","configObjects","formattedConfigObject","configObject","key","keys","override","newObject","current","keyParts","split","index","I18n","translations","_config$locale","locale","documentElement","lang","t","lookupKey","options","translation","count","translationPluralForm","getPluralSuffix","match","replacePlaceholders","translationString","formatter","Intl","NumberFormat","supportedLocalesOf","undefined","replace","placeholderWithBraces","placeholderKey","hasOwnProperty","call","placeholderValue","format","hasIntlPluralRulesSupport","Boolean","window","PluralRules","preferredForm","select","selectPluralFormUsingFallbackRules","console","warn","Math","abs","floor","ruleset","getPluralRulesForLocale","pluralRules","localeShort","pluralRule","pluralRulesMap","languages","arabic","chinese","french","german","irish","russian","scottish","spanish","welsh","n","lastTwo","last","Button","debounceFormSubmitTimer","addEventListener","event","handleKeyDown","debounce","$target","target","getAttribute","preventDefault","click","preventDoubleClick","setTimeout","DEBOUNCE_TIMEOUT_IN_SECONDS","closestAttributeValue","$element","attributeName","$closestElementWithAttribute","closest","freeze","CharacterCount","configOverrides","maxlength","maxwords","_ref","_this$config$maxwords","$textarea","$visibleCountMessage","$screenReaderCountMessage","lastInputTimestamp","lastInputValue","valueChecker","i18n","maxLength","querySelector","HTMLTextAreaElement","HTMLInputElement","errors","validationErrors","conditions","required","errorMessage","every","push","validateConfig","Infinity","textareaDescriptionId","id","$textareaDescription","getElementById","$errorMessage","textContent","insertAdjacentElement","createElement","className","add","removeAttribute","bindChangeEvents","updateCountMessage","handleKeyUp","handleFocus","handleBlur","updateVisibleCountMessage","Date","now","setInterval","updateIfValueChanged","clearInterval","updateScreenReaderCountMessage","isError","toggle","isOverThreshold","getCountMessage","text","_text$match","remainingNumber","countType","formatCountMessage","translationKeySuffix","threshold","currentLength","charactersUnderLimit","one","other","charactersAtLimit","charactersOverLimit","wordsUnderLimit","wordsAtLimit","wordsOverLimit","textareaDescription","anyOf","Checkboxes","$inputs","querySelectorAll","forEach","$input","targetId","syncAllConditionalReveals","handleClick","syncConditionalRevealWithInputState","inputIsChecked","checked","unCheckAllInputsExcept","$inputWithSameName","form","unCheckExclusiveInputs","$exclusiveInput","$clickedInput","ErrorSummary","disableAutoFocus","_options$onBeforeFocu","isFocusable","onBlur","_options$onBlur","once","onBeforeFocus","focus","setFocus","focusTarget","HTMLAnchorElement","inputId","hash","$legendOrLabel","getAssociatedLegendOrLabel","scrollIntoView","preventScroll","_document$querySelect","$fieldset","$legends","getElementsByTagName","$candidateLegend","legendTop","getBoundingClientRect","top","inputRect","height","innerHeight","FileUpload","$button","$status","$announcements","enteredAnotherElement","$label","findLabel","ariaDescribedBy","innerText","appendChild","commaSpan","containerSpan","buttonSpan","insertAdjacentText","instructionSpan","onClick","bind","onChange","updateDisabledState","observeDisabledState","onDrop","updateDropzoneVisibility","disabled","hideDraggingState","Node","dataTransfer","isContainingFiles","showDraggingState","remove","files","dispatchEvent","CustomEvent","fileCount","MutationObserver","mutationList","mutation","observe","attributes","hasNoTypesInfo","types","isDraggingFiles","some","chooseFilesButton","dropInstruction","noFileChosen","multipleFilesChosen","enteredDropZone","leftDropZone","PasswordInput","$showHideButton","$screenReaderStatusMessage","HTMLButtonElement","hide","persisted","show","setType","isHidden","prefixButton","prefixStatus","showPassword","hidePassword","showPasswordAriaLabel","hidePasswordAriaLabel","passwordShownAnnouncement","passwordHiddenAnnouncement","Radios","$allInputs","$clickedInputForm","$clickedInputName","hasSameFormOwner","FileFieldController","Controller","static","mimeTypes","connect","counter","initialPreviewContent","onUploadFlag","onUpload","hasDestroyTarget","destroyTarget","previewTarget","hasPreviewTarget","currentTarget","showPreview","setPreviewContent","setDestroy","previousInput","toggleAttribute","fileInput","content","filenameTag","drop","file","fileForEvent","mimeTypesValue","dT","DataTransfer","items","Event","dragover","dragenter","dragleave","reader","FileReader","onload","e","readAsDataURL","accept","indexOf","item","find","getAsFile","Definitions","controllerConstructor","imageTag","src","result","initAll","_config$scope","log","components","button","characterCount","errorSummary","fileUpload","pass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nW,EAAO2W,OAAiBR,EAAgBlZ,SAC3DoZ,EAAWpK,QAAQ,EAAEvO,EAAWsC,MACZhD,EAAOgP,iBACvB,iBAAiBtO,EAAUE,gBAEnBqO,QAAS/E,IACjB,IACE,aAAcxJ,EACV,IAAIA,EAAUwJ,EAAUlH,GACxB,IAAItC,EAAUwJ,EACpB,CAAE,MAAO0P,GACPjS,QAAQyR,IAAIQ,EACd,KAGN","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12]}
@@ -91,6 +91,51 @@ module Katalyst
91
91
  end
92
92
  end
93
93
 
94
+ # Generates a input of type +time+
95
+ #
96
+ # @param attribute_name [Symbol] The name of the attribute
97
+ # @param hint [Hash,Proc] The content of the hint. No hint will be added if 'text' is left +nil+. When a +Proc+
98
+ # is supplied the hint will be wrapped in a +div+ instead of a +span+
99
+ # @option hint text [String] the hint text
100
+ # @option hint kwargs [Hash] additional arguments are applied as attributes to the hint
101
+ # @param width [Integer,String] sets the width of the input, can be +2+, +3+ +4+, +5+, +10+ or +20+ characters
102
+ # or +one-quarter+, +one-third+, +one-half+, +two-thirds+ or +full+ width of the container
103
+ # @param extra_letter_spacing [Boolean] when true adds space between characters to increase the readability of
104
+ # sequences of letters and numbers. Defaults to +false+.
105
+ # @param label [Hash,Proc] configures or sets the associated label content
106
+ # @option label text [String] the label text
107
+ # @option label size [String] the size of the label font, can be +xl+, +l+, +m+, +s+ or nil
108
+ # @option label tag [Symbol,String] the label's wrapper tag, intended to allow labels to act as page headings
109
+ # @option label hidden [Boolean] control the visability of the label. Hidden labels are read by screenreaders.
110
+ # @option label kwargs [Hash] additional arguments are applied as attributes on the +label+ element
111
+ # @param caption [Hash] configures or sets the caption content which is inserted above the label
112
+ # @option caption text [String] the caption text
113
+ # @option caption size [String] the size of the caption, can be +xl+, +l+ or +m+. Defaults to +m+
114
+ # @option caption kwargs [Hash] additional arguments are applied as attributes on the caption +span+ element
115
+ # @option kwargs [Hash] kwargs additional arguments are applied as attributes to the +input+ element
116
+ # @param form_group [Hash] configures the form group
117
+ # @option form_group kwargs [Hash] additional attributes added to the form group
118
+ # @param prefix_text [String] the text placed before the input. No prefix will be added if left +nil+
119
+ # @param suffix_text [String] the text placed after the input. No suffix will be added if left +nil+
120
+ # @param block [Block] arbitrary HTML that will be rendered between the hint and the input
121
+ # @return [ActiveSupport::SafeBuffer] HTML output
122
+ # @see https://design-system.service.gov.uk/components/text-input/ GOV.UK Text input
123
+ # @see https://design-system.service.gov.uk/styles/typography/#headings-with-captions Headings with captions
124
+ #
125
+ # @example A required time field with a placeholder
126
+ # = f.govuk_time_field :time,
127
+ # label: { text: 'Event time' },
128
+ # hint: { text: 'Assumes the server timezone' },
129
+ # required: true,
130
+ # placeholder: '08:00am'
131
+ #
132
+ def govuk_time_field(attribute_name, hint: {}, label: {}, caption: {}, width: nil, extra_letter_spacing: false,
133
+ form_group: {}, prefix_text: nil, suffix_text: nil, **, &)
134
+ Elements::Time.new(self, object_name, attribute_name,
135
+ hint:, label:, caption:, width:, extra_letter_spacing:, form_group:, prefix_text:,
136
+ suffix_text:, **, &).html
137
+ end
138
+
94
139
  # Generates a check box within a fieldset to be used as a boolean toggle for a single attribute.
95
140
  # The values are 1 (toggled on), and 0 (toggled off).
96
141
  #
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "govuk_design_system_formbuilder"
4
+
5
+ module Katalyst
6
+ module GOVUK
7
+ module FormBuilder
8
+ module Elements
9
+ class Time < GOVUKDesignSystemFormBuilder::Base
10
+ include GOVUKDesignSystemFormBuilder::Traits::Input
11
+ include GOVUKDesignSystemFormBuilder::Traits::Error
12
+ include GOVUKDesignSystemFormBuilder::Traits::Hint
13
+ include GOVUKDesignSystemFormBuilder::Traits::Label
14
+ include GOVUKDesignSystemFormBuilder::Traits::Supplemental
15
+ include GOVUKDesignSystemFormBuilder::Traits::HTMLAttributes
16
+
17
+ private
18
+
19
+ def builder_method
20
+ :time_field
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -147,6 +147,10 @@
147
147
  }
148
148
  }
149
149
 
150
+ .govuk-pagination__link-title {
151
+ text-decoration-thickness: inherit;
152
+ }
153
+
150
154
  .govuk-pagination__link-label {
151
155
  @include govuk-typography-weight-regular;
152
156
  @include govuk-link-decoration;