representing the content\n // it means the required HTML structure is not met so the script will stop\n if (!$summary || !$content) {\n return\n }\n\n // If the content doesn't have an ID, assign it one now\n // which we'll need for the summary's aria-controls assignment\n if (!$content.id) {\n $content.id = 'details-content-' + generateUniqueID()\n }\n\n // Add ARIA role=\"group\" to details\n $module.setAttribute('role', 'group')\n\n // Add role=button to summary\n $summary.setAttribute('role', 'button')\n\n // Add aria-controls\n $summary.setAttribute('aria-controls', $content.id)\n\n // Set tabIndex so the summary is keyboard accessible for non-native elements\n //\n // We have to use the camelcase `tabIndex` property as there is a bug in IE6/IE7 when we set the correct attribute lowercase:\n // See http://web.archive.org/web/20170120194036/http://www.saliences.com/browserBugs/tabIndex.html for more information.\n $summary.tabIndex = 0\n\n // Detect initial open state\n if (this.$module.hasAttribute('open')) {\n $summary.setAttribute('aria-expanded', 'true')\n } else {\n $summary.setAttribute('aria-expanded', 'false')\n $content.style.display = 'none'\n }\n\n // Bind an event to handle summary elements\n this.polyfillHandleInputs(this.polyfillSetAttributes.bind(this))\n}\n\n/**\n * Define a statechange function that updates aria-expanded and style.display\n *\n * @deprecated Will be made private in v5.0\n * @returns {boolean} Returns true\n */\nDetails.prototype.polyfillSetAttributes = function () {\n if (this.$module.hasAttribute('open')) {\n this.$module.removeAttribute('open')\n this.$summary.setAttribute('aria-expanded', 'false')\n this.$content.style.display = 'none'\n } else {\n this.$module.setAttribute('open', 'open')\n this.$summary.setAttribute('aria-expanded', 'true')\n this.$content.style.display = ''\n }\n\n return true\n}\n\n/**\n * Handle cross-modal click events\n *\n * @deprecated Will be made private in v5.0\n * @param {polyfillHandleInputsCallback} callback - function\n */\nDetails.prototype.polyfillHandleInputs = function (callback) {\n this.$summary.addEventListener('keypress', function (event) {\n var $target = event.target\n // When the key gets pressed - check if it is enter or space\n if (event.keyCode === KEY_ENTER || event.keyCode === KEY_SPACE) {\n if ($target instanceof HTMLElement && $target.nodeName.toLowerCase() === 'summary') {\n // Prevent space from scrolling the page\n // and enter from submitting a form\n event.preventDefault()\n // Click to let the click event do all the necessary action\n if ($target.click) {\n $target.click()\n } else {\n // except Safari 5.1 and under don't support .click() here\n callback(event)\n }\n }\n }\n })\n\n // Prevent keyup to prevent clicking twice in Firefox when using space key\n this.$summary.addEventListener('keyup', function (event) {\n var $target = event.target\n if (event.keyCode === KEY_SPACE) {\n if ($target instanceof HTMLElement && $target.nodeName.toLowerCase() === 'summary') {\n event.preventDefault()\n }\n }\n })\n\n this.$summary.addEventListener('click', callback)\n}\n\nexport default Details\n\n/**\n * @callback polyfillHandleInputsCallback\n * @param {UIEvent} event - Keyboard or mouse event\n * @returns {void}\n */\n"],"names":[],"mappings":";;;;AAAA;AACA,AAUA;AACA,IAAI,SAAS,GAAG,GAAE;AAClB,IAAI,SAAS,GAAG,GAAE;;;;;;;;AAQlB,SAAS,OAAO,EAAE,OAAO,EAAE;EACzB,IAAI,EAAE,OAAO,YAAY,WAAW,CAAC,EAAE;IACrC,OAAO,IAAI;GACZ;;;EAGD,IAAI,CAAC,OAAO,GAAG,QAAO;;;EAGtB,IAAI,CAAC,QAAQ,GAAG,KAAI;;;EAGpB,IAAI,CAAC,QAAQ,GAAG,KAAI;CACrB;;;;;AAKD,OAAO,CAAC,SAAS,CAAC,IAAI,GAAG,YAAY;;EAEnC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;IACjB,MAAM;GACP;;;EAGD,IAAI,gBAAgB,GAAG,oBAAoB,IAAI,MAAM;IACnD,IAAI,CAAC,OAAO,YAAY,mBAAkB;;EAE5C,IAAI,CAAC,gBAAgB,EAAE;IACrB,IAAI,CAAC,eAAe,GAAE;GACvB;EACF;;;;;;;AAOD,OAAO,CAAC,SAAS,CAAC,eAAe,GAAG,YAAY;EAC9C,IAAI,OAAO,GAAG,IAAI,CAAC,QAAO;;;EAG1B,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,EAAC;EAC9E,IAAI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ist/govuk-esm/components/error-summary/error-summary.mjs
deleted file mode 100644
index bb00e8d768..0000000000
--- a/packages/govuk-frontend/dist/govuk-esm/components/error-summary/error-summary.mjs
+++ /dev/null
@@ -1,233 +0,0 @@
-import { mergeConfigs } from '../../common/index.mjs';
-import { normaliseDataset } from '../../common/normalise-dataset.mjs';
-import '../../vendor/polyfills/Element/prototype/closest.mjs';
-import '../../vendor/polyfills/Event.mjs';
-import '../../vendor/polyfills/Function/prototype/bind.mjs';
-
-/* eslint-disable es-x/no-function-prototype-bind -- Polyfill imported */
-
-/**
- * JavaScript enhancements for the ErrorSummary
- *
- * Takes focus on initialisation for accessible announcement, unless disabled in configuration.
- *
- * @class
- * @param {Element} $module - HTML element to use for error summary
- * @param {ErrorSummaryConfig} [config] - Error summary config
- */
-function ErrorSummary ($module, config) {
- // Some consuming code may not be passing a module,
- // for example if they initialise the component
- // on their own by directly passing the result
- // of `document.querySelector`.
- // To avoid breaking further JavaScript initialisation
- // we need to safeguard against this so things keep
- // working the same now we read the elements data attributes
- if (!($module instanceof HTMLElement)) {
- // Little safety in case code gets ported as-is
- // into and ES6 class constructor, where the return value matters
- return this
- }
-
- /** @deprecated Will be made private in v5.0 */
- this.$module = $module;
-
- var defaultConfig = {
- disableAutoFocus: false
- };
-
- /**
- * @deprecated Will be made private in v5.0
- * @type {ErrorSummaryConfig}
- */
- this.config = mergeConfigs(
- defaultConfig,
- config || {},
- normaliseDataset($module.dataset)
- );
-}
-
-/**
- * Initialise component
- */
-ErrorSummary.prototype.init = function () {
- // Check that required elements are present
- if (!this.$module) {
- return
- }
-
- var $module = this.$module;
-
- this.setFocus();
- $module.addEventListener('click', this.handleClick.bind(this));
-};
-
-/**
- * Focus the error summary
- *
- * @deprecated Will be made private in v5.0
- */
-ErrorSummary.prototype.setFocus = function () {
- var $module = this.$module;
-
- if (this.config.disableAutoFocus) {
- return
- }
-
- // Set tabindex to -1 to make the element programmatically focusable, but
- // remove it on blur as the error summary doesn't need to be focused again.
- $module.setAttribute('tabindex', '-1');
-
- $module.addEventListener('blur', function () {
- $module.removeAttribute('tabindex');
- });
-
- $module.focus();
-};
-
-/**
- * Click event handler
- *
- * @deprecated Will be made private in v5.0
- * @param {MouseEvent} event - Click event
- */
-ErrorSummary.prototype.handleClick = function (event) {
- var $target = event.target;
- if (this.focusTarget($target)) {
- event.preventDefault();
- }
-};
-
-/**
- * Focus the target element
- *
- * By default, the browser will scroll the target into view. Because our labels
- * or legends appear above the input, this means the user will be presented with
- * an input without any context, as the label or legend will be off the top of
- * the screen.
- *
- * Manually handling the click event, scrolling the question into view and then
- * focussing the element solves this.
- *
- * This also results in the label and/or legend being announced correctly in
- * NVDA (as tested in 2018.3.2) - without this only the field type is announced
- * (e.g. "Edit, has autocomplete").
- *
- * @deprecated Will be made private in v5.0
- * @param {EventTarget} $target - Event target
- * @returns {boolean} True if the target was able to be focussed
- */
-ErrorSummary.prototype.focusTarget = function ($target) {
- // If the element that was clicked was not a link, return early
- if (!($target instanceof HTMLAnchorElement)) {
- return false
- }
-
- var inputId = this.getFragmentFromUrl($target.href);
- if (!inputId) {
- return false
- }
-
- var $input = document.getElementById(inputId);
- if (!$input) {
- return false
- }
-
- var $legendOrLabel = this.getAssociatedLegendOrLabel($input);
- if (!$legendOrLabel) {
- return false
- }
-
- // Scroll the legend or label into view *before* calling focus on the input to
- // avoid extra scrolling in browsers that don't support `preventScroll` (which
- // at time of writing is most of them...)
- $legendOrLabel.scrollIntoView();
- $input.focus({ preventScroll: true });
-
- return true
-};
-
-/**
- * Get fragment from URL
- *
- * Extract the fragment (everything after the hash) from a URL, but not including
- * the hash.
- *
- * @deprecated Will be made private in v5.0
- * @param {string} url - URL
- * @returns {string | undefined} Fragment from URL, without the hash
- */
-ErrorSummary.prototype.getFragmentFromUrl = function (url) {
- if (url.indexOf('#') === -1) {
- return undefined
- }
-
- return url.split('#').pop()
-};
-
-/**
- * Get associated legend or label
- *
- * Returns the first element that exists from this list:
- *
- * - The `