{"version":3,"file":"all-esm.mjs","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/components/button/button.mjs","../../../node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs","../../../node_modules/govuk-frontend/dist/govuk/components/radios/radios.mjs","../../../node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs","../../../node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.mjs","../../../node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.mjs","../../../node_modules/govuk-frontend/dist/govuk/init.mjs","../../assets/javascripts/esm/collapsible-checkboxes.mjs","../../assets/javascripts/esm/colour-preview.mjs","../../assets/javascripts/esm/file-upload.mjs","../../assets/javascripts/esm/autofocus.mjs","../../assets/javascripts/esm/homepage.mjs","../../assets/javascripts/esm/preview-pane.mjs","../../assets/javascripts/esm/utils.mjs","../../../node_modules/textarea-caret-ts/index.js","../../assets/javascripts/esm/stick-to-window-when-scrolling.mjs","../../assets/javascripts/esm/copy-to-clipboard.mjs","../../assets/javascripts/esm/list-entry.mjs","../../assets/javascripts/esm/radios-with-images.mjs","../../assets/javascripts/esm/live-search.mjs","../../assets/javascripts/esm/enhanced-textbox.mjs","../../assets/javascripts/esm/check-report-status.mjs","../../assets/javascripts/esm/live-checkbox-controls.mjs","../../assets/javascripts/esm/add-branding-options-controls.mjs","../../assets/javascripts/esm/radio-select.mjs","../../assets/javascripts/esm/fullscreen-table.mjs","../../assets/javascripts/esm/remove-in-presence-of.mjs","../../assets/javascripts/esm/error-banner.mjs","../../assets/javascripts/esm/authenticate-security-key.mjs","../../assets/javascripts/esm/register-security-key.mjs","../../assets/javascripts/esm/update-status.mjs","../../../node_modules/morphdom/dist/morphdom-esm.js","../../assets/javascripts/esm/update-content.mjs","../../assets/javascripts/esm/update-relative-time_nl.mjs","../../assets/javascripts/esm/template-folder-form_nl.mjs","../../assets/javascripts/esm/all-esm.mjs","../../assets/javascripts/esm/focus-banner.mjs"],"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 { 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","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 { 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 { getBreakpoint } from '../../common/index.mjs';\nimport { Component } from '../../component.mjs';\nimport { ElementError } from '../../errors/index.mjs';\n\n/**\n * Service Navigation component\n *\n * @preserve\n */\nclass ServiceNavigation extends Component {\n  /**\n   * @param {Element | null} $root - HTML element to use for header\n   */\n  constructor($root) {\n    super($root);\n    this.$menuButton = void 0;\n    this.$menu = void 0;\n    this.menuIsOpen = false;\n    this.mql = null;\n    const $menuButton = this.$root.querySelector('.govuk-js-service-navigation-toggle');\n    if (!$menuButton) {\n      return this;\n    }\n    const menuId = $menuButton.getAttribute('aria-controls');\n    if (!menuId) {\n      throw new ElementError({\n        component: ServiceNavigation,\n        identifier: 'Navigation button (`<button class=\"govuk-js-service-navigation-toggle\">`) attribute (`aria-controls`)'\n      });\n    }\n    const $menu = document.getElementById(menuId);\n    if (!$menu) {\n      throw new ElementError({\n        component: ServiceNavigation,\n        element: $menu,\n        identifier: `Navigation (\\`<ul id=\"${menuId}\">\\`)`\n      });\n    }\n    this.$menu = $menu;\n    this.$menuButton = $menuButton;\n    this.setupResponsiveChecks();\n    this.$menuButton.addEventListener('click', () => this.handleMenuButtonClick());\n  }\n  setupResponsiveChecks() {\n    const breakpoint = getBreakpoint('tablet');\n    if (!breakpoint.value) {\n      throw new ElementError({\n        component: ServiceNavigation,\n        identifier: `CSS custom property (\\`${breakpoint.property}\\`) on pseudo-class \\`:root\\``\n      });\n    }\n    this.mql = window.matchMedia(`(min-width: ${breakpoint.value})`);\n    if ('addEventListener' in this.mql) {\n      this.mql.addEventListener('change', () => this.checkMode());\n    } else {\n      this.mql.addListener(() => this.checkMode());\n    }\n    this.checkMode();\n  }\n  checkMode() {\n    if (!this.mql || !this.$menu || !this.$menuButton) {\n      return;\n    }\n    if (this.mql.matches) {\n      this.$menu.removeAttribute('hidden');\n      setAttributes(this.$menuButton, attributesForHidingButton);\n    } else {\n      removeAttributes(this.$menuButton, Object.keys(attributesForHidingButton));\n      this.$menuButton.setAttribute('aria-expanded', this.menuIsOpen.toString());\n      if (this.menuIsOpen) {\n        this.$menu.removeAttribute('hidden');\n      } else {\n        this.$menu.setAttribute('hidden', '');\n      }\n    }\n  }\n  handleMenuButtonClick() {\n    this.menuIsOpen = !this.menuIsOpen;\n    this.checkMode();\n  }\n}\nServiceNavigation.moduleName = 'govuk-service-navigation';\nconst attributesForHidingButton = {\n  hidden: '',\n  'aria-hidden': 'true'\n};\n\n/**\n * Sets a group of attributes on the given element\n *\n * @param {Element} $element - The element to set the attribute on\n * @param {{[attributeName: string]: string}} attributes - The attributes to set\n */\nfunction setAttributes($element, attributes) {\n  for (const attributeName in attributes) {\n    $element.setAttribute(attributeName, attributes[attributeName]);\n  }\n}\n\n/**\n * Removes a list of attributes from the given element\n *\n * @param {Element} $element - The element to remove the attributes from\n * @param {string[]} attributeNames - The names of the attributes to remove\n */\nfunction removeAttributes($element, attributeNames) {\n  for (const attributeName of attributeNames) {\n    $element.removeAttribute(attributeName);\n  }\n}\n\nexport { ServiceNavigation };\n//# sourceMappingURL=service-navigation.mjs.map\n","import { setFocus } from '../../common/index.mjs';\nimport { Component } from '../../component.mjs';\nimport { ElementError } from '../../errors/index.mjs';\n\n/**\n * Skip link component\n *\n * @preserve\n * @augments Component<HTMLAnchorElement>\n */\nclass SkipLink extends Component {\n  /**\n   * @param {Element | null} $root - HTML element to use for skip link\n   * @throws {ElementError} when $root is not set or the wrong type\n   * @throws {ElementError} when $root.hash does not contain a hash\n   * @throws {ElementError} when the linked element is missing or the wrong type\n   */\n  constructor($root) {\n    var _this$$root$getAttrib;\n    super($root);\n    const hash = this.$root.hash;\n    const href = (_this$$root$getAttrib = this.$root.getAttribute('href')) != null ? _this$$root$getAttrib : '';\n    if (this.$root.origin !== window.location.origin || this.$root.pathname !== window.location.pathname) {\n      return;\n    }\n    const linkedElementId = hash.replace('#', '');\n    if (!linkedElementId) {\n      throw new ElementError(`Skip link: Target link (\\`href=\"${href}\"\\`) has no hash fragment`);\n    }\n    const $linkedElement = document.getElementById(linkedElementId);\n    if (!$linkedElement) {\n      throw new ElementError({\n        component: SkipLink,\n        element: $linkedElement,\n        identifier: `Target content (\\`id=\"${linkedElementId}\"\\`)`\n      });\n    }\n    this.$root.addEventListener('click', () => setFocus($linkedElement, {\n      onBeforeFocus() {\n        $linkedElement.classList.add('govuk-skip-link-focused-element');\n      },\n      onBlur() {\n        $linkedElement.classList.remove('govuk-skip-link-focused-element');\n      }\n    }));\n  }\n}\nSkipLink.elementType = HTMLAnchorElement;\nSkipLink.moduleName = 'govuk-skip-link';\n\nexport { SkipLink };\n//# sourceMappingURL=skip-link.mjs.map\n","import { getBreakpoint } from '../../common/index.mjs';\nimport { Component } from '../../component.mjs';\nimport { ElementError } from '../../errors/index.mjs';\n\n/**\n * Tabs component\n *\n * @preserve\n */\nclass Tabs extends Component {\n  /**\n   * @param {Element | null} $root - HTML element to use for tabs\n   */\n  constructor($root) {\n    super($root);\n    this.$tabs = void 0;\n    this.$tabList = void 0;\n    this.$tabListItems = void 0;\n    this.jsHiddenClass = 'govuk-tabs__panel--hidden';\n    this.changingHash = false;\n    this.boundTabClick = void 0;\n    this.boundTabKeydown = void 0;\n    this.boundOnHashChange = void 0;\n    this.mql = null;\n    const $tabs = this.$root.querySelectorAll('a.govuk-tabs__tab');\n    if (!$tabs.length) {\n      throw new ElementError({\n        component: Tabs,\n        identifier: 'Links (`<a class=\"govuk-tabs__tab\">`)'\n      });\n    }\n    this.$tabs = $tabs;\n    this.boundTabClick = this.onTabClick.bind(this);\n    this.boundTabKeydown = this.onTabKeydown.bind(this);\n    this.boundOnHashChange = this.onHashChange.bind(this);\n    const $tabList = this.$root.querySelector('.govuk-tabs__list');\n    const $tabListItems = this.$root.querySelectorAll('li.govuk-tabs__list-item');\n    if (!$tabList) {\n      throw new ElementError({\n        component: Tabs,\n        identifier: 'List (`<ul class=\"govuk-tabs__list\">`)'\n      });\n    }\n    if (!$tabListItems.length) {\n      throw new ElementError({\n        component: Tabs,\n        identifier: 'List items (`<li class=\"govuk-tabs__list-item\">`)'\n      });\n    }\n    this.$tabList = $tabList;\n    this.$tabListItems = $tabListItems;\n    this.setupResponsiveChecks();\n  }\n  setupResponsiveChecks() {\n    const breakpoint = getBreakpoint('tablet');\n    if (!breakpoint.value) {\n      throw new ElementError({\n        component: Tabs,\n        identifier: `CSS custom property (\\`${breakpoint.property}\\`) on pseudo-class \\`:root\\``\n      });\n    }\n    this.mql = window.matchMedia(`(min-width: ${breakpoint.value})`);\n    if ('addEventListener' in this.mql) {\n      this.mql.addEventListener('change', () => this.checkMode());\n    } else {\n      this.mql.addListener(() => this.checkMode());\n    }\n    this.checkMode();\n  }\n  checkMode() {\n    var _this$mql;\n    if ((_this$mql = this.mql) != null && _this$mql.matches) {\n      this.setup();\n    } else {\n      this.teardown();\n    }\n  }\n  setup() {\n    var _this$getTab;\n    this.$tabList.setAttribute('role', 'tablist');\n    this.$tabListItems.forEach($item => {\n      $item.setAttribute('role', 'presentation');\n    });\n    this.$tabs.forEach($tab => {\n      this.setAttributes($tab);\n      $tab.addEventListener('click', this.boundTabClick, true);\n      $tab.addEventListener('keydown', this.boundTabKeydown, true);\n      this.hideTab($tab);\n    });\n    const $activeTab = (_this$getTab = this.getTab(window.location.hash)) != null ? _this$getTab : this.$tabs[0];\n    this.showTab($activeTab);\n    window.addEventListener('hashchange', this.boundOnHashChange, true);\n  }\n  teardown() {\n    this.$tabList.removeAttribute('role');\n    this.$tabListItems.forEach($item => {\n      $item.removeAttribute('role');\n    });\n    this.$tabs.forEach($tab => {\n      $tab.removeEventListener('click', this.boundTabClick, true);\n      $tab.removeEventListener('keydown', this.boundTabKeydown, true);\n      this.unsetAttributes($tab);\n    });\n    window.removeEventListener('hashchange', this.boundOnHashChange, true);\n  }\n  onHashChange() {\n    const hash = window.location.hash;\n    const $tabWithHash = this.getTab(hash);\n    if (!$tabWithHash) {\n      return;\n    }\n    if (this.changingHash) {\n      this.changingHash = false;\n      return;\n    }\n    const $previousTab = this.getCurrentTab();\n    if (!$previousTab) {\n      return;\n    }\n    this.hideTab($previousTab);\n    this.showTab($tabWithHash);\n    $tabWithHash.focus();\n  }\n  hideTab($tab) {\n    this.unhighlightTab($tab);\n    this.hidePanel($tab);\n  }\n  showTab($tab) {\n    this.highlightTab($tab);\n    this.showPanel($tab);\n  }\n  getTab(hash) {\n    return this.$root.querySelector(`a.govuk-tabs__tab[href=\"${hash}\"]`);\n  }\n  setAttributes($tab) {\n    const panelId = $tab.hash.replace('#', '');\n    if (!panelId) {\n      return;\n    }\n    $tab.setAttribute('id', `tab_${panelId}`);\n    $tab.setAttribute('role', 'tab');\n    $tab.setAttribute('aria-controls', panelId);\n    $tab.setAttribute('aria-selected', 'false');\n    $tab.setAttribute('tabindex', '-1');\n    const $panel = this.getPanel($tab);\n    if (!$panel) {\n      return;\n    }\n    $panel.setAttribute('role', 'tabpanel');\n    $panel.setAttribute('aria-labelledby', $tab.id);\n    $panel.classList.add(this.jsHiddenClass);\n  }\n  unsetAttributes($tab) {\n    $tab.removeAttribute('id');\n    $tab.removeAttribute('role');\n    $tab.removeAttribute('aria-controls');\n    $tab.removeAttribute('aria-selected');\n    $tab.removeAttribute('tabindex');\n    const $panel = this.getPanel($tab);\n    if (!$panel) {\n      return;\n    }\n    $panel.removeAttribute('role');\n    $panel.removeAttribute('aria-labelledby');\n    $panel.classList.remove(this.jsHiddenClass);\n  }\n  onTabClick(event) {\n    const $currentTab = this.getCurrentTab();\n    const $nextTab = event.currentTarget;\n    if (!$currentTab || !($nextTab instanceof HTMLAnchorElement)) {\n      return;\n    }\n    event.preventDefault();\n    this.hideTab($currentTab);\n    this.showTab($nextTab);\n    this.createHistoryEntry($nextTab);\n  }\n  createHistoryEntry($tab) {\n    const $panel = this.getPanel($tab);\n    if (!$panel) {\n      return;\n    }\n    const panelId = $panel.id;\n    $panel.id = '';\n    this.changingHash = true;\n    window.location.hash = panelId;\n    $panel.id = panelId;\n  }\n  onTabKeydown(event) {\n    switch (event.key) {\n      case 'ArrowLeft':\n      case 'Left':\n        this.activatePreviousTab();\n        event.preventDefault();\n        break;\n      case 'ArrowRight':\n      case 'Right':\n        this.activateNextTab();\n        event.preventDefault();\n        break;\n    }\n  }\n  activateNextTab() {\n    const $currentTab = this.getCurrentTab();\n    if (!($currentTab != null && $currentTab.parentElement)) {\n      return;\n    }\n    const $nextTabListItem = $currentTab.parentElement.nextElementSibling;\n    if (!$nextTabListItem) {\n      return;\n    }\n    const $nextTab = $nextTabListItem.querySelector('a.govuk-tabs__tab');\n    if (!$nextTab) {\n      return;\n    }\n    this.hideTab($currentTab);\n    this.showTab($nextTab);\n    $nextTab.focus();\n    this.createHistoryEntry($nextTab);\n  }\n  activatePreviousTab() {\n    const $currentTab = this.getCurrentTab();\n    if (!($currentTab != null && $currentTab.parentElement)) {\n      return;\n    }\n    const $previousTabListItem = $currentTab.parentElement.previousElementSibling;\n    if (!$previousTabListItem) {\n      return;\n    }\n    const $previousTab = $previousTabListItem.querySelector('a.govuk-tabs__tab');\n    if (!$previousTab) {\n      return;\n    }\n    this.hideTab($currentTab);\n    this.showTab($previousTab);\n    $previousTab.focus();\n    this.createHistoryEntry($previousTab);\n  }\n  getPanel($tab) {\n    const panelId = $tab.hash.replace('#', '');\n    if (!panelId) {\n      return null;\n    }\n    return this.$root.querySelector(`#${panelId}`);\n  }\n  showPanel($tab) {\n    const $panel = this.getPanel($tab);\n    if (!$panel) {\n      return;\n    }\n    $panel.classList.remove(this.jsHiddenClass);\n  }\n  hidePanel($tab) {\n    const $panel = this.getPanel($tab);\n    if (!$panel) {\n      return;\n    }\n    $panel.classList.add(this.jsHiddenClass);\n  }\n  unhighlightTab($tab) {\n    if (!$tab.parentElement) {\n      return;\n    }\n    $tab.setAttribute('aria-selected', 'false');\n    $tab.parentElement.classList.remove('govuk-tabs__list-item--selected');\n    $tab.setAttribute('tabindex', '-1');\n  }\n  highlightTab($tab) {\n    if (!$tab.parentElement) {\n      return;\n    }\n    $tab.setAttribute('aria-selected', 'true');\n    $tab.parentElement.classList.add('govuk-tabs__list-item--selected');\n    $tab.setAttribute('tabindex', '0');\n  }\n  getCurrentTab() {\n    return this.$root.querySelector('.govuk-tabs__list-item--selected a.govuk-tabs__tab');\n  }\n}\nTabs.moduleName = 'govuk-tabs';\n\nexport { Tabs };\n//# sourceMappingURL=tabs.mjs.map\n","import { normaliseOptions } from './common/configuration.mjs';\nimport { isSupported, isObject } from './common/index.mjs';\nimport { Accordion } from './components/accordion/accordion.mjs';\nimport { Button } from './components/button/button.mjs';\nimport { CharacterCount } from './components/character-count/character-count.mjs';\nimport { Checkboxes } from './components/checkboxes/checkboxes.mjs';\nimport { ErrorSummary } from './components/error-summary/error-summary.mjs';\nimport { ExitThisPage } from './components/exit-this-page/exit-this-page.mjs';\nimport { FileUpload } from './components/file-upload/file-upload.mjs';\nimport { NotificationBanner } from './components/notification-banner/notification-banner.mjs';\nimport { PasswordInput } from './components/password-input/password-input.mjs';\nimport { Radios } from './components/radios/radios.mjs';\nimport { ServiceNavigation } from './components/service-navigation/service-navigation.mjs';\nimport { SkipLink } from './components/skip-link/skip-link.mjs';\nimport { Tabs } from './components/tabs/tabs.mjs';\nimport { SupportError, ElementError } from './errors/index.mjs';\n\n/**\n * Initialise all components\n *\n * Use the `data-module` attributes to find, instantiate and init all of the\n * components provided as part of GOV.UK Frontend.\n *\n * @param {Config | Element | Document | null} [scopeOrConfig] - Scope of the document to search within or config for all components (with optional scope)\n */\nfunction initAll(scopeOrConfig = {}) {\n  const config = isObject(scopeOrConfig) ? scopeOrConfig : {};\n  const options = normaliseOptions(scopeOrConfig);\n  try {\n    if (!isSupported()) {\n      throw new SupportError();\n    }\n    if (options.scope === null) {\n      throw new ElementError({\n        element: options.scope,\n        identifier: 'GOV.UK Frontend scope element (`$scope`)'\n      });\n    }\n  } catch (error) {\n    if (options.onError) {\n      options.onError(error, {\n        config\n      });\n    } else {\n      console.log(error);\n    }\n    return;\n  }\n  const components = [[Accordion, config.accordion], [Button, config.button], [CharacterCount, config.characterCount], [Checkboxes], [ErrorSummary, config.errorSummary], [ExitThisPage, config.exitThisPage], [FileUpload, config.fileUpload], [NotificationBanner, config.notificationBanner], [PasswordInput, config.passwordInput], [Radios], [ServiceNavigation], [SkipLink], [Tabs]];\n  components.forEach(([Component, componentConfig]) => {\n    createAll(Component, componentConfig, options);\n  });\n}\n\n/**\n * Create all instances of a specific component on the page\n *\n * Uses the `data-module` attribute to find all elements matching the specified\n * component on the page, creating instances of the component object for each\n * of them.\n *\n * Any component errors will be caught and logged to the console.\n *\n * @template {CompatibleClass} ComponentClass\n * @param {ComponentClass} Component - class of the component to create\n * @param {ComponentConfig<ComponentClass>} [config] - Config supplied to component\n * @param {OnErrorCallback<ComponentClass> | Element | Document | null | CreateAllOptions<ComponentClass>} [scopeOrOptions] - options for createAll including scope of the document to search within and callback function if error throw by component on init\n * @returns {Array<InstanceType<ComponentClass>>} - array of instantiated components\n */\nfunction createAll(Component, config, scopeOrOptions) {\n  let $elements;\n  const options = normaliseOptions(scopeOrOptions);\n  try {\n    var _options$scope;\n    if (!isSupported()) {\n      throw new SupportError();\n    }\n    if (options.scope === null) {\n      throw new ElementError({\n        element: options.scope,\n        component: Component,\n        identifier: 'Scope element (`$scope`)'\n      });\n    }\n    $elements = (_options$scope = options.scope) == null ? void 0 : _options$scope.querySelectorAll(`[data-module=\"${Component.moduleName}\"]`);\n  } catch (error) {\n    if (options.onError) {\n      options.onError(error, {\n        component: Component,\n        config\n      });\n    } else {\n      console.log(error);\n    }\n    return [];\n  }\n  return Array.from($elements != null ? $elements : []).map($element => {\n    try {\n      return typeof config !== 'undefined' ? new Component($element, config) : new Component($element);\n    } catch (error) {\n      if (options.onError) {\n        options.onError(error, {\n          element: $element,\n          component: Component,\n          config\n        });\n      } else {\n        console.log(error);\n      }\n      return null;\n    }\n  }).filter(Boolean);\n}\n/**\n * @typedef {{new (...args: any[]): any, moduleName: string}} CompatibleClass\n */\n/**\n * Config for all components via `initAll()`\n *\n * @typedef {object} Config\n * @property {Element | Document | null} [scope] - Scope of the document to search within\n * @property {OnErrorCallback<CompatibleClass>} [onError] - Initialisation error callback\n * @property {AccordionConfig} [accordion] - Accordion config\n * @property {ButtonConfig} [button] - Button config\n * @property {CharacterCountConfig} [characterCount] - Character Count config\n * @property {ErrorSummaryConfig} [errorSummary] - Error Summary config\n * @property {ExitThisPageConfig} [exitThisPage] - Exit This Page config\n * @property {FileUploadConfig} [fileUpload] - File Upload config\n * @property {NotificationBannerConfig} [notificationBanner] - Notification Banner config\n * @property {PasswordInputConfig} [passwordInput] - Password input config\n */\n/**\n * Config for individual components\n *\n * @import { AccordionConfig } from './components/accordion/accordion.mjs'\n * @import { ButtonConfig } from './components/button/button.mjs'\n * @import { CharacterCountConfig } from './components/character-count/character-count.mjs'\n * @import { ErrorSummaryConfig } from './components/error-summary/error-summary.mjs'\n * @import { ExitThisPageConfig } from './components/exit-this-page/exit-this-page.mjs'\n * @import { NotificationBannerConfig } from './components/notification-banner/notification-banner.mjs'\n * @import { PasswordInputConfig } from './components/password-input/password-input.mjs'\n * @import { FileUploadConfig } from './components/file-upload/file-upload.mjs'\n */\n/**\n * Component config keys, e.g. `accordion` and `characterCount`\n *\n * @typedef {keyof Omit<Config, 'scope' | 'onError'>} ConfigKey\n */\n/**\n * @template {CompatibleClass} ComponentClass\n * @typedef {ConstructorParameters<ComponentClass>[1]} ComponentConfig\n */\n/**\n * @template {CompatibleClass} ComponentClass\n * @typedef {object} ErrorContext\n * @property {Element} [element] - Element used for component module initialisation\n * @property {ComponentClass} [component] - Class of component\n * @property {Config | ComponentConfig<ComponentClass>} [config] - Config supplied to components\n */\n/**\n * @template {CompatibleClass} ComponentClass\n * @callback OnErrorCallback\n * @param {unknown} error - Thrown error\n * @param {ErrorContext<ComponentClass>} context - Object containing the element, component class and configuration\n */\n/**\n * @template {CompatibleClass} ComponentClass\n * @typedef {object} CreateAllOptions\n * @property {Element | Document | null} [scope] - scope of the document to search within\n * @property {OnErrorCallback<ComponentClass>} [onError] - callback function if error throw by component on init\n */\n\nexport { createAll, initAll };\n//# sourceMappingURL=init.mjs.map\n","import { isSupported } from 'govuk-frontend';\n\n// This new way of writing Javascript components is based on the GOV.UK Frontend skeleton Javascript coding standard\n// that uses ES 015 Classes -\n// https://github.com/alphagov/govuk-frontend/blob/main/docs/contributing/coding-standards/js.md#skeleton\n//\n// It replaces the previously used way of setting methods on the component's `prototype`.\n// We use a class declaration way of defining classes -\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/class\n//\n// More on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\n\nclass CollapsibleCheckboxes  {\n  constructor($module) {\n    if (!isSupported()) {\n      return this;\n    }\n\n    this.toggleButtonClass = 'notify-button--with-chevron';\n    this.toggleButtonChevronClass = 'notify-button--with-chevron__chevron';\n    this.toggleButtonChevronActiveClass = 'notify-button--with-chevron__chevron--active';\n\n    this.$module = $module;\n    this.$selectionSummaryContainer = this.$module.querySelector('.selection-summary');\n    this.fieldLabel = this.$module.getAttribute('data-field-label');\n    this.$fieldset = this.$module.querySelector('.govuk-fieldset');\n    this.$checkboxesContainer = this.$fieldset.querySelector('.govuk-checkboxes');\n    this.$checkboxesArray = this.$fieldset.querySelectorAll('input[type=checkbox]');\n    this.legendText = this.$fieldset.querySelector('legend').textContent.trim();\n\n    this.total = this.$checkboxesArray.length;\n    this.selectionSummaryContent = {\n      all: (selection, total, field) => `All ${field}s`,\n      some: (selection, total, field) => `${selection} of ${total} ${field}s`,\n      none: (selection, total, field) => ({\n        \"folder\": \"No folders (only templates outside a folder)\",\n        \"team member\": \"No team members (only you)\"\n      }[field] || `No ${field}s`)\n    };\n\n    // add heading\n    this.addHeadingHideLegend();\n\n    // insert selection summary text\n    this.initSelectionSummary();\n\n    // insert toggle button\n    this.constructToggleButton();\n\n    // add custom classes\n    this.$fieldset.classList.add('selection-wrapper');\n    this.$checkboxesContainer.classList.add('selection-content', 'govuk-!-margin-top-3');\n\n    // hide checkboxes inside the fieldset\n    this.$fieldset.setAttribute('hidden', '');\n\n    this.handleToggleButtonClick();\n    this.handleCheckboxClick();\n  }\n\n  constructToggleButton() {\n    const $toggleButton = document.createElement('button');\n    $toggleButton.setAttribute('type', 'button');\n    $toggleButton.setAttribute('aria-expanded', 'false');\n    $toggleButton.textContent = `Choose ${this.fieldLabel}s`;\n    $toggleButton.classList.add('govuk-button', 'govuk-button--secondary', this.toggleButtonClass);\n    // visually hidden text\n    const $visuallyHiddenButtonContent = document.createElement('span');\n    $visuallyHiddenButtonContent.classList.add('govuk-visually-hidden');\n    $visuallyHiddenButtonContent.textContent = this.legendText.toLowerCase().replace(`${this.fieldLabel}s`,'');\n    // Create container for show / hide icon\n    const $toggleButtonChevron = document.createElement('span');\n    $toggleButtonChevron.classList.add(this.toggleButtonChevronClass);\n    $toggleButton.append($visuallyHiddenButtonContent);\n    $toggleButton.prepend($toggleButtonChevron);\n\n    this.$fieldset.before($toggleButton);\n  }\n\n  handleToggleButtonClick() {\n    let $button = this.$module.querySelector(`.${this.toggleButtonClass}`);\n    $button.addEventListener(\"click\", () => {\n      let expanded = $button.getAttribute('aria-expanded') === 'true' || false;\n\n      $button.setAttribute('aria-expanded', !expanded);\n      $button.querySelector(`.${this.toggleButtonChevronClass}`).classList.toggle(this.toggleButtonChevronActiveClass);\n      this.$fieldset.hidden = expanded;\n    });\n\n  }\n\n  handleCheckboxClick() {\n    this.$checkboxesArray.forEach(checkbox => {\n      checkbox.addEventListener(\"click\", () => {\n        this.updateSelectionSummary(this.getSelectionCount());\n      });\n    });\n  }\n\n  getSelectionCount() {\n    return Array.from(this.$checkboxesArray).filter((checkbox) => checkbox.checked).length;\n  }\n\n  initSelectionSummary() {\n    const $hint = this.$module.querySelector('.govuk-hint');\n    const $summaryText = document.createElement('p');\n    $summaryText.classList.add('selection-summary__text');\n\n    if (this.fieldLabel === 'folder') {\n      $summaryText.classList.add('selection-summary__text--folders');\n    }\n\n    this.$selectionSummaryContainer.setAttribute('id', $hint.getAttribute('id'));\n    this.$selectionSummaryContainer.append($summaryText);\n    this.$fieldset.before(this.$selectionSummaryContainer);\n    $hint.remove();\n\n    this.updateSelectionSummary(this.getSelectionCount());\n  }\n\n  updateSelectionSummary(count) {\n    const $selectionSummaryTextContainer =  this.$selectionSummaryContainer.querySelector('.selection-summary__text');\n    let template;\n\n    if (count === this.total) {\n      template = 'all';\n    } else if (count > 0) {\n      template = 'some';\n    } else {\n      template = 'none';\n    }\n\n    $selectionSummaryTextContainer.textContent = this.selectionSummaryContent[template](count, this.total, this.fieldLabel);\n  }\n\n  addHeadingHideLegend() {\n\n    const headingLevel = this.$module.getAttribute('data-heading-level');    \n  \n    // allowed list of heading levels\n    const safeHeadingLevels = ['1', '2', '3', '4', '5', '6'];\n    \n    // if data attribute is in the allowed array, apply it. If not use the default\n    const safeLevel = safeHeadingLevels.includes(headingLevel) ? headingLevel : '2';\n    const $heading = document.createElement(`H${safeLevel}`); \n    \n    const $legend = this.$fieldset.querySelector('legend');    \n    $heading.classList.add('heading-small');    \n    $heading.textContent = `${this.legendText}`;\n\n    this.$fieldset.before($heading);\n    $legend.classList.add('govuk-visually-hidden');\n  }\n}\n\nexport default CollapsibleCheckboxes;\n","import { isSupported } from 'govuk-frontend';\n\n// This new way of writing Javascript components is based on the GOV.UK Frontend skeleton Javascript coding standard\n// that uses ES2015 Classes -\n// https://github.com/alphagov/govuk-frontend/blob/main/docs/contributing/coding-standards/js.md#skeleton\n//\n// It replaces the previously used way of setting methods on the component's `prototype`.\n// We use a class declaration way of defining classes -\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/class\n//\n// More on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\n\nclass ColourPreview {\n  constructor($module) {\n    if (!isSupported()) {\n      return this;\n    }\n\n    this.isHexColourValue = value => value.match(/^#?(?:[0-9A-F]{3}){1,2}$/i);\n    this.addHashIfNeeded = value => value.charAt(0) === '#' ? value : '#' + value;\n    this.colourOrWhite = value => this.isHexColourValue(value) ? this.addHashIfNeeded(value) : '#FFFFFF';\n\n    this.$input = $module;\n\n    // We expect the colour preview module to only ever be applied to a GOV.UK Design System text input with a prefix,\n    // which wraps the text input inside a `govuk-input__wrapper` div.\n    const $appendToElement = this.$input.parentNode;\n\n    this.$colourPreviewElement = document.createElement('span');\n    this.$colourPreviewElement.setAttribute('class', 'govuk-input__colour-preview');\n    $appendToElement.append(this.$colourPreviewElement);\n\n    this.applyBackgroundColour();\n\n    this.$input.addEventListener(\"input\", () => {\n      this.applyBackgroundColour();\n    });\n  }\n\n  applyBackgroundColour() {\n    this.$colourPreviewElement.style.background = this.colourOrWhite(this.$input.value.trim());\n  }\n}\n\nexport default ColourPreview;\n","import { Button, isSupported } from 'govuk-frontend';\n\n// This new way of writing Javascript components is based on the GOV.UK Frontend skeleton Javascript coding standard\n// that uses ES2015 Classes -\n// https://github.com/alphagov/govuk-frontend/blob/main/docs/contributing/coding-standards/js.md#skeleton\n//\n// It replaces the previously used way of setting methods on the component's `prototype`.\n// We use a class declaration way of defining classes -\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/class\n//\n// More on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\n\n// Focus banners that do not use the GOVUK Design System Error Summary component but still need to\n// match its behaviour when they appear\n\nclass FileUpload {\n  constructor($module) {\n    if (!isSupported()) {\n      return this;\n    }\n\n    this.$form = $module;\n    this.$field = this.$form.querySelector('.file-upload-field');\n    this.$fieldErrors = this.$form.querySelector('.file-upload-label .govuk-error-message');\n\n    // Note: label.file-upload-label, input.file-upload-field and button.file-upload-submit\n    // are all hidden by CSS that uses the .govuk-frontend-supported class on the body tag\n\n    this.addFakeButton();\n\n    // Clear the form if the user navigates back to the page\n    window.addEventListener(\"pageshow\", () => this.$form.reset());\n\n\n    this.$form.querySelector('.file-upload-field').addEventListener('change', () => {\n      this.$form.submit();\n      this.addCancelButton();\n    });\n  \n  }\n\n  addCancelButton() {\n    const $cancelButton = document.createElement('a');\n    $cancelButton.setAttribute('role', 'button');\n    $cancelButton.setAttribute('href', '');\n    $cancelButton.classList.add('file-upload-button', 'govuk-button', 'govuk-button--warning');\n    $cancelButton.textContent = 'Cancel upload';\n\n    this.$form.querySelector('button.file-upload-button').replaceWith($cancelButton);\n\n    // add GOVUK Frontend behaviours\n    new Button($cancelButton);\n\n    // move focus to the cancel button, it is lost when the upload button is removed\n    $cancelButton.focus();\n  }\n\n  addFakeButton() {\n    const buttonText = this.$field.dataset.buttonText;\n    const fieldId = this.$field.getAttribute('id'); // copy the id across so error links work\n    const oldFieldId = `hidden-${fieldId}`;\n    \n    const $button = document.createElement('button');\n    $button.setAttribute('type', 'button');\n    $button.classList.add('file-upload-button', 'govuk-button', 'govuk-!-margin-right-1');\n    $button.setAttribute('id', fieldId);\n    $button.textContent = buttonText; // Styled as a submit button to raise prominence. The type shouldn't change.\n    \n    // If errors with the upload, copy into a label above the button\n    // Buttons don't need labels by default as the accessible name comes from their text but\n    // errors need to be added to that.\n    const formErrors = Boolean(this.$fieldErrors);\n\n    // Change id of field now we're using it for the button\n    this.$field.setAttribute('id', oldFieldId);\n    this.$field.parentNode.querySelector(`label[for=${fieldId}]`).setAttribute('for', oldFieldId);\n    \n    this.$field.insertAdjacentElement('afterend', $button);\n\n    if (formErrors) {\n      const $label = document.createElement('label');\n      $label.classList.add('file-upload-button-label', 'govuk-error-message');\n      $label.setAttribute('for', fieldId);\n\n      const $span = document.createElement('span');\n      $span.classList.add('govuk-visually-hidden');\n      $span.textContent = `${buttonText} `;\n      \n      $label.appendChild($span);\n      $label.appendChild(document.createTextNode(this.$fieldErrors.textContent));\n\n      this.$field.insertAdjacentElement('afterend', $label);\n    }\n\n    document.querySelector('button.file-upload-button').addEventListener('click', () => {\n      this.$field.click();\n    });\n  }\n}\n\nexport default FileUpload;\n","import { isSupported } from 'govuk-frontend';\n\n// This new way of writing Javascript components is based on the GOV.UK Frontend skeleton Javascript coding standard\n// that uses ES2015 Classes -\n// https://github.com/alphagov/govuk-frontend/blob/main/docs/contributing/coding-standards/js.md#skeleton\n//\n// It replaces the previously used way of setting methods on the component's `prototype`.\n// We use a class declaration way of defining classes -\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/class\n//\n// More on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\n\nclass Autofocus {\n  constructor($module) {\n    if (!isSupported()) {\n      return this;\n    }\n    this.$component = $module;\n    const forceFocus = Boolean(this.$component.dataset.forceFocus);\n    const arrayOfTargetElements = ['input', 'textarea', 'select'];\n    // if the page loads with a scroll position, we can't assume the item to focus onload\n    // is still where users intend to start\n    if ((window.scrollY > 0) && !forceFocus) { return; }\n\n    // See if the component itself is something we want to send focus to\n    // Otherwise look inside the component to see if there are any elements\n    // we want to send focus to\n    let target = arrayOfTargetElements.includes(this.$component.tagName.toLowerCase())\n      ? this.$component\n      : this.$component.querySelector(arrayOfTargetElements.join(','));\n    target.focus();\n  }\n}\n\nexport default Autofocus;\n","import { isSupported } from 'govuk-frontend';\n\nclass Homepage {\n  constructor($module) {\n    if (!isSupported()) {\n      return this;\n    }\n\n    let iterations = 0;\n    let timeout = null;\n\n    $module.addEventListener(\"click\", () => {\n      if (++iterations == 5) {\n        $module.classList.toggle('product-page-intro-wrapper--alternative');\n      }\n      clearTimeout(timeout);\n      timeout = setTimeout(() => iterations = 0, 1500);\n    });\n  }\n}\n\nexport default Homepage;\n","import { isSupported } from 'govuk-frontend';\n\n// This new way of writing Javascript components is based on the GOV.UK Frontend skeleton Javascript coding standard\n// that uses ES2015 Classes -\n// https://github.com/alphagov/govuk-frontend/blob/main/docs/contributing/coding-standards/js.md#skeleton\n//\n// It replaces the previously used way of setting methods on the component's `prototype`.\n// We use a class declaration way of defining classes -\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/class\n//\n// More on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\n\nclass PreviewPane {\n  constructor($module) {\n    if (!isSupported()) {\n      return this;\n    }\n\n    this.branding_style = $module.value;\n    this.$form = $module.form;\n    this.$paneWrapper = this.$form.querySelector('.govuk-grid-column-full');\n    this.previewType = this.$form.dataset.previewType;\n    this.letterBrandingPreviewRootPath = `templates/${this.previewType}-preview-image`;\n\n    this.applyPreviewPane(this.previewType);\n    \n    this.$form.setAttribute('action', location.pathname.replace(new RegExp(`set-${this.previewType}-branding$`), `preview-${this.previewType}-branding`));\n    this.$form.querySelector('button').textContent = 'Save';\n\n    this.$form.querySelector('fieldset').addEventListener(\"change\", (e) => {\n      if (e.target.matches('input[name=\"branding_style\"]')) {\n        this.setPreviewPane(e.target);\n      }\n    });\n  }\n\n  applyPreviewPane(previewType) {\n    previewType === 'letter' ? this.generateImagePreview() : this.generateIframePreview();\n  }\n\n  // we want to generate this just-in-time as otherwise\n  // once the image is appended, src does a http request\n  // even if the previewType is letter\n  generateImagePreview() {\n    let imagePreviewPane = document.createElement('div');\n    imagePreviewPane.setAttribute('class','branding-preview-image');\n    let imagePreviewPaneImage = document.createElement('img');\n    imagePreviewPaneImage.setAttribute('alt','Preview of selected letter branding');\n    imagePreviewPaneImage.setAttribute('src', `/${this.letterBrandingPreviewRootPath}?${this.buildQueryString([\"branding_style\", this.branding_style])}`);\n    imagePreviewPane.appendChild(imagePreviewPaneImage);\n    this.$paneWrapper.append(imagePreviewPane);\n  }\n\n  generateIframePreview() {\n    let iframePreviewPane = document.createElement('iframe');\n    iframePreviewPane.setAttribute('class','branding-preview');\n    iframePreviewPane.setAttribute('scrolling','no');\n    iframePreviewPane.setAttribute('src',`/_${this.previewType}?${this.buildQueryString(['branding_style', this.branding_style])}`);\n    this.$paneWrapper.append(iframePreviewPane);\n  }\n\n  buildQueryString () {\n    // we can accept multiple arrays of parameters\n    // but here we only have 2\n    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments\n    const data = Array.from(arguments);\n    return data.map((val, _idx) => `${encodeURI(val[0])}=${encodeURI(val[1])}`).join('&');\n  }\n  \n  setPreviewPane ($target) {\n    this.branding_style = $target.value;\n    this.previewType === 'letter' ?\n      this.$paneWrapper.querySelector('img').setAttribute('src', `/${this.letterBrandingPreviewRootPath}?${this.buildQueryString(['branding_style', this.branding_style])}`)\n    :\n      this.$paneWrapper.querySelector('iframe').setAttribute('src', `/_${this.previewType}?${this.buildQueryString(['branding_style', this.branding_style])}`);\n    ;\n  }\n}\n\nexport default PreviewPane;\n","// Taken from https://youmightnotneedjquery.com/#offset\nconst offset = (el) => {\n  const box = el.getBoundingClientRect();\n  const docElem = document.documentElement;\n  \n  return {\n    top: box.top + window.scrollY - docElem.clientTop,\n    left: box.left + window.scrollX - docElem.clientLeft\n  };\n};\n\n// Location helpers\nconst locationReload = () => {\n  window.location.reload();\n};\n\nconst locationReplace = (pathName) => {\n  window.location.replace(pathName);\n};\n\nconst locationAssign = (pathName) => {\n  window.location.assign(pathName);\n};\n\nexport { \n  locationAssign,\n  locationReload,\n  locationReplace,\n  offset,\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Caret;\n(function (Caret) {\n    /**\n     * Returns the Absolute (relative to the inner window size) position of the caret in the given element.\n     * @param element Input (has to be type='text') or Text Area.\n     */\n    function getAbsolutePosition(element) {\n        var caretRelPost = getRelativePosition(element);\n        return {\n            left: window.scrollX + element.getBoundingClientRect().left + caretRelPost.left,\n            top: window.scrollY + element.getBoundingClientRect().top + caretRelPost.top,\n            absolute: true,\n            height: caretRelPost.height\n        };\n    }\n    Caret.getAbsolutePosition = getAbsolutePosition;\n    /**\n     * Returns the relative position of the caret in the given element.\n     * @param element Input (has to be type='text') or Text Area.\n     */\n    function getRelativePosition(element, options) {\n        if (options === void 0) { options = { debug: false, useSelectionEnd: false, checkWidthOverflow: true }; }\n        var selectionStart = element.selectionStart !== null ? element.selectionStart : 0;\n        var selectionEnd = element.selectionEnd !== null ? element.selectionEnd : 0;\n        var position = options.useSelectionEnd ? selectionEnd : selectionStart;\n        // We'll copy the properties below into the mirror div.\n        // Note that some browsers, such as Firefox, do not concatenate properties\n        // into their shorthand (e.g. padding-top, padding-bottom etc. -> padding),\n        // so we have to list every single property explicitly.\n        var properties = [\n            'direction',\n            'boxSizing',\n            'width',\n            'height',\n            'overflowX',\n            'overflowY',\n            'borderTopWidth',\n            'borderRightWidth',\n            'borderBottomWidth',\n            'borderLeftWidth',\n            'borderStyle',\n            'paddingTop',\n            'paddingRight',\n            'paddingBottom',\n            'paddingLeft',\n            // https://developer.mozilla.org/en-US/docs/Web/CSS/font\n            'fontStyle',\n            'fontVariant',\n            'fontWeight',\n            'fontStretch',\n            'fontSize',\n            'fontSizeAdjust',\n            'lineHeight',\n            'fontFamily',\n            'textAlign',\n            'textTransform',\n            'textIndent',\n            'textDecoration',\n            'letterSpacing',\n            'wordSpacing',\n            'tabSize',\n            'MozTabSize'\n        ];\n        // Firefox 1.0+\n        var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n        var isBrowser = typeof window !== 'undefined';\n        if (!isBrowser) {\n            throw new Error('textarea-caret-position#getCaretPosition should only be called in a browser');\n        }\n        var debug = (options && options.debug) || false;\n        if (debug) {\n            var el = document.querySelector('#input-textarea-caret-position-mirror-div');\n            if (el && el.parentNode)\n                el.parentNode.removeChild(el);\n        }\n        // The mirror div will replicate the textareas style\n        var div = document.createElement('div');\n        div.id = 'input-textarea-caret-position-mirror-div';\n        document.body.appendChild(div);\n        var style = div.style;\n        // @ts-ignore\n        var computed = window.getComputedStyle ? window.getComputedStyle(element) : element.currentStyle; // currentStyle for IE < 9\n        var isInput = element.nodeName === 'INPUT';\n        // Default textarea styles\n        style.whiteSpace = 'pre-wrap';\n        if (!isInput)\n            style.wordWrap = 'break-word'; // only for textarea-s\n        // Position off-screen\n        style.position = 'absolute'; // required to return coordinates properly\n        if (!debug)\n            style.visibility = 'hidden'; // not 'display: none' because we want rendering\n        // Transfer the element's properties to the div\n        properties.forEach(function (prop) {\n            if (isInput && prop === 'lineHeight') {\n                // Special case for <input>s because text is rendered centered and line height may be != height\n                if (computed.boxSizing === 'border-box') {\n                    var height = parseInt(computed.height);\n                    var outerHeight_1 = parseInt(computed.paddingTop) +\n                        parseInt(computed.paddingBottom) +\n                        parseInt(computed.borderTopWidth) +\n                        parseInt(computed.borderBottomWidth);\n                    var targetHeight = outerHeight_1 + parseInt(computed.lineHeight);\n                    if (height > targetHeight) {\n                        style.lineHeight = height - outerHeight_1 + 'px';\n                    }\n                    else if (height === targetHeight) {\n                        style.lineHeight = computed.lineHeight;\n                    }\n                    else {\n                        style.lineHeight = '0';\n                    }\n                }\n                else {\n                    style.lineHeight = computed.height;\n                }\n            }\n            else {\n                //@ts-ignore\n                style[prop] = computed[prop];\n            }\n        });\n        if (isFirefox) {\n            // Firefox lies about the overflow property for textareas: https://bugzilla.mozilla.org/show_bug.cgi?id=984275\n            if (element.scrollHeight > parseInt(computed.height))\n                style.overflowY = 'scroll';\n        }\n        else {\n            style.overflow = 'hidden'; // for Chrome to not render a scrollbar; IE keeps overflowY = 'scroll'\n        }\n        div.textContent = element.value.substring(0, position);\n        // The second special handling for input type=\"text\" vs textarea:\n        // spaces need to be replaced with non-breaking spaces - http://stackoverflow.com/a/13402035/1269037\n        if (isInput && div.textContent)\n            div.textContent = div.textContent.replace(/\\s/g, '\\u00a0');\n        var span = document.createElement('span');\n        // Wrapping must be replicated *exactly*, including when a long word gets\n        // onto the next line, with whitespace at the end of the line before (#7).\n        // The  *only* reliable way to do that is to copy the *entire* rest of the\n        // textareas content into the <span> created at the caret position.\n        // For inputs, just '.' would be enough, but no need to bother.\n        span.textContent = element.value.substring(position) || '.'; // || because a completely empty faux span doesn't render at all\n        div.appendChild(span);\n        var relativePosition = {\n            top: span.offsetTop + parseInt(computed['borderTopWidth']),\n            left: span.offsetLeft + parseInt(computed['borderLeftWidth']),\n            absolute: false,\n            height: parseInt(computed['lineHeight'])\n        };\n        if (debug) {\n            span.style.backgroundColor = '#aaa';\n        }\n        else {\n            document.body.removeChild(div);\n        }\n        if (relativePosition.left >= element.clientWidth && options.checkWidthOverflow) {\n            relativePosition.left = element.clientWidth;\n        }\n        return relativePosition;\n    }\n    Caret.getRelativePosition = getRelativePosition;\n    /**\n     * sets the top and left css style of the element based on the absolute position of the caretElements caret,\n     * @param offset offsets the position.\n     * @param detectBoundary offsets the position if the position would be outside the window.\n     * @param returnOnly if true the element position wont be set.\n     */\n    function setElementPositionBasedOnCaret(element, caretElement, offset, margin, detectBoundary, returnOnly) {\n        if (offset === void 0) { offset = { top: 0, left: 0 }; }\n        if (margin === void 0) { margin = 2; }\n        if (detectBoundary === void 0) { detectBoundary = true; }\n        if (returnOnly === void 0) { returnOnly = false; }\n        var pos = getAbsolutePosition(caretElement);\n        if (detectBoundary) {\n            pos.left =\n                pos.left + (element.clientWidth + margin) + offset.left > window.scrollX + window.innerWidth\n                    ? (pos.left = window.scrollX + window.innerWidth - (element.clientWidth + margin))\n                    : (pos.left += offset.left);\n            pos.top =\n                pos.top + (element.clientWidth + margin) + offset.top > window.scrollY + window.innerHeight\n                    ? (pos.top -= element.clientWidth + margin)\n                    : (pos.top += offset.top);\n        }\n        else {\n            pos.top += offset.top;\n            pos.left += offset.left;\n        }\n        if (!returnOnly) {\n            element.style.top = pos.top + 'px';\n            element.style.left = pos.left + 'px';\n        }\n        return pos;\n    }\n    Caret.setElementPositionBasedOnCaret = setElementPositionBasedOnCaret;\n})(Caret = exports.Caret || (exports.Caret = {}));\n/**\n * @deprecated use Caret.getRelativePosition instead.\n */\nexports.getCaretCoordinates = function (element, position, options) {\n    if (options === void 0) { options = { debug: false }; }\n    return Caret.getRelativePosition(element, options);\n};\n","import { isSupported } from 'govuk-frontend';\nimport { offset } from './utils.mjs';\nimport { Caret } from 'textarea-caret-ts';\n\nlet _mode = 'default';\n\n// Class to make objects representing the area sticky elements move in\n// This includes holding a reference to the containing element but also methods to handle interactions in the area that may\n// overlapped by sticky elements\n//\n// Note: the actual boundaries of sticky behaviour are set by `.js-header` and `.js-footer` classes rather than the parent element\n//\n// More on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\nclass ScrollArea {\n\n  constructor (el, edge, selector) {\n    const $el = el.$fixedEl;\n    let $scrollArea = $el.closest('.sticky-scroll-area');\n\n    if ($scrollArea === null) {\n      $scrollArea = $el.parentElement;\n      $scrollArea.classList.add('sticky-scroll-area');\n    }\n    this.els = [el];\n    this.edge = edge;\n    this.selector = selector;\n    this.node = $scrollArea;\n    this.setEvents();\n  }\n\n  addEl (el) {\n    this.els.push(el);\n  }\n\n  hasEl (el) {\n    return this.els.includes(el);\n  }\n\n  updateEls (usedEls) {\n    this.els = usedEls;\n  }\n\n  #keyUpHandler (e) {\n    if (e.target.matches('textarea')) {\n      this.focusHandler(e);\n    }\n  }\n\n  setEvents () {\n    this.node.addEventListener('focus', this.focusHandler.bind(this), { capture: true, passive: true });\n    this.node.addEventListener('keyup', this.#keyUpHandler.bind(this), { passive: true });\n  }\n\n  removeEvents () {\n    this.node.removeEventListener('focus', this.focusHandler.bind(this), { capture: true, passive: true });\n    this.node.removeEventListener('keyup', this.#keyUpHandler.bind(this), { passive: true });\n  }\n\n  getFocusedDetails = {\n    forElement: ($focusedElement) => {\n      const focused = {\n        'top': offset($focusedElement).top,\n        'height': $focusedElement.offsetHeight,\n        'type': 'element'\n      };\n      focused.bottom = focused.top + focused.height;\n\n      return focused;\n    },\n    forCaret: ($textarea) => {\n      const textarea = $textarea;\n      const caretCoordinates = Caret.getAbsolutePosition(textarea);\n      const focused = {\n        'top': caretCoordinates.top,\n        'height': caretCoordinates.height,\n        'type': 'caret'\n      };\n      focused.bottom = focused.top + focused.height;\n\n      return focused;\n    }\n  };\n\n  focusHandler () {\n    this.scrollToRevealElement(document.activeElement);\n  }\n\n  scrollToRevealElement ($el) {\n    const nodeName = $el.nodeName.toLowerCase();\n    const nodeType = $el.getAttribute('type');\n    const endOfFurthestEl = focusOverlap.endOfFurthestEl(this.els, this.edge);\n    const isInSticky = $el.closest(this.selector) !== null;\n    let focused;\n    let overlap;\n\n    if (nodeName === 'textarea') {\n      focused = this.getFocusedDetails.forCaret($el);\n    } else if (!isInSticky && (nodeType === 'checkbox' || nodeType === 'radio')) {\n      focused = this.getFocusedDetails.forElement($el.parentElement);\n    } else {\n      if (isInSticky) { return; }\n      focused = this.getFocusedDetails.forElement($el);\n    }\n\n    overlap = focusOverlap.getOverlap(focused, this.edge, endOfFurthestEl);\n    if (overlap > 0) {\n      focusOverlap.adjustForOverlap(focused, this.edge, overlap);\n    }\n  }\n\n  destroy () {\n    this.removeEvents();\n  }\n\n}\n\n// Singleton class collecting together methods for interacting with the scrollareas on the page\n//\n// It replaces the previously used way of setting methods on the component's `prototype`.\n// We use a class declaration way of defining classes -\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/class\n//\n// More on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\nclass ScrollAreas {\n  #scrollAreas = [];\n\n  constructor () {}\n\n  getAreaForEl (el) {\n    let loopIdx = this.#scrollAreas.length;\n\n    while(loopIdx--) {\n      if (this.#scrollAreas[loopIdx].hasEl(el)) {\n        return this.#scrollAreas[loopIdx];\n      }\n    }\n\n    return false;\n  }\n\n  getAreaByEl (el) {\n    const matches = this.#scrollAreas.filter(area => area.els.includes(el));\n\n    return matches[0] || false;\n  }\n\n  addEl (el, edge, selector) {\n    const scrollArea = this.getAreaForEl(el);\n\n    if (!scrollArea) {\n      this.#scrollAreas.push(new ScrollArea(el, edge, selector));\n    } else {\n      scrollArea.addEl(el);\n    }\n  }\n\n  syncEls (elsInDOM) {\n    const unusedAreas = [];\n\n    const getUsed = (area) => {\n      return elsInDOM.filter(el => area.hasEl(el));\n    };\n\n    const deleteUnused = (idx, areaIdx) => {\n      // remove any events for overlap checking bound to the scrollArea\n      this.#scrollAreas[areaIdx].destroy();\n      this.#scrollAreas.splice(areaIdx, 1);\n    };\n\n    // update any scroll areas with els still in the DOM and track any with none\n    this.#scrollAreas.forEach((area, areaIdx) => {\n      const used = getUsed(area);\n\n      if (!used.length) {\n        unusedAreas.push(areaIdx);\n      }\n\n      area.updateEls(used);\n    });\n\n    // delete any scroll areas with no els still in DOM\n    unusedAreas.forEach(deleteUnused);\n  }\n\n  filterBy (filterFunc) {\n    return this.#scrollAreas.filter(filterFunc);\n  }\n\n}\nconst scrollAreas = new ScrollAreas();\n\n// Object collecting together methods for stopping sticky overlapping focused elements\nconst focusOverlap = {\n  getOverlap: function (focused, edge, endOfFurthestEl) {\n    if (!endOfFurthestEl) { return 0; }\n\n    if (edge === 'top') {\n      return endOfFurthestEl - focused.top;\n    } else {\n      return focused.bottom - endOfFurthestEl;\n    }\n  },\n  endOfFurthestEl: function (els, edge) {\n    const stuckEls = els.filter((el) => el.isStuck);\n    let edgeOfEl;\n\n    if (!stuckEls.length) { return false; }\n\n    if (edge === 'bottom') {\n      edgeOfEl = el => offset(el.$fixedEl).top;\n    } else {\n      edgeOfEl = el => offset(el.$fixedEl).top + el.height;\n    }\n\n    const offsets = stuckEls.map((el) => edgeOfEl(el));\n\n    return offsets.reduce((accumulator, offset) => {\n      return (accumulator < offset) ? offset: accumulator;\n    });\n  },\n  adjustForOverlap: function (focused, edge, overlap) {\n    const scrollTop = window.scrollY;\n\n    // scroll so element becomes visible\n    if (edge === 'top') {\n      window.scrollTo(window.pageXOffset, (scrollTop - overlap));\n    } else {\n      window.scrollTo(window.pageXOffset, (scrollTop + overlap));\n    }\n  }\n};\n\n// Singleton class for dealing with marking the edge of a sticky, or group of sticky elements (as seen in dialog mode)\nclass OppositeEdge {\n\n  #classes = {\n    'top': 'content-fixed__top',\n    'bottom': 'content-fixed__bottom'\n  };\n\n  constructor () {}\n\n  mark (sticky) {\n    const edgeClass = this.#classes[sticky.edge];\n    let els;\n\n    if (_mode === 'dialog') {\n      els = [dialog.getElementAtOppositeEnd(sticky)];\n    } else {\n      els = sticky.els;\n    }\n\n    els = els.filter((el) => el.isStuck);\n\n    els.forEach((el) => el.$fixedEl.classList.add(edgeClass));\n  }\n\n  unmark (sticky) {\n    const edgeClass = this.#classes[sticky.edge];\n\n    sticky.els.forEach(el => el.$fixedEl.classList.remove(edgeClass));\n  }\n\n}\nconst oppositeEdge = new OppositeEdge();\n\n\n// Class wrapping sticky elements, to control changes to their HTML and CSS, as well as the shim inserted when they become sticky\n//\n// It replaces the previously used way of setting methods on the component's `prototype`.\n// We use a class declaration way of defining classes -\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/class\n//\n// More on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\nclass StickyElement {\n  #initialFixedClass = 'content-fixed-onload';\n  #fixedClass = 'content-fixed';\n  #appliedClass = null;\n  #stopped = false;\n  #hasLoaded = false;\n  #canBeStuck = true;\n  #sticky;\n\n  constructor ($el, sticky) {\n    this.#sticky = sticky;\n    this.$fixedEl = $el;\n    this.$shim = null;\n\n    const marginTop = window.getComputedStyle(this.$fixedEl)['margin-top'];\n    const marginBottom = window.getComputedStyle(this.$fixedEl)['margin-bottom'];\n\n    this.verticalMargins = {\n      'top': (marginTop !== '') ? parseInt(marginTop, 10) : null,\n      'bottom': (marginBottom !== '') ? parseInt(marginBottom, 10) : null\n    };\n  }\n\n  #getShimCSS () {\n    let inlineStyles = `width: ${this.horizontalSpace}px; height: ${this.height}px`;\n\n    if (this.verticalMargins.top) {\n      inlineStyles += `; margin-top: ${this.verticalMargins.top}px`;\n    }\n    if (this.verticalMargins.bottom) {\n      inlineStyles += `; margin-bottom: ${this.verticalMargins.bottomtop}px`;\n    }\n    return inlineStyles;\n  }\n\n  stickyClass () {\n    return (this.#sticky.initialPositionsSet) ? this.#fixedClass : this.#initialFixedClass;\n  }\n\n  appliedClass () {\n    return this.#appliedClass;\n  }\n\n  removeStickyClasses () {\n    this.$fixedEl.classList.remove(this.#initialFixedClass, this.#fixedClass);\n  }\n\n  get isStuck () {\n    return this.#appliedClass !== null;\n  }\n\n  stick () {\n    this.#appliedClass = this.stickyClass();\n    this.$fixedEl.classList.add(this.#appliedClass);\n  }\n\n  release () {\n    this.#appliedClass = null;\n    this.removeStickyClasses();\n  }\n\n  // When a sticky element is moved into the 'stuck' state, a shim is inserted into the\n  // page to preserve the space the element occupies in the flow.\n  addShim (position) {\n    const insertPosition = (position === 'before') ? 'beforebegin' : 'afterend';\n\n    this.$shim = document.createElement('div');\n    this.$shim.innerHTML = '&nbsp;'; // we should use createTextNode but it won't take HTML entities\n    this.$shim.classList.add('shim');\n    this.$shim.setAttribute('style', this.#getShimCSS());\n    this.$fixedEl.insertAdjacentElement(insertPosition, this.$shim);\n  }\n\n  removeShim () {\n    if (this.$shim !== null) {\n      this.$shim.remove();\n      this.$shim = null;\n    }\n  }\n\n  // Changes to the dimensions of a sticky element with a shim need to be passed on to the shim\n  updateShim () {\n    if (this.$shim) {\n      this.$shim.setAttribute('style', this.#getShimCSS());\n    }\n  }\n\n  stop () {\n    this.#stopped = true;\n  }\n\n  unstop () {\n    this.#stopped = false;\n  }\n\n  get isStopped () {\n    return this.#stopped;\n  }\n\n  get isInPage () {\n    const node = this.$fixedEl;\n    return (node === document.body) ? false : document.body.contains(node);\n  }\n\n  get canBeStuck () {\n    return this.#canBeStuck;\n  }\n\n  set canBeStuck (val) {\n    this.#canBeStuck = val;\n  }\n\n  get hasLoaded () {\n    return this.#hasLoaded;\n  }\n\n  set hasLoaded (val) {\n    this.#hasLoaded = val;\n  }\n\n}\n\n// Singleton class for treating multiple sticky elements as a group.\n//\n// More on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\nclass Dialog {\n  static spaceBetweenStickys = 40;\n\n  constructor () {\n    this.hasResized = false;\n  }\n\n  // we add padding of 20px around each sticky to give some space between it and the rest of the page\n  // this shouldn't apply between stickys in a stack\n  // (the in-page CSS handles this by each subsequent sticky in a sequence having margin: -40px)\n  #getPaddingBetweenEls (els) {\n    if (els.length <= 1) { return 0; }\n\n    return (els.length - 1) * Dialog.spaceBetweenStickys;\n  }\n\n  #getTotalHeight (els) {\n    const reducer = (accumulator, currentValue) => {\n      return accumulator + currentValue;\n    };\n    const combinedHeight = els.map(el => el.height).reduce(reducer);\n\n    return combinedHeight - this.#getPaddingBetweenEls(els);\n  }\n\n  #elsThatCanBeStuck (els) {\n    return els.filter(el => el.canBeStuck);\n  }\n\n  getOffsetFromEdge (el, sticky) {\n    let els = this.#elsThatCanBeStuck(sticky.els).slice();\n\n    // els must be arranged furtherest from window edge is stuck to first\n    // default direction is order in document\n    if (sticky.edge === 'top') {\n      els.reverse();\n    }\n\n    const elIdx = els.indexOf(el);\n\n    // if next to window edge the dialog is stuck to, no offset\n    if (elIdx === (els.length - 1)) { return 0; }\n\n    // make els all those from this one to the window edge\n    els = els.slice(elIdx + 1);\n\n    // remove the space between those els and the one on the edge\n    return this.#getTotalHeight(els) - Dialog.spaceBetweenStickys;\n  }\n\n  getOffsetFromEnd (el, sticky) {\n    let els = this.#elsThatCanBeStuck(sticky.els);\n\n    // els must be arranged furtherest from window edge is stuck to first\n    // default direction is order in document\n    if (sticky.edge === 'bottom') {\n      els.reverse();\n    }\n\n    const elIdx = els.indexOf(el);\n\n    // if next to opposite edge to the one the dialog is stuck to, no offset\n    if (elIdx === (els.length - 1)) { return 0; }\n\n    // make els all those from this one to the window edge\n    els = els.slice(elIdx + 1);\n\n    return this.#getTotalHeight(els) - Dialog.spaceBetweenStickys;\n  }\n\n  // checks total height of all this._sticky elements against a height\n  // unsticks each that won't fit and marks them as unstickable\n  fitToHeight (sticky) {\n    const self = this;\n    const els = sticky.els.slice();\n    const height = StickAtEdge.getWindowDimensions().height;\n    const totalStickyHeight = () => self.#getTotalHeight(self.#elsThatCanBeStuck(els));\n    const dialogFitsHeight = () => totalStickyHeight() <= height;\n\n    // els must be arranged furtherest from window edge is stuck to first\n    // default direction is order in document\n    if (sticky.edge === 'top') {\n      els.reverse();\n    }\n\n    // reset elements\n    els.forEach(el => el.canBeStuck = true);\n\n    while (self.#elsThatCanBeStuck(els).length && !dialogFitsHeight()) {\n      const currentEl = self.#elsThatCanBeStuck(els)[0];\n\n      sticky.reset(currentEl);\n      currentEl.canBeStuck = false;\n\n      if (!self.hasResized) { self.hasResized = true; }\n    }\n  }\n\n  getElementAtStickyEdge (sticky) {\n    const els = this.#elsThatCanBeStuck(sticky.els);\n    const idx = (sticky.edge === 'top') ? 0 : els.length - 1;\n\n    return els[idx];\n  }\n\n  // get element at the end opposite the sticky edge\n  getElementAtOppositeEnd (sticky) {\n    const els = this.#elsThatCanBeStuck(sticky.els);\n    const idx = (sticky.edge === 'top') ? els.length - 1 : 0;\n\n    return els[idx];\n  }\n\n  getInPageEdgePosition (sticky) {\n    return this.getElementAtStickyEdge(sticky).inPageEdgePosition;\n  }\n\n  getHeight (els) {\n    return this.#getTotalHeight(this.#elsThatCanBeStuck(els));\n  }\n\n  adjustForResize (sticky) {\n    const windowHeight = StickAtEdge.getWindowDimensions().height;\n\n    if (sticky.edge === 'top') {\n      window.scrollTo(window.pageXOffset, this.getInPageEdgePosition(sticky));\n    } else {\n      window.scrollTo(window.pageXOffset, this.getInPageEdgePosition(sticky) - windowHeight);\n    }\n\n    this.hasResized = false;\n  }\n\n  releaseEl (el, sticky) {\n    el.$fixedEl.style[sticky.edge] = '';\n  }\n\n}\nconst dialog = new Dialog();\n\n// Class collecting together all generic behaviour for controlling the state of\n// sticky elements and all their associated behaviour.\n//\n// It replaces the previously used way of setting methods on the component's `prototype`.\n// We use a class declaration way of defining classes -\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/class\n//\n// More on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\nclass StickAtEdge {\n  #hasScrolled = false;\n  #scrollTimeout = false;\n  #windowHasResized = false;\n  #resizeTimeout = false;\n\n  constructor (selector) {\n    this.els = [];\n    this.initialPositionsSet = false;\n\n    this.CSS_SELECTOR = selector;\n    this.STOP_PADDING = 10;\n  }\n\n  setMode (mode) {\n    _mode = mode;\n  }\n\n  // Change state of sticky elements based on their position relative to the window\n  setElementPositions () {\n    const windowDimensions = StickAtEdge.getWindowDimensions(),\n          windowTop = StickAtEdge.getWindowPositions().scrollTop,\n          windowPositions = {\n            'top': windowTop,\n            'bottom':  windowTop + windowDimensions.height\n          };\n\n    const setElementPosition = (el) => {\n      if (this.viewportIsWideEnough(windowDimensions.width)) {\n\n        if (this.windowNotPastScrolledFrom(windowPositions, this.getScrolledFrom(el))) {\n          this.reset(el);\n        } else { // past the point it sits in the document\n          if (this.windowNotPastScrollingTo(windowPositions, this.getScrollingTo(el))) {\n            this.stick(el);\n            if (el.isStopped) {\n              this.unstop(el);\n            }\n          } else { // window past scrollingTo position\n            if (!el.isStuck) {\n              this.stick(el);\n            }\n            this.stop(el);\n          }\n        }\n\n      } else {\n\n        this.reset(el);\n\n      }\n    };\n\n    // clean up any existing styles marking the edges of sticky elements\n    oppositeEdge.unmark(this);\n\n    this.els.forEach(el => {\n      if (el.canBeStuck) {\n        setElementPosition(el);\n      }\n    });\n\n    // add styles to mark the edge of sticky elements opposite to that stuck to the window\n    oppositeEdge.mark(this);\n\n    if (this.initialPositionsSet === false) { this.initialPositionsSet = true; }\n  }\n\n  // Store all the dimensions for a sticky element to limit DOM queries\n  setElementDimensions (el, callback) {\n    const onHeightSet = () => {\n      // if element is shim'ed, pass changes in dimension on to the shim\n      if (el.$shim) {\n        el.updateShim();\n      }\n      if (callback !== undefined) {\n        callback();\n      }\n    };\n\n    this.setElWidth(el);\n    this.setElHeight(el, onHeightSet);\n  }\n\n  // Reset element to original state in the page\n  reset (el) {\n    if (el.isStopped) {\n      this.unstop(el);\n    }\n\n    if (el.isStuck) {\n      this.release(el);\n    }\n  }\n\n  // Recalculate stored dimensions for all sticky elements\n  recalculate () {\n    // break early if GOVUK Frontend is not supported\n    if (!isSupported()) {\n      return;\n    }\n\n    const onSyncComplete = () => {\n      scrollAreas.syncEls(this.els);\n      this.setEvents();\n      if (_mode === 'dialog') {\n        dialog.fitToHeight(this);\n        if (dialog.hasResized) {\n          dialog.adjustForResize(this);\n        }\n      }\n      this.setElementPositions();\n    };\n\n    this.syncWithDOM(onSyncComplete);\n  }\n\n  // Public method to scroll so an element isn't covered by the sticky nav\n  scrollToRevealElement ($el) {\n    // guard against previous version of this method recieving `$el` as a jQuery-wrapped DOM node\n    if ('jquery' in $el) { $el = $el.get(0); }\n\n    const scrollAreaNode = $el.closest('.sticky-scroll-area');\n    const matches = scrollAreas.filterBy(scrollArea => {\n      return scrollArea.node === scrollAreaNode;\n    });\n\n    if (matches.length) {\n      matches[0].scrollToRevealElement($el);\n    }\n  }\n\n  setElWidth (el) {\n    const $el = el.$fixedEl;\n    const scrollArea = scrollAreas.getAreaByEl(el);\n    const width = scrollArea.node.getBoundingClientRect().width;\n\n    el.horizontalSpace = width;\n\n    // if stuck, element won't inherit width from parent so set explicitly\n    if (el.$shim) {\n      $el.style.width = width + 'px';\n    }\n  }\n\n  setElHeight (el, callback) {\n    const $el = el.$fixedEl;\n    const $img = $el.querySelector('img');\n\n    const onload = () => {\n      el.height = $el.offsetHeight;\n      // if element has a shim, the shim's offset represents the element's in-page position\n      if (el.$shim) {\n        el.inPageEdgePosition = this.getInPageEdgePosition(el.$shim);\n      } else {\n        el.inPageEdgePosition = this.getInPageEdgePosition($el);\n      }\n      callback();\n    };\n\n    if (!el.hasLoaded && ($img !== null)) {\n      const image = new window.Image();\n      image.onload = () => {\n        onload();\n      };\n      image.src = $img.attr('src');\n    } else {\n      onload();\n    }\n  }\n\n  allElementsLoaded (totalEls) {\n    return this.els.length === totalEls;\n  }\n\n  getElForNode (node) {\n    const matches = this.els.filter(el => el.$fixedEl === node);\n\n    return matches.length ? matches[0] : false;\n  }\n\n  add (node, setPositions, cb) {\n    const $el = node;\n    let elObj = this.getElForNode(node);\n    const exists = !!elObj;\n\n    const onDimensionsSet = () => {\n      elObj.hasLoaded = true;\n\n      // guard against adding elements already stored\n      if (!exists) {\n        this.els.push(elObj);\n      }\n\n      if (setPositions) {\n        this.setElementPositions();\n      }\n\n      if (cb !== undefined) {\n        cb();\n      }\n    };\n\n    if (!exists) {\n      elObj = new StickyElement($el, this);\n      scrollAreas.addEl(elObj, this.edge, this.CSS_SELECTOR);\n    }\n\n    this.setElementDimensions(elObj, onDimensionsSet);\n  }\n\n  remove (el) {\n    if (this.els.includes(el)) {\n\n      // reset DOM node to original state\n      this.reset(el);\n\n      // remove sticky element object\n      this.els = this.els.filter(_el => _el !== el);\n    }\n  }\n\n  // gets all sticky elements in the DOM and removes any in this.els no longer in attached to it\n  syncWithDOM (callback) {\n    const $els = document.querySelectorAll(this.CSS_SELECTOR);\n    const numOfEls = $els.length;\n\n    const onLoaded = () => {\n      if (this.els.length === numOfEls) {\n        this.endOfScrollArea = this.getEndOfScrollArea();\n        if (callback !== undefined) {\n          callback();\n        }\n      }\n    };\n\n    // remove any els no longer in the DOM\n    if (this.els.length) {\n      this.els.forEach(el => {\n        if (!el.isInPage) {\n          this.remove(el);\n        }\n      });\n    }\n\n    if (numOfEls) {\n      // reset flag marking page load\n      this.initialPositionsSet = false;\n\n      $els.forEach(el => {\n        // delay setting position until all stickys are loaded\n        this.add(el, false, onLoaded);\n      });\n    }\n  }\n\n  init () {\n    // reset all state\n    this.#hasScrolled = false;\n    this.#scrollTimeout = false;\n    this.#windowHasResized = false;\n    this.#resizeTimeout = false;\n\n    this.recalculate();\n  }\n\n  setEvents () {\n    this._scrollEvent = this.onScroll.bind(this);\n    this._resizeEvent = this.onResize.bind(this);\n\n    // flag when scrolling takes place and check (and re-position) sticky elements relative to\n    // window position\n    if (this.#scrollTimeout === false) {\n      // TODO: consider replacing with 'scrollEnd' event when more widely available\n      // https://developer.mozilla.org/en-US/docs/Web/API/Document/scroll_event\n      window.addEventListener('scroll', this._scrollEvent);\n      this.#scrollTimeout = window.setInterval(this.checkScroll.bind(this), 50);\n    }\n\n    // Recalculate all dimensions when the window resizes\n    if (this.#resizeTimeout === false) {\n      window.addEventListener('resize', this._resizeEvent);\n      this.#resizeTimeout = window.setInterval(this.checkResize.bind(this), 50);\n    }\n  }\n\n  clearEvents () {\n    if (this.#scrollTimeout !== false) {\n      document.removeEventListener('scroll', this._scrollEvent);\n      window.clearInterval(this.#scrollTimeout);\n      this.#scrollTimeout = false;\n    }\n\n    if (this.#resizeTimeout !== false) {\n      window.removeEventListener('resize', this._resizeEvent);\n      window.clearInterval(this.#resizeTimeout);\n      this.#resizeTimeout = false;\n    }\n\n  }\n\n  viewportIsWideEnough (windowWidth) {\n    return windowWidth > 768;\n  }\n\n  onScroll () {\n    this.#hasScrolled = true;\n  }\n\n  onResize () {\n    this.#windowHasResized = true;\n  }\n\n  checkScroll () {\n    if (this.#hasScrolled === true) {\n      this.#hasScrolled = false;\n      this.setElementPositions();\n    }\n  }\n\n  checkResize () {\n    const windowWidth = StickAtEdge.getWindowDimensions().width;\n\n    if (this.#windowHasResized === true) {\n      this.#windowHasResized = false;\n\n      this.els.forEach(el => {\n        if (!this.viewportIsWideEnough(windowWidth)) {\n          this.reset(el);\n        } else {\n          this.setElementDimensions(el);\n        }\n      });\n\n      if (this.viewportIsWideEnough(windowWidth)) {\n        if (_mode === 'dialog') {\n          dialog.fitToHeight(this);\n          if (dialog.hasResized) {\n            dialog.adjustForResize(this);\n          }\n        }\n        this.setElementPositions();\n      }\n    }\n  }\n\n  release (el) {\n    if (el.isStuck) {\n      const $el = el.$fixedEl;\n\n      el.removeStickyClasses();\n      $el.style.width = '';\n      // clear styles from any elements stuck while in a dialog mode\n      dialog.releaseEl(el, this);\n      el.removeShim();\n      el.release();\n    }\n  }\n\n  static getWindowDimensions () {\n    return {\n      height: window.innerHeight,\n      width: window.innerWidth\n    };\n  }\n\n  static getWindowPositions () {\n    return {\n      scrollTop: window.pageYOffset\n    };\n  }\n\n}\n\n// Extension of sticky object to add behaviours specific to sticking to top of window\n//\n// It replaces the previously used way of setting methods on the component's `prototype`.\n// We use a class declaration way of defining classes -\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/class\n//\n// More on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\nclass StickAtTop extends StickAtEdge {\n  constructor () {\n    super('.js-stick-at-top-when-scrolling');\n    this.edge = 'top';\n  }\n\n  // Store furthest point sticky elements are allowed\n  getEndOfScrollArea () {\n    const footer = document.querySelector('.js-footer');\n    if (footer === null) {\n      return 0;\n    }\n    return offset(footer).top - this.STOP_PADDING;\n  }\n\n  // position of the bottom edge when in the page flow\n  getInPageEdgePosition ($el) {\n    return offset($el).top;\n  }\n\n  getScrolledFrom (el) {\n    if (_mode === 'dialog') {\n      return dialog.getInPageEdgePosition(this);\n    } else {\n      return el.inPageEdgePosition;\n    }\n  }\n\n  getScrollingTo (el) {\n    let height = el.height;\n\n    if (_mode === 'dialog') {\n      height = dialog.getHeight(this.els);\n    }\n\n    return this.endOfScrollArea - height;\n  }\n\n  getStoppingPosition (el) {\n    let offset = 0;\n\n    if (_mode === 'dialog') {\n      offset = dialog.getOffsetFromEnd(el, this);\n    }\n\n    return (this.endOfScrollArea - offset) - el.height;\n  }\n\n  windowNotPastScrolledFrom (windowPositions, scrolledFrom) {\n    return scrolledFrom > windowPositions.top;\n  }\n\n  windowNotPastScrollingTo (windowPositions, scrollingTo) {\n    return windowPositions.top < scrollingTo;\n  }\n\n  stick (el) {\n    if (!el.isStuck) {\n      const $el = el.$fixedEl;\n      let offset = 0;\n\n      if (_mode === 'dialog') {\n        offset = dialog.getOffsetFromEdge(el, this);\n      }\n\n      el.addShim('before');\n      $el.style.width = $el.getBoundingClientRect().width + 'px';\n      $el.style.top = offset + 'px';\n      el.stick();\n    }\n  }\n\n  stop (el) {\n    if (!el.isStopped) {\n      el.$fixedEl.style.position = 'absolute';\n      el.$fixedEl.style.top = this.getStoppingPosition(el) + 'px';\n      el.stop();\n    }\n  }\n\n  unstop (el) {\n    let offset = 0;\n\n    if (_mode === 'dialog') {\n      offset = dialog.getOffsetFromEdge(el, this);\n    }\n\n    el.$fixedEl.style.position = '';\n    el.$fixedEl.style.top = offset + 'px';\n    el.unstop();\n  }\n\n}\nconst stickAtTop = new StickAtTop();\n\n// Extension of sticky object to add behaviours specific to sticking to bottom of window\n//\n// It replaces the previously used way of setting methods on the component's `prototype`.\n// We use a class declaration way of defining classes -\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/class\n//\n// More on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\nclass StickAtBottom extends StickAtEdge {\n  constructor () {\n    super('.js-stick-at-bottom-when-scrolling');\n    this.edge = 'bottom';\n  }\n\n  // Store furthest point sticky elements are allowed\n  getEndOfScrollArea () {\n    const header = document.querySelector('.js-header');\n    if (header === null) {\n      return 0;\n    }\n    return (offset(header).top + header.offsetHeight) + this.STOP_PADDING;\n  }\n\n  // position of the bottom edge when in the page flow\n  getInPageEdgePosition ($el) {\n    return offset($el).top + $el.offsetHeight;\n  }\n\n  getScrolledFrom (el) {\n    if (_mode === 'dialog') {\n      return dialog.getInPageEdgePosition(this);\n    } else {\n      return el.inPageEdgePosition;\n    }\n  }\n\n  getScrollingTo (el) {\n    let height = el.height;\n\n    if (_mode === 'dialog') {\n      height = dialog.getHeight(this.els);\n    }\n\n    return this.endOfScrollArea + height;\n  }\n\n  getStoppingPosition (el) {\n    let offset = 0;\n\n    if (_mode === 'dialog') {\n      offset = dialog.getOffsetFromEnd(el, this);\n    }\n\n    return this.endOfScrollArea + offset;\n  }\n\n  windowNotPastScrolledFrom (windowPositions, scrolledFrom) {\n    return scrolledFrom < windowPositions.bottom;\n  }\n\n  windowNotPastScrollingTo (windowPositions, scrollingTo) {\n    return windowPositions.bottom > scrollingTo;\n  }\n\n  stick (el) {\n    if (!el.isStuck) {\n      const $el = el.$fixedEl;\n      let offset = 0;\n\n      if (_mode === 'dialog') {\n        offset = dialog.getOffsetFromEdge(el, this);\n      }\n\n      el.addShim('after');\n      // element will be absolutely positioned so cannot rely on parent element for width\n      $el.style.width = $el.getBoundingClientRect().width + 'px';\n      $el.style.bottom = offset + 'px';\n      el.stick();\n    }\n  }\n\n  stop (el) {\n    if (!el.isStopped) {\n      el.$fixedEl.style.position = 'absolute';\n      el.$fixedEl.style.top = this.getStoppingPosition(el) + 'px';\n      el.$fixedEl.style.bottom = 'auto';\n      el.stop();\n    }\n  }\n\n  unstop (el) {\n    let offset = 0;\n\n    if (_mode === 'dialog') {\n      offset = dialog.getOffsetFromEdge(el, this);\n    }\n\n    el.$fixedEl.style.position = '';\n    el.$fixedEl.style.top = '';\n    el.$fixedEl.style.bottom = offset + 'px';\n    el.unstop();\n  }\n\n}\nconst stickAtBottom = new StickAtBottom;\n\nexport {\n  stickAtTop as stickAtTopWhenScrolling,\n  stickAtBottom as stickAtBottomWhenScrolling\n};\n","import { isSupported } from 'govuk-frontend';\nimport { stickAtBottomWhenScrolling } from './stick-to-window-when-scrolling.mjs';\n\n// This new way of writing Javascript components is based on the GOV.UK Frontend skeleton Javascript coding standard\n// that uses ES2015 Classes -\n// https://github.com/alphagov/govuk-frontend/blob/main/docs/contributing/coding-standards/js.md#skeleton\n//\n// It replaces the previously used way of setting methods on the component's `prototype`.\n// We use a class declaration way of defining classes -\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/class\n//\n// More on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\n\nclass CopyToClipboard {\n  constructor($module) {\n    if (!isSupported() || !navigator.clipboard) {\n      return this;\n    }\n\n    this.states = {\n      'valueVisible': (options) => {\n        return {\n          'value': `<span class=\"copy-to-clipboard__value\">${options.valueLabel ?'<span class=\"govuk-visually-hidden\">' +\n                      options.thing +': </span>' : ''}${options.value}</span>`,\n          'notice': {\n            'classes': \"copy-to-clipboard__notice govuk-visually-hidden\",\n            'content': options.onload ? '' : options.thing + ' showing, use button to copy to clipboard'\n          },\n          'button': {\n            'classes': \"govuk-button govuk-button--secondary copy-to-clipboard__button--copy\",\n            'content': `Copy ${options.thing} to clipboard${options.name ? '<span class=\"govuk-visually-hidden\"> for ' + options.name + '</span>' : ''}`\n          }\n        };\n      },\n      'valueCopied': (options) => {\n        return {\n          'value': '',\n          'notice': {\n            'classes': \"copy-to-clipboard__notice\",\n            'content': `<span class=\"govuk-visually-hidden\">${options.thing} </span>Copied to clipboard<span class=\"govuk-visually-hidden\">, use button to show in page</span>`\n          },\n          'button': {\n            'classes': \"govuk-button govuk-button--secondary copy-to-clipboard__button--show\",\n            'content': `Show ${options.thing}${options.name ? '<span class=\"govuk-visually-hidden\"> for ' + options.name + '</span>' : ''}`\n          }\n        };\n      }\n    };\n    this.$module = $module;\n    this.stateOptions = {\n      value: this.$module.dataset.value,\n      thing: this.$module.dataset.thing\n    };\n    this.name = this.$module.dataset.name;\n\n    // if the name is distinct from the thing:\n    // - it will be used in the rendering\n    // - the value won't be identified by a heading so needs its own label\n    if (this.name.toLowerCase() !== this.stateOptions.thing.toLowerCase()) {\n      this.stateOptions.name = this.name;\n      this.stateOptions.valueLabel = true;\n    }\n    this.$module.classList.add('copy-to-clipboard');\n    \n    // button and SR elements are added\n    this.updateHTML('valueVisible', {...{ 'onload': true }, ...this.stateOptions}, this.$module);\n\n    this.$module.addEventListener('click', (e) => {\n      const $target = e.target;\n      if ($target.tagName === \"BUTTON\") {\n        const buttonWasClicked = $target.classList.contains('copy-to-clipboard__button--show');\n        if (buttonWasClicked) {\n          this.updateHTML(buttonWasClicked, this.stateOptions, this.$module, $target);\n        } else {\n          this.copyValueToClipboard(\n            this.getRangeFromElement(this.$module.querySelector('.copy-to-clipboard__value'))\n          );\n          this.updateHTML(buttonWasClicked, this.stateOptions, this.$module, $target);\n        };\n      }\n    });\n\n    stickAtBottomWhenScrolling.recalculate();\n  }\n  \n  updateHTML (buttonWasClicked, stateOptions, $module, $button) {\n    // use the correct state key to update the HTML\n    // if the button was clicked then content needs to change to reflect that\n    // e.g say 'copied, ....\n    const stateKey = buttonWasClicked ? 'valueVisible' : 'valueCopied';\n    const state = this.states[stateKey](stateOptions);\n\n    $module.querySelectorAll('.copy-to-clipboard__value').forEach(e => e.remove());\n    if (state.value !== '') {\n      $module.insertAdjacentHTML('afterbegin', state.value);\n    }\n    let $clipboardNoticeEl = $module.querySelector('.copy-to-clipboard__notice');\n    $clipboardNoticeEl.innerHTML = state.notice.content;\n    $clipboardNoticeEl.setAttribute('class', state.notice.classes);\n\n    !$button ? this.generateButton(state) : this.updateButton(state, $button);\n  }\n\n  generateButton (state) {\n    let $newButton = document.createElement('button');\n    $newButton.setAttribute('class', state.button.classes);\n    $newButton.innerHTML = state.button.content;\n    this.$module.append($newButton);\n  }\n\n  updateButton (state, $button) {\n    $button.innerHTML = state.button.content;\n    $button.removeAttribute('class');\n    $button.setAttribute('class', state.button.classes);\n  }\n\n  async copyValueToClipboard(text){\n    try {\n      await navigator.clipboard.writeText(text);\n    } catch (err) {\n      console.error('Failed to copy: ', err);\n    }\n  }\n\n  getRangeFromElement (copyableElement) {\n    const range = document.createRange();\n    const childNodes = Array.prototype.slice.call(copyableElement.childNodes);\n    let prefixIndex = -1;\n\n    childNodes.forEach((el, idx) => {\n      if ((el.nodeType === 1) && el.classList.contains('govuk-visually-hidden')) {\n        prefixIndex = idx;\n      }\n    });\n\n    range.selectNodeContents(copyableElement);\n    if (prefixIndex !== -1) { range.setStart(copyableElement, prefixIndex + 1); }\n\n    return range;\n  };\n}\n\nexport default CopyToClipboard;\n","import { isSupported } from 'govuk-frontend';\n\nclass _ListEntry {\n  constructor($module) {\n    if (!isSupported()) {\n      return this;\n    }\n\n    const idPattern = $module.getAttribute('id');\n\n    if (idPattern === null) { return false; }\n    this.idPattern = idPattern;\n    this.elementSelector = '.list-entry, .input-list__button--remove, .input-list__button--add';\n    this.sharedInputClasses = ['govuk-input', 'govuk-input--numbered'];\n    this.entries = [];\n    this.$wrapper = $module;\n    this.minEntries = 2;\n    this.listItemName = this.$wrapper.dataset.listItemName;\n    this.getCustomClasses();\n    this.getSharedAttributes();\n\n    this.getValuesAndErrors();\n    this.maxEntries = this.entries.length;\n    this.trimEntries();\n    this.render();\n    this.bindEvents();\n  }\n\n  entryTemplate (dataObj) {\n    const { error, id, name, listItemName, number, value, customClasses, button, sharedInputClasses, sharedAttributes } = dataObj;\n\n    return `\n      <div class=\"list-entry\">\n        <div class=\"govuk-form-group${error ? ' govuk-form-group--error' : ''}\">\n          <label for=\"${id}\" class=\"govuk-label govuk-input--numbered__label${error ? ' govuk-input--numbered__label--error' : ''}\">\n           <span class=\"govuk-visually-hidden\">${listItemName} number </span>${number}.\n          </label>\n          ${error ?\n          `<p id=\"${id}-error\" class=\"govuk-error-message\" data-notify-module=\"track-error\" data-error-type=\"${error}\" data-error-label=\"${name}\">\n           <span class=\"govuk-visually-hidden\">Error: </span>${error}\n          </p>` : ''}\n          <input\n           name=\"${name}\"\n           id=\"${id}\"\n           ${value ? `value=\"${value}\"` : ''}\n           class=\"${sharedInputClasses}${customClasses ? ` ${customClasses}` : ''}${error ? ' govuk-input--error' : ''}\"\n           ${error ? `aria-describedby=\"${id}-error\"` : ''}\n           ${sharedAttributes}\n          />\n          ${button ? `\n          <button type=\"button\" class=\"govuk-button govuk-button--secondary input-list__button--remove\">\n          Remove<span class=\"govuk-visually-hidden\"> ${listItemName} number ${number}</span>\n          </button>` : ''}\n        </div>\n      </div>`;\n  }\n\n  addButtonTemplate (dataObj) {\n    const { listItemName, entriesLeft } = dataObj;\n\n    return `<button type=\"button\" class=\"govuk-button govuk-button--secondary input-list__button--add\">Add another ${listItemName} (${entriesLeft} remaining)</button>`;\n  }\n\n  getSharedAttributes () {\n    var $inputs = this.$wrapper.querySelectorAll('input'),\n        attributeTemplate = dataObj => {\n          const { name, value } = dataObj;\n\n          return ` ${name}=\"${value}\"`;\n        },\n        protectedAttributes = ['id', 'name', 'value', 'class', 'aria-describedby'],\n        attributes = [],\n        attrIdx,\n        elmAttributes,\n        getAttributesHTML;\n\n    getAttributesHTML = function (attrsByElm) {\n      var attrStr = '',\n          elmIdx = attrsByElm.length,\n          existingAttributes = [],\n          elmAttrs,\n          attrIdx;\n\n      while (elmIdx--) {\n        elmAttrs = attrsByElm[elmIdx];\n        attrIdx = elmAttrs.length;\n        while (attrIdx--) {\n          // prevent duplicates\n          if (!existingAttributes.includes(elmAttrs[attrIdx].name)) {\n            attrStr += attributeTemplate({ 'name': elmAttrs[attrIdx].name, 'value': elmAttrs[attrIdx].value });\n            existingAttributes.push(elmAttrs[attrIdx].name);\n          }\n        }\n      }\n      return attrStr;\n    };\n\n    $inputs.forEach(function (elm) {\n      attrIdx = elm.attributes.length;\n      elmAttributes = [];\n      while(attrIdx--) {\n        if (!protectedAttributes.includes(elm.attributes[attrIdx].name)) {\n          elmAttributes.push({\n            'name': elm.attributes[attrIdx].name,\n            'value': elm.attributes[attrIdx].value\n          });\n        }\n      }\n      if (elmAttributes.length) {\n        attributes.push(elmAttributes);\n      }\n    });\n\n    this.sharedAttributes = (attributes.length) ? getAttributesHTML(attributes) : '';\n  }\n\n  getCustomClasses () {\n    this.customClasses = [];\n    this.$wrapper.querySelectorAll('input').forEach(function ($elm) {\n      var customClassesForElm = [];\n\n      $elm.classList.forEach(token => {\n        if (!this.sharedInputClasses.includes(token) && (token !== 'govuk-input--error')) {\n          customClassesForElm.push(token);\n        }\n      });\n\n      if (customClassesForElm.length > 0) {\n        this.customClasses.push(customClassesForElm);\n      }\n    }.bind(this));\n  }\n\n  getValuesAndErrors () {\n    this.entries = [];\n    this.errors = [];\n    this.$wrapper.querySelectorAll('input').forEach(function ($elm) {\n      var val = $elm.value;\n      var $error = $elm.previousElementSibling;\n\n      $error = $error.matches('p.govuk-error-message') ? $error : null;\n\n      this.entries.push(val);\n      if ($error !== null) {\n        this.errors.push($error.textContent.trim().replace('Error: ', ''));\n      } else {\n        this.errors.push(null);\n      }\n    }.bind(this));\n  }\n\n  trimEntries () {\n    var entryIdx = this.entries.length,\n        newEntries = [];\n\n    while (entryIdx--) {\n      if (this.entries[entryIdx] !== '') {\n        newEntries.push(this.entries[entryIdx]);\n      } else {\n        if (entryIdx < this.minEntries) {\n          newEntries.push('');\n        }\n      }\n    }\n    this.entries = newEntries.reverse();\n  }\n\n  getId (num) {\n    var pattern = this.idPattern.replace(\"list-entry-\", \"\");\n    if (\"undefined\" === typeof num) {\n      return pattern;\n    } else {\n      return pattern + \"-\" + num;\n    }\n  }\n\n  bindEvents () {\n    this.$wrapper.addEventListener('click', function (e) {\n      if (e.target.matches('.input-list__button--remove')) {\n        this.removeEntry(e.target);\n      }\n      if (e.target.matches('.input-list__button--add')) {\n        this.addEntry();\n      }\n    }.bind(this));\n  }\n\n  shiftFocus (opts) {\n    var numberTargeted;\n\n    if (opts.action === 'remove') {\n      numberTargeted = (opts.entryNumberFocused > 1) ? opts.entryNumberFocused - 1 : 1;\n    } else { // opts.action === 'add'\n      numberTargeted = opts.entryNumberFocused + 1;\n    }\n    this.$wrapper.querySelectorAll('.list-entry')[numberTargeted - 1].querySelector('input').focus();\n  }\n\n  removeEntryFromEntriesAndErrors (entryNumber) {\n    var entryIdx = entryNumber - 1;\n\n    this.entries.splice(entryIdx, 1);\n    this.errors.splice(entryIdx, 1);\n  }\n\n  addEntry ($removeButton) {\n    var currentLastEntryNumber = this.entries.length;\n\n    this.getValuesAndErrors();\n    this.entries.push('');\n    this.render();\n    this.shiftFocus({ 'action' : 'add', 'entryNumberFocused' : currentLastEntryNumber });\n  }\n\n  removeEntry ($removeButton) {\n    var entryNumber = parseInt($removeButton.querySelector('span').textContent.match(/\\d+/)[0], 10);\n\n    this.getValuesAndErrors();\n    this.removeEntryFromEntriesAndErrors(entryNumber);\n    this.render();\n    this.shiftFocus({ 'action' : 'remove', 'entryNumberFocused' : entryNumber });\n  }\n\n  render () {\n    this.$wrapper.querySelectorAll(this.elementSelector).forEach(el => el.remove());\n    this.entries.forEach(function (entry, idx) {\n      var entryNumber = idx + 1,\n          error = this.errors[idx],\n          customClasses = this.customClasses[idx],\n          dataObj = {\n            'id' : this.getId(entryNumber),\n            'number' : entryNumber,\n            'index': idx,\n            'name' : this.getId(entryNumber),\n            'value' : entry,\n            'listItemName' : this.listItemName,\n            'sharedInputClasses': this.sharedInputClasses.join(' '),\n            'sharedAttributes': this.sharedAttributes\n          };\n\n      if (entryNumber > 1) {\n        dataObj.button = true;\n      }\n      if (error !== null) {\n        dataObj.error = error;\n      }\n      if (customClasses !== null) {\n        dataObj.customClasses = ' ' + customClasses.join(' ');\n      }\n      this.$wrapper.insertAdjacentHTML('beforeend', this.entryTemplate(dataObj));\n    }.bind(this));\n    if (this.entries.length < this.maxEntries) {\n      this.$wrapper.insertAdjacentHTML('beforeend', this.addButtonTemplate({\n        'listItemName' : this.listItemName,\n        'entriesLeft' : (this.maxEntries - this.entries.length)\n      }));\n    }\n  }\n}\n\nconst _lists = [];\n\nclass ListEntry {\n  constructor($module) {\n    if (!isSupported()) {\n      return this;\n    }\n\n    _lists.push(new _ListEntry($module));\n  }\n}\n\nexport default ListEntry;\n","import { isSupported } from 'govuk-frontend';\n\n// This new way of writing Javascript components is based on the GOV.UK Frontend skeleton Javascript coding standard\n// that uses ES2015 Classes -\n// https://github.com/alphagov/govuk-frontend/blob/main/docs/contributing/coding-standards/js.md#skeleton\n//\n// It replaces the previously used way of setting methods on the component's `prototype`.\n// We use a class declaration way of defining classes -\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/class\n//\n// More on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\n\nclass RadiosWithImages {\n  constructor($module) {\n    if (!isSupported()) {\n      return this;\n    }\n\n    this.$module = $module;\n    this.$module.addEventListener('click', this.handleImageClick);\n\n    const image_input = this.$module.nextElementSibling.querySelector(`[aria-describedby=\"${this.$module.id}\"]`);\n    this.$module.style.cursor = image_input.disabled ? 'not-allowed' : 'pointer';\n  }\n\n  handleImageClick () {\n    const image_input = this.nextElementSibling.querySelector(`[aria-describedby=\"${this.id}\"]`);\n    if (image_input.disabled) {\n      return;\n    }\n    image_input.checked = true;\n    image_input.focus();\n  };\n}\n\nexport default RadiosWithImages;\n","import { isSupported } from 'govuk-frontend';\nimport { stickAtBottomWhenScrolling } from './stick-to-window-when-scrolling.mjs';\n\nclass LiveSearch {\n  constructor($module) {\n    if (!isSupported()) {\n      return this;\n    }\n\n    this.$module = $module;\n\n    this.$searchBox = this.$module.querySelector('input');\n    this.$searchLabel = this.$module.querySelector('label');\n    this.$liveRegion = this.$module.querySelector('.live-search__status');\n    this.$targets = document.querySelectorAll(this.$module.dataset.targets);\n    this.state = 'loaded';\n\n\n    this.$searchBox.addEventListener(\"input\", () => {\n      this.filter(this.$searchBox, this.$searchLabel, this.$liveRegion, this.$targets);\n    });\n\n    this.filter(this.$searchBox, this.$searchLabel, this.$liveRegion, this.$targets);\n\n  }\n\n  filter ($searchBox, $searchLabel, $liveRegion, $targets) {\n\n    let query = this.normalize(this.$searchBox.value);\n    let results = 0;\n\n    $targets.forEach(($node) => {\n\n      let contents = $node.querySelectorAll('.live-search-relevant').length ? $node.querySelectorAll('.live-search-relevant') : [$node];\n      let isMatch = false;\n\n      contents.forEach((content_item) => {\n        if (this.normalize(content_item.textContent).includes(this.normalize(query))) {\n          isMatch = true;\n        }\n      });\n\n      // if there is a child node with checked state\n      if ($node.querySelectorAll(':checked').length > 0) {\n        if ($node.hasAttribute('hidden')) {\n          $node.removeAttribute('hidden');\n        }\n        results++;\n        return;\n      }\n\n      if (query == '') {\n        if ($node.hasAttribute('hidden')) {\n          $node.removeAttribute('hidden');\n        }\n        // specific to template list as we have items hidden by default in css\n        // (items with ancestors) that we need to show if they match the search query\n        // but also hide them back when there is no search query\n        if ($node.classList.contains('visible-as-matches-search-query')) {\n          $node.classList.remove('visible-as-matches-search-query');\n        }\n        results++;\n        return;\n      }\n\n      if (isMatch) {\n        $node.removeAttribute('hidden');\n        // specific to template list as we have items hidden by default in css\n        // (items with ancestors) that we need to show if they match the search query\n        // we do that by applying a new class with display block property\n        if ($node.classList.contains('template-list-item-hidden-by-default')) {\n          $node.classList.add('visible-as-matches-search-query');\n        }\n      } else {\n        $node.setAttribute('hidden', '');\n        // specific to template list as we have items hidden by default in css\n        // (items with ancestors) that we now need to hide again when they don't\n        // match the search criteria\n        if ($node.classList.contains('visible-as-matches-search-query')) {\n          $node.classList.remove('visible-as-matches-search-query');\n        }\n      };\n\n      if (isMatch) {\n        results++;\n      }\n\n    });\n\n    if (this.state === 'loaded') {\n      if (query !== '') {\n       $searchBox.setAttribute('aria-label', $searchLabel.textContent.trim() + ', ' + this.resultsSummary(results));\n      }\n      this.state = 'active';\n    } else {\n      $searchBox.removeAttribute('aria-label');\n      $liveRegion.textContent = this.resultsSummary(results);\n    }\n\n    // make sticky JS recalculate its cache of the element's position\n    // because live search can change the height document\n    stickAtBottomWhenScrolling.recalculate();\n\n  }\n\n  normalize (string) {\n    return string.toLowerCase().replace(/ /g,'');\n  }\n\n  resultsSummary (num) {\n    if (num === 0) {\n      return \"no results\";\n    } else {\n      return num + (num === 1 ? \" result\" : \" results\");\n    }\n  };\n}\n\nexport default LiveSearch;\n","import { isSupported } from 'govuk-frontend';\nimport { stickAtBottomWhenScrolling } from './stick-to-window-when-scrolling.mjs';\n\n// This new way of writing Javascript components is based on the GOV.UK Frontend skeleton Javascript coding standard\n// that uses ES2015 Classes -\n// https://github.com/alphagov/govuk-frontend/blob/main/docs/contributing/coding-standards/js.md#skeleton\n//\n// It replaces the previously used way of setting methods on the component's `prototype`.\n// We use a class declaration way of defining classes -\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/class\n//\n// More on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\n\nclass EnhancedTextbox {\n  constructor($module) {\n    if (!isSupported()) {\n      return this;\n    }\n\n    // guard against CSS not being loaded\n    if (window.getComputedStyle($module)['position'] !== 'relative') {\n      return this;\n    }\n\n    this.$module = $module;\n    this.tagPattern = /\\(\\(([^\\)\\((\\?)]+)(\\?\\?)?([^\\)\\(]*)\\)\\)/g;\n    this.highlightPlaceholders = this.$module.dataset.highlightPlaceholders === 'true';\n    this.autofocus = this.$module.dataset.autofocusTextbox === 'true';\n    this.$textbox = this.$module;\n\n    // wrap module in a container\n    this.$wrappingElement = document.createElement('div');\n    this.$wrappingElement.classList.add('govuk-textarea-highlight__wrapper');\n    this.$textbox.replaceWith(this.$wrappingElement);\n    this.$wrappingElement.appendChild(this.$textbox);\n\n    // append a background container to the module\n    this.$backgroundHighlightElement = document.createElement('div');\n    this.$backgroundHighlightElement.classList.add('govuk-textarea-highlight__background');\n    this.$backgroundHighlightElement.setAttribute('aria-hidden', 'true');\n    this.$textbox.after(this.$backgroundHighlightElement);\n\n    this.$textbox.addEventListener(\"input\", this.update.bind(this));\n    window.addEventListener(\"resize\", this.resize.bind(this));\n\n    this.$visibleTextbox = this.$textbox.cloneNode(true);\n    this.$visibleTextbox.style.position = 'absolute';\n    this.$visibleTextbox.style.visibility = 'hidden';\n    this.$visibleTextbox.style.display = 'block';\n    document.querySelector('body').append(this.$visibleTextbox);\n\n    this.initialHeight = this.$visibleTextbox.offsetHeight;\n\n    this.$backgroundHighlightElement.style.borderWidth =\n      window.getComputedStyle(this.$textbox).getPropertyValue('border-width');\n\n    this.$visibleTextbox.remove();\n    this.$textbox.dispatchEvent(new Event('input', { bubbles: true }));\n\n    if (this.autofocus) {\n      this.$textbox.focus();\n    }\n  }\n\n  resize () {\n    this.$backgroundHighlightElement.style.width = window.getComputedStyle(this.$textbox).width;\n    this.$textbox.style.height =\n      `${Math.max(\n          this.initialHeight,\n          this.$backgroundHighlightElement.offsetHeight\n      )}px`;\n\n    stickAtBottomWhenScrolling.recalculate();\n  }\n\n  contentReplaced () {\n    const fragment = document.createDocumentFragment();\n    const text = this.$textbox.value;\n    let lastIndex = 0;\n\n    for (const match of text.matchAll(this.tagPattern)) {\n      // append plain text before the placeholder starts\n      fragment.append(text.slice(lastIndex, match.index));\n\n      const [\n        fullMatch,  // index 0: full match\n        name,       // index 1: capture group 1\n        separator,  // index 2: capture group 2\n        value       // index 3: capture group 3\n      ] = match;\n      const $span = document.createElement('span');\n\n      if (value && separator) {\n        $span.className = 'placeholder-conditional';\n        $span.textContent = `((${name}??`;\n        fragment.append($span, `${value}))`);\n      } else {\n        $span.className = 'placeholder';\n        $span.textContent = `((${name}${value}))`;\n        fragment.append($span);\n      }\n\n      // update with the index where the current placeholder ends\n      lastIndex = match.index + fullMatch.length;\n    }\n\n    // append any remaining trailing text\n    fragment.append(text.slice(lastIndex));\n    return fragment;\n  }\n\n  update () {\n    // clear everything that's in the container to avoid any potential XSS\n    this.$backgroundHighlightElement.textContent = '';\n\n    if (this.highlightPlaceholders) {\n      this.$backgroundHighlightElement.append(this.contentReplaced());\n    } else {\n      this.$backgroundHighlightElement.textContent = this.$textbox.value;\n    }\n\n    this.resize();\n  }\n}\n\nexport default EnhancedTextbox;\n","import { isSupported } from 'govuk-frontend';\nimport { locationReplace } from './utils.mjs';\n\n// This new way of writing Javascript components is based on the GOV.UK Frontend skeleton Javascript coding standard\n// that uses ES2015 Classes -\n// https://github.com/alphagov/govuk-frontend/blob/main/docs/contributing/coding-standards/js.md#skeleton\n//\n// It replaces the previously used way of setting methods on the component's `prototype`.\n// We use a class declaration way of defining classes -\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/class\n//\n// More on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\n\nclass CheckReportStatus {\n  constructor($module) {\n    if (!isSupported()) {\n      return this;\n    }\n\n    this.$module = $module;\n    this.fetchInterval = 20000;\n    this.redirectDelay = 10000;\n    this.reportStatusEndpoint = `${location.pathname}/status.json`;\n    this.reportReadyStatus = 'stored';\n    this.reportFailedStatus = 'failed';\n    this.currentCheck = null;\n\n  }\n\n  runCheck() {\n    this.currentCheck = this.checkStatus();\n  }\n\n  async checkStatus() {\n    try {\n      const response = await fetch(this.reportStatusEndpoint);\n      if (!response.ok) {\n        throw new Error('Error checking report status: no response');\n      }\n      const data = await response.json();\n      this.processStatus(data.status);\n    } catch (error) {\n      console.error('Error checking report status:', error);\n      setTimeout(this.runCheck.bind(this), this.fetchInterval);\n    }\n  }\n\n  processStatus(status) {\n    if (status === this.reportReadyStatus || status === this.reportFailedStatus) {\n      this.updatePageText();\n      setTimeout(() => {\n        locationReplace(location.pathname);\n      }, this.redirectDelay);\n    } else {\n      setTimeout(this.runCheck.bind(this), this.fetchInterval);\n    }\n  }\n\n  updatePageText() {\n    const statusUpdateText = document.createElement('p');\n    statusUpdateText.classList.add('govuk-body');\n    statusUpdateText.textContent = 'Report status has been updated. We will redirect you shortly.';\n    this.$module.innerHTML = '';\n    this.$module.append(statusUpdateText);\n  }\n}\n\nexport default CheckReportStatus;\n","import { isSupported } from 'govuk-frontend';\n\n// This new way of writing Javascript components is based on the GOV.UK Frontend skeleton Javascript coding standard\n// that uses ES2015 Classes -\n// https://github.com/alphagov/govuk-frontend/blob/main/docs/contributing/coding-standards/js.md#skeleton\n//\n// It replaces the previously used way of setting methods on the component's `prototype`.\n// We use a class declaration way of defining classes -\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/class\n//\n// More on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\n\nclass LiveCheckboxControls {\n    constructor (form) {\n      if (!isSupported()) {\n        return this;\n      }\n      this.$form = form;\n      this.$liveRegionCounter = this.$form.querySelector('.selection-counter');\n\n      // variants of the noun for checkbox items, used by sentences describing what is selected\n      this.thing = {\n        singular: this.$form.dataset.thingSingular || 'option',\n        plural: this.$form.dataset.thingPlural || 'options'\n      };\n\n      this.$liveRegionCounter.insertAdjacentHTML('beforebegin', this.nothingSelectedHint);\n      this.$liveRegionCounter.insertAdjacentHTML('beforebegin', this.itemsSelectedHint);\n\n      // all the diff states that we want to show or hide\n      this.states = [\n        {\n          key: 'nothing-selected-hint',\n          $el: this.$form.querySelector('#nothing-selected'),\n          cancellable: false\n        },\n        {\n          key: 'items-selected-hint',\n          $el: this.$form.querySelector('#items-selected'),\n          cancellable: false\n        }\n      ];\n\n      // clear/select-all buttons only relevant if JS enabled, so\n      this.states.filter(state => state.key === 'nothing-selected-hint').forEach(state => this.onNothingSelected(state));\n      this.states.filter(state => state.key === 'items-selected-hint').forEach(state => this.onSomethingSelected(state));\n\n      this._lastState = this.$form.dataset.prevState;\n      if (this._lastState === undefined) {\n        this.showInitialState();\n      } else {\n        this.currentState = this._lastState;\n        this.render();\n      }\n\n      this.$form.addEventListener('change', (evt) => {\n        if (evt.target.matches('input[type=checkbox]')) { this.onCheckboxChanged(); }\n      });\n    }\n\n    // Default behaviour - show a 'Select all' link/button if no checkboxes are selected\n    onNothingSelected (state) {\n      const $clear = this.makeActionButton('Select all', {\n        'onclick': () => {\n\n          // check all templates and folders\n          this.$form.querySelectorAll('input[type=checkbox]').forEach(el => {\n            el.setAttribute('checked', 'checked');\n            el.checked = true;\n          });\n\n          // move focus to the first checkbox\n          this.$form.querySelectorAll('input[type=checkbox]')[0].focus();\n          this.showInitialState();\n        },\n        'nonvisualText': `${this.thing.plural}`\n      });\n\n      state.$el.querySelector('.checkbox-list-selected-counter').append($clear);\n    }\n\n    // Default behaviour - show a 'Clear' link/button if any checkboxes are selected\n    onSomethingSelected (state) {\n      const $clear = this.makeActionButton('Clear', {\n        'onclick': () => {\n\n          // uncheck all templates and folders\n          this.$form.querySelectorAll('input[type=checkbox]').forEach(el => {\n            el.removeAttribute('checked');\n            el.checked = false;\n          });\n\n          // move focus to the first checkbox\n          this.$form.querySelectorAll('input[type=checkbox]')[0].focus();\n          this.showInitialState();\n        },\n        'nonvisualText': \"selection\"\n      });\n\n      state.$el.querySelector('.checkbox-list-selected-counter').append($clear);\n    }\n\n    get selectionStatus () {\n      return {\n        'default': () => {\n          return `No ${this.thing.plural} selected`;\n        },\n        'selected': numSelected => {\n          if (numSelected === 1) {\n            return `1 ${this.thing.singular} selected`;\n          } else {\n            return `${numSelected} ${this.thing.plural} selected`;\n          }\n        },\n        'update': numSelected => {\n          const message = (numSelected > 0) ? this.selectionStatus.selected(numSelected) : this.selectionStatus.default();\n\n          document.querySelector('.checkbox-list-selected-counter__count').innerHTML = message;\n          this.$liveRegionCounter.innerHTML = message;\n        }\n      };\n    }\n\n    makeActionButton (text, opts) {\n      const $btn = document.createElement('a');\n      const callback = (evt) => {\n        // space, enter or no keyCode (must be mouse input)\n        if ([13, 32, undefined].includes(evt.keyCode)) {\n          evt.preventDefault();\n          if (opts.hasOwnProperty('onclick')) { opts.onclick(); }\n        }\n      };\n\n      $btn.setAttribute('href', '');\n      $btn.innerHTML = text;\n      $btn.classList.add('govuk-link', 'govuk-link--no-visited-state', 'js-action');\n      $btn.setAttribute('tabindex', '0');\n      $btn.addEventListener('click', callback);\n      $btn.addEventListener('keydown', callback);\n\n      if (opts.hasOwnProperty('nonvisualText')) {\n        $btn.insertAdjacentHTML('beforeend', `<span class=\"govuk-visually-hidden\"> ${opts.nonvisualText}</span>`);\n      }\n\n      return $btn;\n    }\n\n    showInitialState () {\n      // Reset the form to initial state, where nothing is selected\n      this.currentState = 'nothing-selected-hint';\n      this.onCheckboxChanged();\n    }\n\n    stateHasChanged () {\n      const changed = this.currentState !== this._lastState;\n\n      this._lastState = this.currentState;\n      return changed;\n    }\n\n    onCheckboxChanged () {\n      const numSelected = this.countSelectedCheckboxes();\n\n      if (this.currentState === 'nothing-selected-hint' && numSelected !== 0) {\n        // user has just selected first item\n        this.currentState = 'items-selected-hint';\n      } else if (this.currentState === 'items-selected-hint' && numSelected === 0) {\n        // user has just deselected last item\n        this.currentState = 'nothing-selected-hint';\n      }\n\n      if (this.stateHasChanged()) {\n        this.render();\n      }\n\n      this.selectionStatus.update(numSelected);\n    };\n\n    countSelectedCheckboxes () {\n      return this.$form.querySelectorAll('input[type=checkbox]:checked').length;\n    }\n\n    render () {\n      // detach everything, unless they are the currentState\n      this.states.forEach(\n        state => (state.key === this.currentState ? this.$liveRegionCounter.insertAdjacentElement('beforebegin', state.$el) : state.$el.remove())\n      );\n    }\n\n    get nothingSelectedHint () {\n      return `\n        <div id=\"nothing-selected\">\n          <div class=\"checkbox-list-selected-counter\">\n            <span class=\"checkbox-list-selected-counter__count\" aria-hidden=\"true\"></span>\n          </div>\n        </div>`;\n    }\n\n    get itemsSelectedHint () {\n      return `\n        <div id=\"items-selected\">\n          <div class=\"checkbox-list-selected-counter\">\n            <span class=\"checkbox-list-selected-counter__count\" aria-hidden=\"true\"></span>\n          </div>\n        </div>`;\n  }\n}\n\nexport default LiveCheckboxControls;\n","import LiveCheckboxControls from './live-checkbox-controls.mjs';\n\nclass AddBrandingOptionsControls extends LiveCheckboxControls {\n  onNothingSelected (state) {}\n}\n\nexport default AddBrandingOptionsControls;\n","import { isSupported } from 'govuk-frontend';\nimport { stickAtBottomWhenScrolling } from './stick-to-window-when-scrolling.mjs';\n\n// This new way of writing Javascript components is based on the GOV.UK Frontend skeleton Javascript coding standard\n// that uses ES2015 Classes -\n// https://github.com/alphagov/govuk-frontend/blob/main/docs/contributing/coding-standards/js.md#skeleton\n//\n// It replaces the previously used way of setting methods on the component's `prototype`.\n// We use a class declaration way of defining classes -\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/class\n//\n// More on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\n\nclass RadioSelect {\n  constructor($module) {\n    if (!isSupported()) {\n      return this;\n    }\n\n    this.$module = $module;\n    this.confirmMadeSticky = false;\n    this.keyCache = null;\n    this.ENTER_CODE = 13;\n    this.timesByDay = {};\n    this.days = this.$module.dataset.days.split(',').map(day => {\n      let dayValue = this.getKeyFromDayLabel(day);\n      this.timesByDay[dayValue] = [];\n      return {\n        'value': dayValue,\n        'label': day\n      };\n    });\n    this.componentName = this.$module.querySelector('input[type=radio]').getAttribute('name');\n    this.componentLabelText = this.$module.previousElementSibling.textContent.trim();\n    this.$module.querySelectorAll('label').forEach(function (label, idx) {\n      let labelText = label.textContent.trim();\n      let relatedRadio = label.previousElementSibling;\n      let timeData = {\n        'id': label.getAttribute('for'),\n        'label': labelText,\n        'value': relatedRadio.value\n      };\n      let day = this.getKeyFromDayLabel(labelText.split(' at ')[0]);\n\n      if (idx === 0) { // Store the first time\n        this.selectedTime = this.getTimeFromRadio(relatedRadio);\n\n        // The first time's label doesn't contain its day so use the first day\n        day = this.days[0].value;\n      }\n\n      timeData.name = `times-for-${day}`;\n      this.timesByDay[day].push(timeData);\n\n    }.bind(this));\n    this.selectedDay = this.days[0];\n    this.selectedTime = this.timesByDay[this.selectedDay.value][0];\n\n    const initialHTML = this.buildInitialHTML({\n      'componentName': this.componentName,\n      'selectedTime': this.selectedTime,\n      'days': this.days,\n      'times': this.timesByDay\n    }, this.componentLabelText);\n\n    // clear out the original HTML structure\n    this.$module.textContent = ''; \n    // append new markup\n    this.$module.append(initialHTML);\n\n    this.$module.closest('fieldset').replaceWith(this.$module);\n\n    this.form = this.$module.closest('form');\n    this.formSubmitButton = this.form.querySelector('button:not([type=button])');\n\n    this.bindEvents();\n\n  }\n\n  // Object holding all the states for the component's HTML\n  buildInitialHTML(params, labelText) {\n    const fragment = document.createDocumentFragment();\n\n    const $sendNowInputLabel = document.createElement('label');\n    $sendNowInputLabel.setAttribute('for', 'radio-select__selected-day-and-time');\n    $sendNowInputLabel.className = 'govuk-label radio-select__label';\n    $sendNowInputLabel.textContent = labelText;\n    fragment.appendChild($sendNowInputLabel);\n\n    const $radioSelectContainer = document.createElement('div');\n    $radioSelectContainer.className = 'radio-select__selection-and-button';\n\n    const $sendNowInput = document.createElement('input');\n    $sendNowInput.type = 'text';\n    $sendNowInput.className = 'radio-select__selected-day-and-time';\n    $sendNowInput.id = 'radio-select__selected-day-and-time';\n    $sendNowInput.readOnly = true;\n    $sendNowInput.value = params.selectedTime.label;\n    $radioSelectContainer.appendChild($sendNowInput);\n\n    const $hiddenInput = document.createElement('input');\n    $hiddenInput.type = 'hidden';\n    $hiddenInput.className = 'radio-select__selected-value';\n    $hiddenInput.value = params.selectedTime.value;\n    $hiddenInput.name = params.componentName;\n    $radioSelectContainer.appendChild($hiddenInput);\n\n    const $expanderContainer = document.createElement('div');\n    $expanderContainer.className = 'radio-select__expander-and-expandee';\n\n    const $expanderBtn = document.createElement('button');\n    $expanderBtn.type = 'button';\n    $expanderBtn.className = 'govuk-button govuk-button--secondary radio-select__expander';\n    $expanderBtn.setAttribute('aria-expanded', 'false');\n    $expanderBtn.setAttribute('aria-controls', `${params.componentName}-expanding-section`);\n    $expanderBtn.textContent = 'Choose a different time';\n    $expanderContainer.appendChild($expanderBtn);\n\n    const $expandeeContainer = document.createElement('div');\n    $expandeeContainer.className = 'radio-select__expandee';\n    $expandeeContainer.id = `${params.componentName}-expanding-section`;\n    $expandeeContainer.hidden = true;\n\n    const $daysContainer = document.createElement('div');\n    $daysContainer.className = 'radio-select__view';\n\n    const $daysFieldset = document.createElement('fieldset');\n    $daysFieldset.className = 'govuk-fieldset radio-select__days';\n\n    const $daysLegend = document.createElement('legend');\n    $daysLegend.className = 'govuk-visually-hidden';\n    $daysLegend.textContent = 'Day to send these messages';\n    $daysFieldset.appendChild($daysLegend);\n\n    params.days.forEach(day => {\n      const $dayBtn = document.createElement('button');\n      $dayBtn.className = 'govuk-button govuk-button--secondary radio-select__day';\n      $dayBtn.type = 'button';\n      $dayBtn.name = day.value;\n      $dayBtn.value = day.value;\n      $dayBtn.textContent = day.label;\n      $daysFieldset.appendChild($dayBtn);\n    });\n\n    $daysContainer.appendChild($daysFieldset);\n    $expandeeContainer.appendChild($daysContainer);\n\n    const $dayTimesContainer = document.createElement('div');\n    $dayTimesContainer.className = 'radio-select__view';\n    $dayTimesContainer.hidden = true;\n\n    const $backLink = document.createElement('a');\n    $backLink.href = '';\n    $backLink.className = 'govuk-link govuk-back-link radio-select__return-to-days js-header';\n    $backLink.textContent = 'Change the day';\n    $dayTimesContainer.appendChild($backLink);\n\n    params.days.forEach(day => {\n      const $dayTimesFieldset = document.createElement('fieldset');\n      $dayTimesFieldset.className = 'govuk-fieldset radio-select__times';\n      $dayTimesFieldset.id = `radio-select__times-for-${day.value}`;\n      $dayTimesFieldset.setAttribute('aria-describedby', 'radio-select__times-help');\n      $dayTimesFieldset.hidden = true;\n\n      const $dayTimesLegend = document.createElement('legend');\n      $dayTimesLegend.className = 'govuk-visually-hidden';\n      $dayTimesLegend.textContent = 'Time to send these messages';\n      $dayTimesFieldset.appendChild($dayTimesLegend);\n\n      const $timesHint = document.createElement('p');\n      $timesHint.className = 'govuk-visually-hidden radio-select__times-help govuk-body';\n      $timesHint.id = 'radio-select__times-help';\n      $timesHint.textContent = 'Choose a time and confirm';\n      $dayTimesFieldset.appendChild($timesHint);\n\n      params.times[day.value].forEach(time => {\n        const $radioItemContainer = document.createElement('div');\n        $radioItemContainer.className = 'govuk-radios__item';\n\n        const $radioInput = document.createElement('input');\n        $radioInput.className = 'govuk-radios__input radio-select__time';\n        $radioInput.type = 'radio';\n        $radioInput.value = time.value;\n        $radioInput.id = time.id;\n        $radioInput.name = time.name;\n        if (time.checked) {\n          $radioInput.checked = true;\n        }\n        $radioItemContainer.appendChild($radioInput);\n\n        const $radioTimeLabel = document.createElement('label');\n        $radioTimeLabel.className = 'govuk-label govuk-radios__label';\n        $radioTimeLabel.setAttribute('for', time.id);\n        $radioTimeLabel.textContent = time.label;\n        $radioItemContainer.appendChild($radioTimeLabel);\n\n        $dayTimesFieldset.appendChild($radioItemContainer);\n      });\n\n      $dayTimesContainer.appendChild($dayTimesFieldset);\n    });\n\n    const $confirmContainer = document.createElement('div');\n    $confirmContainer.className = 'radio-select__confirm js-stick-at-bottom-when-scrolling';\n\n    const $confirmTimeBtn = document.createElement('button');\n    $confirmTimeBtn.type = 'button';\n    $confirmTimeBtn.className = 'govuk-button govuk-button--secondary radio-select__confirm__button';\n    $confirmTimeBtn.textContent = 'Confirm time';\n    $confirmContainer.appendChild($confirmTimeBtn);\n\n    $dayTimesContainer.appendChild($confirmContainer);\n    $expandeeContainer.appendChild($dayTimesContainer);\n\n    $expanderContainer.appendChild($expandeeContainer);\n    $radioSelectContainer.appendChild($expanderContainer);\n    fragment.appendChild($radioSelectContainer);\n\n    return fragment;\n  }\n\n  bindEvents() {\n    this.$module.addEventListener('click', this.handleClick.bind(this));\n    this.$module.addEventListener('change', this.handleTimeSelection.bind(this));\n    this.$module.addEventListener('keydown', (e) => {\n      if (e.target.classList.contains('radio-select__time') || e.target.classList.contains('radio-select__selected-day-and-time')) {\n        this.onEnterKeyUpAndDown(e);\n      }\n    });\n    this.$module.addEventListener('keyup', (e) => {\n      if (e.target.classList.contains('radio-select__time') || e.target.classList.contains('radio-select__selected-day-and-time')) {\n        this.onEnterKeyUpAndDown(e);\n      }\n    });\n  }\n\n  handleClick(event) {\n    const target = event.target;\n\n    switch (true) {\n      case Boolean(target.closest('.radio-select__expander')):\n        event.preventDefault();\n        this.toggleExpandingSection();\n        break;\n\n      case Boolean(target.closest('.radio-select__day')):\n        this.handleDayClick(target);\n        break;\n\n      case Boolean(target.closest('.radio-select__return-to-days')):\n        event.preventDefault();\n        this.handleReturnToDays();\n        break;\n\n      case Boolean(target.closest('.radio-select__confirm__button')):\n        this.selectDayAndTime();\n        break;\n    }\n  }\n\n  handleDayClick(dayButton) {\n    this.selectedDay = dayButton.value.trim();\n    this.showTimesForDay(this.selectedDay);\n    this.showTimesView();\n    this.focusSelectedTimeOrFirst();\n  }\n\n  handleReturnToDays() {\n    this.showDaysView();\n    this.$module.querySelector(`.radio-select__days button[name=${this.selectedDay}]`).focus();\n  }\n\n  handleTimeSelection(event) {\n    if (!event.target.classList.contains('radio-select__time')) return;\n    \n    // Uncheck any other selected radios, as they don't share a name attribute\n    this.$module.querySelectorAll('.radio-select__time:checked').forEach(radio => {\n      if (radio !== event.target) {\n        radio.checked = false;\n      }\n    });\n  }\n\n  showDaysView() {\n    const viewPanes = this.$module.querySelectorAll('.radio-select__expandee .radio-select__view');\n    viewPanes[0].removeAttribute('hidden');\n    viewPanes[1].setAttribute('hidden', '');\n  };\n\n  showTimesForDay(day) {\n    this.$module.querySelectorAll('.radio-select__times').forEach(timesGroup => {\n      if (timesGroup.id === `radio-select__times-for-${day}`) {\n        timesGroup.removeAttribute('hidden');\n      } else {\n        timesGroup.setAttribute('hidden', '');\n      }\n    });\n  }\n\n  showTimesView() {\n    const viewPanes = this.$module.querySelectorAll('.radio-select__expandee .radio-select__view');\n\n    viewPanes[0].setAttribute('hidden', '');\n    viewPanes[1].removeAttribute('hidden');\n\n    stickAtBottomWhenScrolling.recalculate();\n  }\n\n  selectDayAndTime() {\n    const selectedRadio = this.$module.querySelector('.radio-select__times:not([hidden]) .radio-select__time:checked');\n    if (selectedRadio === null) return;\n\n    this.selectedTime = this.getTimeFromRadio(selectedRadio);\n\n    this.showDaysView();\n    this.toggleExpandingSection();\n    this.updateSelection();\n    this.$module.querySelector('.radio-select__selected-day-and-time').focus();\n  }\n\n  toggleExpandingSection() {\n    const expander = this.$module.querySelector('.radio-select__expander');\n    const expandee = this.$module.querySelector('.radio-select__expandee');\n    const isExpanded = expander.getAttribute('aria-expanded') === 'true';\n\n    if (isExpanded) {\n      expander.setAttribute('aria-expanded', 'false');\n      expandee.setAttribute('hidden', '');\n    } else {\n      expander.setAttribute('aria-expanded', 'true');\n      expandee.removeAttribute('hidden');\n    }\n\n    this.toggleFormSubmit();\n  }\n\n  toggleFormSubmit() {\n    const $form = this.$module.closest('form');\n    const formSubmitButton = $form.querySelector('.govuk-button:not([type=button])');\n\n    if (!formSubmitButton.hasAttribute('hidden')) {\n      formSubmitButton.style.display = 'none';\n      formSubmitButton.setAttribute('hidden', '');\n      $form.addEventListener('submit', this.cancelFiredEvent);\n    } else {\n      formSubmitButton.removeAttribute('style');\n      formSubmitButton.removeAttribute('hidden');\n      $form.removeEventListener('submit', this.cancelFiredEvent);\n    }\n  }\n\n  focusSelectedTimeOrFirst () {\n    const selector = `.radio-select__expandee input[name=times-for-${this.selectedDay}]`;\n    let timeInput = this.$module.querySelector(`${selector}:checked`) || this.$module.querySelector(selector);\n    timeInput.focus();\n  };\n\n  updateSelection() {\n    this.$module.querySelector('.radio-select__selected-day-and-time').value = this.selectedTime.label;\n    this.$module.querySelector('.radio-select__selected-value').value = this.selectedTime.value;\n  }\n\n  onEnterKeyUpAndDown(event) {\n    let isExpanded;\n    let targetIsSelectedDayAndTimeField;\n\n    if (event.which !== this.ENTER_CODE) {\n      return;\n    }\n    if (event.type === 'keydown') {\n      this.keyCache = event.target;\n      return;\n    }\n\n    if (event.target !== this.keyCache) {\n      return;\n    }\n\n    // event.type is 'keyup', key is enter and was the key that fired the last 'keydown' event\n    targetIsSelectedDayAndTimeField = event.target.classList.contains('radio-select__selected-day-and-time');\n    isExpanded = this.$module.querySelector('.radio-select__expander').getAttribute('aria-expanded') === 'true';\n\n    if (targetIsSelectedDayAndTimeField) {\n      if (isExpanded) { \n        this.toggleExpandingSection();\n      }\n    } else { // target element is the radio for a time\n      this.selectDayAndTime();\n    }\n\n    this.keyCache = null;\n  }\n\n  getTimeFromRadio (radio) {\n    return {\n      'value': radio.value,\n      'label': radio.nextElementSibling.textContent.trim()\n    };\n  }\n\n  getKeyFromDayLabel(label) {\n    return label.toLowerCase().replace(/\\s/g, '-');\n  }\n\n  cancelFiredEvent(evt) {\n    evt.preventDefault();\n  }\n}\n\nexport default RadioSelect;\n","import { isSupported } from 'govuk-frontend';\nimport { stickAtBottomWhenScrolling } from './stick-to-window-when-scrolling.mjs';\n\n\n// This new way of writing Javascript components is based on the GOV.UK Frontend skeleton Javascript coding standard\n// that uses ES2015 Classes -\n// https://github.com/alphagov/govuk-frontend/blob/main/docs/contributing/coding-standards/js.md#skeleton\n//\n// It replaces the previously used way of setting methods on the component's `prototype`.\n// We use a class declaration way of defining classes -\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/class\n//\n// More on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\n\nclass FullscreenTable {\n\n  constructor($module) {\n\n    if (!isSupported()) {\n      return this;\n    }\n\n    this.$module = $module;\n    this.$table = this.$module.querySelector('table');\n\n    this.nativeHeight = this.$module.offsetHeight + 20; // 20px for scrollbar room\n    this.topOffset = this.$module.offsetTop;\n\n    this.isFocusable = this.$table.getBoundingClientRect().width > this.$module.getBoundingClientRect().width;\n    this.maintainHeight = this.maintainHeight.bind(this);\n    this.maintainWidth = this.maintainWidth.bind(this);\n    this.toggleShadows = this.toggleShadows.bind(this);\n\n    this.insertShims();\n    this.maintainWidth();\n    this.maintainHeight();\n    this.toggleShadows();\n\n    window.addEventListener('scroll', this.maintainHeight);\n    window.addEventListener('resize', this.maintainHeight);\n    window.addEventListener('resize', this.maintainWidth);\n\n    this.$scrollableTable.addEventListener('scroll', this.toggleShadows);\n    this.$scrollableTable.addEventListener('scroll', this.maintainHeight);\n\n    if (this.isFocusable) {\n      const toggleFocusStyle = () => this.$module.classList.toggle('js-focus-style');\n      this.$scrollableTable.addEventListener('focus', toggleFocusStyle);\n      this.$scrollableTable.addEventListener('blur', toggleFocusStyle);\n    }\n\n    stickAtBottomWhenScrolling.recalculate();\n\n    this.maintainWidth();\n  }\n\n  insertShims() {\n    const caption = this.$table.querySelector('caption');\n    const captionId = caption.textContent.toLowerCase().replace(/[^A-Za-z]+/g, '');\n    caption.id = captionId;\n\n    // Create the scrollable wrapper and move the table inside it\n    const $scrollableWrapper = document.createElement('div');\n    $scrollableWrapper.className = 'fullscreen-scrollable-table';\n    if (this.isFocusable) {\n      $scrollableWrapper.setAttribute('role', 'region');\n      $scrollableWrapper.setAttribute('aria-labelledby', captionId);\n      $scrollableWrapper.setAttribute('tabindex', '0');\n    }\n    this.$table.parentNode.insertBefore($scrollableWrapper, this.$table);\n    $scrollableWrapper.appendChild(this.$table);\n\n    // Create the fixed (frozen column) table by cloning the scrollable one\n    const $fixedWrapper = $scrollableWrapper.cloneNode(true);\n    $fixedWrapper.className = 'fullscreen-fixed-table';\n    $fixedWrapper.removeAttribute('role');\n    $fixedWrapper.removeAttribute('aria-labelledby');\n    $fixedWrapper.removeAttribute('tabindex');\n    $fixedWrapper.setAttribute('aria-hidden', 'true');\n    $fixedWrapper.querySelector('caption')?.removeAttribute('id');\n\n    // Create the shadow and shim elements\n    const $rightShadow = document.createElement('div');\n    $rightShadow.className = 'fullscreen-right-shadow';\n\n    const $shim = document.createElement('div');\n    $shim.className = 'fullscreen-shim';\n    $shim.style.height = `${this.nativeHeight}px`;\n    $shim.style.top = `${this.topOffset}px`;\n\n    // Add new elements to the DOM\n    this.$module.appendChild($fixedWrapper);\n    this.$module.appendChild($rightShadow);\n    this.$module.parentNode.insertBefore($shim, this.$module.nextSibling);\n    this.$module.style.position = 'absolute';\n\n    // Cache references to the new elements\n    this.$scrollableTable = this.$module.querySelector('.fullscreen-scrollable-table');\n    this.$fixedTable = this.$module.querySelector('.fullscreen-fixed-table');\n    this.$rightShadow = this.$module.querySelector('.fullscreen-right-shadow');\n  }\n\n  maintainHeight() {\n    const height = Math.min(\n      (window.innerHeight - this.topOffset) + window.scrollY,\n      this.nativeHeight\n    );\n  \n    this.$scrollableTable.style.height = `${height}px`;\n    this.$fixedTable.style.height = `${height}px`;\n  }\n\n  maintainWidth() {\n    const $scrollableIndexColumnHeader = this.$scrollableTable.querySelector('.table-field-heading-first');\n    const $fixedIndexColumnHeader = this.$fixedTable.querySelector('.table-field-heading-first');\n\n    if ($scrollableIndexColumnHeader === null || $fixedIndexColumnHeader === null) return;\n\n    this.$scrollableTable.style.width = `${this.$module.parentElement.getBoundingClientRect().width}px`;\n\n    // Ensure column widths in both tables match to prevent misalignment\n    if ($fixedIndexColumnHeader.getBoundingClientRect().width !== $scrollableIndexColumnHeader.getBoundingClientRect().width) {\n      $scrollableIndexColumnHeader.style.width = `${$fixedIndexColumnHeader.getBoundingClientRect().width}px`;\n    }\n\n    // Set the width of the fixed table container to match its first column\n    this.$fixedTable.style.width = `${$fixedIndexColumnHeader.getBoundingClientRect().width + 4}px`; // 4px for shadow\n  }\n\n  toggleShadows() {\n    // Show a shadow on the frozen column if the table is scrolled left\n    const isScrolled = this.$scrollableTable.scrollLeft > 0;\n    this.$fixedTable.classList.toggle('fullscreen-scrolled-table', isScrolled);\n\n    // Show a shadow on the right edge if there's more content to scroll to\n    const maxScroll = this.$table.offsetWidth - this.$scrollableTable.offsetWidth;\n    const isScrollable = this.$scrollableTable.scrollLeft < maxScroll;\n    this.$rightShadow.classList.toggle('visible', isScrollable);\n\n    setTimeout(() => this.$rightShadow.classList.add('with-transition'), 3000);\n  }\n}\n\nexport default FullscreenTable;\n","import { isSupported } from 'govuk-frontend';\n\n// This new way of writing Javascript components is based on the GOV.UK Frontend skeleton Javascript coding standard\n// that uses ES2015 Classes -\n// https://github.com/alphagov/govuk-frontend/blob/main/docs/contributing/coding-standards/js.md#skeleton\n//\n// It replaces the previously used way of setting methods on the component's `prototype`.\n// We use a class declaration way of defining classes -\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/class\n//\n// More on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\n\nclass RemoveInPresenceOf {\n  constructor($module) {\n    if (!isSupported()) {\n      return this;\n    }\n\n    this.$elementToRemove = $module;\n    const observer = new MutationObserver(function () {\n      if (document.getElementById(this.$elementToRemove.dataset.targetElementId)) {\n        this.$elementToRemove.parentNode.removeChild(this.$elementToRemove);\n        observer.disconnect();\n      }\n    }.bind(this));\n\n    observer.observe(document.getElementById('main-content'), { childList: true, subtree: true });\n\n  }\n}\n\nexport default RemoveInPresenceOf;\n","import { isSupported } from 'govuk-frontend';\n\n/*\nThis new way of writing Javascript components is based on the GOV.UK Frontend skeleton Javascript coding standard\nthat uses ES2015 Classes -\nhttps://github.com/alphagov/govuk-frontend/blob/main/docs/contributing/coding-standards/js.md#skeleton\n\nIt replaces the previously used way of setting methods on the component's `prototype`.\nWe use a class declaration way of defining classes -\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/class\n\nMore on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\n\nThis module is intended to be used to show and hide an error banner based on a javascript trigger. You should make\nsure the banner has an appropriate aria-live attribute, and a tabindex of -1 so that screenreaders and keyboard users\nare alerted to the change respectively.\n\nThis may behave in unexpected ways if you have more than one element with the `govuk-error-summary` class on your page.\n*/\nclass ErrorBanner {\n  constructor(selector) {\n    if (!isSupported()) {\n      return this;\n    }\n    /* \n    authenticate and register security keys have 3 error banners:\n    no-js, no-webauth support and one for error in getting/setting creds\n    old JS used to toggle display of all 3.\n\n    now, we pass a selector that we want to toggle but still use\n    govuk-error-summary as the default\n    */\n    selector = selector || '.govuk-error-summary';\n    this.$bannerElement = document.querySelector(selector);\n  }   \n\n  hideBanner() {\n    this.$bannerElement.setAttribute('hidden','hidden');\n  }\n\n  showBanner() {\n    this.$bannerElement.removeAttribute('hidden');\n    this.$bannerElement.focus();\n  }\n}\n\nexport default ErrorBanner;\n","import { isSupported } from 'govuk-frontend';\nimport ErrorBanner from './error-banner.mjs';\nimport { locationAssign } from './utils.mjs';\n\n// This new way of writing Javascript components is based on the GOV.UK Frontend skeleton Javascript coding standard\n// that uses ES 2015 Classes -\n// https://github.com/alphagov/govuk-frontend/blob/main/docs/contributing/coding-standards/js.md#skeleton\n//\n// It replaces the previously used way of setting methods on the component's `prototype`.\n// We use a class declaration way of defining classes -\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/class\n//\n// More on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\n\nclass AuthenticateSecurityKey {\n  constructor($module) {\n    if (\n      !isSupported() ||\n      !window.TextEncoder ||\n      !window.PublicKeyCredential?.parseRequestOptionsFromJSON\n    ) {\n      return this;\n    }\n    this.authenticationEndpoint = '/webauthn/authenticate';\n    this.$module = $module;\n\n    this.$module.addEventListener('click', this.authenticateKey.bind(this));\n  }\n\n  async authenticateKey(e) {\n    e.preventDefault();\n\n    try {\n      const options = await this.handleFetch();\n      const credential = await this.getCredential(options);\n      const response = await this.postCredential(credential);\n      await this.handleCredentialResponse(response);\n    } catch (error) {\n      this.handleError(error);\n    }\n  }\n\n  async handleFetch() {\n    const response = await fetch(this.authenticationEndpoint);\n\n    if (!response.ok) {\n      throw Error(response.statusText);\n    }\n\n    const optionsJSON = await response.json();\n    return PublicKeyCredential.parseRequestOptionsFromJSON(optionsJSON.publicKey);\n  }\n\n  async getCredential(publicKey) {\n    // triggers browser dialogue to login with authenticator\n    return window.navigator.credentials.get({ publicKey });\n  }\n\n  async postCredential(credential) {\n    const currentURL = new URL(window.location.href);\n\n    // create authenticateURL from admin hostname plus authentication endpoint path\n    const authenticateURL = new URL(this.authenticationEndpoint, window.location.href);\n\n    const nextUrl = currentURL.searchParams.get('next');\n    if (nextUrl) {\n      // takes nextUrl from the query string on the current browser URL\n      // (which should be /two-factor-webauthn) and pass it through to\n      // the POST. put it in a query string so it's consistent with how\n      // the other login flows manage it\n      authenticateURL.searchParams.set('next', nextUrl);\n    }\n\n    return fetch(authenticateURL, {\n      method: 'POST',\n      headers: {\n        'X-CSRFToken': this.$module.dataset.csrfToken,\n        'Content-Type': 'application/json'\n      },\n      body: JSON.stringify(credential.toJSON())\n    });\n  }\n\n  async handleCredentialResponse(response) {\n    if (!response.ok) {\n      throw Error(response.statusText);\n    }\n\n    const data = await response.json();\n\n    // Redirect the user on successful authentication\n    locationAssign(data.redirect_url);\n  }\n\n  handleError(error) {\n    console.error(error);\n    // some browsers will show an error dialogue for some errors;\n    // to be safe we always display an error message on the page.\n    new ErrorBanner('.webauthn__error').showBanner();\n  }\n}\n\nexport default AuthenticateSecurityKey;\n","import { isSupported } from 'govuk-frontend';\nimport ErrorBanner from './error-banner.mjs';\nimport { locationReload } from './utils.mjs';\n\n// This new way of writing Javascript components is based on the GOV.UK Frontend skeleton Javascript coding standard\n// that uses ES 2015 Classes -\n// https://github.com/alphagov/govuk-frontend/blob/main/docs/contributing/coding-standards/js.md#skeleton\n//\n// It replaces the previously used way of setting methods on the component's `prototype`.\n// We use a class declaration way of defining classes -\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/class\n//\n// More on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\n\nclass RegisterSecurityKey {\n  constructor($module) {\n    if (\n      !isSupported() ||\n      !window.TextEncoder ||\n      !window.PublicKeyCredential?.parseCreationOptionsFromJSON\n    ) {\n      return this;\n    }\n    this.registerAuthenticationEndpoint = '/webauthn/register';\n    this.$module = $module;\n\n    this.$module.addEventListener('click', this.registerKey.bind(this));\n  }\n\n  async registerKey(e) {\n    e.preventDefault();\n\n    try {\n      const options = await this.handleFetch();\n      const credential = await this.createCredential(options);\n      const response = await this.postCredential(credential);\n      this.handleCredentialResponse(response);\n    } catch (error) {\n      this.handleError(error);\n    }\n  }\n\n  async handleFetch() {\n    const response = await fetch(this.registerAuthenticationEndpoint);\n\n    if (!response.ok) {\n      throw Error(response.statusText);\n    }\n\n    const optionsJSON = await response.json();\n    return PublicKeyCredential.parseCreationOptionsFromJSON(optionsJSON.publicKey);\n  }\n\n  createCredential(publicKey) {\n    // triggers browser dialogue to select authenticator\n    return window.navigator.credentials.create({ publicKey });\n  }\n\n  postCredential(credential) {\n    return fetch(this.registerAuthenticationEndpoint, {\n      method: 'POST',\n      headers: {\n        'X-CSRFToken': this.$module.dataset.csrfToken,\n        'Content-Type': 'application/json'\n      },\n      body: JSON.stringify(credential.toJSON())\n    });\n  }\n\n  handleCredentialResponse(response) {\n    if (!response.ok) {\n      throw Error(response.statusText);\n    }\n    locationReload();\n  }\n\n  handleError(error) {\n    console.error(error);\n    // some browsers will show an error dialogue for some errors;\n    // to be safe we always display an error message on the page.\n    new ErrorBanner('.webauthn__error').showBanner();\n  }\n}\n\nexport default RegisterSecurityKey;\n","import { isSupported } from 'govuk-frontend';\n\n// This new way of writing Javascript components is based on the GOV.UK Frontend skeleton Javascript coding standard\n// that uses ES2015 Classes -\n// https://github.com/alphagov/govuk-frontend/blob/main/docs/contributing/coding-standards/js.md#skeleton\n//\n// It replaces the previously used way of setting methods on the component's `prototype`.\n// We use a class declaration way of defining classes -\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/class\n//\n// More on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\n\nclass UpdateStatus {\n  constructor($module) {\n    if (!isSupported()) {\n      return this;\n    }\n\n    this.$module = $module;\n    this.$textbox = document.getElementById(this.$module.dataset.target);\n    this.throttleOn = false;\n    this.callsHaveBeenThrottled = false;\n    this.timeout = null;\n  }\n\n  getRenderer($module, response) {\n    $module.innerHTML = response.html;\n  }\n\n  throttle(func, limit) {\n    return (...args) => {\n      if (this.throttleOn) {\n        this.callsHaveBeenThrottled = true;\n      } else {\n        func.apply(this, args);\n        this.throttleOn = true;\n      }\n\n      clearTimeout(this.timeout);\n\n      this.timeout = setTimeout(() => {\n        this.throttleOn = false;\n        if (this.callsHaveBeenThrottled) func.apply(this, args);\n        this.callsHaveBeenThrottled = false;\n      }, limit);\n    };\n  }\n\n  init() {\n    const id = 'update-status';\n    this.$module.setAttribute('id', id);\n    this.$module.parentNode.removeAttribute('hidden');\n    const ariaDescribedby = this.$textbox.getAttribute('aria-describedby') || '';\n\n    this.$textbox.setAttribute(\n      'aria-describedby',\n      `${ariaDescribedby}${ariaDescribedby ? ' ' : ''}${id}`\n    );\n\n    this.$textbox.addEventListener('input', this.throttle(this.update.bind(this), 150).bind(this));\n    this.$textbox.dispatchEvent(new Event('input'));\n  }\n\n  async update() {\n    const url = this.$module.dataset.updatesUrl;\n    const formData = new URLSearchParams(new FormData(this.$textbox.closest('form'))).toString();\n\n    try {\n      const response = await fetch(url, {\n        method: 'POST',\n        headers: {\n          \"Content-Type\": \"application/x-www-form-urlencoded\",\n        },\n        body: formData\n      });\n\n      if (response.ok) {\n        const data = await response.json();\n        this.getRenderer(this.$module, data);\n      }\n    } catch (error) {\n      console.error('Failed to update status:', error);\n    }\n  }\n}\n\nexport default UpdateStatus;\n","var DOCUMENT_FRAGMENT_NODE = 11;\n\nfunction morphAttrs(fromNode, toNode) {\n    var toNodeAttrs = toNode.attributes;\n    var attr;\n    var attrName;\n    var attrNamespaceURI;\n    var attrValue;\n    var fromValue;\n\n    // document-fragments dont have attributes so lets not do anything\n    if (toNode.nodeType === DOCUMENT_FRAGMENT_NODE || fromNode.nodeType === DOCUMENT_FRAGMENT_NODE) {\n      return;\n    }\n\n    // update attributes on original DOM element\n    for (var i = toNodeAttrs.length - 1; i >= 0; i--) {\n        attr = toNodeAttrs[i];\n        attrName = attr.name;\n        attrNamespaceURI = attr.namespaceURI;\n        attrValue = attr.value;\n\n        if (attrNamespaceURI) {\n            attrName = attr.localName || attrName;\n            fromValue = fromNode.getAttributeNS(attrNamespaceURI, attrName);\n\n            if (fromValue !== attrValue) {\n                if (attr.prefix === 'xmlns'){\n                    attrName = attr.name; // It's not allowed to set an attribute with the XMLNS namespace without specifying the `xmlns` prefix\n                }\n                fromNode.setAttributeNS(attrNamespaceURI, attrName, attrValue);\n            }\n        } else {\n            fromValue = fromNode.getAttribute(attrName);\n\n            if (fromValue !== attrValue) {\n                fromNode.setAttribute(attrName, attrValue);\n            }\n        }\n    }\n\n    // Remove any extra attributes found on the original DOM element that\n    // weren't found on the target element.\n    var fromNodeAttrs = fromNode.attributes;\n\n    for (var d = fromNodeAttrs.length - 1; d >= 0; d--) {\n        attr = fromNodeAttrs[d];\n        attrName = attr.name;\n        attrNamespaceURI = attr.namespaceURI;\n\n        if (attrNamespaceURI) {\n            attrName = attr.localName || attrName;\n\n            if (!toNode.hasAttributeNS(attrNamespaceURI, attrName)) {\n                fromNode.removeAttributeNS(attrNamespaceURI, attrName);\n            }\n        } else {\n            if (!toNode.hasAttribute(attrName)) {\n                fromNode.removeAttribute(attrName);\n            }\n        }\n    }\n}\n\nvar range; // Create a range object for efficently rendering strings to elements.\nvar NS_XHTML = 'http://www.w3.org/1999/xhtml';\n\nvar doc = typeof document === 'undefined' ? undefined : document;\nvar HAS_TEMPLATE_SUPPORT = !!doc && 'content' in doc.createElement('template');\nvar HAS_RANGE_SUPPORT = !!doc && doc.createRange && 'createContextualFragment' in doc.createRange();\n\nfunction createFragmentFromTemplate(str) {\n    var template = doc.createElement('template');\n    template.innerHTML = str;\n    return template.content.childNodes[0];\n}\n\nfunction createFragmentFromRange(str) {\n    if (!range) {\n        range = doc.createRange();\n        range.selectNode(doc.body);\n    }\n\n    var fragment = range.createContextualFragment(str);\n    return fragment.childNodes[0];\n}\n\nfunction createFragmentFromWrap(str) {\n    var fragment = doc.createElement('body');\n    fragment.innerHTML = str;\n    return fragment.childNodes[0];\n}\n\n/**\n * This is about the same\n * var html = new DOMParser().parseFromString(str, 'text/html');\n * return html.body.firstChild;\n *\n * @method toElement\n * @param {String} str\n */\nfunction toElement(str) {\n    str = str.trim();\n    if (HAS_TEMPLATE_SUPPORT) {\n      // avoid restrictions on content for things like `<tr><th>Hi</th></tr>` which\n      // createContextualFragment doesn't support\n      // <template> support not available in IE\n      return createFragmentFromTemplate(str);\n    } else if (HAS_RANGE_SUPPORT) {\n      return createFragmentFromRange(str);\n    }\n\n    return createFragmentFromWrap(str);\n}\n\n/**\n * Returns true if two node's names are the same.\n *\n * NOTE: We don't bother checking `namespaceURI` because you will never find two HTML elements with the same\n *       nodeName and different namespace URIs.\n *\n * @param {Element} a\n * @param {Element} b The target element\n * @return {boolean}\n */\nfunction compareNodeNames(fromEl, toEl) {\n    var fromNodeName = fromEl.nodeName;\n    var toNodeName = toEl.nodeName;\n    var fromCodeStart, toCodeStart;\n\n    if (fromNodeName === toNodeName) {\n        return true;\n    }\n\n    fromCodeStart = fromNodeName.charCodeAt(0);\n    toCodeStart = toNodeName.charCodeAt(0);\n\n    // If the target element is a virtual DOM node or SVG node then we may\n    // need to normalize the tag name before comparing. Normal HTML elements that are\n    // in the \"http://www.w3.org/1999/xhtml\"\n    // are converted to upper case\n    if (fromCodeStart <= 90 && toCodeStart >= 97) { // from is upper and to is lower\n        return fromNodeName === toNodeName.toUpperCase();\n    } else if (toCodeStart <= 90 && fromCodeStart >= 97) { // to is upper and from is lower\n        return toNodeName === fromNodeName.toUpperCase();\n    } else {\n        return false;\n    }\n}\n\n/**\n * Create an element, optionally with a known namespace URI.\n *\n * @param {string} name the element name, e.g. 'div' or 'svg'\n * @param {string} [namespaceURI] the element's namespace URI, i.e. the value of\n * its `xmlns` attribute or its inferred namespace.\n *\n * @return {Element}\n */\nfunction createElementNS(name, namespaceURI) {\n    return !namespaceURI || namespaceURI === NS_XHTML ?\n        doc.createElement(name) :\n        doc.createElementNS(namespaceURI, name);\n}\n\n/**\n * Copies the children of one DOM element to another DOM element\n */\nfunction moveChildren(fromEl, toEl) {\n    var curChild = fromEl.firstChild;\n    while (curChild) {\n        var nextChild = curChild.nextSibling;\n        toEl.appendChild(curChild);\n        curChild = nextChild;\n    }\n    return toEl;\n}\n\nfunction syncBooleanAttrProp(fromEl, toEl, name) {\n    if (fromEl[name] !== toEl[name]) {\n        fromEl[name] = toEl[name];\n        if (fromEl[name]) {\n            fromEl.setAttribute(name, '');\n        } else {\n            fromEl.removeAttribute(name);\n        }\n    }\n}\n\nvar specialElHandlers = {\n    OPTION: function(fromEl, toEl) {\n        var parentNode = fromEl.parentNode;\n        if (parentNode) {\n            var parentName = parentNode.nodeName.toUpperCase();\n            if (parentName === 'OPTGROUP') {\n                parentNode = parentNode.parentNode;\n                parentName = parentNode && parentNode.nodeName.toUpperCase();\n            }\n            if (parentName === 'SELECT' && !parentNode.hasAttribute('multiple')) {\n                if (fromEl.hasAttribute('selected') && !toEl.selected) {\n                    // Workaround for MS Edge bug where the 'selected' attribute can only be\n                    // removed if set to a non-empty value:\n                    // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12087679/\n                    fromEl.setAttribute('selected', 'selected');\n                    fromEl.removeAttribute('selected');\n                }\n                // We have to reset select element's selectedIndex to -1, otherwise setting\n                // fromEl.selected using the syncBooleanAttrProp below has no effect.\n                // The correct selectedIndex will be set in the SELECT special handler below.\n                parentNode.selectedIndex = -1;\n            }\n        }\n        syncBooleanAttrProp(fromEl, toEl, 'selected');\n    },\n    /**\n     * The \"value\" attribute is special for the <input> element since it sets\n     * the initial value. Changing the \"value\" attribute without changing the\n     * \"value\" property will have no effect since it is only used to the set the\n     * initial value.  Similar for the \"checked\" attribute, and \"disabled\".\n     */\n    INPUT: function(fromEl, toEl) {\n        syncBooleanAttrProp(fromEl, toEl, 'checked');\n        syncBooleanAttrProp(fromEl, toEl, 'disabled');\n\n        if (fromEl.value !== toEl.value) {\n            fromEl.value = toEl.value;\n        }\n\n        if (!toEl.hasAttribute('value')) {\n            fromEl.removeAttribute('value');\n        }\n    },\n\n    TEXTAREA: function(fromEl, toEl) {\n        var newValue = toEl.value;\n        if (fromEl.value !== newValue) {\n            fromEl.value = newValue;\n        }\n\n        var firstChild = fromEl.firstChild;\n        if (firstChild) {\n            // Needed for IE. Apparently IE sets the placeholder as the\n            // node value and vise versa. This ignores an empty update.\n            var oldValue = firstChild.nodeValue;\n\n            if (oldValue == newValue || (!newValue && oldValue == fromEl.placeholder)) {\n                return;\n            }\n\n            firstChild.nodeValue = newValue;\n        }\n    },\n    SELECT: function(fromEl, toEl) {\n        if (!toEl.hasAttribute('multiple')) {\n            var selectedIndex = -1;\n            var i = 0;\n            // We have to loop through children of fromEl, not toEl since nodes can be moved\n            // from toEl to fromEl directly when morphing.\n            // At the time this special handler is invoked, all children have already been morphed\n            // and appended to / removed from fromEl, so using fromEl here is safe and correct.\n            var curChild = fromEl.firstChild;\n            var optgroup;\n            var nodeName;\n            while(curChild) {\n                nodeName = curChild.nodeName && curChild.nodeName.toUpperCase();\n                if (nodeName === 'OPTGROUP') {\n                    optgroup = curChild;\n                    curChild = optgroup.firstChild;\n                } else {\n                    if (nodeName === 'OPTION') {\n                        if (curChild.hasAttribute('selected')) {\n                            selectedIndex = i;\n                            break;\n                        }\n                        i++;\n                    }\n                    curChild = curChild.nextSibling;\n                    if (!curChild && optgroup) {\n                        curChild = optgroup.nextSibling;\n                        optgroup = null;\n                    }\n                }\n            }\n\n            fromEl.selectedIndex = selectedIndex;\n        }\n    }\n};\n\nvar ELEMENT_NODE = 1;\nvar DOCUMENT_FRAGMENT_NODE$1 = 11;\nvar TEXT_NODE = 3;\nvar COMMENT_NODE = 8;\n\nfunction noop() {}\n\nfunction defaultGetNodeKey(node) {\n  if (node) {\n      return (node.getAttribute && node.getAttribute('id')) || node.id;\n  }\n}\n\nfunction morphdomFactory(morphAttrs) {\n\n    return function morphdom(fromNode, toNode, options) {\n        if (!options) {\n            options = {};\n        }\n\n        if (typeof toNode === 'string') {\n            if (fromNode.nodeName === '#document' || fromNode.nodeName === 'HTML' || fromNode.nodeName === 'BODY') {\n                var toNodeHtml = toNode;\n                toNode = doc.createElement('html');\n                toNode.innerHTML = toNodeHtml;\n            } else {\n                toNode = toElement(toNode);\n            }\n        }\n\n        var getNodeKey = options.getNodeKey || defaultGetNodeKey;\n        var onBeforeNodeAdded = options.onBeforeNodeAdded || noop;\n        var onNodeAdded = options.onNodeAdded || noop;\n        var onBeforeElUpdated = options.onBeforeElUpdated || noop;\n        var onElUpdated = options.onElUpdated || noop;\n        var onBeforeNodeDiscarded = options.onBeforeNodeDiscarded || noop;\n        var onNodeDiscarded = options.onNodeDiscarded || noop;\n        var onBeforeElChildrenUpdated = options.onBeforeElChildrenUpdated || noop;\n        var childrenOnly = options.childrenOnly === true;\n\n        // This object is used as a lookup to quickly find all keyed elements in the original DOM tree.\n        var fromNodesLookup = Object.create(null);\n        var keyedRemovalList = [];\n\n        function addKeyedRemoval(key) {\n            keyedRemovalList.push(key);\n        }\n\n        function walkDiscardedChildNodes(node, skipKeyedNodes) {\n            if (node.nodeType === ELEMENT_NODE) {\n                var curChild = node.firstChild;\n                while (curChild) {\n\n                    var key = undefined;\n\n                    if (skipKeyedNodes && (key = getNodeKey(curChild))) {\n                        // If we are skipping keyed nodes then we add the key\n                        // to a list so that it can be handled at the very end.\n                        addKeyedRemoval(key);\n                    } else {\n                        // Only report the node as discarded if it is not keyed. We do this because\n                        // at the end we loop through all keyed elements that were unmatched\n                        // and then discard them in one final pass.\n                        onNodeDiscarded(curChild);\n                        if (curChild.firstChild) {\n                            walkDiscardedChildNodes(curChild, skipKeyedNodes);\n                        }\n                    }\n\n                    curChild = curChild.nextSibling;\n                }\n            }\n        }\n\n        /**\n         * Removes a DOM node out of the original DOM\n         *\n         * @param  {Node} node The node to remove\n         * @param  {Node} parentNode The nodes parent\n         * @param  {Boolean} skipKeyedNodes If true then elements with keys will be skipped and not discarded.\n         * @return {undefined}\n         */\n        function removeNode(node, parentNode, skipKeyedNodes) {\n            if (onBeforeNodeDiscarded(node) === false) {\n                return;\n            }\n\n            if (parentNode) {\n                parentNode.removeChild(node);\n            }\n\n            onNodeDiscarded(node);\n            walkDiscardedChildNodes(node, skipKeyedNodes);\n        }\n\n        // // TreeWalker implementation is no faster, but keeping this around in case this changes in the future\n        // function indexTree(root) {\n        //     var treeWalker = document.createTreeWalker(\n        //         root,\n        //         NodeFilter.SHOW_ELEMENT);\n        //\n        //     var el;\n        //     while((el = treeWalker.nextNode())) {\n        //         var key = getNodeKey(el);\n        //         if (key) {\n        //             fromNodesLookup[key] = el;\n        //         }\n        //     }\n        // }\n\n        // // NodeIterator implementation is no faster, but keeping this around in case this changes in the future\n        //\n        // function indexTree(node) {\n        //     var nodeIterator = document.createNodeIterator(node, NodeFilter.SHOW_ELEMENT);\n        //     var el;\n        //     while((el = nodeIterator.nextNode())) {\n        //         var key = getNodeKey(el);\n        //         if (key) {\n        //             fromNodesLookup[key] = el;\n        //         }\n        //     }\n        // }\n\n        function indexTree(node) {\n            if (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE$1) {\n                var curChild = node.firstChild;\n                while (curChild) {\n                    var key = getNodeKey(curChild);\n                    if (key) {\n                        fromNodesLookup[key] = curChild;\n                    }\n\n                    // Walk recursively\n                    indexTree(curChild);\n\n                    curChild = curChild.nextSibling;\n                }\n            }\n        }\n\n        indexTree(fromNode);\n\n        function handleNodeAdded(el) {\n            onNodeAdded(el);\n\n            var curChild = el.firstChild;\n            while (curChild) {\n                var nextSibling = curChild.nextSibling;\n\n                var key = getNodeKey(curChild);\n                if (key) {\n                    var unmatchedFromEl = fromNodesLookup[key];\n                    // if we find a duplicate #id node in cache, replace `el` with cache value\n                    // and morph it to the child node.\n                    if (unmatchedFromEl && compareNodeNames(curChild, unmatchedFromEl)) {\n                        curChild.parentNode.replaceChild(unmatchedFromEl, curChild);\n                        morphEl(unmatchedFromEl, curChild);\n                    } else {\n                      handleNodeAdded(curChild);\n                    }\n                } else {\n                  // recursively call for curChild and it's children to see if we find something in\n                  // fromNodesLookup\n                  handleNodeAdded(curChild);\n                }\n\n                curChild = nextSibling;\n            }\n        }\n\n        function cleanupFromEl(fromEl, curFromNodeChild, curFromNodeKey) {\n            // We have processed all of the \"to nodes\". If curFromNodeChild is\n            // non-null then we still have some from nodes left over that need\n            // to be removed\n            while (curFromNodeChild) {\n                var fromNextSibling = curFromNodeChild.nextSibling;\n                if ((curFromNodeKey = getNodeKey(curFromNodeChild))) {\n                    // Since the node is keyed it might be matched up later so we defer\n                    // the actual removal to later\n                    addKeyedRemoval(curFromNodeKey);\n                } else {\n                    // NOTE: we skip nested keyed nodes from being removed since there is\n                    //       still a chance they will be matched up later\n                    removeNode(curFromNodeChild, fromEl, true /* skip keyed nodes */);\n                }\n                curFromNodeChild = fromNextSibling;\n            }\n        }\n\n        function morphEl(fromEl, toEl, childrenOnly) {\n            var toElKey = getNodeKey(toEl);\n\n            if (toElKey) {\n                // If an element with an ID is being morphed then it will be in the final\n                // DOM so clear it out of the saved elements collection\n                delete fromNodesLookup[toElKey];\n            }\n\n            if (!childrenOnly) {\n                // optional\n                if (onBeforeElUpdated(fromEl, toEl) === false) {\n                    return;\n                }\n\n                // update attributes on original DOM element first\n                morphAttrs(fromEl, toEl);\n                // optional\n                onElUpdated(fromEl);\n\n                if (onBeforeElChildrenUpdated(fromEl, toEl) === false) {\n                    return;\n                }\n            }\n\n            if (fromEl.nodeName !== 'TEXTAREA') {\n              morphChildren(fromEl, toEl);\n            } else {\n              specialElHandlers.TEXTAREA(fromEl, toEl);\n            }\n        }\n\n        function morphChildren(fromEl, toEl) {\n            var curToNodeChild = toEl.firstChild;\n            var curFromNodeChild = fromEl.firstChild;\n            var curToNodeKey;\n            var curFromNodeKey;\n\n            var fromNextSibling;\n            var toNextSibling;\n            var matchingFromEl;\n\n            // walk the children\n            outer: while (curToNodeChild) {\n                toNextSibling = curToNodeChild.nextSibling;\n                curToNodeKey = getNodeKey(curToNodeChild);\n\n                // walk the fromNode children all the way through\n                while (curFromNodeChild) {\n                    fromNextSibling = curFromNodeChild.nextSibling;\n\n                    if (curToNodeChild.isSameNode && curToNodeChild.isSameNode(curFromNodeChild)) {\n                        curToNodeChild = toNextSibling;\n                        curFromNodeChild = fromNextSibling;\n                        continue outer;\n                    }\n\n                    curFromNodeKey = getNodeKey(curFromNodeChild);\n\n                    var curFromNodeType = curFromNodeChild.nodeType;\n\n                    // this means if the curFromNodeChild doesnt have a match with the curToNodeChild\n                    var isCompatible = undefined;\n\n                    if (curFromNodeType === curToNodeChild.nodeType) {\n                        if (curFromNodeType === ELEMENT_NODE) {\n                            // Both nodes being compared are Element nodes\n\n                            if (curToNodeKey) {\n                                // The target node has a key so we want to match it up with the correct element\n                                // in the original DOM tree\n                                if (curToNodeKey !== curFromNodeKey) {\n                                    // The current element in the original DOM tree does not have a matching key so\n                                    // let's check our lookup to see if there is a matching element in the original\n                                    // DOM tree\n                                    if ((matchingFromEl = fromNodesLookup[curToNodeKey])) {\n                                        if (fromNextSibling === matchingFromEl) {\n                                            // Special case for single element removals. To avoid removing the original\n                                            // DOM node out of the tree (since that can break CSS transitions, etc.),\n                                            // we will instead discard the current node and wait until the next\n                                            // iteration to properly match up the keyed target element with its matching\n                                            // element in the original tree\n                                            isCompatible = false;\n                                        } else {\n                                            // We found a matching keyed element somewhere in the original DOM tree.\n                                            // Let's move the original DOM node into the current position and morph\n                                            // it.\n\n                                            // NOTE: We use insertBefore instead of replaceChild because we want to go through\n                                            // the `removeNode()` function for the node that is being discarded so that\n                                            // all lifecycle hooks are correctly invoked\n                                            fromEl.insertBefore(matchingFromEl, curFromNodeChild);\n\n                                            // fromNextSibling = curFromNodeChild.nextSibling;\n\n                                            if (curFromNodeKey) {\n                                                // Since the node is keyed it might be matched up later so we defer\n                                                // the actual removal to later\n                                                addKeyedRemoval(curFromNodeKey);\n                                            } else {\n                                                // NOTE: we skip nested keyed nodes from being removed since there is\n                                                //       still a chance they will be matched up later\n                                                removeNode(curFromNodeChild, fromEl, true /* skip keyed nodes */);\n                                            }\n\n                                            curFromNodeChild = matchingFromEl;\n                                        }\n                                    } else {\n                                        // The nodes are not compatible since the \"to\" node has a key and there\n                                        // is no matching keyed node in the source tree\n                                        isCompatible = false;\n                                    }\n                                }\n                            } else if (curFromNodeKey) {\n                                // The original has a key\n                                isCompatible = false;\n                            }\n\n                            isCompatible = isCompatible !== false && compareNodeNames(curFromNodeChild, curToNodeChild);\n                            if (isCompatible) {\n                                // We found compatible DOM elements so transform\n                                // the current \"from\" node to match the current\n                                // target DOM node.\n                                // MORPH\n                                morphEl(curFromNodeChild, curToNodeChild);\n                            }\n\n                        } else if (curFromNodeType === TEXT_NODE || curFromNodeType == COMMENT_NODE) {\n                            // Both nodes being compared are Text or Comment nodes\n                            isCompatible = true;\n                            // Simply update nodeValue on the original node to\n                            // change the text value\n                            if (curFromNodeChild.nodeValue !== curToNodeChild.nodeValue) {\n                                curFromNodeChild.nodeValue = curToNodeChild.nodeValue;\n                            }\n\n                        }\n                    }\n\n                    if (isCompatible) {\n                        // Advance both the \"to\" child and the \"from\" child since we found a match\n                        // Nothing else to do as we already recursively called morphChildren above\n                        curToNodeChild = toNextSibling;\n                        curFromNodeChild = fromNextSibling;\n                        continue outer;\n                    }\n\n                    // No compatible match so remove the old node from the DOM and continue trying to find a\n                    // match in the original DOM. However, we only do this if the from node is not keyed\n                    // since it is possible that a keyed node might match up with a node somewhere else in the\n                    // target tree and we don't want to discard it just yet since it still might find a\n                    // home in the final DOM tree. After everything is done we will remove any keyed nodes\n                    // that didn't find a home\n                    if (curFromNodeKey) {\n                        // Since the node is keyed it might be matched up later so we defer\n                        // the actual removal to later\n                        addKeyedRemoval(curFromNodeKey);\n                    } else {\n                        // NOTE: we skip nested keyed nodes from being removed since there is\n                        //       still a chance they will be matched up later\n                        removeNode(curFromNodeChild, fromEl, true /* skip keyed nodes */);\n                    }\n\n                    curFromNodeChild = fromNextSibling;\n                } // END: while(curFromNodeChild) {}\n\n                // If we got this far then we did not find a candidate match for\n                // our \"to node\" and we exhausted all of the children \"from\"\n                // nodes. Therefore, we will just append the current \"to\" node\n                // to the end\n                if (curToNodeKey && (matchingFromEl = fromNodesLookup[curToNodeKey]) && compareNodeNames(matchingFromEl, curToNodeChild)) {\n                    fromEl.appendChild(matchingFromEl);\n                    // MORPH\n                    morphEl(matchingFromEl, curToNodeChild);\n                } else {\n                    var onBeforeNodeAddedResult = onBeforeNodeAdded(curToNodeChild);\n                    if (onBeforeNodeAddedResult !== false) {\n                        if (onBeforeNodeAddedResult) {\n                            curToNodeChild = onBeforeNodeAddedResult;\n                        }\n\n                        if (curToNodeChild.actualize) {\n                            curToNodeChild = curToNodeChild.actualize(fromEl.ownerDocument || doc);\n                        }\n                        fromEl.appendChild(curToNodeChild);\n                        handleNodeAdded(curToNodeChild);\n                    }\n                }\n\n                curToNodeChild = toNextSibling;\n                curFromNodeChild = fromNextSibling;\n            }\n\n            cleanupFromEl(fromEl, curFromNodeChild, curFromNodeKey);\n\n            var specialElHandler = specialElHandlers[fromEl.nodeName];\n            if (specialElHandler) {\n                specialElHandler(fromEl, toEl);\n            }\n        } // END: morphChildren(...)\n\n        var morphedNode = fromNode;\n        var morphedNodeType = morphedNode.nodeType;\n        var toNodeType = toNode.nodeType;\n\n        if (!childrenOnly) {\n            // Handle the case where we are given two DOM nodes that are not\n            // compatible (e.g. <div> --> <span> or <div> --> TEXT)\n            if (morphedNodeType === ELEMENT_NODE) {\n                if (toNodeType === ELEMENT_NODE) {\n                    if (!compareNodeNames(fromNode, toNode)) {\n                        onNodeDiscarded(fromNode);\n                        morphedNode = moveChildren(fromNode, createElementNS(toNode.nodeName, toNode.namespaceURI));\n                    }\n                } else {\n                    // Going from an element node to a text node\n                    morphedNode = toNode;\n                }\n            } else if (morphedNodeType === TEXT_NODE || morphedNodeType === COMMENT_NODE) { // Text or comment node\n                if (toNodeType === morphedNodeType) {\n                    if (morphedNode.nodeValue !== toNode.nodeValue) {\n                        morphedNode.nodeValue = toNode.nodeValue;\n                    }\n\n                    return morphedNode;\n                } else {\n                    // Text node to something else\n                    morphedNode = toNode;\n                }\n            }\n        }\n\n        if (morphedNode === toNode) {\n            // The \"to node\" was not compatible with the \"from node\" so we had to\n            // toss out the \"from node\" and use the \"to node\"\n            onNodeDiscarded(fromNode);\n        } else {\n            if (toNode.isSameNode && toNode.isSameNode(morphedNode)) {\n                return;\n            }\n\n            morphEl(morphedNode, toNode, childrenOnly);\n\n            // We now need to loop over any keyed nodes that might need to be\n            // removed. We only do the removal if we know that the keyed node\n            // never found a match. When a keyed node is matched up we remove\n            // it out of fromNodesLookup and we use fromNodesLookup to determine\n            // if a keyed node has been matched up or not\n            if (keyedRemovalList) {\n                for (var i=0, len=keyedRemovalList.length; i<len; i++) {\n                    var elToRemove = fromNodesLookup[keyedRemovalList[i]];\n                    if (elToRemove) {\n                        removeNode(elToRemove, elToRemove.parentNode, false);\n                    }\n                }\n            }\n        }\n\n        if (!childrenOnly && morphedNode !== fromNode && fromNode.parentNode) {\n            if (morphedNode.actualize) {\n                morphedNode = morphedNode.actualize(fromNode.ownerDocument || doc);\n            }\n            // If we had to swap out the from node with a new node because the old\n            // node was not compatible with the target node then we need to\n            // replace the old DOM node in the original DOM tree. This is only\n            // possible if the original DOM node was part of a DOM tree which\n            // we know is the case if it has a parent node.\n            fromNode.parentNode.replaceChild(morphedNode, fromNode);\n        }\n\n        return morphedNode;\n    };\n}\n\nvar morphdom = morphdomFactory(morphAttrs);\n\nexport default morphdom;\n","import { isSupported } from 'govuk-frontend';\nimport morphdom from 'morphdom';\nimport { locationReload } from './utils.mjs';\n\nconst resourceState = {};\nconst defaultInterval = 2000;\n\n// Keyed by resource URL. Each entry holds:\n// renderers – Set of renderer functions registered by all instances\n// timeout – The single active setTimeout handle\n// interval – Current backoff interval\n// fetching – Whether a fetch is in flight\nfunction getState(resource) {\n  if (!resourceState[resource]) {\n    resourceState[resource] = {\n      renderers: new Set(),\n      timeout: null,\n      interval: defaultInterval,\n      fetching: false,\n    };\n  }\n  return resourceState[resource];\n}\n\n// Because the polling loop is shared, it can't belong to one instance. \n// It reads and writes resourceState[resource] directly. \n// All instances for the same URL share the exact same timeout and interval.\nasync function pollResource(resource, $form) {\n  const state = getState(resource);\n\n  clearTimeout(state.timeout);\n\n  if (document.visibilityState === 'hidden' || state.fetching) {\n    state.timeout = setTimeout(() => pollResource(resource, $form), state.interval);\n    return;\n  }\n\n  state.fetching = true;\n  const startTime = Date.now();\n\n  const method = $form ? 'POST' : 'GET';\n  const fetchOptions = { method, headers: {} };\n\n  if ($form) {\n    const formEl = document.getElementById($form);\n    if (formEl) {\n      fetchOptions.body = new URLSearchParams(new FormData(formEl)).toString();\n      fetchOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';\n    }\n  }\n\n  try {\n    const response = await fetch(resource, fetchOptions);\n\n    if (!response.ok) {\n      if (response.status === 401) {\n        locationReload();\n      }\n      state.fetching = false;\n      return;\n    }\n\n    const responseData = await response.json();\n\n    for (const renderer of state.renderers) {\n      renderer(responseData);\n    }\n\n    if (responseData.stop === 1) {\n      state.fetching = false;\n      return;\n    }\n\n    // Calculate backoff from actual response time, replacing the initial default.\n    state.interval = UpdateContent.prototype.calculateBackoff(Date.now() - startTime);\n\n  } catch {\n    // Network error – back off and retry.\n  }\n\n  state.fetching = false;\n  state.timeout = setTimeout(() => pollResource(resource, $form), state.interval);\n}\n\nclass UpdateContent {\n  constructor($module) {\n    if (!isSupported()) {\n      return this;\n    }\n    \n    this.$contents = $module.firstElementChild;\n    this.key = $module.dataset.key;\n    this.resource = $module.dataset.resource;\n    this.$form = $module.dataset.form;\n\n    // Replace component with contents.\n    // The renderer does this anyway when diffing against the first response\n    $module.parentNode.replaceChild(this.$contents, $module);\n\n    const state = getState(this.resource);\n    const renderer = this.getRenderer(this.$contents, this.key);\n\n    state.renderers.add(renderer);\n\n    if (state.renderers.size === 1) {\n      state.timeout = setTimeout(() => pollResource(this.resource, this.$form), state.interval);\n    }\n  }\n\n  calculateBackoff(responseTime) {\n    return Math.max(Math.floor(250 * Math.sqrt(responseTime)) - 1000, 1000);\n  }\n\n  getRenderer(contents, key) {\n    return (response) => {\n      if (!response || !response[key]) return;\n\n      let contentHasUpdated = false;\n      const parser = new DOMParser();\n      const doc = parser.parseFromString(response[key], 'text/html');\n      const newContents = doc.body.firstElementChild;\n\n      morphdom(contents, newContents, {\n        onBeforeElUpdated: (fromEl, toEl) => {\n          // spec - https://dom.spec.whatwg.org/#concept-node-equals\n          if (fromEl.isEqualNode(toEl)) {\n            return false;\n          } else if (fromEl === contents) { // if root node is different, updates will apply\n            contentHasUpdated = true;\n          }\n          return true;\n        }\n      });\n\n      if (contentHasUpdated) {\n        document.dispatchEvent(new CustomEvent('updateContent.onafterupdate', {\n          detail: { el: [contents] }\n        }));\n      }\n    };\n  }\n}\n\nexport default UpdateContent;\n","import { isSupported } from 'govuk-frontend';\n\n// This new way of writing Javascript components is based on the GOV.UK Frontend skeleton Javascript coding standard\n// that uses ES2015 Classes -\n// https://github.com/alphagov/govuk-frontend/blob/main/docs/contributing/coding-standards/js.md#skeleton\n//\n// It replaces the previously used way of setting methods on the component's `prototype`.\n// We use a class declaration way of defining classes -\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/class\n//\n// More on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\n\n// inspired by https://polypane.app/blog/the-intl-api-the-best-browser-api-youre-not-using/\n// NL override of update-relative-time.mjs - uses the nl-NL locale instead of en-GB\nclass UpdateRelativeTime {\n  // creating formatters is expensive so we create them once and reuse\n  static relativeFormatter = new Intl.RelativeTimeFormat('nl-NL', { numeric: 'auto' });\n  static fullDateFormatter = new Intl.DateTimeFormat('nl-NL', { dateStyle: 'long', timeStyle: 'short' });\n\n  constructor(selector) {\n    if (!isSupported()) {\n      return this;\n    }\n\n    this.selector = selector;\n\n    this.init();\n  }\n\n  init() {\n    this.updateExistingElements();\n\n    // start global 60s interval\n    setInterval(() => this.updateExistingElements(), 60000);\n  }\n\n  updateExistingElements() {\n    const $elements = document.querySelectorAll(this.selector);\n    const now = new Date();\n    $elements.forEach(($el) => this.updateTextString($el, now));\n  }\n\n  updateTextString(element, currentTime) {\n    const elementDatetimeStamp = element.getAttribute('datetime');\n    // don't run if we forgot to include the attribute\n    if (!elementDatetimeStamp) return;\n\n    const elementTime = new Date(elementDatetimeStamp);\n\n    // we only update the title attribute once with\n    // human-readible date format\n    if (!element.hasAttribute('title')) {\n      element.setAttribute('title', UpdateRelativeTime.fullDateFormatter.format(elementTime));\n    }\n\n    const relativeTimeString = this.calculateRelativeTimeString(elementTime, currentTime);\n\n    // only update text if there's a change\n    // hours, days and longer don't need to have\n    // their text updated every minute\n    if (element.textContent !== relativeTimeString) {\n      element.textContent = relativeTimeString;\n    }\n  }\n\n  calculateRelativeTimeString(elementTime, currentTime) {\n    // thresholds to switch display units\n    // in line with what we used before and other libraries\n    // https://github.com/rmm5t/jquery-timeago/blob/master/jquery.timeago.js#L102\n    // https://day.js.org/docs/en/customization/relative-time#relative-time-thresholds-and-rounding\n    const diffInSeconds = Math.round((elementTime - currentTime) / 1000);\n    const absSeconds = Math.abs(diffInSeconds);\n\n    // Custom overrides for the immediate past\n    if (diffInSeconds <= 0) {\n      if (absSeconds < 30) {\n        return \"zojuist\";\n      }\n      if (absSeconds < 60) {\n        return \"in de afgelopen minuut\";\n      }\n    }\n\n    // handle future seconds or cases not caught by custom past strings\n    if (diffInSeconds > 0 && absSeconds < 45) { // 0 to 44s (future)\n      return UpdateRelativeTime.relativeFormatter.format(diffInSeconds, 'second');\n    }\n\n    const diffInMinutes = Math.round(diffInSeconds / 60);\n    // ensure we are at least at 60s to avoid overlapping with \"in de afgelopen minuut\"\n    if (absSeconds >= 60 && Math.abs(diffInMinutes) < 45) { // 60s to 44m\n      return UpdateRelativeTime.relativeFormatter.format(diffInMinutes, 'minute');\n    }\n\n    const diffInHours = Math.round(diffInMinutes / 60);\n    if (Math.abs(diffInHours) < 22) { // 45m to 21h\n      return UpdateRelativeTime.relativeFormatter.format(diffInHours, 'hour');\n    }\n\n    const diffInDays = Math.round(diffInHours / 24);\n    if (Math.abs(diffInDays) < 27) { // 22h to 26d\n      return UpdateRelativeTime.relativeFormatter.format(diffInDays, 'day');\n    }\n\n    // for months and years, we use the calendar date logic as lengths are different\n    const monthDiff = (elementTime.getFullYear() - currentTime.getFullYear()) * 12 +\n                      (elementTime.getMonth() - currentTime.getMonth());\n\n    if (Math.abs(monthDiff) < 11) {\n      return UpdateRelativeTime.relativeFormatter.format(monthDiff, 'month');\n    }\n\n    const yearDiff = Math.round(monthDiff / 12);\n    return UpdateRelativeTime.relativeFormatter.format(yearDiff, 'year');\n  }\n}\n\nexport default UpdateRelativeTime;\n","import { isSupported } from 'govuk-frontend';\nimport { stickAtBottomWhenScrolling } from './stick-to-window-when-scrolling.mjs';\n\nclass TemplateFolderForm {\n  constructor($module) {\n    if (!isSupported()) {\n      return this;\n    }\n\n    this.$form = $module;\n\n    this.setupSelectionStatus();\n    this.setupDOM();\n    this.setupStates();\n    this.setupStateModifiers();\n    this.setupInitialState();\n    this.bindEvents();\n  }\n\n  setupDOM() {\n    // remove the hidden unknown button - if you've got JS enabled then the action you want to do is implied by\n    // which field is visible.\n    this.$form.querySelector('button[value=unknown]').remove();\n\n    this.$liveRegionCounter = this.$form.querySelector('.selection-counter');\n\n    this.$nothingSelectedButtons = this.createNothingSelectedButtons();\n    this.$itemsSelectedButtons = this.createItemsSelectedButtons();\n\n    this.$liveRegionCounter.before(this.$nothingSelectedButtons);\n    this.$liveRegionCounter.before(this.$itemsSelectedButtons);\n  }\n\n  setupStates() {\n    // all the diff states that we want to show or hide\n    this.states = [\n      {\n        key: 'nothing-selected-buttons',\n        $el: this.$form.querySelector('#nothing_selected'),\n        cancellable: false\n      },\n      {\n        key: 'items-selected-buttons',\n        $el: this.$form.querySelector('#items_selected'),\n        cancellable: false\n      },\n      {\n        key: 'move-to-existing-folder',\n        $el: this.$form.querySelector('#move_to_folder_radios'),\n        cancellable: true,\n        setFocus: () => document.getElementById('move_to_folder_radios').focus(),\n        action: 'verplaatsen naar map',\n        description: 'Selecteer ‘Verplaatsen’ om te bevestigen of ‘Annuleren’ om te sluiten'\n      },\n      {\n        key: 'move-to-new-folder',\n        $el: this.$form.querySelector('#move_to_new_folder_form'),\n        cancellable: true,\n        setFocus: () => document.getElementById('move_to_new_folder_form').focus(),\n        action: 'verplaatsen naar nieuwe map',\n        description: 'Selecteer ‘Toevoegen aan nieuwe map’ om de naam te bevestigen of ‘Annuleren’ om te sluiten'\n      },\n      {\n        key: 'add-new-folder',\n        $el: this.$form.querySelector('#add_new_folder_form'),\n        cancellable: true,\n        setFocus: () => document.getElementById('add_new_folder_form').focus(),\n        action: 'nieuwe map',\n        description: 'Selecteer ‘Nieuwe map toevoegen’ om de naam te bevestigen of ‘Annuleren’ om te sluiten'\n      },\n      {\n        key: 'add-new-template',\n        $el: this.$form.querySelector('#add_new_template_form'),\n        cancellable: true,\n        setFocus: () => document.getElementById('add_new_template_form').focus(),\n        action: 'nieuw sjabloon',\n        description: 'Selecteer ‘Doorgaan’ om de selectie te bevestigen of ‘Annuleren’ om te sluiten'\n      }\n    ];\n  }\n\n  setupStateModifiers() {\n    this.states.forEach(state => {\n      if (!state.$el) return;\n      // cancel/clear buttons only relevant if JS enabled\n      if (state.cancellable) this.addCancelButton(state);\n      if (state.key === 'items-selected-buttons') this.addClearButton(state);\n      // make elements focusable\n      if (state.setFocus) state.$el.setAttribute('tabindex', '0');\n    });\n\n    this.addDescriptionsToStates();\n\n    // activate stickiness of elements in each state\n    this.activateStickyElements();\n  }\n\n  setupInitialState() {\n    // first off show the new template / new folder buttons\n    this._lastState = this.$form.dataset.prevState;\n    if (this._lastState === undefined) {\n      this.selectActionButtons();\n    } else {\n      this.currentState = this._lastState;\n      this.render();\n    }\n  }\n\n  bindEvents() {\n    this.$form.addEventListener('click', (event) => {\n      if (event.target.closest('button.govuk-button--secondary')) {\n        this.actionButtonClicked(event);\n      }\n    });\n\n    this.$form.addEventListener('change', (event) => {\n      if (event.target.matches('input[type=\"checkbox\"]')) {\n        this.templateFolderCheckboxChanged();\n      }\n    });\n  }\n\n  setupSelectionStatus() {\n    this.selectionStatus = {\n      'default': 'Niets geselecteerd',\n      'selected': numSelected => {\n        const nouns = {\n          templates: { singular: 'sjabloon', plural: 'sjablonen' },\n          folders: { singular: 'map', plural: 'mappen' }\n        };\n\n        const getString = key => {\n          if (numSelected[key] === 0) {\n            return '';\n          } else if (numSelected[key] === 1) {\n            return `1 ${nouns[key].singular}`;\n          } else {\n            return `${numSelected[key]} ${nouns[key].plural}`;\n          }\n        };\n\n        const results = [];\n\n        if (numSelected.templates > 0) {\n          results.push(getString('templates'));\n        }\n        if (numSelected.folders > 0) {\n          results.push(getString('folders'));\n        }\n        return results.join(', ') + ' geselecteerd';\n      },\n      'update': numSelected => {\n        let message = (numSelected.total > 0) ? this.selectionStatus.selected(numSelected) : this.selectionStatus.default;\n\n        document.querySelector('.checkbox-list-selected-counter__count').textContent = message;\n        this.$liveRegionCounter.textContent = message;\n      }\n    };\n  }\n\n  addDescriptionsToStates() {\n    this.states.forEach(state => {\n      if (!state.$el || !state.description) return;\n\n      const id = `${state.key}__description`;\n      const $description = document.createElement('p');\n      $description.className = 'govuk-visually-hidden';\n      $description.id = id;\n      $description.textContent = state.description;\n\n      state.$el.prepend($description);\n      state.$el.setAttribute('aria-describedby', id);\n    });\n  }\n\n  activateStickyElements() {\n    const oldClass = 'js-will-stick-at-bottom-when-scrolling';\n    const newClass = 'js-stick-at-bottom-when-scrolling';\n\n    this.states.forEach(state => {\n      if (!state.$el) return;\n\n      state.$el.querySelectorAll('.' + oldClass).forEach(el => {\n        el.classList.remove(oldClass);\n        el.classList.add(newClass);\n      });\n    });\n  }\n\n  addCancelButton(state) {\n    let selector = `[value=${state.key}]`;\n    let $cancel = this.makeButton('Annuleren', {\n      'onclick': () => {\n        // clear existing data\n        state.$el.querySelectorAll('input[type=\"radio\"]').forEach(radio => radio.checked = false);\n        state.$el.querySelectorAll('input[type=\"text\"]').forEach(input => input.value = '');\n\n        // go back to action buttons\n        this.selectActionButtons(selector);\n      },\n      'cancelSelector': selector,\n      'nonvisualText': state.action\n    });\n\n    state.$el.querySelector(selector).after($cancel);\n  }\n\n  addClearButton(state) {\n    let selector = 'button[value=add-new-template]';\n    let $clear = this.makeButton('Wissen', {\n      'onclick': () => {\n        // uncheck all templates and folders\n        this.$form.querySelectorAll('input[type=\"checkbox\"]').forEach(cb => cb.checked = false);\n\n        // go back to action buttons\n        this.selectActionButtons(selector);\n      },\n      'nonvisualText': \"selectie\"\n    });\n\n   state.$el.querySelector('.checkbox-list-selected-counter').append($clear);\n  }\n\n  makeButton(text, opts) {\n    let $btn = document.createElement('a');\n    $btn.setAttribute('href', '');\n    $btn.innerHTML = text;\n    $btn.classList.add('govuk-link', 'govuk-link--no-visited-state', 'js-cancel');\n    // isn't set if cancelSelector is undefined\n    if (opts.cancelSelector) {\n      $btn.dataset.target = opts.cancelSelector;\n    }\n    $btn.setAttribute('tabindex', '0');\n\n    const handleOnClick = (event) => {\n      event.preventDefault();\n      if (Object.prototype.hasOwnProperty.call(opts, 'onclick')) { opts.onclick(); }\n    };\n\n    $btn.addEventListener('click', handleOnClick);\n    $btn.addEventListener('keydown', (event) => {\n      // enter or space pressed - https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key\n      if (event.key === \"Enter\" || event.key === \" \") {\n        handleOnClick(event);\n      }\n    });\n\n    if (Object.prototype.hasOwnProperty.call(opts, 'nonvisualText')) {\n      const span = document.createElement('span');\n      span.className = 'govuk-visually-hidden';\n      span.textContent = ` ${opts.nonvisualText}`; // space before it maintained\n      $btn.append(span);\n    }\n\n    return $btn;\n  }\n\n  selectActionButtons(targetSelector) {\n    // If we want to show one of the grey choose actions state, we can pretend we're in the choose actions state,\n    // and then pretend a checkbox was clicked to work out whether to show zero or non-zero options.\n    // This calls a render at the end\n    this.currentState = 'nothing-selected-buttons';\n    this.templateFolderCheckboxChanged();\n    if (targetSelector) {\n      this.$form.querySelector(targetSelector).focus();\n    }\n  }\n\n  // method that checks the state against the last one, used prior to render() to see if needed\n  stateChanged() {\n    let changed = this.currentState !== this._lastState;\n\n    this._lastState = this.currentState;\n    return changed;\n  }\n\n  actionButtonClicked(event) {\n    event.preventDefault();\n    this.currentState = event.target.closest('button.govuk-button--secondary').value;\n\n    if (this.stateChanged()) {\n        this.render();\n    }\n  }\n\n  templateFolderCheckboxChanged() {\n    let numSelected = this.countSelectedCheckboxes();\n\n    if (this.currentState === 'nothing-selected-buttons' && numSelected.total !== 0) {\n      // user has just selected first item\n      this.currentState = 'items-selected-buttons';\n    } else if (this.currentState === 'items-selected-buttons' && numSelected.total === 0) {\n      // user has just deselected last item\n      this.currentState = 'nothing-selected-buttons';\n    }\n\n    if (this.stateChanged()) {\n      this.render();\n    }\n\n    this.selectionStatus.update(numSelected);\n\n    document.querySelector('.checkbox-list-selected-counter').style.display = this.hasCheckboxes() ? '' : 'none';\n  }\n\n  hasCheckboxes() {\n    return !!this.$form.querySelectorAll('input[type=\"checkbox\"]').length;\n  }\n\n  countSelectedCheckboxes() {\n    const allSelected = this.$form.querySelectorAll('input[type=\"checkbox\"]:checked');\n\n    return Array.from(allSelected).reduce((acc, el) => {\n      const parent = el.parentElement;\n      if (parent) {\n        if (parent.querySelector('.template-list-template')) acc.templates++;\n        if (parent.querySelector('.template-list-folder')) acc.folders++;\n      }\n      acc.total++;\n      return acc;\n    }, { templates: 0, folders: 0, total: 0 });\n  }\n\n  render() {\n    let mode = 'default';\n    let currentStateObj = this.states.filter(state => { return (state.key === this.currentState); })[0];\n    let scrollTop;\n\n    // detach everything, unless they are the currentState\n    this.states.forEach(state => {\n      if (state.key === this.currentState) {\n        if (this.$liveRegionCounter && state.$el) {\n          this.$liveRegionCounter.before(state.$el);\n        }\n      } else {\n        if (state.$el) {\n          state.$el.remove();\n        }\n      }\n    });\n\n    // use dialog mode for states which contain more than one form control\n    if (['move-to-existing-folder', 'add-new-template'].includes(this.currentState)) {\n      mode = 'dialog';\n    }\n    stickAtBottomWhenScrolling.setMode(mode);\n    // we cache and reset the scrollTop to negate scrolling the browser does when elements inside the new state are focused\n    // make sticky JS recalculate its cache of the element's position\n    stickAtBottomWhenScrolling.recalculate();\n\n    // if the rendered page contains an error summary, we don't focus the form and let Design System Javascript handle error-summary focus\n    if (currentStateObj && ('setFocus' in currentStateObj) && !this.formHasError()) {\n      scrollTop = window.pageYOffset || document.documentElement.scrollTop;\n      currentStateObj.setFocus();\n      window.scrollTo(window.pageXOffset || document.documentElement.scrollLeft, scrollTop);\n    }\n  }\n\n  createNothingSelectedButtons() {\n    const $container = document.createElement('div');\n    $container.id = 'nothing_selected';\n\n    const $stickyContainer = document.createElement('div');\n    $stickyContainer.className = 'js-stick-at-bottom-when-scrolling';\n\n    const $newTemplateBtn = document.createElement('button');\n    $newTemplateBtn.type = 'button';\n    $newTemplateBtn.className = 'govuk-button govuk-button--secondary govuk-!-margin-right-3 govuk-!-margin-bottom-1';\n    $newTemplateBtn.value = 'add-new-template';\n    $newTemplateBtn.textContent = 'Nieuw sjabloon';\n    $newTemplateBtn.setAttribute('aria-expanded', 'false');\n\n    const $newFolderBtn = document.createElement('button');\n    $newFolderBtn.type = 'button';\n    $newFolderBtn.className = 'govuk-button govuk-button--secondary govuk-!-margin-bottom-1';\n    $newFolderBtn.value = 'add-new-folder';\n    $newFolderBtn.setAttribute('aria-expanded', 'false');\n    $newFolderBtn.textContent = 'Nieuwe map';\n\n    const $counterDiv = document.createElement('div');\n    $counterDiv.className = 'checkbox-list-selected-counter';\n\n    const countSpan = document.createElement('span');\n    countSpan.className = 'checkbox-list-selected-counter__count';\n    countSpan.setAttribute('aria-hidden', 'true');\n    countSpan.textContent = this.selectionStatus.default;\n\n    $counterDiv.appendChild(countSpan);\n    $stickyContainer.appendChild($newTemplateBtn);\n    $stickyContainer.appendChild($newFolderBtn);\n    $stickyContainer.appendChild($counterDiv);\n    $container.appendChild($stickyContainer);\n\n    return $container;\n  }\n\n  createItemsSelectedButtons() {\n    const $container = document.createElement('div');\n    $container.id = 'items_selected';\n\n    const $stickyContainer = document.createElement('div');\n    $stickyContainer.className = 'js-stick-at-bottom-when-scrolling';\n\n    const $moveBtn = document.createElement('button');\n    $moveBtn.type = 'button';\n    $moveBtn.className = 'govuk-button govuk-button--secondary govuk-!-margin-right-3 govuk-!-margin-bottom-1';\n    $moveBtn.value = 'move-to-existing-folder';\n    $moveBtn.setAttribute('aria-expanded', 'false');\n    $moveBtn.textContent = 'Verplaats';\n\n    const $srMessageContainer = document.createElement('span');\n    $srMessageContainer.className = 'govuk-visually-hidden';\n    $srMessageContainer.textContent = ' de selectie naar de map';\n    $moveBtn.appendChild($srMessageContainer);\n\n    const $addFolderBtn = document.createElement('button');\n    $addFolderBtn.type = 'button';\n    $addFolderBtn.className = 'govuk-button govuk-button--secondary govuk-!-margin-bottom-1';\n    $addFolderBtn.value = 'move-to-new-folder';\n    $addFolderBtn.setAttribute('aria-expanded', 'false');\n    $addFolderBtn.textContent = 'Toevoegen aan een nieuwe map';\n\n    const $counterDiv = document.createElement('div');\n    $counterDiv.className = 'checkbox-list-selected-counter';\n    $counterDiv.setAttribute('aria-hidden', 'true');\n\n    const $countElement = document.createElement('span');\n    $countElement.className = 'checkbox-list-selected-counter__count';\n    $countElement.setAttribute('aria-hidden', 'true');\n    $countElement.textContent = this.selectionStatus.selected(this.selectionStatus.default);\n\n    $counterDiv.appendChild($countElement);\n    $stickyContainer.appendChild($moveBtn);\n    $stickyContainer.appendChild($addFolderBtn);\n    $stickyContainer.appendChild($counterDiv);\n    $container.appendChild($stickyContainer);\n\n    return $container;\n  }\n\n  formHasError() {\n    return Boolean(document.querySelector('.govuk-error-summary'));\n  }\n}\n\nexport default TemplateFolderForm;\n","// GOVUK Frontend modules\nimport { createAll, Button, Radios, ErrorSummary, SkipLink, Tabs, ServiceNavigation } from 'govuk-frontend';\n\nimport CollapsibleCheckboxes from './collapsible-checkboxes.mjs';\nimport FocusBanner from './focus-banner.mjs';\nimport ColourPreview from './colour-preview.mjs';\nimport FileUpload from './file-upload.mjs';\nimport Autofocus from './autofocus.mjs';\nimport Homepage from './homepage.mjs';\nimport PreviewPane from './preview-pane.mjs';\nimport CopyToClipboard from './copy-to-clipboard.mjs';\nimport ListEntry from './list-entry.mjs';\nimport RadiosWithImages from './radios-with-images.mjs';\n\nimport LiveSearch from './live-search.mjs';\nimport EnhancedTextbox from './enhanced-textbox.mjs';\nimport CheckReportStatus from './check-report-status.mjs';\nimport LiveCheckboxControls from './live-checkbox-controls.mjs';\nimport AddBrandingOptionsControls from './add-branding-options-controls.mjs';\n\nimport RadioSelect from './radio-select.mjs';\nimport FullscreenTable from './fullscreen-table.mjs';\nimport RemoveInPresenceOf from './remove-in-presence-of.mjs';\nimport AuthenticateSecurityKey from './authenticate-security-key.mjs';\nimport RegisterSecurityKey from './register-security-key.mjs';\nimport UpdateStatus from './update-status.mjs';\nimport UpdateContent from './update-content.mjs';\nimport UpdateRelativeTime from './update-relative-time_nl.mjs';\nimport { stickAtTopWhenScrolling, stickAtBottomWhenScrolling } from './stick-to-window-when-scrolling.mjs';\nimport TemplateFolderForm from './template-folder-form_nl.mjs';\n\ncreateAll(Button,\n  { preventDoubleClick: true }\n);\ncreateAll(Radios);\ncreateAll(ErrorSummary);\ncreateAll(SkipLink);\ncreateAll(Tabs);\ncreateAll(ServiceNavigation);\n\nstickAtTopWhenScrolling.init();\nstickAtBottomWhenScrolling.init();\n\nconst $livesearch = document.querySelector('[data-notify-module=\"live-search\"]');\nif ($livesearch) {\n  new LiveSearch($livesearch);\n}\n\nconst $collapsibleCheckboxes = document.querySelector('[data-notify-module=\"collapsible-checkboxes\"]');\nif ($collapsibleCheckboxes) {\n  new CollapsibleCheckboxes($collapsibleCheckboxes);\n}\n\nconst $colourPreview = document.querySelector('[data-notify-module=\"colour-preview\"]');\nif ($colourPreview) {\n  new ColourPreview($colourPreview);\n}\n\nconst $fileUpload = document.querySelector('[data-notify-module=\"file-upload\"]');\nif ($fileUpload) {\n  new FileUpload($fileUpload);\n}\n\nconst $autoFocus = document.querySelector('[data-notify-module=\"autofocus\"]');\nif ($autoFocus) {\n  new Autofocus($autoFocus);\n}\n\nconst $homePage = document.querySelector('[data-notify-module=\"homepage\"]');\nif ($homePage) {\n  new Homepage($homePage);\n}\n\n// this module doesn't currently use \"data-notify-module\" for initialisation\n// should we change that?\nconst $previewPane = document.querySelector('.govuk-radios__item input[name=\"branding_style\"]:checked');\nif ($previewPane) {\n  new PreviewPane($previewPane);\n}\n\nconst $CopyToClipboardArray = document.querySelectorAll('[data-notify-module=\"copy-to-clipboard\"]');\nif ($CopyToClipboardArray.length > 0) {\n  $CopyToClipboardArray.forEach((el) => new CopyToClipboard(el));\n}\n\nconst $ListEntryArray = document.querySelectorAll('[data-notify-module=\"list-entry\"]');\nif ($ListEntryArray.length > 0) {\n  $ListEntryArray.forEach((el) => new ListEntry(el));\n}\n\nconst $radiosWithImagesArray = document.querySelectorAll('[data-notify-module=\"radios-with-images\"]');\nif ($radiosWithImagesArray.length > 0) {\n  $radiosWithImagesArray.forEach((el) => new RadiosWithImages(el));\n}\n\n\nconst $enhancedTextboxArray = document.querySelectorAll('[data-notify-module=\"enhanced-textbox\"]');\nif ($enhancedTextboxArray.length > 0) {\n  $enhancedTextboxArray.forEach((el) => new EnhancedTextbox(el));\n}\n\nconst $checkReportStatusEl = document.querySelector('[data-notify-module=\"check-report-status\"]');\nif ($checkReportStatusEl) {\n  new CheckReportStatus($checkReportStatusEl).checkStatus();\n}\n\nconst $authTypeForm = document.querySelector('[data-notify-module=\"set-auth-type-form\"]');\nif ($authTypeForm) {\n  new LiveCheckboxControls($authTypeForm);\n}\n\nconst $addBrandingOptionsForm = document.querySelector('[data-notify-module=\"add-branding-options-form\"]');\nif ($addBrandingOptionsForm) {\n  new AddBrandingOptionsControls($addBrandingOptionsForm);\n}\n\nconst $radioSelectElementsArray = document.querySelectorAll('[data-notify-module=\"radio-select\"]');\n\nif ($radioSelectElementsArray.length > 0) {\n  $radioSelectElementsArray.forEach(el => {\n    new RadioSelect(el);\n  });\n}\n\nconst $fullScreenTableArray = document.querySelectorAll('[data-notify-module=\"fullscreen-table\"]');\nif ($fullScreenTableArray.length > 0) {\n  $fullScreenTableArray.forEach(tableComponent => new FullscreenTable(tableComponent));\n}\n\nconst $elementToRemove = document.querySelector('[data-notify-module=\"remove-in-presence-of\"]');\nif ($elementToRemove) {\n  new RemoveInPresenceOf($elementToRemove);\n}\n\nconst $authenticateSecurityKey = document.querySelector('[data-notify-module=\"authenticate-security-key\"]');\nif ($authenticateSecurityKey) {\n  new AuthenticateSecurityKey($authenticateSecurityKey);\n}\n\nconst $registerSecurityKey = document.querySelector('[data-notify-module=\"register-security-key\"]');\nif ($registerSecurityKey) {\n  new RegisterSecurityKey($registerSecurityKey);\n}\n\nconst $updateStatus = document.querySelector('[data-notify-module=\"update-status\"]');\nif ($updateStatus) {\n  new UpdateStatus($updateStatus).init();\n}\n\nconst $updateContentBlocks = document.querySelectorAll('[data-notify-module=\"update-content\"]');\nif ($updateContentBlocks.length > 0) {\n  $updateContentBlocks.forEach(updateBlockComponent => {\n    new UpdateContent(updateBlockComponent);\n  });\n};\n\nnew FocusBanner();\n\n// if there's at least 1 element on the page initialise the class\n// multiple elements are handled by it\nconst updateRelativeTimeSelector = '[data-notify-module=\"update-relative-time\"]';\nif (document.querySelector('[data-notify-module=\"update-relative-time\"]')) {\n  new UpdateRelativeTime(updateRelativeTimeSelector);\n}\n\nconst $templateFolderForm = document.querySelector('[data-notify-module=\"template-folder-form\"]');\nif ($templateFolderForm) {\n  new TemplateFolderForm($templateFolderForm);\n}\n\nwindow.GOVUK = window.GOVUK || {};\nwindow.GOVUK.stickAtTopWhenScrolling = stickAtTopWhenScrolling;\nwindow.GOVUK.stickAtBottomWhenScrolling = stickAtBottomWhenScrolling;\n","import { isSupported } from 'govuk-frontend';\n\n// This new way of writing Javascript components is based on the GOV.UK Frontend skeleton Javascript coding standard\n// that uses ES 2015 Classes -\n// https://github.com/alphagov/govuk-frontend/blob/main/docs/contributing/coding-standards/js.md#skeleton\n//\n// It replaces the previously used way of setting methods on the component's `prototype`.\n// We use a class declaration way of defining classes -\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/class\n//\n// More on ES2015 Classes at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\n\n// Focus banners that do not use the GOVUK Design System Error Summary component but still need to\n// match its behaviour when they appear\nclass FocusBanner {\n  constructor() {\n    if (!isSupported()) {\n      return this;\n    }\n\n    // focus any error banners when the page loads\n    const $bannerEl = document.querySelector('.banner-dangerous');\n    if ($bannerEl) {\n      this.focusBanner($bannerEl);\n    }\n\n    // focus success and error banners when they appear in any content updates\n    document.addEventListener('updateContent.onafterupdate', (event) => {\n      const el = event.detail.el[0];\n      const $bannerEl = el.classList.contains(\"banner-dangerous\") ? el : el.querySelector(\".banner-dangerous\");\n      if ($bannerEl) {\n        this.focusBanner($bannerEl);\n      }\n    });\n  }\n\n  focusBanner($bannerEl) {\n    $bannerEl.setAttribute('tabindex', '-1');\n    $bannerEl.focus();\n    $bannerEl.addEventListener('blur', () => {\n      $bannerEl.removeAttribute('tabindex');\n    }, { once: true });\n  }\n}\n\nexport default FocusBanner;\n"],"names":["getBreakpoint","name","property","value","window","getComputedStyle","document","documentElement","getPropertyValue","undefined","setFocus","$element","options","_options$onBeforeFocu","isFocusable","getAttribute","onBlur","_options$onBlur","call","removeAttribute","setAttribute","addEventListener","once","onBeforeFocus","focus","isSupported","$scope","body","classList","contains","isObject","option","Array","isArray","isScope","Element","Document","formatErrorMessage","Component","message","moduleName","GOVUKFrontendError","Error","constructor","args","super","this","SupportError","supportMessage","HTMLScriptElement","prototype","ConfigError","ElementError","messageOrOptions","component","identifier","element","expectedType","InitError","componentOrMessage","$root","_$root","childConstructor","elementType","checkSupport","checkInitialised","HTMLElement","hasAttribute","isInitialised","configOverride","Symbol","for","ConfigurableComponent","param","config","_config","defaults","datasetConfig","dataset","schema","out","entries","Object","properties","entry","namespace","field","toString","normaliseString","type","extractConfigByNamespace","normaliseDataset","mergeConfigs","trimmedValue","trim","output","outputType","includes","length","isFinite","Number","configObjects","formattedConfigObject","configObject","key","keys","override","newObject","current","keyParts","split","index","Button","debounceFormSubmitTimer","event","handleKeyDown","debounce","$target","target","preventDefault","click","preventDoubleClick","setTimeout","DEBOUNCE_TIMEOUT_IN_SECONDS","freeze","ErrorSummary","disableAutoFocus","handleClick","focusTarget","HTMLAnchorElement","inputId","hash","replace","$input","getElementById","$legendOrLabel","getAssociatedLegendOrLabel","scrollIntoView","preventScroll","_document$querySelect","$fieldset","closest","$legends","getElementsByTagName","$candidateLegend","HTMLInputElement","legendTop","getBoundingClientRect","top","inputRect","height","innerHeight","querySelector","Radios","$inputs","querySelectorAll","forEach","targetId","syncAllConditionalReveals","syncConditionalRevealWithInputState","inputIsChecked","checked","toggle","$clickedInput","$allInputs","$clickedInputForm","form","$clickedInputName","hasSameFormOwner","ServiceNavigation","$menuButton","$menu","menuIsOpen","mql","menuId","setupResponsiveChecks","handleMenuButtonClick","breakpoint","matchMedia","checkMode","addListener","matches","attributes","attributeName","setAttributes","attributesForHidingButton","attributeNames","removeAttributes","hidden","SkipLink","_this$$root$getAttrib","href","origin","location","pathname","linkedElementId","$linkedElement","add","remove","Tabs","$tabs","$tabList","$tabListItems","jsHiddenClass","changingHash","boundTabClick","boundTabKeydown","boundOnHashChange","onTabClick","bind","onTabKeydown","onHashChange","_this$mql","setup","teardown","_this$getTab","$item","$tab","hideTab","$activeTab","getTab","showTab","removeEventListener","unsetAttributes","$tabWithHash","$previousTab","getCurrentTab","unhighlightTab","hidePanel","highlightTab","showPanel","panelId","$panel","getPanel","id","$currentTab","$nextTab","currentTarget","createHistoryEntry","activatePreviousTab","activateNextTab","parentElement","$nextTabListItem","nextElementSibling","$previousTabListItem","previousElementSibling","createAll","scopeOrOptions","$elements","onError","scope","normaliseOptions","_options$scope","error","console","log","from","map","filter","Boolean","CollapsibleCheckboxes","$module","toggleButtonClass","toggleButtonChevronClass","toggleButtonChevronActiveClass","$selectionSummaryContainer","fieldLabel","$checkboxesContainer","$checkboxesArray","legendText","textContent","total","selectionSummaryContent","all","selection","some","none","folder","addHeadingHideLegend","initSelectionSummary","constructToggleButton","handleToggleButtonClick","handleCheckboxClick","$toggleButton","createElement","$visuallyHiddenButtonContent","toLowerCase","$toggleButtonChevron","append","prepend","before","$button","expanded","checkbox","updateSelectionSummary","getSelectionCount","$hint","$summaryText","count","$selectionSummaryTextContainer","template","headingLevel","safeLevel","$heading","$legend","ColourPreview","isHexColourValue","match","addHashIfNeeded","charAt","colourOrWhite","$appendToElement","parentNode","$colourPreviewElement","applyBackgroundColour","style","background","FileUpload","$form","$field","$fieldErrors","addFakeButton","reset","submit","addCancelButton","$cancelButton","replaceWith","buttonText","fieldId","oldFieldId","formErrors","insertAdjacentElement","$label","$span","appendChild","createTextNode","Autofocus","$component","forceFocus","arrayOfTargetElements","scrollY","tagName","join","Homepage","iterations","timeout","clearTimeout","PreviewPane","branding_style","$paneWrapper","previewType","letterBrandingPreviewRootPath","applyPreviewPane","RegExp","e","setPreviewPane","generateImagePreview","generateIframePreview","imagePreviewPane","imagePreviewPaneImage","buildQueryString","iframePreviewPane","arguments","val","_idx","encodeURI","offset","el","box","docElem","clientTop","left","scrollX","clientLeft","locationReload","reload","Caret","defineProperty","exports","getAbsolutePosition","caretRelPost","getRelativePosition","absolute","debug","useSelectionEnd","checkWidthOverflow","selectionStart","selectionEnd","position","isFirefox","navigator","userAgent","indexOf","removeChild","div","computed","currentStyle","isInput","nodeName","whiteSpace","wordWrap","visibility","prop","boxSizing","parseInt","outerHeight_1","paddingTop","paddingBottom","borderTopWidth","borderBottomWidth","targetHeight","lineHeight","scrollHeight","overflowY","overflow","substring","span","relativePosition","offsetTop","offsetLeft","backgroundColor","clientWidth","setElementPositionBasedOnCaret","caretElement","margin","detectBoundary","returnOnly","pos","innerWidth","getCaretCoordinates","_mode","ScrollArea","edge","selector","$el","$fixedEl","$scrollArea","els","node","setEvents","addEl","push","hasEl","updateEls","usedEls","keyUpHandler","focusHandler","capture","passive","removeEvents","getFocusedDetails","forElement","$focusedElement","focused","offsetHeight","bottom","forCaret","$textarea","textarea","caretCoordinates","scrollToRevealElement","activeElement","nodeType","endOfFurthestEl","focusOverlap","isInSticky","overlap","getOverlap","adjustForOverlap","destroy","scrollAreas","getAreaForEl","loopIdx","getAreaByEl","area","scrollArea","syncEls","elsInDOM","unusedAreas","areaIdx","used","getUsed","idx","splice","filterBy","filterFunc","stuckEls","isStuck","edgeOfEl","reduce","accumulator","scrollTop","scrollTo","pageXOffset","oppositeEdge","classes","mark","sticky","edgeClass","dialog","getElementAtOppositeEnd","unmark","StickyElement","initialFixedClass","fixedClass","appliedClass","stopped","hasLoaded","canBeStuck","$shim","marginTop","marginBottom","verticalMargins","getShimCSS","inlineStyles","horizontalSpace","bottomtop","stickyClass","removeStickyClasses","stick","release","addShim","insertPosition","innerHTML","removeShim","updateShim","stop","unstop","isStopped","isInPage","Dialog","static","hasResized","getPaddingBetweenEls","spaceBetweenStickys","getTotalHeight","currentValue","elsThatCanBeStuck","getOffsetFromEdge","slice","reverse","elIdx","getOffsetFromEnd","fitToHeight","self","StickAtEdge","getWindowDimensions","dialogFitsHeight","currentEl","getElementAtStickyEdge","getInPageEdgePosition","inPageEdgePosition","getHeight","adjustForResize","windowHeight","releaseEl","hasScrolled","scrollTimeout","windowHasResized","resizeTimeout","initialPositionsSet","CSS_SELECTOR","STOP_PADDING","setMode","mode","setElementPositions","windowDimensions","windowTop","getWindowPositions","windowPositions","setElementPosition","viewportIsWideEnough","width","windowNotPastScrolledFrom","getScrolledFrom","windowNotPastScrollingTo","getScrollingTo","setElementDimensions","callback","setElWidth","setElHeight","recalculate","syncWithDOM","get","scrollAreaNode","$img","onload","image","Image","src","attr","allElementsLoaded","totalEls","getElForNode","setPositions","cb","elObj","exists","_el","$els","numOfEls","onLoaded","endOfScrollArea","getEndOfScrollArea","init","_scrollEvent","onScroll","_resizeEvent","onResize","setInterval","checkScroll","checkResize","clearEvents","clearInterval","windowWidth","pageYOffset","stickAtTop","footer","getStoppingPosition","scrolledFrom","scrollingTo","stickAtBottom","header","CopyToClipboard","clipboard","states","valueVisible","valueLabel","thing","notice","content","button","valueCopied","stateOptions","updateHTML","buttonWasClicked","copyValueToClipboard","getRangeFromElement","stickAtBottomWhenScrolling","stateKey","state","insertAdjacentHTML","$clipboardNoticeEl","updateButton","generateButton","$newButton","text","writeText","err","copyableElement","range","createRange","childNodes","prefixIndex","selectNodeContents","setStart","_ListEntry","idPattern","elementSelector","sharedInputClasses","$wrapper","minEntries","listItemName","getCustomClasses","getSharedAttributes","getValuesAndErrors","maxEntries","trimEntries","render","bindEvents","entryTemplate","dataObj","number","customClasses","sharedAttributes","addButtonTemplate","entriesLeft","attrIdx","elmAttributes","getAttributesHTML","attributeTemplate","protectedAttributes","attrsByElm","elmAttrs","attrStr","elmIdx","existingAttributes","elm","$elm","customClassesForElm","token","errors","$error","entryIdx","newEntries","getId","num","pattern","removeEntry","addEntry","shiftFocus","opts","numberTargeted","action","entryNumberFocused","removeEntryFromEntriesAndErrors","entryNumber","$removeButton","currentLastEntryNumber","_lists","ListEntry","RadiosWithImages","handleImageClick","image_input","cursor","disabled","LiveSearch","$searchBox","$searchLabel","$liveRegion","$targets","targets","query","normalize","results","$node","contents","isMatch","content_item","resultsSummary","string","EnhancedTextbox","tagPattern","highlightPlaceholders","autofocus","autofocusTextbox","$textbox","$wrappingElement","$backgroundHighlightElement","after","update","resize","$visibleTextbox","cloneNode","display","initialHeight","borderWidth","dispatchEvent","Event","bubbles","Math","max","contentReplaced","fragment","createDocumentFragment","lastIndex","matchAll","fullMatch","separator","className","CheckReportStatus","fetchInterval","redirectDelay","reportStatusEndpoint","reportReadyStatus","reportFailedStatus","currentCheck","runCheck","checkStatus","response","fetch","ok","data","json","processStatus","status","updatePageText","pathName","statusUpdateText","LiveCheckboxControls","$liveRegionCounter","singular","thingSingular","plural","thingPlural","nothingSelectedHint","itemsSelectedHint","cancellable","onNothingSelected","onSomethingSelected","_lastState","prevState","showInitialState","currentState","evt","onCheckboxChanged","$clear","makeActionButton","onclick","nonvisualText","selectionStatus","default","selected","numSelected","$btn","keyCode","hasOwnProperty","stateHasChanged","changed","countSelectedCheckboxes","AddBrandingOptionsControls","RadioSelect","confirmMadeSticky","keyCache","ENTER_CODE","timesByDay","days","day","dayValue","getKeyFromDayLabel","label","componentName","componentLabelText","labelText","relatedRadio","timeData","selectedTime","getTimeFromRadio","selectedDay","initialHTML","buildInitialHTML","times","formSubmitButton","params","$sendNowInputLabel","$radioSelectContainer","$sendNowInput","readOnly","$hiddenInput","$expanderContainer","$expanderBtn","$expandeeContainer","$daysContainer","$daysFieldset","$daysLegend","$dayBtn","$dayTimesContainer","$backLink","$dayTimesFieldset","$dayTimesLegend","$timesHint","time","$radioItemContainer","$radioInput","$radioTimeLabel","$confirmContainer","$confirmTimeBtn","handleTimeSelection","onEnterKeyUpAndDown","toggleExpandingSection","handleDayClick","handleReturnToDays","selectDayAndTime","dayButton","showTimesForDay","showTimesView","focusSelectedTimeOrFirst","showDaysView","radio","viewPanes","timesGroup","selectedRadio","updateSelection","expander","expandee","toggleFormSubmit","cancelFiredEvent","isExpanded","targetIsSelectedDayAndTimeField","which","FullscreenTable","$table","nativeHeight","topOffset","maintainHeight","maintainWidth","toggleShadows","insertShims","$scrollableTable","toggleFocusStyle","caption","captionId","$scrollableWrapper","insertBefore","$fixedWrapper","$rightShadow","nextSibling","$fixedTable","min","$scrollableIndexColumnHeader","$fixedIndexColumnHeader","isScrolled","scrollLeft","maxScroll","offsetWidth","isScrollable","RemoveInPresenceOf","$elementToRemove","observer","MutationObserver","targetElementId","disconnect","observe","childList","subtree","ErrorBanner","$bannerElement","hideBanner","showBanner","AuthenticateSecurityKey","TextEncoder","PublicKeyCredential","parseRequestOptionsFromJSON","authenticationEndpoint","authenticateKey","handleFetch","credential","getCredential","postCredential","handleCredentialResponse","handleError","statusText","optionsJSON","publicKey","credentials","currentURL","URL","authenticateURL","nextUrl","searchParams","set","method","headers","csrfToken","JSON","stringify","toJSON","redirect_url","assign","RegisterSecurityKey","parseCreationOptionsFromJSON","registerAuthenticationEndpoint","registerKey","createCredential","create","UpdateStatus","throttleOn","callsHaveBeenThrottled","getRenderer","html","throttle","func","limit","apply","ariaDescribedby","url","updatesUrl","formData","URLSearchParams","FormData","doc","HAS_TEMPLATE_SUPPORT","HAS_RANGE_SUPPORT","toElement","str","createFragmentFromTemplate","selectNode","createContextualFragment","createFragmentFromRange","createFragmentFromWrap","compareNodeNames","fromEl","toEl","fromCodeStart","toCodeStart","fromNodeName","toNodeName","charCodeAt","toUpperCase","syncBooleanAttrProp","specialElHandlers","OPTION","parentName","selectedIndex","INPUT","TEXTAREA","newValue","firstChild","oldValue","nodeValue","placeholder","SELECT","optgroup","i","curChild","noop","defaultGetNodeKey","morphdom","morphAttrs","fromNode","toNode","toNodeHtml","getNodeKey","onBeforeNodeAdded","onNodeAdded","onBeforeElUpdated","onElUpdated","onBeforeNodeDiscarded","onNodeDiscarded","onBeforeElChildrenUpdated","childrenOnly","fromNodesLookup","keyedRemovalList","addKeyedRemoval","walkDiscardedChildNodes","skipKeyedNodes","removeNode","handleNodeAdded","unmatchedFromEl","replaceChild","morphEl","toElKey","curToNodeKey","curFromNodeKey","fromNextSibling","toNextSibling","matchingFromEl","curToNodeChild","curFromNodeChild","outer","isSameNode","curFromNodeType","isCompatible","onBeforeNodeAddedResult","actualize","ownerDocument","cleanupFromEl","specialElHandler","morphChildren","indexTree","namespaceURI","morphedNode","morphedNodeType","toNodeType","nextChild","moveChildren","createElementNS","len","elToRemove","morphdomFactory","attrName","attrNamespaceURI","attrValue","toNodeAttrs","localName","getAttributeNS","prefix","setAttributeNS","fromNodeAttrs","d","hasAttributeNS","removeAttributeNS","resourceState","getState","resource","renderers","Set","interval","fetching","async","pollResource","visibilityState","startTime","Date","now","fetchOptions","formEl","responseData","renderer","UpdateContent","calculateBackoff","$contents","firstElementChild","size","responseTime","floor","sqrt","contentHasUpdated","newContents","DOMParser","parseFromString","isEqualNode","CustomEvent","detail","UpdateRelativeTime","Intl","RelativeTimeFormat","numeric","DateTimeFormat","dateStyle","timeStyle","updateExistingElements","updateTextString","currentTime","elementDatetimeStamp","elementTime","fullDateFormatter","format","relativeTimeString","calculateRelativeTimeString","diffInSeconds","round","absSeconds","abs","relativeFormatter","diffInMinutes","diffInHours","diffInDays","monthDiff","getFullYear","getMonth","yearDiff","TemplateFolderForm","setupSelectionStatus","setupDOM","setupStates","setupStateModifiers","setupInitialState","$nothingSelectedButtons","createNothingSelectedButtons","$itemsSelectedButtons","createItemsSelectedButtons","description","addClearButton","addDescriptionsToStates","activateStickyElements","selectActionButtons","actionButtonClicked","templateFolderCheckboxChanged","nouns","templates","folders","getString","$description","oldClass","$cancel","makeButton","input","cancelSelector","handleOnClick","targetSelector","stateChanged","hasCheckboxes","allSelected","acc","parent","currentStateObj","formHasError","$container","$stickyContainer","$newTemplateBtn","$newFolderBtn","$counterDiv","countSpan","$moveBtn","$srMessageContainer","$addFolderBtn","$countElement","stickAtTopWhenScrolling","$livesearch","$collapsibleCheckboxes","$colourPreview","$fileUpload","$autoFocus","$homePage","$previewPane","$CopyToClipboardArray","$ListEntryArray","$radiosWithImagesArray","$enhancedTextboxArray","$checkReportStatusEl","$authTypeForm","$addBrandingOptionsForm","$radioSelectElementsArray","$fullScreenTableArray","tableComponent","$authenticateSecurityKey","$registerSecurityKey","$updateStatus","$updateContentBlocks","updateBlockComponent","$bannerEl","focusBanner","$templateFolderForm","GOVUK"],"mappings":"AAAA,SAASA,EAAcC,GACrB,MAAMC,EAAW,sBAAsBD,IAEvC,MAAO,CACLC,WACAC,MAHYC,OAAOC,iBAAiBC,SAASC,iBAAiBC,iBAAiBN,SAG/DO,EAEpB,CACA,SAASC,EAASC,EAAUC,EAAU,I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