UNPKG

digitalmarketplace-frontend

Version:

Digital Marketplace Frontend contains assets and components used in Digital Marketplace projects

2 lines 118 kB
const version="4.3.4",loadGoogleTagManager=()=>((e,i,o,w,x)=>{e[w]=e[w]||[],e[w].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});const $=i.getElementsByTagName(o)[0],O=i.createElement(o);O.async=!0,O.src="https://www.googletagmanager.com/gtm.js?id="+x,$.parentNode.insertBefore(O,$)})(window,document,"script","dataLayer","GTM-WCGFX3GW");function assign(e){for(var i=1;i<arguments.length;i++){var o=arguments[i];for(var w in o)"__proto__"!==w&&(e[w]=o[w])}return e}var e,i=function init(e,i){function set(o,w,x){if("undefined"!=typeof document){"number"==typeof(x=assign({},i,x)).expires&&(x.expires=new Date(Date.now()+864e5*x.expires)),x.expires&&(x.expires=x.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var $="";for(var O in x)x[O]&&($+="; "+O,!0!==x[O]&&($+="="+x[O].split(";")[0]));return document.cookie=o+"="+e.write(w,o)+$}}return Object.create({set:set,get:function(i){if("undefined"!=typeof document&&(!arguments.length||i)){for(var o=document.cookie?document.cookie.split("; "):[],w={},x=0;x<o.length;x++){var $=o[x].split("="),O=$.slice(1).join("=");try{var A=decodeURIComponent($[0]);if(A in w||(w[A]=e.read(O,A)),i===A)break}catch(B){}}return i?w[i]:w}},remove:function(e,i){set(e,"",assign({},i,{expires:-1}))},withAttributes:function(e){return init(this.converter,assign({},this.attributes,e))},withConverter:function(e){return init(assign({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(e)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});!function(e){e.GRANTED="granted",e.NOT_GRANTED="not granted"}(e||(e={}));const getGrantedText=i=>i?e.GRANTED:e.NOT_GRANTED,o=[{cookieName:"usage",cookiePrefixes:["_ga","_gi"]},{cookieName:"glassbox",cookiePrefixes:["_cls"]}],w=[".marketplace.team",".digitalmarketplace.service.gov.uk","www.applytosupply.digitalmarketplace.service.gov.uk"],getCookiePreferences=()=>JSON.parse(i.get("cookie_preferences_dmp")??'{"usage":false,"glassbox":false}'),setCookiePreferences=o=>{const w=getCookiePreferences();w.usage=o,w.settings_viewed=!0,i.set("cookie_preferences_dmp",JSON.stringify(w),{expires:365}),(i=>{window.dataLayer.push({event:"gtm_consent_update",usage_consent:getGrantedText(i.usage),glassbox_consent:getGrantedText(i.glassbox),marketing_consent:e.NOT_GRANTED})})(w),removeUnwantedCookies()},removeUnwantedCookies=()=>{const e=Object.keys(i.get()),x=["digitalmarketplace_cookie_settings_viewed","digitalmarketplace_google_analytics_enabled","digitalmarketplace_cookie_options_v1","dm_cookies_policy"],$=getCookiePreferences(),O=[];o.forEach((e=>{$[e.cookieName]||O.push(...e.cookiePrefixes)}));for(let i=0;i<e.length;i++){const o=e[i];O.some((e=>o.startsWith(e)))&&x.push(o)}("localhost"===window.location.hostname?w.concat(["localhost"]):w).forEach((e=>{x.forEach((o=>{i.remove(o,{path:"/",domain:e})}))}))},initGoogleAnalytics=()=>{loadGoogleTagManager(),removeUnwantedCookies()};function _arrayLikeToArray(e,i){(null==i||i>e.length)&&(i=e.length);for(var o=0,w=Array(i);o<i;o++)w[o]=e[o];return w}function _createClass(e,i,o){return i&&function(e,i){for(var o=0;o<i.length;o++){var w=i[o];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(e,_toPropertyKey(w.key),w)}}(e.prototype,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function _createForOfIteratorHelperLoose(e,i){var o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(o)return(o=o.call(e)).next.bind(o);if(Array.isArray(e)||(o=function(e,i){if(e){if("string"==typeof e)return _arrayLikeToArray(e,i);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(e,i):void 0}}(e))||i){o&&(e=o);var w=0;return function(){return w>=e.length?{done:!0}:{done:!1,value:e[w++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function _inheritsLoose(e,i){e.prototype=Object.create(i.prototype),e.prototype.constructor=e,_setPrototypeOf(e,i)}function _isNativeReflectConstruct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_isNativeReflectConstruct=function(){return!!e})()}function _setPrototypeOf(e,i){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,i){return e.__proto__=i,e},_setPrototypeOf(e,i)}function _toPropertyKey(e){var i=function(e,i){if("object"!=typeof e||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var w=o.call(e,i);if("object"!=typeof w)return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof i?i:i+""}function _wrapNativeSuper(e){var i="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(i){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(e))return i.get(e);i.set(e,Wrapper)}function Wrapper(){return function(e,i,o){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var w=[null];w.push.apply(w,i);var x=new(e.bind.apply(e,w));return o&&_setPrototypeOf(x,o.prototype),x}(e,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(e.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,e)},_wrapNativeSuper(e)}function isObject(e){return!!e&&"object"==typeof e&&!function(e){return Array.isArray(e)}(e)}function formatErrorMessage(e,i){return e.moduleName+": "+i}var x=function(e){function GOVUKFrontendError(){for(var i,o=arguments.length,w=new Array(o),x=0;x<o;x++)w[x]=arguments[x];return(i=e.call.apply(e,[this].concat(w))||this).name="GOVUKFrontendError",i}return _inheritsLoose(GOVUKFrontendError,e),GOVUKFrontendError}(_wrapNativeSuper(Error)),O=function(e){function SupportError(i){var o;void 0===i&&(i=document.body);var w="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";return(o=e.call(this,i?w:'GOV.UK Frontend initialised without `<script type="module">`')||this).name="SupportError",o}return _inheritsLoose(SupportError,e),SupportError}(x),A=function(e){function ConfigError(){for(var i,o=arguments.length,w=new Array(o),x=0;x<o;x++)w[x]=arguments[x];return(i=e.call.apply(e,[this].concat(w))||this).name="ConfigError",i}return _inheritsLoose(ConfigError,e),ConfigError}(x),B=function(e){function ElementError(i){var o,w="string"==typeof i?i:"";if(isObject(i)){var x=i.component,$=i.identifier,O=i.element,A=i.expectedType;w=$,w+=O?" is not of type "+(null!=A?A:"HTMLElement"):" not found",x&&(w=formatErrorMessage(x,w))}return(o=e.call(this,w)||this).name="ElementError",o}return _inheritsLoose(ElementError,e),ElementError}(x),Q=function(e){function InitError(i){var o,w="string"==typeof i?i:formatErrorMessage(i,"Root element (`$root`) already initialised");return(o=e.call(this,w)||this).name="InitError",o}return _inheritsLoose(InitError,e),InitError}(x),W=function(){function Component(e){this._$root=void 0;var i=this.constructor;if("string"!=typeof i.moduleName)throw new Q("`moduleName` not defined in component");if(!(e instanceof i.elementType))throw new B({element:e,component:i,identifier:"Root element (`$root`)",expectedType:i.elementType.name});this._$root=e,i.checkSupport(),this.checkInitialised();var o=i.moduleName;this.$root.setAttribute("data-"+o+"-init","")}return Component.prototype.checkInitialised=function(){var e=this.constructor,i=e.moduleName;if(i&&function(e,i){return e instanceof HTMLElement&&e.hasAttribute("data-"+i+"-init")}(this.$root,i))throw new Q(e)},Component.checkSupport=function(){if(void 0===e&&(e=document.body),!e||!e.classList.contains("govuk-frontend-supported"))throw new O;var e},_createClass(Component,[{key:"$root",get:function(){return this._$root}}])}();W.elementType=HTMLElement;var K=Symbol.for("configOverride"),Y=function(e){function ConfigurableComponent(i,o){var w;(w=e.call(this,i)||this)._config=void 0;var x=w.constructor;if(!isObject(x.defaults))throw new A(formatErrorMessage(x,"Config passed as parameter into constructor but no defaults defined"));var $=function(e,i){if(!isObject(e.schema))throw new A(formatErrorMessage(e,"Config passed as parameter into constructor but no schema defined"));for(var o={},w=Object.entries(e.schema.properties),x=0,$=w;x<$.length;x++){var O=$[x],B=O[0],Q=O[1],W=B.toString();W in i&&(o[W]=normaliseString(i[W],Q)),"object"===(null==Q?void 0:Q.type)&&(o[W]=extractConfigByNamespace(e.schema,i,B))}return o}(x,w._$root.dataset);return w._config=mergeConfigs(x.defaults,null!=o?o:{},w[K]($),$),w}return _inheritsLoose(ConfigurableComponent,e),ConfigurableComponent.prototype[K]=function(e){return{}},_createClass(ConfigurableComponent,[{key:"config",get:function(){return this._config}}])}(W);function normaliseString(e,i){var o,w=e?e.trim():"",x=null==i?void 0:i.type;switch(x||(["true","false"].includes(w)&&(x="boolean"),w.length>0&&isFinite(Number(w))&&(x="number")),x){case"boolean":o="true"===w;break;case"number":o=Number(w);break;default:o=e}return o}function mergeConfigs(){for(var e={},i=arguments.length,o=new Array(i),w=0;w<i;w++)o[w]=arguments[w];for(var x=0,$=o;x<$.length;x++)for(var O=$[x],A=0,B=Object.keys(O);A<B.length;A++){var Q=B[A],W=e[Q],K=O[Q];isObject(W)&&isObject(K)?e[Q]=mergeConfigs(W,K):e[Q]=K}return e}function extractConfigByNamespace(e,i,o){var w,x=e.properties[o];if("object"===(null==x?void 0:x.type)){for(var $=((w={})[o]={},w),O=0,A=Object.entries(i);O<A.length;O++)for(var B,Q=A[O],W=Q[0],K=Q[1],Y=$,Z=W.split("."),X=_createForOfIteratorHelperLoose(Z.entries());!(B=X()).done;){var J=B.value,tt=J[0],et=J[1];isObject(Y)&&(tt<Z.length-1?(isObject(Y[et])||(Y[et]={}),Y=Y[et]):W!==o&&(Y[et]=normaliseString(K)))}return $[o]}}var Z=function(){function I18n(e,i){var o;void 0===e&&(e={}),void 0===i&&(i={}),this.translations=void 0,this.locale=void 0,this.translations=e,this.locale=null!=(o=i.locale)?o:document.documentElement.lang||"en"}var e=I18n.prototype;return e.t=function(e,i){if(!e)throw new Error("i18n: lookup key missing");var o=this.translations[e];if("number"==typeof(null==i?void 0:i.count)&&isObject(o)){var w=o[this.getPluralSuffix(e,i.count)];w&&(o=w)}if("string"==typeof o){if(o.match(/%{(.\S+)}/)){if(!i)throw new Error("i18n: cannot replace placeholders in string if no option data provided");return this.replacePlaceholders(o,i)}return o}return e},e.replacePlaceholders=function(e,i){var o=Intl.NumberFormat.supportedLocalesOf(this.locale).length?new Intl.NumberFormat(this.locale):void 0;return e.replace(/%{(.\S+)}/g,(function(e,w){if(Object.prototype.hasOwnProperty.call(i,w)){var x=i[w];return!1===x||"number"!=typeof x&&"string"!=typeof x?"":"number"==typeof x?o?o.format(x):""+x:x}throw new Error("i18n: no data found to replace "+e+" placeholder in string")}))},e.hasIntlPluralRulesSupport=function(){return Boolean("PluralRules"in window.Intl&&Intl.PluralRules.supportedLocalesOf(this.locale).length)},e.getPluralSuffix=function(e,i){if(i=Number(i),!isFinite(i))return"other";var o=this.translations[e],w=this.hasIntlPluralRulesSupport()?new Intl.PluralRules(this.locale).select(i):"other";if(isObject(o)){if(w in o)return w;if("other"in o)return console.warn('i18n: Missing plural form ".'+w+'" for "'+this.locale+'" locale. Falling back to ".other".'),"other"}throw new Error('i18n: Plural form ".other" is required for "'+this.locale+'" locale')},I18n}();var X,J=function(e){function FileUpload(i,o){var w;void 0===o&&(o={}),(w=e.call(this,i,o)||this).$input=void 0,w.$button=void 0,w.$status=void 0,w.i18n=void 0,w.id=void 0,w.$announcements=void 0,w.enteredAnotherElement=void 0;var x,$,O,A=w.$root.querySelector("input");if(null===A)throw new B({component:FileUpload,identifier:'File inputs (`<input type="file">`)'});if("file"!==A.type)throw new B(formatErrorMessage(FileUpload,'File input (`<input type="file">`) attribute (`type`) is not `file`'));if(w.$input=A,!w.$input.id)throw new B({component:FileUpload,identifier:'File input (`<input type="file">`) attribute (`id`)'});w.id=w.$input.id,w.i18n=new Z(w.config.i18n,{locale:(x=w.$root,$="lang",O=x.closest("["+$+"]"),O?O.getAttribute($):null)});var Q=w.findLabel();Q.id||(Q.id=w.id+"-label"),w.$input.id=w.id+"-input",w.$input.setAttribute("hidden","true");var W=document.createElement("button");W.classList.add("govuk-file-upload-button"),W.type="button",W.id=w.id,W.classList.add("govuk-file-upload-button--empty");var K=w.$input.getAttribute("aria-describedby");K&&W.setAttribute("aria-describedby",K);var Y=document.createElement("span");Y.className="govuk-body govuk-file-upload-button__status",Y.setAttribute("aria-live","polite"),Y.innerText=w.i18n.t("noFileChosen"),W.appendChild(Y);var X=document.createElement("span");X.className="govuk-visually-hidden",X.innerText=", ",X.id=w.id+"-comma",W.appendChild(X);var J=document.createElement("span");J.className="govuk-file-upload-button__pseudo-button-container";var tt=document.createElement("span");tt.className="govuk-button govuk-button--secondary govuk-file-upload-button__pseudo-button",tt.innerText=w.i18n.t("chooseFilesButton"),J.appendChild(tt),J.insertAdjacentText("beforeend"," ");var et=document.createElement("span");return et.className="govuk-body govuk-file-upload-button__instruction",et.innerText=w.i18n.t("dropInstruction"),J.appendChild(et),W.appendChild(J),W.setAttribute("aria-labelledby",Q.id+" "+X.id+" "+W.id),W.addEventListener("click",w.onClick.bind(w)),W.addEventListener("dragover",(function(e){e.preventDefault()})),w.$root.insertAdjacentElement("afterbegin",W),w.$input.setAttribute("tabindex","-1"),w.$input.setAttribute("aria-hidden","true"),w.$button=W,w.$status=Y,w.$input.addEventListener("change",w.onChange.bind(w)),w.updateDisabledState(),w.observeDisabledState(),w.$announcements=document.createElement("span"),w.$announcements.classList.add("govuk-file-upload-announcements"),w.$announcements.classList.add("govuk-visually-hidden"),w.$announcements.setAttribute("aria-live","assertive"),w.$root.insertAdjacentElement("afterend",w.$announcements),w.$button.addEventListener("drop",w.onDrop.bind(w)),document.addEventListener("dragenter",w.updateDropzoneVisibility.bind(w)),document.addEventListener("dragenter",(function(){w.enteredAnotherElement=!0})),document.addEventListener("dragleave",(function(){w.enteredAnotherElement||w.$button.disabled||(w.hideDraggingState(),w.$announcements.innerText=w.i18n.t("leftDropZone")),w.enteredAnotherElement=!1})),w}_inheritsLoose(FileUpload,e);var i=FileUpload.prototype;return i.updateDropzoneVisibility=function(e){this.$button.disabled||e.target instanceof Node&&(this.$root.contains(e.target)?e.dataTransfer&&this.canDrop(e.dataTransfer)&&(this.$button.classList.contains("govuk-file-upload-button--dragging")||(this.showDraggingState(),this.$announcements.innerText=this.i18n.t("enteredDropZone"))):this.$button.classList.contains("govuk-file-upload-button--dragging")&&(this.hideDraggingState(),this.$announcements.innerText=this.i18n.t("leftDropZone")))},i.showDraggingState=function(){this.$button.classList.add("govuk-file-upload-button--dragging")},i.hideDraggingState=function(){this.$button.classList.remove("govuk-file-upload-button--dragging")},i.onDrop=function(e){e.preventDefault(),e.dataTransfer&&this.canFillInput(e.dataTransfer)&&(this.$input.files=e.dataTransfer.files,this.$input.dispatchEvent(new CustomEvent("change")),this.hideDraggingState())},i.canFillInput=function(e){return this.matchesInputCapacity(e.files.length)},i.canDrop=function(e){return e.items.length?this.matchesInputCapacity(function(e){for(var i=0,o=0;o<e.length;o++)"file"===e[o].kind&&i++;return i}(e.items)):!e.types.length||e.types.includes("Files")},i.matchesInputCapacity=function(e){return this.$input.multiple?e>0:1===e},i.onChange=function(){var e=this.$input.files.length;0===e?(this.$status.innerText=this.i18n.t("noFileChosen"),this.$button.classList.add("govuk-file-upload-button--empty")):(this.$status.innerText=1===e?this.$input.files[0].name:this.i18n.t("multipleFilesChosen",{count:e}),this.$button.classList.remove("govuk-file-upload-button--empty"))},i.findLabel=function(){var e=document.querySelector('label[for="'+this.$input.id+'"]');if(!e)throw new B({component:FileUpload,identifier:"Field label (`<label for="+this.$input.id+">`)"});return e},i.onClick=function(){this.$input.click()},i.observeDisabledState=function(){var e=this;new MutationObserver((function(i){for(var o,w=_createForOfIteratorHelperLoose(i);!(o=w()).done;){var x=o.value;"attributes"===x.type&&"disabled"===x.attributeName&&e.updateDisabledState()}})).observe(this.$input,{attributes:!0})},i.updateDisabledState=function(){this.$button.disabled=this.$input.disabled,this.$root.classList.toggle("govuk-drop-zone--disabled",this.$button.disabled)},FileUpload}(Y);J.moduleName="govuk-file-upload",J.defaults=Object.freeze({i18n:{chooseFilesButton:"Choose file",dropInstruction:"or drop file",noFileChosen:"No file chosen",multipleFilesChosen:{one:"%{count} file chosen",other:"%{count} files chosen"},enteredDropZone:"Entered drop zone",leftDropZone:"Left drop zone"}}),J.schema=Object.freeze({properties:{i18n:{type:"object"}}});class ComplianceCommunicationAttachmentListRowFileInput{$dropZone;$input;$label;$hint;$button;$comma;$announcements;constructor(e,i){const o=e.find(`.govuk-grid-column-one-half:nth-of-type(${i})`);this.$dropZone=o.find(".govuk-drop-zone"),this.$input=o.find("input"),this.$label=o.find(".govuk-label"),this.$hint=o.find("div.govuk-hint"),this.$button=o.find("button"),this.$comma=o.find("button > span.govuk-visually-hidden"),this.$announcements=o.find("span.govuk-file-upload-announcements")}updateIndex(e){const i=this.$input.attr("name").replace(/\d+/,e.toString()),o=`input-${i}`;this.$button.length?(this.$label.attr("for",o),this.$label.attr("id",`${o}-label`),this.$hint.attr("id",`${o}-hint`),this.$input.attr("id",`${o}-input`),this.$input.attr("name",i),this.$input.attr("aria-describedby",`${o}-hint`),this.$button.attr("id",o),this.$button.attr("aria-describedby",`${o}-hint`),this.$button.attr("aria-labelledby",`${o}-label ${o}-comma ${o}`),this.$comma.attr("id",`${o}-comma`)):(this.$label.attr("for",o),this.$hint.attr("id",`${o}-hint`),this.$input.attr("id",o),this.$input.attr("name",i),this.$input.attr("aria-describedby",`${o}-hint`))}makeInteractable(){if(!this.$button.length)return new J(this.$dropZone.get(0))}resetHtml(){this.$label.removeAttr("id"),this.$dropZone.removeAttr("data-govuk-file-upload-init"),this.$button.remove();const e=this.$input.attr("id");this.$input.removeAttr("hidden"),this.$input.removeAttr("aria-hidden"),this.$input.attr("id",e.substring(0,e.length-6)),this.$announcements.remove()}}class ComplianceCommunicationAttachmentListRequiredInput{$requiredSection;$input;$label;constructor(e){this.$requiredSection=e.find(".dm-compliance-communication__attachments-item-required"),this.$input=this.$requiredSection.find(".govuk-checkboxes__item > input"),this.$label=this.$requiredSection.find(".govuk-checkboxes__item > .govuk-label")}isChecked(){return this.$input.is(":checked")}updateIndex(e){const i=this.$input.attr("name").replace(/\d+/,e.toString()),o=`input-${i}`;this.$label.attr("for",o),this.$input.attr("id",o),this.$input.attr("name",i)}checkRow(){this.$requiredSection.toggleClass("govuk-visually-hidden",!0),this.$input.prop("checked",!0),this.$input.attr("tabindex",-1),this.$input.attr("tabindex",-1)}}class ComplianceCommunicationAttachmentListRowRemoveButton{attachmentListRow;$button;$removeButtonCounter;constructor(e,i){this.attachmentListRow=e,this.$button=i.find(".dm-compliance-communication__attachments-item-remove"),this.$removeButtonCounter=this.$button.find(".dm-compliance-communication__attachments-item-remove-counter")}init(){this.toggleVisibility(!0),this.$button.on("click",(()=>{this.attachmentListRow.removeRow()}))}toggleVisibility(e){this.$button.toggleClass("govuk-visually-hidden",!e),e?this.$button.removeAttr("tabindex"):this.$button.attr("tabindex",-1)}updateIndex(e){this.$removeButtonCounter.text(e+1)}}class ComplianceCommunicationAttachmentListRow{$row;attachmentList;index;$legendCounter;attachmentListRowFileInput;attachmentListRowRequiredInput;attachmentListRowRemoveButton;constructor(e,i,o){this.$row=o,this.attachmentList=e,this.index=i,this.$legendCounter=this.$row.find(".dm-compliance-communication__attachments-item-legend-counter"),this.attachmentListRowFileInput=new ComplianceCommunicationAttachmentListRowFileInput(o,1),this.attachmentListRowRequiredInput=new ComplianceCommunicationAttachmentListRequiredInput(o),this.attachmentListRowRemoveButton=new ComplianceCommunicationAttachmentListRowRemoveButton(this,o)}init(){this.attachmentListRowRemoveButton.init(),this.attachmentListRowFileInput.makeInteractable(),this.attachmentListRowRequiredInput.checkRow()}updateIndex(e){this.index=e,this.attachmentListRowFileInput.updateIndex(e),this.attachmentListRowRequiredInput.updateIndex(e),this.attachmentListRowRemoveButton.updateIndex(e),this.$legendCounter.text(e+1)}removeRow(){this.attachmentList.removeRow(this.index),this.deleteRow()}deleteRow(){this.$row.remove()}toggleRemoveButtonVisibility(e){this.attachmentListRowRemoveButton.toggleVisibility(e)}isRowChecked(){return this.attachmentListRowRequiredInput.isChecked()}}class ComplianceCommunicationAttachmentListAddButton{attachmentList;$button;$buttonCounter;constructor(e,i){this.attachmentList=e,this.$button=i,this.$buttonCounter=i.find(".dm-compliance-communication__attachments__js-remaining-counter")}init(e){this.$button.on("click",(()=>{this.attachmentList.addRow()})),this.updateButtonText(this.attachmentList.maxNumberOfAttachments-e)}updateButtonText(e){this.$buttonCounter.text(e)}toggleVisibility(e){this.$button.toggleClass("govuk-visually-hidden",!e),e?this.$button.removeAttr("tabindex"):this.$button.attr("tabindex",-1)}}class ComplianceCommunicationAttachments{static moduleName="dm-compliance-communication-attachments";$attachmentList;$attachmentListItems;attachmentListRows;attachmentListTemplateRow;attachmentListAddButton;maxNumberOfAttachments;constructor(e){this.$attachmentList=e,this.$attachmentListItems=this.$attachmentList.find(".dm-compliance-communication__attachments-items"),this.attachmentListRows=this.$attachmentListItems.find(".dm-compliance-communication__attachments-item").get().map(((e,i)=>new ComplianceCommunicationAttachmentListRow(this,i,$(e)))),this.attachmentListTemplateRow=new ComplianceCommunicationAttachmentListRow(this,99,this.$attachmentList.find(".dm-compliance-communication__attachments-item-template > .dm-compliance-communication__attachments-item")),this.attachmentListAddButton=new ComplianceCommunicationAttachmentListAddButton(this,this.$attachmentList.find(".dm-compliance-communication__attachments-add")),this.maxNumberOfAttachments=this.$attachmentList.data("maxNumberOfAttachments")}init(){const e=this.attachmentListRows.map((e=>e.isRowChecked()));let i;i=e.every((e=>!e))?0:e.indexOf(!1),i>=0&&(this.attachmentListRows.slice(i).forEach((e=>e.deleteRow())),this.attachmentListRows.splice(i)),this.attachmentListAddButton.init(this.attachmentListRows.length),this.attachmentListRows.forEach((e=>e.init())),this.attachmentListTemplateRow.attachmentListRowFileInput.resetHtml(),this.updateIfMinRows(),this.updateAttachmentButton()}removeRow(e){this.attachmentListRows.splice(e,1),this.attachmentListRows.slice(e).forEach(((i,o)=>{i.updateIndex(e+o)})),this.updateIfMinRows(),this.updateAttachmentButton(),e>0?this.focusOnRow(e):this.attachmentListAddButton.$button.focus()}addRow(){const e=this.attachmentListRows.length;if(e<this.maxNumberOfAttachments){const i=this.attachmentListTemplateRow.$row.clone(),o=new ComplianceCommunicationAttachmentListRow(this,e,i);o.updateIndex(e),this.attachmentListRows.push(o),this.$attachmentListItems.append(i),this.attachmentListRows[e].init(),this.updateIfMinRows(),this.updateAttachmentButton(),this.focusOnRow(e)}}updateIfMinRows(){0!==this.attachmentListRows.length&&this.attachmentListRows[0].toggleRemoveButtonVisibility(!0)}updateAttachmentButton(){this.attachmentListRows.length===this.maxNumberOfAttachments?this.attachmentListAddButton.toggleVisibility(!1):(this.attachmentListAddButton.toggleVisibility(!0),this.attachmentListAddButton.updateButtonText(this.maxNumberOfAttachments-this.attachmentListRows.length))}focusOnRow(e){const i=this.attachmentListRows.length;let o=e;e>=i&&(o=i-1),this.attachmentListRows[o].attachmentListRowFileInput.$button.focus()}}class CookieBanner{static moduleName="dm-cookie-banner";$module;$cookieBannerMainContent;$cookieBannerConfirmationContent;$cookieBannerConfirmationMessage;$hideLink;$acceptCookiesLink;$rejectCookiesLink;constructor(e){this.$module=e,this.$cookieBannerMainContent=this.$module.find(".dm-cookie-banner__button--main"),this.$cookieBannerConfirmationContent=this.$module.find(".dm-cookie-banner--selection-made"),this.$cookieBannerConfirmationMessage=this.$module.find(".dm-cookie-banner__confirmation-message"),this.$hideLink=this.$module.find("button[data-hide-cookie-banner]"),this.$acceptCookiesLink=this.$module.find("button[data-accept-cookies=true]"),this.$rejectCookiesLink=this.$module.find("button[data-accept-cookies=false]")}init(){this.$hideLink.on("click",(e=>{this.hideCookieMessage(e)})),this.$acceptCookiesLink.on("click",(()=>{this.setCookieConsent(!0)})),this.$rejectCookiesLink.on("click",(()=>{this.setCookieConsent(!1)})),this.showCookieMessage()}setCookieConsent(e){setCookiePreferences(e),this.showConfirmationMessage(e),this.$cookieBannerConfirmationContent.trigger("focus")}showCookieMessage(){const e=getCookiePreferences();this.$module&&!e.settings_viewed&&this.$module.css("display","block")}hideCookieMessage(e){this.$module.css("display","none"),e.target&&e.preventDefault()}showConfirmationMessage(e){const i=e?"You’ve accepted analytics cookies.":"You told us not to use analytics cookies.";this.$cookieBannerMainContent.attr("hidden","hidden"),this.$cookieBannerConfirmationMessage.prepend(i),this.$cookieBannerConfirmationContent.removeAttr("hidden")}}class CookieSettings{static moduleName="dm-cookie-settings";$moudle;$radioButtonAnalyticsYes;$radioButtonAnalyticsNo;$confirmationMessage;$previousPageLink;$errorSummary;$formGroup;$warningMessage;$cookieBanner;constructor(e){this.$moudle=e,this.$radioButtonAnalyticsYes=this.$moudle.find("input[name=cookies-analytics][value=On]"),this.$radioButtonAnalyticsNo=this.$moudle.find("input[name=cookies-analytics][value=Off]"),this.$confirmationMessage=$("#dm-cookie-settings-confirmation"),this.$previousPageLink=$(".dm-cookie-settings__prev-page"),this.$errorSummary=$("#dm-cookie-settings-error"),this.$formGroup=this.$moudle.find(".govuk-form-group"),this.$warningMessage=$("#dm-cookie-settings-warning"),this.$cookieBanner=$(".dm-cookie-banner")}init(){this.$moudle.on("submit",(e=>{this.submitSettingsForm(e)})),this.hideCookieBanner(),this.setInitialFormValues()}setInitialFormValues(){const e=getCookiePreferences();if(!e.settings_viewed)return;let i;this.hideWarningMessage(),i=e.usage?this.$radioButtonAnalyticsYes:this.$radioButtonAnalyticsNo,i.prop("checked",!0)}submitSettingsForm(e){let i;e.preventDefault();for(const o of this.$moudle.serializeArray())if("cookies-analytics"===o.name){i="On"===o.value;break}void 0!==i?(setCookiePreferences(i),this.hideWarningMessage(),this.hideError(),this.showConfirmationMessage()):this.showError()}showConfirmationMessage(){const e=CookieSettings.getReferrerLink();document.body.scrollTop=document.documentElement.scrollTop=0,e&&e!==document.location.pathname?(this.$previousPageLink.attr("href",e),this.$previousPageLink.css("display","block")):this.$previousPageLink.css("display","none"),this.$confirmationMessage.css("display","block")}showError(){this.$errorSummary.length&&(this.$errorSummary.css("display","block"),document.body.scrollTop=document.documentElement.scrollTop=0),this.showErrorMessage()}showErrorMessage(){this.$formGroup.addClass("govuk-form-group--error");const e=$(document.createElement("p"));e.attr("id","dm-cookie-settings-error-message"),e.addClass("govuk-error-message"),e.html('<span class="govuk-visually-hidden">Error:</span> Select yes to accept analytics cookies'),e.insertBefore("#cookie-settings-1, .govuk-radios--inline")}hideError(){this.$errorSummary.css("display","none"),this.hideErrorMessage()}hideErrorMessage(){this.$moudle.find("#dm-cookie-settings-error-message").css("display","none"),this.$formGroup.removeClass("govuk-form-group--error")}hideWarningMessage(){this.$warningMessage.css("display","none")}hideCookieBanner(){this.$cookieBanner.css("display","none")}static getReferrerLink(){return!!document.referrer&&new URL(document.referrer).pathname}}class ListInput{static moduleName="dm-list-input";static itemContainerClass="dm-list-input__item-container";static hiddenItemClass="dm-list-input__item--hidden";static visibleItemClass="dm-list-input__item--visible";static itemInputClass="dm-list-input__item-input";static itemErrorClass="dm-list-input__item--error";static itemErrorMsgClass="dm-list-input-error-message";static itemCounterClass="dm-list-input__counter";static inputErrorClass="govuk-input--error";static removeButtonClass="dm-list-input__item-remove";static hiddenRemoveButtonClass="dm-list-input__item-remove--hidden";static formGroupErrorClass="govuk-form-group--error";static hiddenAddButtonClass="dm-list-input__item-add--hidden";static addButtonRemainingClass="dm-list-input__js-remaining-counter";$module;$allVisibleItems;$addAnotherButton;$allItems;constructor(e){this.$module=e,this.$allVisibleItems=this.findVisibleItems(),this.$addAnotherButton=this.$module.find(".dm-list-input__item-add"),this.$allItems=this.$module.find(".dm-list-input__item")}init(){this.hideEmptyItems(),this.updateAllCounters(),this.addRemoveClickEvent(),this.toggleAddAnotherButton(),this.addAddClickEvent()}findVisibleItems(){return this.$module.find(".dm-list-input__item--visible")}hideEmptyItems(){let e=0,i=0;this.$allItems.each(((o,w)=>{const x=$(w),O=x.find("."+ListInput.itemInputClass),A=x.find("."+ListInput.removeButtonClass);O.attr("value")?(x.removeClass(ListInput.hiddenItemClass),x.addClass(ListInput.visibleItemClass),A.removeClass(ListInput.hiddenRemoveButtonClass),i+=1):(0===e||1===e&&0===i?A.removeClass(ListInput.hiddenRemoveButtonClass):(x.addClass(ListInput.hiddenItemClass),x.removeClass(ListInput.visibleItemClass),A.addClass(ListInput.hiddenRemoveButtonClass),O.attr("disabled","true")),e+=1)})),this.$allVisibleItems=this.findVisibleItems()}addRemoveClickEvent(){this.$allItems.each(((e,i)=>{const o=$(i),w=o.find("."+ListInput.itemInputClass),x=o.find("."+ListInput.removeButtonClass);x.on("click",(()=>{if(w.val(""),w.removeAttr("value"),w.attr("disabled","true"),x.addClass(ListInput.hiddenRemoveButtonClass),o.addClass(ListInput.hiddenItemClass),o.removeClass(ListInput.visibleItemClass),this.$allVisibleItems=this.findVisibleItems(),o.hasClass(ListInput.itemErrorClass)){o.removeClass(ListInput.itemErrorClass);const e=o.find("."+ListInput.formGroupErrorClass);e.removeClass(ListInput.formGroupErrorClass),e.remove("."+ListInput.itemErrorMsgClass);const i=e.find("."+ListInput.inputErrorClass),w=i.attr("id"),x=i.attr("aria-describedby");i.attr("aria-describedby",x.replace(w+"-error","")),i.removeClass(ListInput.inputErrorClass)}if(1===this.$allVisibleItems.length){this.$module.find("."+ListInput.removeButtonClass).each(((e,i)=>{$(i).addClass(ListInput.hiddenRemoveButtonClass)})),$(this.$allVisibleItems.get(0)).find("input").trigger("focus")}else{const e=ListInput.getSibling("next",o,"."+ListInput.visibleItemClass);if(e)e.find("input").trigger("focus");else{ListInput.getSibling("previous",o,"."+ListInput.visibleItemClass).find("input").trigger("focus")}}this.updateAllCounters(),this.toggleAddAnotherButton()}))}))}updateCounters(){this.$allVisibleItems.each(((e,i)=>{$(i).find("."+ListInput.itemCounterClass).each(((i,o)=>{$(o).text(e+1)}))}))}updateRemainingCounter(){const e=this.$allVisibleItems,i=this.$allItems.length;this.$module.find("."+ListInput.addButtonRemainingClass).text(i-e.length)}addAddClickEvent(){this.$addAnotherButton.on("click",(()=>{const e=this.$module.find("."+ListInput.hiddenItemClass).first(),i=e.find("."+ListInput.itemInputClass);e.length&&(i.removeAttr("disabled"),this.$module.find("."+ListInput.itemContainerClass).append(e),e.removeClass(ListInput.hiddenItemClass),e.addClass(ListInput.visibleItemClass),this.$allVisibleItems=this.findVisibleItems(),this.updateAllCounters(),e.find("."+ListInput.removeButtonClass).removeClass(ListInput.hiddenRemoveButtonClass),i.trigger("focus"),this.toggleAddAnotherButton(),this.$allVisibleItems.length>1&&this.$module.find("."+ListInput.removeButtonClass).each(((e,i)=>{$(i).removeClass(ListInput.hiddenRemoveButtonClass)})))}))}toggleAddAnotherButton(){this.$module.find("."+ListInput.hiddenItemClass).length?this.$addAnotherButton.removeClass(ListInput.hiddenAddButtonClass):this.$addAnotherButton.addClass(ListInput.hiddenAddButtonClass)}updateAllCounters(){this.updateCounters(),this.updateRemainingCounter()}static getSibling(e,i,o){let w="next"===e?i.next():i.prev();if(!o)return w;for(;w.length;){if(w.is(o))return w;w="next"===e?w.next():w.prev()}}}class OptionSelect{static moduleName="dm-option-select";$optionSelect;$options;$optionsContainer;$optionList;$allCheckboxes;checkedCheckboxes;filterOptions;constructor(e){this.$optionSelect=e,this.$options=this.$optionSelect.find('input[type="checkbox"]'),this.$optionsContainer=this.$optionSelect.find(".js-options-container"),this.$optionList=this.$optionsContainer.find(".js-auto-height-inner"),this.$allCheckboxes=this.$optionsContainer.find(".govuk-checkboxes__item"),this.checkedCheckboxes=[]}init(){this.$optionSelect.on("change",(e=>{const i=e.target;"INPUT"===i.tagName&&"checkbox"===i.getAttribute("type")&&this.updateCheckedCount()})),this.replaceHeadingSpanWithButton(),this.$optionSelect.addClass("js-collapsible"),this.$optionSelect.find(".js-container-button").on("click",(e=>{this.toggleOptionSelect(e)})),this.$optionSelect.data().closedOnLoad?this.close():this.setupHeight();const e=this.checkedString();e&&this.attachCheckedCounter(e);const i=this.$optionSelect.find(".js-dm-filter-options");i.length&&(this.filterOptions=new FilterOptions(i,this),this.filterOptions.init())}getAllCheckedCheckboxes(){this.checkedCheckboxes=[],this.$allCheckboxes.each(((e,i)=>{$(i).find("input[type=checkbox]").is(":checked")&&this.checkedCheckboxes.push(i)}))}replaceHeadingSpanWithButton(){const e=this.$optionSelect.find(".js-container-button"),i=e.html(),o=document.createElement("button");o.classList.add("js-container-button","dm-option-select__title","dm-option-select__button"),o.setAttribute("type","button"),o.setAttribute("aria-expanded","true"),o.setAttribute("id",e.attr("id")),o.setAttribute("aria-controls",this.$optionsContainer.attr("id")),o.innerHTML=i,e.after(o.outerHTML),e.remove()}attachCheckedCounter(e){this.$optionSelect.find(".js-container-button").after(`<div class="dm-option-select__selected-counter js-selected-counter">${e}</div>`)}updateCheckedCount(){const e=this.checkedString(),i=this.$optionSelect.find(".js-selected-counter");e?i.length?i.text(e):this.attachCheckedCounter(e):i.remove()}checkedString(){this.getAllCheckedCheckboxes();const e=this.checkedCheckboxes.length;return e>0?`${e} selected`:""}toggleOptionSelect(e){this.isClosed()?this.open():this.close(),e.preventDefault()}open(){this.isClosed()&&(this.$optionSelect.find(".js-container-button").attr("aria-expanded","true"),this.$optionSelect.removeClass("js-closed"),this.$optionSelect.addClass("js-opened"),this.$optionsContainer.css("height")||this.setupHeight())}close(){this.$optionSelect.removeClass("js-opened"),this.$optionSelect.addClass("js-closed"),this.$optionSelect.find(".js-container-button").attr("aria-expanded","false")}isClosed(){return this.$optionSelect.hasClass("js-closed")}setContainerHeight(e){this.$optionsContainer.css("height",e+"px")}getMaxContainerHeight(){const e=parseFloat(window.getComputedStyle(this.$optionsContainer.get(0)).maxHeight);return Number.isNaN(e)?200:e}isCheckboxVisible(e,i){if(!e.is(":visible"))return!1;return e.get(0).offsetTop<i}getVisibleCheckboxes(e){const i=this.$allCheckboxes.filter(":visible").get(),o=i.filter((i=>this.isCheckboxVisible($(i),e)));return o.length<i.length&&o.push(i[o.length]),o}setupHeight(){const e=this.$optionsContainer.get(0),i=this.$optionList.get(0),o=this.getMaxContainerHeight(),w=i.scrollHeight;if(null===e.offsetParent)return void this.setContainerHeight(o);if(w<=o+50)return void this.setContainerHeight(w+1);const x=this.getVisibleCheckboxes(o);if(!x.length)return void this.setContainerHeight(w+1);const $=x[x.length-1],O=$?.offsetTop,A=$?.offsetHeight??0,B=O+A/1.5;this.setContainerHeight(Math.max(B,A+1))}}class FilterOptions{static moduleName="dm-filter-options";$filter;$optionSelect;$optionsContainer;$input;$checkboxes;optionSelect;constructor(e,i){this.$filter=e,this.$optionSelect=i.$optionSelect,this.$optionsContainer=i.$optionsContainer,this.$input=this.$filter.find("input"),this.$checkboxes=this.$optionSelect.find(".govuk-checkboxes__item"),this.optionSelect=i}init(){this.$input.on("keyup input search",(()=>this.filterCheckboxes()))}filterCheckboxes(){const e=this.$input.val().toLowerCase();this.$checkboxes.each(((i,o)=>{const w=$(o);w.find("label").text().toLowerCase().includes(e)?w.show():w.hide()})),this.$optionsContainer.css("height","auto"),this.optionSelect.setupHeight()}}class OptionTreeSummary{$totalSelected;$totalSelectedText;itemNameSingular;itemNamePlural;constructor(e,i,o){this.$totalSelected=e.find(".dm-option-tree__summary-total-selected"),this.$totalSelectedText=e.find(".dm-option-tree__summary-total-selected-text"),this.itemNameSingular=i,this.itemNamePlural=o}updateSelectedCount=e=>{this.$totalSelected.text(e),1===e?this.$totalSelectedText.text(`${this.itemNameSingular} selected`):this.$totalSelectedText.text(`${this.itemNamePlural} selected`)}}class OptionTreeSection{optionTree;$section;tier;optionTreeSections;$checkbox;checkboxes;isParent;constructor(e,i,o){this.optionTree=e,this.$section=i,this.tier=o,this.optionTreeSections=this.$section.find("> .dm-option-tree-details__text > .dm-option-tree-details").get().map((e=>new OptionTreeSection(this.optionTree,$(e),o+1))),this.checkboxes=this.$section.find("> .dm-option-tree-details__text > .govuk-form-group > .govuk-checkboxes > .govuk-checkboxes__item > .govuk-checkboxes__input").get().map((e=>$(e))),this.isParent=this.optionTreeSections.length>0;const w=this.$section.find("> .dm-option-tree-details__summary-checkbox > .dm-option-tree-details__summary-text > .dm-option-tree-details__summary-text-label > .govuk-checkboxes__item > .govuk-checkboxes__input").get(0);w&&(this.$checkbox=$(w))}init=()=>{this.openSectionIfSelected(),this.isParent?this.optionTreeSections.forEach((e=>e.init())):this.checkboxes.forEach((e=>{e.on("click",(()=>{this.optionTree.updateTotals(e.val(),e.is(":checked"))}))})),this.$checkbox&&(this.$checkbox.closest(".govuk-checkboxes__item").on("click",(e=>{e.stopPropagation()})),this.$checkbox.on("click",(e=>{const i=$(e.target);if(this.optionTree.independentSelection){const e=i.is(":checked");return this.isParent?this.optionTreeSections.forEach((e=>e.toggleAllCheckboxes(!1))):this.checkboxes.forEach((e=>e.prop("checked",!1))),i.prop("checked",e),void this.optionTree.updateAllParts()}i.is(":checked")&&this.openSections(),this.isParent?this.optionTree.updateAllTotals(this.optionTreeSections,i.is(":checked")):this.optionTree.updateAllTotals([this],i.is(":checked"))})))};selectedItems=()=>this.checkboxes.filter((e=>e.is(":checked")));openSectionIfSelected=()=>{(this.optionTree.independentSelection?this.hasSelectedDescendants():this.countSelected()>0)&&"open"!==this.$section.attr("open")&&this.$section.attr("open","open")};hasSelectedDescendants=()=>this.isParent?this.optionTreeSections.some((e=>e.$checkbox?.is(":checked")||e.hasSelectedDescendants())):this.selectedItems().length>0;openSections=()=>{"open"!==this.$section.attr("open")&&this.$section.attr("open","open"),this.isParent&&this.optionTreeSections.forEach((e=>e.openSections()))};countSelected=()=>{let e=this.optionTree.independentSelection&&this.$checkbox?.is(":checked")?1:0;return this.isParent?e+=this.optionTreeSections.reduce(((e,i)=>e+i.countSelected()),0):e+=this.selectedItems().length,e};isAllSelected=()=>this.isParent?this.optionTreeSections.every((e=>e.isAllSelected())):this.countSelected()==this.checkboxes.length;selectedItemValues=()=>{const e=this.isParent?this.optionTreeSections.map((e=>e.selectedItemValues())).flat():this.selectedItems().map((e=>e.val()));return this.optionTree.independentSelection&&this.$checkbox?.is(":checked")&&e.push(this.$checkbox.val()),e};updateSectionLocks=e=>{this.countSelected()?this.tier===e?this.optionTreeSections.forEach((e=>e.toggleSectionLock(!1))):this.optionTreeSections.forEach((i=>i.updateSectionLocks(e))):this.toggleSectionLock(!0)};updateSectionCheckbox=()=>{if(this.optionTree.independentSelection)return this.optionTreeSections.forEach((e=>e.updateSectionCheckbox())),void(this.$checkbox&&this.hasSelectedDescendants()&&this.$checkbox.prop("checked",!1));this.$checkbox?.prop("checked",this.isAllSelected()),this.isParent&&this.optionTreeSections.forEach((e=>e.updateSectionCheckbox()))};toggleSectionLock=e=>{this.isParent?this.optionTreeSections.forEach((i=>i.toggleSectionLock(e))):this.checkboxes.forEach((i=>i.prop("disabled",e))),e?(this.$section.attr("disabled","disabled"),this.$section.attr("tabIndex",-1),this.$section.removeAttr("open"),this.$checkbox?.prop("disabled",!0),this.$checkbox?.prop("checked",!1)):(this.$section.removeAttr("disabled"),this.$section.removeAttr("tabIndex"),this.$checkbox?.prop("disabled",!1))};toggleCheckbox=(e,i)=>{this.isParent?this.optionTreeSections.forEach((o=>o.toggleCheckbox(e,i))):this.checkboxes.forEach((o=>{o.val()===e&&o.prop("checked",i)}))};toggleAllCheckboxes=e=>{this.$checkbox&&this.$checkbox.prop("checked",e),this.isParent?this.optionTreeSections.forEach((i=>i.toggleAllCheckboxes(e))):this.checkboxes.forEach((i=>{i.prop("checked",e)}))}}class OptionTree{static moduleName="dm-option-tree";$optionTree;optionTreeSummary;optionTreeSections;tierLimit;independentSelection;currentCount=0;constructor(e){this.$optionTree=e,this.optionTreeSummary=new OptionTreeSummary(this.$optionTree.find(".dm-option-tree__summary"),this.$optionTree.data("itemNameSingular"),this.$optionTree.data("itemNamePlural")),this.tierLimit=this.$optionTree.data("tierRestriction")||0,this.independentSelection=!0===this.$optionTree.data("independentSelection"),this.optionTreeSections=this.$optionTree.find(".dm-option-tree__options > .dm-option-tree-details").get().map((e=>new OptionTreeSection(this,$(e),1)))}init=()=>{this.optionTreeSections.forEach((e=>e.init())),this.updateAllParts()};countSelected=()=>new Set(this.optionTreeSections.map((e=>e.selectedItemValues())).flat()).size;updateOptionTreeSummaryCount=()=>{this.currentCount=this.countSelected(),this.optionTreeSummary.updateSelectedCount(this.currentCount)};updateSectionLocks=()=>{this.tierLimit&&this.optionTreeSections.forEach((e=>{0===this.currentCount?e.toggleSectionLock(!1):e.updateSectionLocks(this.tierLimit)}))};updateSectionsCheckboxes=()=>{this.optionTreeSections.forEach((e=>e.updateSectionCheckbox()))};updateAllParts=()=>{this.updateSectionsCheckboxes(),this.updateOptionTreeSummaryCount(),this.updateSectionLocks()};updateTotals=(e,i)=>{this.optionTreeSections.forEach((o=>o.toggleCheckbox(e,i))),this.updateAllParts()};updateAllTotals=(e,i)=>{e.forEach((e=>e.toggleAllCheckboxes(i))),this.updateAllParts()}}!function(e){e[e.CONTROLLER=0]="CONTROLLER",e[e.CONTROLLER_AND_TARGET=1]="CONTROLLER_AND_TARGET",e[e.TARGET=2]="TARGET"}(X||(X={}));class QuestionInput{question;$input;targets;constructor(e,i){this.question=e,this.$input=i;const o=this.$input.attr("data-target");this.targets=o?o.split(" "):[]}setEventListener(){this.$input.on("click",(()=>{this.question.updateTargetQuestionsVisibility()}))}isChecked(){return this.$input.is(":checked")}}class QuestionQuestion{questionWatcher;$question;id;questionType;questionInputs;possibleTargetIds;targetOf;constructor(e,i,o){this.questionWatcher=e,this.$question=i,this.id=this.$question.attr("id"),this.questionType=o,this.questionType===X.CONTROLLER?this.enableControllerQuestionMethods():this.enableTargetQuestionMethods()}enableControllerQuestionMethods(){this.questionInputs=this.$question.find("input").get().map((e=>new QuestionInput(this,$(e)))),this.possibleTargetIds=new Set(this.questionInputs.map((e=>e.targets)).flat())}enableTargetQuestionMethods(){this.targetOf=[]}isVisible(){return!this.$question.hasClass("govuk-visually-hidden")}currentTargetIds(){let e;return e=this.isVisible()&&this.questionInputs?this.questionInputs.filter((e=>e.isChecked())).map((e=>e.targets)).flat():[],new Set(e)}updateTargetQuestionsVisibility(){this.questionWatcher.updateTargetQuestionsVisibility(this.possibleTargetIds)}appendTargetOf(e){void 0!==this.targetOf&&this.targetOf.push(e)}toggleVisibility(e){this.$question.toggleClass("govuk-visually-hidden",!e),this.$question.attr("aria-hidden",(!e).toString()),e?this.$question.removeAttr("hidden"):this.$question.attr("hidden","")}}class Question{static moduleName="dm-question";questions;constructor(){this.questions={},$(`[data-module="${Question.moduleName}"]`).each(((e,i)=>{this.push(new QuestionQuestion(this,$(i),X.CONTROLLER))}));for(const[e,i]of Object.entries(this.questions))for(const o of i.possibleTargetIds||[])o in this.questions?this.questions[o].questionType===X.CONTROLLER&&(this.questions[o].questionType=X.CONTROLLER_AND_TARGET,this.questions[o].enableTargetQuestionMethods()):this.push(new QuestionQuestion(this,$(`#${o}`),X.TARGET)),this.questions[o].appendTargetOf(e)}init(){for(const e of Object.values(this.questions))if(e.questionType<X.TARGET){for(const i of e.questionInputs||[])i.setEventListener();e.questionType===X.CONTROLLER&&this.updateTargetQuestionsVisibility(e.possibleTargetIds)}}push(e){this.questions[e.id]=e}updateTargetQuestionsVisibility(e,i){for(const o of e||[]){const e=this.questions[o];let w;if(void 0===i){const i=e.targetOf?.map((e=>this.questions[e]));w=new Set(i?.map((e=>Array.from(e.currentTargetIds()))).flat()).has(o)}else w=i;e.toggleVisibility(w),e.questionType===X.CONTROLLER_AND_TARGET&&(w?this.updateTargetQuestionsVisibility(e.possibleTargetIds):this.updateTargetQuestionsVisibility(e.possibleTargetIds,!1))}}}class QuestionCheckboxTreeSummary{$totalSelected;$totalSelectedText;itemNameSingular;itemNamePlural;constructor(e,i,o){this.$totalSelected=e.find(".dm-checkbox-tree__summary-total-selected"),this.$totalSelectedText=e.find(".dm-checkbox-tree__summary-total-selected-text"),this.itemNameSingular=i,this.itemNamePlural=o}updateSelectedCount=e=>{this.$totalSelected.text(e),1===e?this.$totalSelectedText.text(`${this.itemNameSingular} selected.`):this.$totalSelectedText.text(`${this.itemNamePlural} selected.`)}}class QuestionCheckboxTreeSection{checkboxTree;$section;$summaryTag;$summaryTagCount;tier;checkboxTreeSections;checkboxes;isParent;constructor(e,i,o){this.checkboxTree=e,this.$section=i,this.tier=o,this.$summaryTag=this.$section.find("> .dm-checkbox-tree-details__summary .govuk-tag"),this.$summaryTagCount=this.$summaryTag.find(".dm-checkbox-tree-details__summary-text-count-selected"),this.checkboxTreeSections=this.$section.find("> .dm-checkbox-tree-details__text > .dm-checkbox-tree-details").get().map((e=>new QuestionCheckboxTreeSection(this.checkboxTree,$(e),o+1))),this.checkboxes=this.$section.find(("DETAILS"===this.$section.prop("tagName")?"> .dm-checkbox-tree-details__text > .govuk-form-group > .govuk-checkboxes > .govuk-checkboxes__item > ":"")+".govuk-checkboxes__input").get().map((e=>$(e))),this.isParent=this.checkboxTreeSections.length>0}init=()=>{this.openSectionIfSelected(),this.isParent?this.checkboxTreeSections.forEach((e=>e.init())):this.checkboxes.forEach((e=>{e.on("click",(()=>{this.checkboxTree.updateTotals(e.val(),e.is(":checked"))}))}))};selectedItems=()=>this.checkboxes.filter((e=>e.is(":checked")));openSectionIfSelected=()=>{this.countSelected()>0&&"open"!==this.$section.attr("open")&&this.$section.attr("open","open")};countSelected=()=>this.isParent?this.checkboxTreeSections.reduce(((e,i)=>e+i.countSelected()),0):this.selectedItems().length;slectedItemValues=()=>this.isParent?this.checkboxTreeSections.map((e=>e.slectedItemValues())).flat():this.selectedItems().map((e=>e.val()));updateSelectedCount=()=>{const e=this.countSelected();e>0?(this.$summaryTagCount.text(e),this.$summaryTag.toggleClass("govuk-visually-hidden",!1)):(this.$summaryTag.toggleClass("govuk-visually-hidden",!0),this.$summaryTagCount.text("")),this.isParent&&this.checkboxTreeSections.forEach((e=>e.updateSelectedCount()))};updateSectionLocks=e=>{this.countSelected()?this.tier===e?this.checkboxTreeSections.forEach((e=>e.toggleSectionLock(!1))):this.checkboxTreeSections.forEach((i=>i.updateSectionLocks(e))):this.toggleSectionLock(!0)};toggleSectionLock=e=>{this.isParent?this.checkboxTreeSections.forEach((i=>i.toggleSectionLock(e))):this.checkboxes.forEach((i=>i.prop("disabled",e))),e?(this.$section.attr("disabled","disabled"),this.$section.attr("tabIndex",-1),this.$section.removeAttr("open")):(this.$section.removeAttr("disabled"),this.$section.removeAttr("tabIndex"))};toggleCheckbox=(e,i)=>{this.isParent?this.checkboxTreeSections.forEach((o=>o.toggleCheckbox(e,i))):this.checkboxes.forEach((o=>{o.val()===e&&o.prop("checked",i)}))}}class QuestionCheckboxTree{static moduleName="dm-question-checkbox-tree";$checkboxTree;checkboxTreeSummary;checkboxTreeSections;tierLimit;currentCount=0;constructor(e){this.$checkboxTree=e,this.checkboxTreeSummary=new QuestionCheckboxTreeSummary(this.$checkboxTree.find(".dm-checkbox-tree__summary"),this.$checkboxTree.data("itemNameSingular"),this.$checkboxTree.data("itemNamePlural")),this.tierLimit=this.$checkboxTree.data("tierRestriction")||0;const i=this.$checkboxTree.find(".dm-checkbox-tree__options > .dm-checkbox-tree-details").get().map((e=>new QuestionCheckboxTreeSection(this,$(e),1)));i.length?this.checkboxTreeSections=i:this.checkboxTreeSections=[new QuestionCheckboxTreeSection(this,$(".dm-checkbox-tree__options"),1)]}init=()=>{this.checkboxTreeSections.forEach((e=>e.init())),this.updateCheckboxTreeSummaryCount(),this.updateCheckboxTreeSectionSelectedCounts(),this.updateSectionLocks()};countSelected=()=>new Set(this.checkboxTreeSections.map((e=>e.slectedItemValues())).flat()).size;updateCheckboxTreeSummaryCount=()=>{this.currentCount=this.countSelected(),this.checkboxTreeSummary.updateSelectedCount(this.currentCount)};updateCheckboxTreeSectionSelectedCounts=()=>{this.checkboxTreeSections.forEach((e=>e.updateSelectedCount()))};updateSectionLocks=()=>{this.tierLimit&&this.checkboxTreeSections.forEach((e=>{0===this.currentCount?e.toggleSectionLock(!1):e.updateSectionLocks(this.tierLimit)}))};updateTotals=(e,i)=>{this.checkboxTreeSections.forEach((o=>o.toggleCheckbox(e,i))),this.updateCheckboxTreeSummaryCount(),this.updateCheckboxTreeSectionSelectedCounts(),this.updateSectionLocks()}}class QuestionListRowInput{$input;$label;$labelCounter;$prefixText;constructor(e){this.$input=e.find(".dm-list__item-input"),this.$label=e.find(".govuk-label"),this.$labelCounter=this.$label.find(".dm-list__item-label-counter"),this.$prefixText=e.find(".govuk-input__prefix")}getValue(){return this.$input.val()}clearValue(){this.$input.val(""),this.$input.attr("value","")}updateIndex(e){const i=`input-${this.$input.attr("name")}-${e}`;this.$label.attr("for",i),this.$labelCounter.text(e+1),this.$prefixText.text(`${e+1}.`),this.$input.attr("id",i)}}class QuestionListRowRemoveButton{answerListRow;$button;$removeButtonCounter;constructor(e,i){this.answerListRow=e,this.$button=i.find(".dm-list__item-remove"),this.$removeButtonCounter=this.$button.find(".dm-list__item-remove-counter")}init(){this.toggleVisibility(!0),this.$button.on("click",(()=>{this.answerListRow.removeRow()}))}toggleVisibility(e){this.$button.toggleClass("govuk-visually-hidden",!e)}updateIndex(e){this.$removeButtonCounter.text(e+1)}}class QuestionListRow{answerList;index;$row;answerListRowInput;answerListRowRemoveButton;constructor(e,i,o){this.answerList=e,this.index=i,this.$row=o,this.answerListRowInput=new QuestionListRowInput(o),this.answerListRowRemoveButton=new QuestionListRowRemoveButton(this,o)}init(){this.answerListRowRemoveButton.init()}updateIndex(e){this.index=e,this.answerListRowInput.updateIndex(e),this.answerListRowRemoveButton.updateIndex(e)}removeRow(){this.answerList.removeRow(this.index),this.deleteRow()}deleteRow(){this.$row.remove()}toggleRemoveButtonVisibility(e){this.answerListRowRemoveButton.toggleVisibility(e)}inputValue(){return this.answerListRowInput.getValue()}}class QuestionListAddButton{answerList;$button;$buttonCounter;constructor(e,i){this.answerList=e,this.$button=i,this.$buttonCounter=i.find(".dm-list__item-add-counter")}init(e){this.$button.on("click",(()=>{this.answerList.addRow()})),this.updateButtonText(this.answerList.maxNumberOfItems-e)}updateButtonText(e){this.$buttonCounter.text(e)}toggleVisibility(e){this.$button.toggleClass("govuk-visually-hidden",!e)}}class QuestionList{static moduleName="dm-question-list";$answerList;$answerListItems;answerListRows;answerListAddButton;maxNumberOfItems;numberOfItemsShownAsDefault;constructor(e){this.$answerList=e,this.maxNumberOfItems=this.$answerList.data("maxNumberOfItems"),this.numberOfItemsShownAsDefault=this.$answerList.data("numberOfItemsShownAsDefault"),this.$answerListItems=this.$answerList.find(".dm-list__items"),this.answerListRows=this.$answerList.find(".dm-list__item").get().map(((e,i)=>new QuestionListRow(this,i,$(e)))),this.answerListAddButton=new QuestionListAddButton(this,this.$answerList.find(".dm-list__item-add"))}init(){const e=this.answerListRows.map((e=>e.inputValue()));let i=1;e.every((e=>!e))?i=this.numberOfItemsShownAsDefault:e.forEach(((e,o)=>{e&&(i=o+1)})),i>=0&&(this.answerListRows.slice(i).forEach((e=>e.deleteRow())),this.answerListRows.splice(i)),this.answerListAddButton.init(this.answerListRows.length),this.answerListRows.forEach((e=>e.init())),this.updateIfMinRows(),this.updateAnswerButton()}removeRow(e){this.answerListRows.splice(e,1),this.answerListRows.slice(e).forEach(((i,o)=>{i.updateIndex(e+o)})),this.updateIfMinRows(),this.updateAnswerButton(),this.focusOnRow(e)}addRow(){const e=this.answerListRows.length;if(e<this.maxNumberOfItems){const i=this.answerListRows[0].$row.clone(),o=new QuestionListRow(this,e,i);o.updateIndex(e),o.answerListRowInput.clearValue(),this.answerListRows.push(o),this.$answerListItems.append(i),this.answerListRows[e].init(),this.updateIfMinRows(),this.updateAnswerButton(),this.focusOnRow(e)}}updateIfMinRows(){1===this.answerListRows.length?this.answerListRows[0].toggleRemoveButtonVisibility(!1):this.answerListRows[0].toggleRemoveButtonVisibility(!0)}updateAnswerButton(){this.answerListRows.length===this.maxNumberOfItems?this.answerListAddButton.toggleVisibility(!1):(this.answerListAddButton.toggleVisibility(!0),this.answerListAddButton.updateButtonText(this.maxNumberOfItems-this.answerListRows.length))}focusOnRow(e){const i=this.answerListRows.length;let o=e;e>=i&&(o=i-1),this.answerListRows[o].answerListRowInput.$input.focus()}}class QuestionListMultiquestionQuestionInput{$question;canHideQuestion;constructor(e){this.$question=e,this.canHideQuestion=this.$question.hasClass("js-hidden")}toggleVisibility(e){e?this.showInput():(this.hideInput(),this.hideQuestion())}hideQuestion(){this.canHideQuestion&&(this.$question.toggleClass("govuk-visually-hidden",!0),this.$question.attr("aria-hidden","true"),this.$question.attr("hidden",""))}}class QuestionListMultiquestionQuestionInputWithField extends QuestionListMultiquestionQuestionInput{$input;constructor(e,i){super(e),this.$input=i}hasValue(){return!!this.$input.val()}showInput(){this.$input.removeAttr("tabindex")}hideInput(){this.$input.val(""),this.$input.attr("value",""),this.$input.attr("tabindex",-1)}focusOnInput(){this.$input.focus()}}class QuestionListMultiquestionQuestionInputWithItems extends QuestionListMultiquestionQuestionInput{inputs;constructor(e,i){super(e),this.inputs=i}hasValue(){return this.inputs.some((e=>e.is(":checked")))}showInput(){this.inputs.forEach((e=>e.removeAttr("tabindex")))}hideInput(){this.inputs.forEach((e=>{e.prop("checked",!1),e.attr("tabindex",-1)}))}focusOnInput(){this.inputs[0].focus()}}class QuestionListMultiquestionQuestionInputFactory{static getQuestionListMultiquestionQuestionInput(e){const i=e.find("input").get().map((e=>$(e)));return 1==i.length?new QuestionListMultiquestionQuestionInputWithField(e,i[0]):new QuestionListMultiquestionQuestionInputWithItems(e,i)}}class QuestionListMultiquestionRow{answerList;$row;answerListRowInputs;constructor(e,i){this.answerList=e,this.$row=i,this.answerListRowInputs=i.find(".question").get().map((e=>QuestionListMultiquestionQuestionInputFactory.getQuestionListMultiquestionQuestionInput($(e))))}toggleVisibility(e){this.$row.toggleClass("govuk-visually-hidden",!e),this.answerListRowInputs.forEach((i=>i.toggleVisibility(e)))}isRowVisible(){return!this.$row.hasClass("govuk-visually-hidden")}rowHasValues(){return this.answerListRowInputs.some((e=>e.hasValue()))}}class QuestionListMultiquestionButton{answerList;$button;$buttonCounter;constructor(e,i,o){this.answerList=e,this.$button=i,this.$buttonCounter=i.find(`.dm-list-multiquestion__item-${o}-counter`)}updateButtonText(e){this.$buttonCounter.text(e)}toggleVisibility(e){this.$button.toggleClass("govuk-visually-hidden",!e),e?this.$button.removeAttr("tabindex"):this.$button.attr("tabindex",-1)}}class QuestionListMultiquestionRemoveButton extends QuestionListMultiquestionButton{constructor(e,i){super(e,i,"remove")}init(e){this.$button.on("click",(()=>{this.answerList.hideRow()})),this.updateButtonText(e)}}class QuestionListMultiquestionAddButton extends QuestionListMultiquestionButton{maxNumberOfItems;constructor(e,i,o){super(e,i,"add"),this.maxNumberOfItems=o}init(e){this.$button.on("click",(()=>{this.answerList.addRow()})),this.updateButtonText(this.maxNumberOfItems-e)}}class QuestionListMultiquestionClientSide{static moduleName="dm-question-list-multiquestion-client-side";$answerList;maxNumberOfItems;answerListRows;answerListAddButton;answerListRemoveButton;constructor(e){this.$answerList=e,this.maxNumberOfItems=this.$answerList.data("maxNumberOfItems"),this.answerListRows=this.$answerList.find(".dm-list-multiquestion__item").get().map((e=>new QuestionListMultiquestionRow(this,$(e)))),this.answerListAddButton=new QuestionListMultiquestionAddButton(this,this.$answerList.find(".dm-list-multiquestion__item-add"),this.maxNumberOfItems),this.answerListRemoveButton=new QuestionListMultiquestionRemoveButton(this,this.$answerList.find(".dm-list-multiquestion__item-remove"))}init(){const e=this.answerListRows.map((e=>e.rowHasValues()));let i=-1;if(e.every((e=>!e)))i=1;else{let o=!0;e.forEach(((e,w)=>{o&&!e&&(i=w),o=e}))}i>=0&&this.answerListRows.slice(i).forEach((e=>e.toggleVisibility(!1)));const o=this.visibleRowsCount();this.answerListAddButton.init(o),this.answerListRemoveButton.init(o),this.updateRemoveButton(o),this.updateAnswerButton(o)}hideRow(){const e=this.visibleRowsCount();e>1&&(this.answerListRows[e-1].toggleVisibility(!1),this.updateRemoveButton(e-1),this.updateAnswerButton(e-1),this.focusOnRow(e-1))}addRow(){const e=this.visibleRowsCount();e<this.maxNumberOfItems&&(this.answerListRows[e].toggleVisibility(!0),this.updateRemoveButton(e+1),this.updateAnswerButton(e+1),this.focusOnRow(e+1))}visibleRowsCount(){return this.answerListRows.reduce(((e,i)=>e+(i.isRowVisible()?1:0)),0)}updateRemoveButton(e){1===e?this.answerListRemoveButton.toggleVisibility(!1):(this.answerListRemoveButton.toggleVisibility(!0),this.answerListRemoveButton.updateButtonText(e))}updateAnswerButton(e){e===this.maxNumberOfItems?this.answerListAddButton.toggleVisibility(!1):(this.answerListAddButton.toggleVisibility(!0),this.answerListAddButton.updateButtonText(this.maxNumberOfItems-e))}focusOnRow(e){this.answerListRows[e-1].answerListRowInputs[0].focusOnInput()}}class SearchBox{static moduleName="dm-search-box";$module;$toggleTarget;constructor(e){this.$module=e,this.$toggleTarget=this.$module.find(".js-class-toggle")}init(){this.inputIsEmpty()||this.addFocusClass(),this.$toggleTarget.on("focus",this.addFocusClass.bind(this)),this.$toggleTarget.on("blur",this.removeFocusClassFromEmptyInput.bind(this))}inputIsEmpty(){return""===this.$toggleTarget.val()}addFocusClass(){this.$toggleTarget.addClass("focus")}removeFocusClassFromEmptyInput(){this.inputIsEmpty()&&this.$toggleTarget.removeClass("focus")}}function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tt,et={exports:{}};var nt=getDefaultExportFromCjs((tt||(tt=1,self,et.exports=function(){var e={8952:function(e,i,o){var w=o(4328),x=o(36),$=TypeError;e.exports=function(e){if(w(e))return e;throw new $(x(e)+" is not a function")}},2096:function(e,i,o){var w=o(2424),x=String,$=TypeError;e.exports=function(e){if(w(e))return e;throw new $("Can't set "+x(e)+" as a prototype")}},4764:function(e,i,o){var w=o(9764).charAt;e.exports=function(e,i,o){return i+(o?w(e,i).length:1)}},6100:function(e,i,o){var w=o(7e3),x=TypeError;e.exports=function(e,i){if(w(i,e))return e;throw new x("Incorrect invocation")}},3951:function(e,i,o){var w=o(1632),x=String,$=TypeError;e.exports=function(e){if(w(e))return e;throw new $(x(e)+" is not an object")}},2504:function(e,i,o){var w=o(4096),x=o(2495),$=o(3556),u=function(e){return function(i,o,O){var A=w(i),B=$(A);if(0===B)return!e&&-1;var Q,W=x(O,B);if(e&&o!=o){for(;B>W;)if((Q=A[W++])!=Q)return!0}else for(;B>W;W++)if((e||W in A)&&A[W]===o)return e||W||0;return!e&&-1}};e.exports={includes:u(!0),indexOf:u(!1)}},3364:function(e,i,o){var w=o(8992),x=o(1664),$=o(5712),O=o(4356),A=o(3556),B=o(2568),Q=x([].push),l=function(e){var i=1===e,o=2===e,x=3===e,W=4===e,K=6===e,Y=7===e,Z=5===e||K;return function(X,J,tt,et){for(var nt,it,ot=O(X),st=$(ot),rt=A(st),at=w(J,tt),ut=0,ct=et||B,lt=i?ct(X,rt):o||Y?ct(X,0):void 0;rt>ut;ut++)if((Z||ut in st)&&(it=at(nt=st[ut],ut,ot),e))if(i)lt[ut]=it;else if(it)switch(e){case 3:return!0;case 5:return nt;case 6:return ut;case 2:Q(lt,nt)}else switch(e){case 4:return!1;case 7:Q(lt,nt)}return K?-1:x||W?W:lt}};e.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},953:function(e,i,o){var w=o(9957),x=o(9972),$=o(8504),O=x("species");e.exports=function(e){return $>=51||!w((function(){var i=[];return(i.constructor={})[O]=function(){return{foo:1}},1!==i[e](Boolean).foo}))}},1496:function(e,i,o){var w=o(9957);e.exports=function(e,i){var o=[][e];return!!o&&w((function(){o.call(null,i||function(){return 1},1)}))}},6728:function(e,i,o){var w=o(3476),x=o(1432),$=TypeError,O=Object.getOwnPropertyDescriptor,A=w&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=A?function(e,i){if(x(e)&&!O(e,"length").writable)throw new $("Cannot set read only .length");return e.length=i}:function(e,i){return e.length=i}},6736:function(e,i,o){var w=o(1432),x=o(6072),$=o(1632),O=o(9972)("species"),A=Array;e.exports=function(e){var i;return w(e)&&(i=e.constructor,(x(i)&&(i===A||w(i.prototype))||$(i)&&null===(i=i[O]))&&(i=void 0)),void 0===i?A:i}},2568:function(e,i,o){var w=o(6736);e.exports=function(e,i){return new(w(e))(0===i?0:i)}},8696:function(e,i,o){var w=o(3951),x=o(3112);e.exports=function(e,i,o,$){try{return $?i(w(o)[0],o[1]):i(o)}catch(O){x(e,"throw",O)}}},1888:function(e,i,o){var w=o(1664),x=w({}.toString),$=w("".slice);e.exports=function(e){return $(x(e),8,-1)}},4427:function(e,i,o){var w=o(16),x=o(4328),$=o(1888),O=o(9972)("toStringTag"),A=Object,B="Arguments"===$(function(){return arguments}());e.exports=w?$:function(e){var i,o,w;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(o=function(e,i){try{return e[i]}catch(o){}}(i=A(e),O))?o:B?$(i):"Object"===(w=$(i))&&x(i.callee)?"Arguments":w}},9968:function(e,i,o){var w=o(5152),x=o(9252),$=o(9444),O=o(8352);e.exports=function(e,i,o){for(var A=x(i),B=O.f,Q=$.f,W=0;W<A.length;W++){var K=A[W];w(e,K)||o&&w(o,K)||B(e,K,Q(i,K))}}},2272:function(e,i,o){var w=o(9957);e.exports=!w((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},3336:function(e){e.exports=function(e,i){return{value:e,done:i}}},3440:function(e,i,o){var w=o(3476),x=o(8352),$=o(9728);e.exports=w?function(e,i,o){return x.f(e,i,$(1,o))}:function(e,i,o){return e[i]=o,e}},9728:function(e){e.exports=function(e,i){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:i}}},92:function(e,i,o){var w=o(3476),x=o(8352),$=o(9728);e.exports=function(e,i,o){w?x.f(e,i,$(0,o)):e[i]=o}},2544:function(e,i,o){var w=o(5312),x=o(8352);e.exports=function(e,i,o){return o.get&&w(o.get,i,{getter:!0}),o.set&&w(o.set,i,{setter:!0}),x.f(e,i,o)}},6076:function(e,i,o){var w=o(4328),x=o(8352),$=o(5312),O=o(4636);e.exports=function(e,i,o,A){A||(A={});var B=A.enumerable,Q=void 0!==A.name?A.name:i;if(w(o)&&$(o,Q,A),A.global)B?e[i]=o:O(i,o);else{try{A.unsafe?e[i]&&(B=!0):delete e[i]}catch(W){}B?e[i]=o:x.f(e,i,{value:o,enumerable:!1,configurable:!A.nonConfigurable,writable:!A.nonWritable})}return e}},4036:function(e,i,o){var w=o(6076);e.exports=function(e,i,o){for(var x in i)w(e,x,i[x],o);return e}},4636:function(e,i,o){var w=o(6420),x=Object.defineProperty;e.exports=function(e,i){try{x(w,e,{value:i,configurable:!0,writable:!0})}catch(o){w[e]=i}return i}},3476:function(e,i,o){var w=o(9957);e.exports=!w((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},8168:function(e,i,o){var w=o(6420),x=o(1632),$=w.document,O=x($)&&x($.createElement);e.exports=function(e){return O?$.createElement(e):{}}},4316:function(e){var i=TypeError;e.exports=function(e){if(e>9007199254740991)throw i("Maximum allowed index exceeded");return e}},6064:function(e){e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},8504:function(e,i,o){var w,x,$=o(6420),O=o(6064),A=$.process,B=$.Deno,Q=A&&A.versions||B&&B.version,W=Q&&Q.v8;W&&(x=(w=W.split("."))[0]>0&&w[0]<4?1:+(w[0]+w[1])),!x&&O&&(!(w=O.match(/Edge\/(\d+)/))||w[1]>=74)&&(w=O.match(/Chrome\/(\d+)/))&&(x=+w[1]),e.exports=x},8256:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6520:function(e,i,o){var w=o(1664),x=Error,$=w("".replace),O=String(new x("zxcasd").stack),A=/\n\s*at [^:]*:[^\n]*/,B=A.test(O);e.exports=function(e,i){if(B&&"string"==typeof e&&!x.prepareStackTrace)for(;i--;)e=$(e,A,"");return e}},3696:function(e,i,o){var w=o(3440),x=o(6520),$=o(9184),O=Error.captureStackTrace;e.exports=function(e,i,o,A){$&&(O?O(e,i):w(e,"stack",x(o,A)))}},9184:function(e,i,o){var w=o(9957),x=o(9728);e.exports=!w((function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",x(1,7)),7!==e.stack)}))},9160:function(e,i,o){var w=o(6420),x=o(9444).f,$=o(3440),O=o(6076),A=o(4636),B=o(9968),Q=o(6704);e.exports=function(e,i){var o,W,K,Y,Z,X=e.target,J=e.global,tt=e.stat;if(o=J?w:tt?w[X]||A(X,{}):w[X]&&w[X].prototype)for(W in i){if(Y=i[W],K=e.dontCallGetSet?(Z=x(o,W))&&Z.value:o[W],!Q(J?W:X+(tt?".":"#")+W,e.forced)&&void 0!==K){if(typeof Y==typeof K)continue;B(Y,K)}(e.sham||K&&K.sham)&&$(Y,"sham",!0),O(o,W,Y,e)}}},9957:function(e){e.exports=function(e){try{return!!e()}catch(i){return!0}}},7176:function(e,i,o){o(880);var w=o(8448),x=o(6076),$=o(7680),O=o(9957),A=o(9972),B=o(3440),Q=A("species"),W=RegExp.prototype;e.exports=function(e,i,o,K){var Y=A(e),Z=!O((function(){var i={};return i[Y]=function(){return 7},7!==""[e](i)})),X=Z&&!O((function(){var i=!1,o=/a/;return"split"===e&&((o={}).constructor={},o.constructor[Q]=function(){return o},o.flags="",o[Y]=/./[Y]),o.exec=function(){return i=!0,null},o[Y](""),!i}));if(!Z||!X||o){var J=/./[Y],tt=i(Y,""[e],(function(e,i,o,x,O){var A=i.exec;return A===$||A===W.exec?Z&&!O?{done:!0,value:w(J,i,o,x)}:{done:!0,value:w(e,o,i,x)}:{done:!1}}));x(String.prototype,e,tt[0]),x(W,Y,tt[1])}K&&B(W[Y],"sham",!0)}},908:function(e,i,o){var w=o(7332),x=Function.prototype,$=x.apply,O=x.call;e.exports="object"==typeof Reflect&&Reflect.apply||(w?O.bind($):function(){return O.apply($,arguments)})},8992:function(e,i,o){var w=o(3180),x=o(8952),$=o(7332),O=w(w.bind);e.exports=function(e,i){return x(e),void 0===i?e:$?O(e,i):function(){return e.apply(i,arguments)}}},7332:function(e,i,o){var w=o(9957);e.exports=!w((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},8448:function(e,i,o){var w=o(7332),x=Function.prototype.call;e.exports=w?x.bind(x):function(){return x.apply(x,arguments)}},6208:function(e,i,o){var w=o(3476),x=o(5152),$=Function.prototype,O=w&&Object.getOwnPropertyDescriptor,A=x($,"name"),B=A&&"something"===function(){}.name,Q=A&&(!w||w&&O($,"name").configurable);e.exports={EXISTS:A,PROPER:B,CONFIGURABLE:Q}},5288:function(e,i,o){var w=o(1664),x=o(8952);e.exports=function(e,i,o){try{return w(x(Object.getOwnPropertyDescriptor(e,i)[o]))}catch($){}}},3180:function(e,i,o){var w=o(1888),x=o(1664);e.exports=function(e){if("Function"===w(e))return x(e)}},1664:function(e,i,o){var w=o(7332),x=Function.prototype,$=x.call,O=w&&x.bind.bind($,$);e.exports=w?O:function(e){return function(){return $.apply(e,arguments)}}},5232:function(e,i,o){var w=o(6420),x=o(4328);e.exports=function(e,i){return arguments.length<2?(o=w[e],x(o)?o:void 0):w[e]&&w[e][i];var o}},6752:function(e){e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},4504:function(e,i,o){var w=o(8952),x=o(9760);e.exports=function(e,i){var o=e[i];return x(o)?void 0:w(o)}},6420:function(e,i,o){var r=function(e){return e&&e.Math===Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof o.g&&o.g)||r("object"==typeof this&&this)||function(){return this}()||Function("return this")()},5152:function(e,i,o){var w=o(1664),x=o(4356),$=w({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,i){return $(x(e),i)}},2560:function(e){e.exports={}},4168:function(e,i,o){var w=o(5232);e.exports=w("document","documentElement")},9888:function(e,i,o){var w=o(3476),x=o(9957),$=o(8168);e.exports=!w&&!x((function(){return 7!==Object.defineProperty($("div"),"a",{get:function(){return 7}}).a}))},5712:function(e,i,o){var w=o(1664),x=o(9957),$=o(1888),O=Object,A=w("".split);e.exports=x((function(){return!O("z").propertyIsEnumerable(0)}))?function(e){return"String"===$(e)?A(e,""):O(e)}:O},7512:function(e,i,o){var w=o(4328),x=o(1632),$=o(4024);e.exports=function(e,i,o){var O,A;return $&&w(O=i.constructor)&&O!==o&&x(A=O.prototype)&&A!==o.prototype&&$(e,A),e}},9112:function(e,i,o){var w=o(1664),x=o(4328),$=o(3976),O=w(Function.toString);x($.inspectSource)||($.inspectSource=function(e){return O(e)}),e.exports=$.inspectSource},3480:function(e,i,o){var w=o(1632),x=o(3440);e.exports=function(e,i){w(i)&&"cause"in i&&x(e,"cause",i.cause)}},9104:function(e,i,o){var w,x,$,O=o(4288),A=o(6420),B=o(1632),Q=o(3440),W=o(5152),K=o(3976),Y=o(6504),Z=o(2560),X="Object already initialized",J=A.TypeError,tt=A.WeakMap;if(O||K.state){var et=K.state||(K.state=new tt);et.get=et.get,et.has=et.has,et.set=et.set,w=function(e,i){if(et.has(e))throw new J(X);return i.facade=e,et.set(e,i),i},x=function(e){return et.get(e)||{}},$=function(e){return et.has(e)}}else{var nt=Y("state");Z[nt]=!0,w=function(e,i){if(W(e,nt))throw new J(X);return i.facade=e,Q(e,nt,i),i},x=function(e){return W(e,nt)?e[nt]:{}},$=function(e){return W(e,nt)}}e.exports={set:w,get:x,has:$,enforce:function(e){return $(e)?x(e):w(e,{})},getterFor:function(e){return function(i){var o;if(!B(i)||(o=x(i)).type!==e)throw new J("Incompatible receiver, "+e+" required");return o}}}},1432:function(e,i,o){var w=o(1888);e.exports=Array.isArray||function(e){return"Array"===w(e)}},4328:function(e){var i="object"==typeof document&&document.all;e.exports=void 0===i&&void 0!==i?function(e){return"function"==typeof e||e===i}:function(e){return"function"==typeof e}},6072:function(e,i,o){var w=o(1664),x=o(9957),$=o(4328),O=o(4427),A=o(5232),B=o(9112),s=function(){},Q=A("Reflect","construct"),W=/^\s*(?:class|function)\b/,K=w(W.exec),Y=!W.test(s),h=function(e){if(!$(e))return!1;try{return Q(s,[],e),!0}catch(i){return!1}},v=function(e){if(!$(e))return!1;switch(O(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Y||!!K(W,B(e))}catch(i){return!0}};v.sham=!0,e.exports=!Q||x((function(){var e;return h(h.call)||!h(Object)||!h((function(){e=!0}))||e}))?v:h},6704:function(e,i,o){var w=o(9957),x=o(4328),$=/#|\.prototype\./,u=function(e,i){var o=A[O(e)];return o===Q||o!==B&&(x(i)?w(i):!!i)},O=u.normalize=function(e){return String(e).replace($,".").toLowerCase()},A=u.data={},B=u.NATIVE="N",Q=u.POLYFILL="P";e.exports=u},9760:function(e){e.exports=function(e){return null==e}},1632:function(e,i,o){var w=o(4328);e.exports=function(e){return"object"==typeof e?null!==e:w(e)}},2424:function(e,i,o){var w=o(1632);e.exports=function(e){return w(e)||null===e}},7048:function(e){e.exports=!1},7728:function(e,i,o){var w=o(5232),x=o(4328),$=o(7e3),O=o(6536),A=Object;e.exports=O?function(e){return"symbol"==typeof e}:function(e){var i=w("Symbol");return x(i)&&$(i.prototype,A(e))}},3112:function(e,i,o){var w=o(8448),x=o(3951),$=o(4504);e.exports=function(e,i,o){var O,A;x(e);try{if(!(O=$(e,"return"))){if("throw"===i)throw o;return o}O=w(O,e)}catch(B){A=!0,O=B}if("throw"===i)throw o;if(A)throw O;return x(O),o}},9724:function(e,i,o){var w=o(8448),x=o(9368),$=o(3440),O=o(4036),A=o(9972),B=o(9104),Q=o(4504),W=o(336).IteratorPrototype,K=o(3336),Y=o(3112),Z=A("toStringTag"),X="IteratorHelper",J="WrapForValidIterator",tt=B.set,y=function(e){var i=B.getterFor(e?J:X);return O(x(W),{next:function(){var o=i(this);if(e)return o.nextHandler();try{var w=o.done?void 0:o.nextHandler();return K(w,o.done)}catch(x){throw o.done=!0,x}},return:function(){var o=i(this),x=o.iterator;if(o.done=!0,e){var $=Q(x,"return");return $?w($,x):K(void 0,!0)}if(o.inner)try{Y(o.inner.iterator,"normal")}catch(O){return Y(x,"throw",O)}return Y(x,"normal"),K(void 0,!0)}})},et=y(!0),nt=y(!1);$(nt,Z,"Iterator Helper"),e.exports=function(e,i){var n=function(o,w){w?(w.iterator=o.iterator,w.next=o.next):w=o,w.type=i?J:X,w.nextHandler=e,w.counter=0,w.done=!1,tt(this,w)};return n.prototype=i?et:nt,n}},5792:function(e,i,o){var w=o(8448),x=o(8952),$=o(3951),O=o(6752),A=o(9724),B=o(8696),Q=A((function(){var e=this.iterator,i=$(w(this.next,e));if(!(this.done=!!i.done))return B(e,this.mapper,[i.value,this.counter++],!0)}));e.exports=function(e){return $(this),x(e),new Q(O(this),{mapper:e})}},336:function(e,i,o){var w,x,$,O=o(9957),A=o(4328),B=o(1632),Q=o(9368),W=o(7796),K=o(6076),Y=o(9972),Z=o(7048),X=Y("iterator"),J=!1;[].keys&&("next"in($=[].keys())?(x=W(W($)))!==Object.prototype&&(w=x):J=!0),!B(w)||O((function(){var e={};return w[X].call(e)!==e}))?w={}:Z&&(w=Q(w)),A(w[X])||K(w,X,(function(){return this})),e.exports={IteratorPrototype:w,BUGGY_SAFARI_ITERATORS:J}},3556:function(e,i,o){var w=o(7584);e.exports=function(e){return w(e.length)}},5312:function(e,i,o){var w=o(1664),x=o(9957),$=o(4328),O=o(5152),A=o(3476),B=o(6208).CONFIGURABLE,Q=o(9112),W=o(9104),K=W.enforce,Y=W.get,Z=String,X=Object.defineProperty,J=w("".slice),tt=w("".replace),et=w([].join),nt=A&&!x((function(){return 8!==X((function(){}),"length",{value:8}).length})),it=String(String).split("String"),ot=e.exports=function(e,i,o){"Symbol("===J(Z(i),0,7)&&(i="["+tt(Z(i),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),o&&o.getter&&(i="get "+i),o&&o.setter&&(i="set "+i),(!O(e,"name")||B&&e.name!==i)&&(A?X(e,"name",{value:i,configurable:!0}):e.name=i),nt&&o&&O(o,"arity")&&e.length!==o.arity&&X(e,"length",{value:o.arity});try{o&&O(o,"constructor")&&o.constructor?A&&X(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(x){}var w=K(e);return O(w,"source")||(w.source=et(it,"string"==typeof i?i:"")),e};Function.prototype.toString=ot((function(){return $(this)&&Y(this).source||Q(this)}),"toString")},1748:function(e){var i=Math.ceil,o=Math.floor;e.exports=Math.trunc||function(e){var w=+e;return(w>0?o:i)(w)}},8948:function(e,i,o){var w=o(5016);e.exports=function(e,i){return void 0===e?arguments.length<2?"":i:w(e)}},9292:function(e,i,o){var w=o(3476),x=o(1664),$=o(8448),O=o(9957),A=o(1531),B=o(9392),Q=o(8912),W=o(4356),K=o(5712),Y=Object.assign,Z=Object.defineProperty,X=x([].concat);e.exports=!Y||O((function(){if(w&&1!==Y({b:1},Y(Z({},"a",{enumerable:!0,get:function(){Z(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},i={},o=Symbol("assign detection"),x="abcdefghijklmnopqrst";return e[o]=7,x.split("").forEach((function(e){i[e]=e})),7!==Y({},e)[o]||A(Y({},i)).join("")!==x}))?function(e,i){for(var o=W(e),x=arguments.length,O=1,Y=B.f,Z=Q.f;x>O;)for(var J,tt=K(arguments[O++]),et=Y?X(A(tt),Y(tt)):A(tt),nt=et.length,it=0;nt>it;)J=et[it++],w&&!$(Z,tt,J)||(o[J]=tt[J]);return o}:Y},9368:function(e,i,o){var w,x=o(3951),$=o(2056),O=o(8256),A=o(2560),B=o(4168),Q=o(8168),W=o(6504),K="prototype",Y="script",Z=W("IE_PROTO"),h=function(){},v=function(e){return"<"+Y+">"+e+"</"+Y+">"},m=function(e){e.write(v("")),e.close();var i=e.parentWindow.Object;return e=null,i},_y=function(){try{w=new ActiveXObject("htmlfile")}catch($){}var e,i,o;_y="undefined"!=typeof document?document.domain&&w?m(w):(i=Q("iframe"),o="java"+Y+":",i.style.display="none",B.appendChild(i),i.src=String(o),(e=i.contentWindow.document).open(),e.write(v("document.F=Object")),e.close(),e.F):m(w);for(var x=O.length;x--;)delete _y[K][O[x]];return _y()};A[Z]=!0,e.exports=Object.create||function(e,i){var o;return null!==e?(h[K]=x(e),o=new h,h[K]=null,o[Z]=e):o=_y(),void 0===i?o:$.f(o,i)}},2056:function(e,i,o){var w=o(3476),x=o(1576),$=o(8352),O=o(3951),A=o(4096),B=o(1531);i.f=w&&!x?Object.defineProperties:function(e,i){O(e);for(var o,w=A(i),x=B(i),Q=x.length,W=0;Q>W;)$.f(e,o=x[W++],w[o]);return e}},8352:function(e,i,o){var w=o(3476),x=o(9888),$=o(1576),O=o(3951),A=o(88),B=TypeError,Q=Object.defineProperty,W=Object.getOwnPropertyDescriptor,K="enumerable",Y="configurable",Z="writable";i.f=w?$?function(e,i,o){if(O(e),i=A(i),O(o),"function"==typeof e&&"prototype"===i&&"value"in o&&Z in o&&!o[Z]){var w=W(e,i);w&&w[Z]&&(e[i]=o.value,o={configurable:Y in o?o[Y]:w[Y],enumerable:K in o?o[K]:w[K],writable:!1})}return Q(e,i,o)}:Q:function(e,i,o){if(O(e),i=A(i),O(o),x)try{return Q(e,i,o)}catch(w){}if("get"in o||"set"in o)throw new B("Accessors not supported");return"value"in o&&(e[i]=o.value),e}},9444:function(e,i,o){var w=o(3476),x=o(8448),$=o(8912),O=o(9728),A=o(4096),B=o(88),Q=o(5152),W=o(9888),K=Object.getOwnPropertyDescriptor;i.f=w?K:function(e,i){if(e=A(e),i=B(i),W)try{return K(e,i)}catch(o){}if(Q(e,i))return O(!x($.f,e,i),e[i])}},5048:function(e,i,o){var w=o(9008),x=o(8256).concat("length","prototype");i.f=Object.getOwnPropertyNames||function(e){return w(e,x)}},9392:function(e,i){i.f=Object.getOwnPropertySymbols},7796:function(e,i,o){var w=o(5152),x=o(4328),$=o(4356),O=o(6504),A=o(2272),B=O("IE_PROTO"),Q=Object,W=Q.prototype;e.exports=A?Q.getPrototypeOf:function(e){var i=$(e);if(w(i,B))return i[B];var o=i.constructor;return x(o)&&i instanceof o?o.prototype:i instanceof Q?W:null}},7e3:function(e,i,o){var w=o(1664);e.exports=w({}.isPrototypeOf)},9008:function(e,i,o){var w=o(1664),x=o(5152),$=o(4096),O=o(2504).indexOf,A=o(2560),B=w([].push);e.exports=function(e,i){var o,w=$(e),Q=0,W=[];for(o in w)!x(A,o)&&x(w,o)&&B(W,o);for(;i.length>Q;)x(w,o=i[Q++])&&(~O(W,o)||B(W,o));return W}},1531:function(e,i,o){var w=o(9008),x=o(8256);e.exports=Object.keys||function(e){return w(e,x)}},8912:function(e,i){var o={}.propertyIsEnumerable,w=Object.getOwnPropertyDescriptor,x=w&&!o.call({1:2},1);i.f=x?function(e){var i=w(this,e);return!!i&&i.enumerable}:o},4024:function(e,i,o){var w=o(5288),x=o(3951),$=o(2096);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,i=!1,o={};try{(e=w(Object.prototype,"__proto__","set"))(o,[]),i=o instanceof Array}catch(O){}return function(o,w){return x(o),$(w),i?e(o,w):o.__proto__=w,o}}():void 0)},7032:function(e,i,o){var w=o(16),x=o(4427);e.exports=w?{}.toString:function(){return"[object "+x(this)+"]"}},2104:function(e,i,o){var w=o(8448),x=o(4328),$=o(1632),O=TypeError;e.exports=function(e,i){var o,A;if("string"===i&&x(o=e.toString)&&!$(A=w(o,e)))return A;if(x(o=e.valueOf)&&!$(A=w(o,e)))return A;if("string"!==i&&x(o=e.toString)&&!$(A=w(o,e)))return A;throw new O("Can't convert object to primitive value")}},9252:function(e,i,o){var w=o(5232),x=o(1664),$=o(5048),O=o(9392),A=o(3951),B=x([].concat);e.exports=w("Reflect","ownKeys")||function(e){var i=$.f(A(e)),o=O.f;return o?B(i,o(e)):i}},584:function(e,i,o){var w=o(8352).f;e.exports=function(e,i,o){o in e||w(e,o,{configurable:!0,get:function(){return i[o]},set:function(e){i[o]=e}})}},9092:function(e,i,o){var w=o(8448),x=o(3951),$=o(4328),O=o(1888),A=o(7680),B=TypeError;e.exports=function(e,i){var o=e.exec;if($(o)){var Q=w(o,e,i);return null!==Q&&x(Q),Q}if("RegExp"===O(e))return w(A,e,i);throw new B("RegExp#exec called on incompatible receiver")}},7680:function(e,i,o){var w,x,$=o(8448),O=o(1664),A=o(5016),B=o(8872),Q=o(3548),W=o(4696),K=o(9368),Y=o(9104).get,Z=o(8e3),X=o(9124),J=W("native-string-replace",String.prototype.replace),tt=RegExp.prototype.exec,et=tt,nt=O("".charAt),it=O("".indexOf),ot=O("".replace),st=O("".slice),rt=(x=/b*/g,$(tt,w=/a/,"a"),$(tt,x,"a"),0!==w.lastIndex||0!==x.lastIndex),at=Q.BROKEN_CARET,ut=void 0!==/()??/.exec("")[1];(rt||ut||at||Z||X)&&(et=function(e){var i,o,w,x,O,Q,W,Z=this,X=Y(Z),ct=A(e),lt=X.raw;if(lt)return lt.lastIndex=Z.lastIndex,i=$(et,lt,ct),Z.lastIndex=lt.lastIndex,i;var ht=X.groups,dt=at&&Z.sticky,pt=$(B,Z),ft=Z.source,mt=0,gt=ct;if(dt&&(pt=ot(pt,"y",""),-1===it(pt,"g")&&(pt+="g"),gt=st(ct,Z.lastIndex),Z.lastIndex>0&&(!Z.multiline||Z.multiline&&"\n"!==nt(ct,Z.lastIndex-1))&&(ft="(?: "+ft+")",gt=" "+gt,mt++),o=new RegExp("^(?:"+ft+")",pt)),ut&&(o=new RegExp("^"+ft+"$(?!\\s)",pt)),rt&&(w=Z.lastIndex),x=$(tt,dt?o:Z,gt),dt?x?(x.input=st(x.input,mt),x[0]=st(x[0],mt),x.index=Z.lastIndex,Z.lastIndex+=x[0].length):Z.lastIndex=0:rt&&x&&(Z.lastIndex=Z.global?x.index+x[0].length:w),ut&&x&&x.length>1&&$(J,x[0],o,(function(){for(O=1;O<arguments.length-2;O++)void 0===arguments[O]&&(x[O]=void 0)})),x&&ht)for(x.groups=Q=K(null),O=0;O<ht.length;O++)Q[(W=ht[O])[0]]=x[W[1]];return x}),e.exports=et},8872:function(e,i,o){var w=o(3951);e.exports=function(){var e=w(this),i="";return e.hasIndices&&(i+="d"),e.global&&(i+="g"),e.ignoreCase&&(i+="i"),e.multiline&&(i+="m"),e.dotAll&&(i+="s"),e.unicode&&(i+="u"),e.unicodeSets&&(i+="v"),e.sticky&&(i+="y"),i}},3548:function(e,i,o){var w=o(9957),x=o(6420).RegExp,$=w((function(){var e=x("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),O=$||w((function(){return!x("a","y").sticky})),A=$||w((function(){var e=x("^r","gy");return e.lastIndex=2,null!==e.exec("str")}));e.exports={BROKEN_CARET:A,MISSED_STICKY:O,UNSUPPORTED_Y:$}},8e3:function(e,i,o){var w=o(9957),x=o(6420).RegExp;e.exports=w((function(){var e=x(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}))},9124:function(e,i,o){var w=o(9957),x=o(6420).RegExp;e.exports=w((function(){var e=x("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},5436:function(e,i,o){var w=o(9760),x=TypeError;e.exports=function(e){if(w(e))throw new x("Can't call method on "+e);return e}},6504:function(e,i,o){var w=o(4696),x=o(7776),$=w("keys");e.exports=function(e){return $[e]||($[e]=x(e))}},3976:function(e,i,o){var w=o(7048),x=o(6420),$=o(4636),O="__core-js_shared__",A=e.exports=x[O]||$(O,{});(A.versions||(A.versions=[])).push({version:"3.36.0",mode:w?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.36.0/LICENSE",source:"https://github.com/zloirock/core-js"})},4696:function(e,i,o){var w=o(3976);e.exports=function(e,i){return w[e]||(w[e]=i||{})}},9764:function(e,i,o){var w=o(1664),x=o(6180),$=o(5016),O=o(5436),A=w("".charAt),B=w("".charCodeAt),Q=w("".slice),l=function(e){return function(i,o){var w,W,K=$(O(i)),Y=x(o),Z=K.length;return Y<0||Y>=Z?e?"":void 0:(w=B(K,Y))<55296||w>56319||Y+1===Z||(W=B(K,Y+1))<56320||W>57343?e?A(K,Y):w:e?Q(K,Y,Y+2):W-56320+(w-55296<<10)+65536}};e.exports={codeAt:l(!1),charAt:l(!0)}},772:function(e,i,o){var w=o(8504),x=o(9957),$=o(6420).String;e.exports=!!Object.getOwnPropertySymbols&&!x((function(){var e=Symbol("symbol detection");return!$(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&w&&w<41}))},2495:function(e,i,o){var w=o(6180),x=Math.max,$=Math.min;e.exports=function(e,i){var o=w(e);return o<0?x(o+i,0):$(o,i)}},4096:function(e,i,o){var w=o(5712),x=o(5436);e.exports=function(e){return w(x(e))}},6180:function(e,i,o){var w=o(1748);e.exports=function(e){var i=+e;return i!=i||0===i?0:w(i)}},7584:function(e,i,o){var w=o(6180),x=Math.min;e.exports=function(e){var i=w(e);return i>0?x(i,9007199254740991):0}},4356:function(e,i,o){var w=o(5436),x=Object;e.exports=function(e){return x(w(e))}},7024:function(e,i,o){var w=o(8448),x=o(1632),$=o(7728),O=o(4504),A=o(2104),B=o(9972),Q=TypeError,W=B("toPrimitive");e.exports=function(e,i){if(!x(e)||$(e))return e;var o,B=O(e,W);if(B){if(void 0===i&&(i="default"),o=w(B,e,i),!x(o)||$(o))return o;throw new Q("Can't convert object to primitive value")}return void 0===i&&(i="number"),A(e,i)}},88:function(e,i,o){var w=o(7024),x=o(7728);e.exports=function(e){var i=w(e,"string");return x(i)?i:i+""}},16:function(e,i,o){var w={};w[o(9972)("toStringTag")]="z",e.exports="[object z]"===String(w)},5016:function(e,i,o){var w=o(4427),x=String;e.exports=function(e){if("Symbol"===w(e))throw new TypeError("Cannot convert a Symbol value to a string");return x(e)}},36:function(e){var i=String;e.exports=function(e){try{return i(e)}catch(n){return"Object"}}},7776:function(e,i,o){var w=o(1664),x=0,$=Math.random(),O=w(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+O(++x+$,36)}},6536:function(e,i,o){var w=o(772);e.exports=w&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},1576:function(e,i,o){var w=o(3476),x=o(9957);e.exports=w&&x((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},4288:function(e,i,o){var w=o(6420),x=o(4328),$=w.WeakMap;e.exports=x($)&&/native code/.test(String($))},9972:function(e,i,o){var w=o(6420),x=o(4696),$=o(5152),O=o(7776),A=o(772),B=o(6536),Q=w.Symbol,W=x("wks"),K=B?Q.for||Q:Q&&Q.withoutSetter||O;e.exports=function(e){return $(W,e)||(W[e]=A&&$(Q,e)?Q[e]:K("Symbol."+e)),W[e]}},6488:function(e,i,o){var w=o(5232),x=o(5152),$=o(3440),O=o(7e3),A=o(4024),B=o(9968),Q=o(584),W=o(7512),K=o(8948),Y=o(3480),Z=o(3696),X=o(3476),J=o(7048);e.exports=function(e,i,o,tt){var et="stackTraceLimit",nt=tt?2:1,it=e.split("."),ot=it[it.length-1],st=w.apply(null,it);if(st){var rt=st.prototype;if(!J&&x(rt,"cause")&&delete rt.cause,!o)return st;var at=w("Error"),ut=i((function(e,i){var o=K(tt?i:e,void 0),w=tt?new st(e):new st;return void 0!==o&&$(w,"message",o),Z(w,ut,w.stack,2),this&&O(rt,this)&&W(w,this,ut),arguments.length>nt&&Y(w,arguments[nt]),w}));if(ut.prototype=rt,"Error"!==ot?A?A(ut,at):B(ut,at,{name:!0}):X&&et in st&&(Q(ut,st,et),Q(ut,st,"prepareStackTrace")),B(ut,st),!J)try{rt.name!==ot&&$(rt,"name",ot),rt.constructor=ut}catch(ct){}return ut}}},7476:function(e,i,o){var w=o(9160),x=o(9957),$=o(1432),O=o(1632),A=o(4356),B=o(3556),Q=o(4316),W=o(92),K=o(2568),Y=o(953),Z=o(9972),X=o(8504),J=Z("isConcatSpreadable"),tt=X>=51||!x((function(){var e=[];return e[J]=!1,e.concat()[0]!==e})),y=function(e){if(!O(e))return!1;var i=e[J];return void 0!==i?!!i:$(e)};w({target:"Array",proto:!0,arity:1,forced:!tt||!Y("concat")},{concat:function(e){var i,o,w,x,$,O=A(this),Y=K(O,0),Z=0;for(i=-1,w=arguments.length;i<w;i++)if(y($=-1===i?O:arguments[i]))for(x=B($),Q(Z+x),o=0;o<x;o++,Z++)o in $&&W(Y,Z,$[o]);else Q(Z+1),W(Y,Z++,$);return Y.length=Z,Y}})},6932:function(e,i,o){var w=o(9160),x=o(3364).filter;w({target:"Array",proto:!0,forced:!o(953)("filter")},{filter:function(e){return x(this,e,arguments.length>1?arguments[1]:void 0)}})},700:function(e,i,o){var w=o(9160),x=o(1664),$=o(5712),O=o(4096),A=o(1496),B=x([].join);w({target:"Array",proto:!0,forced:$!==Object||!A("join",",")},{join:function(e){return B(O(this),void 0===e?",":e)}})},4456:function(e,i,o){var w=o(9160),x=o(3364).map;w({target:"Array",proto:!0,forced:!o(953)("map")},{map:function(e){return x(this,e,arguments.length>1?arguments[1]:void 0)}})},4728:function(e,i,o){var w=o(9160),x=o(4356),$=o(3556),O=o(6728),A=o(4316);w({target:"Array",proto:!0,arity:1,forced:o(9957)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var i=x(this),o=$(i),w=arguments.length;A(o+w);for(var B=0;B<w;B++)i[o]=arguments[B],o++;return O(i,o),o}})},8752:function(e,i,o){var w=o(9160),x=o(6420),$=o(908),O=o(6488),A="WebAssembly",B=x[A],Q=7!==new Error("e",{cause:7}).cause,l=function(e,i){var o={};o[e]=O(e,i,Q),w({global:!0,constructor:!0,arity:1,forced:Q},o)},f=function(e,i){if(B&&B[e]){var o={};o[e]=O(A+"."+e,i,Q),w({target:A,stat:!0,constructor:!0,arity:1,forced:Q},o)}};l("Error",(function(e){return function(i){return $(e,this,arguments)}})),l("EvalError",(function(e){return function(i){return $(e,this,arguments)}})),l("RangeError",(function(e){return function(i){return $(e,this,arguments)}})),l("ReferenceError",(function(e){return function(i){return $(e,this,arguments)}})),l("SyntaxError",(function(e){return function(i){return $(e,this,arguments)}})),l("TypeError",(function(e){return function(i){return $(e,this,arguments)}})),l("URIError",(function(e){return function(i){return $(e,this,arguments)}})),f("CompileError",(function(e){return function(i){return $(e,this,arguments)}})),f("LinkError",(function(e){return function(i){return $(e,this,arguments)}})),f("RuntimeError",(function(e){return function(i){return $(e,this,arguments)}}))},508:function(e,i,o){var w=o(3476),x=o(6208).EXISTS,$=o(1664),O=o(2544),A=Function.prototype,B=$(A.toString),Q=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,W=$(Q.exec);w&&!x&&O(A,"name",{configurable:!0,get:function(){try{return W(Q,B(this))[1]}catch(e){return""}}})},232:function(e,i,o){var w=o(9160),x=o(9292);w({target:"Object",stat:!0,arity:2,forced:Object.assign!==x},{assign:x})},5443:function(e,i,o){var w=o(16),x=o(6076),$=o(7032);w||x(Object.prototype,"toString",$,{unsafe:!0})},880:function(e,i,o){var w=o(9160),x=o(7680);w({target:"RegExp",proto:!0,forced:/./.exec!==x},{exec:x})},9836:function(e,i,o){var w=o(8448),x=o(7176),$=o(3951),O=o(9760),A=o(7584),B=o(5016),Q=o(5436),W=o(4504),K=o(4764),Y=o(9092);x("match",(function(e,i,o){return[function(i){var o=Q(this),x=O(i)?void 0:W(i,e);return x?w(x,i,o):new RegExp(i)[e](B(o))},function(e){var w=$(this),x=B(e),O=o(i,w,x);if(O.done)return O.value;if(!w.global)return Y(w,x);var Q=w.unicode;w.lastIndex=0;for(var W,Z=[],X=0;null!==(W=Y(w,x));){var J=B(W[0]);Z[X]=J,""===J&&(w.lastIndex=K(x,A(w.lastIndex),Q)),X++}return 0===X?null:Z}]}))},3536:function(e,i,o){var w=o(9160),x=o(6420),$=o(6100),O=o(3951),A=o(4328),B=o(7796),Q=o(2544),W=o(92),K=o(9957),Y=o(5152),Z=o(9972),X=o(336).IteratorPrototype,J=o(3476),tt=o(7048),et="constructor",nt="Iterator",it=Z("toStringTag"),ot=TypeError,st=x[nt],rt=tt||!A(st)||st.prototype!==X||!K((function(){st({})})),_=function(){if($(this,X),B(this)===X)throw new ot("Abstract class Iterator not directly constructable")},S=function(e,i){J?Q(X,e,{configurable:!0,get:function(){return i},set:function(i){if(O(this),this===X)throw new ot("You can't redefine this property");Y(this,e)?this[e]=i:W(this,e,i)}}):X[e]=i};Y(X,it)||S(it,nt),!rt&&Y(X,et)&&X[et]!==Object||S(et,_),_.prototype=X,w({global:!0,constructor:!0,forced:rt},{Iterator:_})},2144:function(e,i,o){var w=o(9160),x=o(8448),$=o(8952),O=o(3951),A=o(6752),B=o(9724),Q=o(8696),W=o(7048),K=B((function(){for(var e,i,o=this.iterator,w=this.predicate,$=this.next;;){if(e=O(x($,o)),this.done=!!e.done)return;if(i=e.value,Q(o,w,[i,this.counter++],!0))return i}}));w({target:"Iterator",proto:!0,real:!0,forced:W},{filter:function(e){return O(this),$(e),new K(A(this),{predicate:e})}})},9080:function(e,i,o){var w=o(9160),x=o(5792);w({target:"Iterator",proto:!0,real:!0,forced:o(7048)},{map:x})}},i={};function n(o){var w=i[o];if(void 0!==w)return w.exports;var x=i[o]={exports:{}};return e[o].call(x.exports,x,x.exports,n),x.exports}n.d=function(e,i){for(var o in i)n.o(i,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:i[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,i){return Object.prototype.hasOwnProperty.call(e,i)};var o={};return function(){n.d(o,{default:function(){return J}}),n(8752),n(6932),n(4456),n(508),n(232),n(5443),n(3536),n(2144),n(9080);var t=function(){},e={},i=[],w=[];function u(o,x){var $,O,A,B,Q=w;for(B=arguments.length;B-- >2;)i.push(arguments[B]);for(x&&null!=x.children&&(i.length||i.push(x.children),delete x.children);i.length;)if((O=i.pop())&&void 0!==O.pop)for(B=O.length;B--;)i.push(O[B]);else"boolean"==typeof O&&(O=null),(A="function"!=typeof o)&&(null==O?O="":"number"==typeof O?O=String(O):"string"!=typeof O&&(A=!1)),A&&$?Q[Q.length-1]+=O:Q===w?Q=[O]:Q.push(O),$=A;var W=new t;return W.nodeName=o,W.children=Q,W.attributes=null==x?void 0:x,W.key=null==x?void 0:x.key,void 0!==e.vnode&&e.vnode(W),W}function a(e,i){for(var o in i)e[o]=i[o];return e}function c(e,i){e&&("function"==typeof e?e(i):e.current=i)}var x="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,$=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,O=[];function p(i){!i._dirty&&(i._dirty=!0)&&1==O.push(i)&&(e.debounceRendering||x)(d)}function d(){for(var e;e=O.pop();)e._dirty&&T(e)}function h(e,i,o){return"string"==typeof i||"number"==typeof i?void 0!==e.splitText:"string"==typeof i.nodeName?!e._componentConstructor&&v(e,i.nodeName):o||e._componentConstructor===i.nodeName}function v(e,i){return e.normalizedNodeName===i||e.nodeName.toLowerCase()===i.toLowerCase()}function m(e){var i=a({},e.attributes);i.children=e.children;var o=e.nodeName.defaultProps;if(void 0!==o)for(var w in o)void 0===i[w]&&(i[w]=o[w]);return i}function y(e){var i=e.parentNode;i&&i.removeChild(e)}function g(e,i,o,w,O){if("className"===i&&(i="class"),"key"===i);else if("ref"===i)c(o,null),c(w,e);else if("class"!==i||O)if("style"===i){if(w&&"string"!=typeof w&&"string"!=typeof o||(e.style.cssText=w||""),w&&"object"==typeof w){if("string"!=typeof o)for(var A in o)A in w||(e.style[A]="");for(var A in w)e.style[A]="number"==typeof w[A]&&!1===$.test(A)?w[A]+"px":w[A]}}else if("dangerouslySetInnerHTML"===i)w&&(e.innerHTML=w.__html||"");else if("o"==i[0]&&"n"==i[1]){var B=i!==(i=i.replace(/Capture$/,""));i=i.toLowerCase().substring(2),w?o||e.addEventListener(i,b,B):e.removeEventListener(i,b,B),(e._listeners||(e._listeners={}))[i]=w}else if("list"!==i&&"type"!==i&&!O&&i in e){try{e[i]=null==w?"":w}catch(x){}null!=w&&!1!==w||"spellcheck"==i||e.removeAttribute(i)}else{var Q=O&&i!==(i=i.replace(/^xlink:?/,""));null==w||!1===w?Q?e.removeAttributeNS("http://www.w3.org/1999/xlink",i.toLowerCase()):e.removeAttribute(i):"function"!=typeof w&&(Q?e.setAttributeNS("http://www.w3.org/1999/xlink",i.toLowerCase(),w):e.setAttribute(i,w))}else e.className=w||""}function b(i){return this._listeners[i.type](e.event&&e.event(i)||i)}var A=[],B=0,Q=!1,W=!1;function S(){for(var i;i=A.shift();)e.afterMount&&e.afterMount(i),i.componentDidMount&&i.componentDidMount()}function C(e,i,o,w,x,$){B++||(Q=null!=x&&void 0!==x.ownerSVGElement,W=null!=e&&!("__preactattr_"in e));var O=E(e,i,o,w,$);return x&&O.parentNode!==x&&x.appendChild(O),--B||(W=!1,$||S()),O}function E(e,i,o,w,x){var $=e,O=Q;if(null!=i&&"boolean"!=typeof i||(i=""),"string"==typeof i||"number"==typeof i)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||x)?e.nodeValue!=i&&(e.nodeValue=i):($=document.createTextNode(i),e&&(e.parentNode&&e.parentNode.replaceChild($,e),I(e,!0))),$.__preactattr_=!0,$;var A,B,K=i.nodeName;if("function"==typeof K)return function(e,i,o,w){for(var x=e&&e._component,$=x,O=e,A=x&&e._componentConstructor===i.nodeName,B=A,Q=m(i);x&&!B&&(x=x._parentComponent);)B=x.constructor===i.nodeName;return x&&B&&(!w||x._component)?(k(x,Q,3,o,w),e=x.base):($&&!A&&(R($),e=O=null),x=P(i.nodeName,Q,o),e&&!x.nextBase&&(x.nextBase=e,O=null),k(x,Q,1,o,w),e=x.base,O&&e!==O&&(O._component=null,I(O,!1))),e}(e,i,o,w);if(Q="svg"===K||"foreignObject"!==K&&Q,K=String(K),(!e||!v(e,K))&&(A=K,(B=Q?document.createElementNS("http://www.w3.org/2000/svg",A):document.createElement(A)).normalizedNodeName=A,$=B,e)){for(;e.firstChild;)$.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild($,e),I(e,!0)}var Y=$.firstChild,Z=$.__preactattr_,X=i.children;if(null==Z){Z=$.__preactattr_={};for(var J=$.attributes,tt=J.length;tt--;)Z[J[tt].name]=J[tt].value}return!W&&X&&1===X.length&&"string"==typeof X[0]&&null!=Y&&void 0!==Y.splitText&&null==Y.nextSibling?Y.nodeValue!=X[0]&&(Y.nodeValue=X[0]):(X&&X.length||null!=Y)&&function(e,i,o,w,x){var $,O,A,B,Q,W=e.childNodes,K=[],Y={},Z=0,X=0,J=W.length,tt=0,et=i?i.length:0;if(0!==J)for(var nt=0;nt<J;nt++){var it=W[nt],ot=it.__preactattr_;null!=(st=et&&ot?it._component?it._component.__key:ot.key:null)?(Z++,Y[st]=it):(ot||(void 0!==it.splitText?!x||it.nodeValue.trim():x))&&(K[tt++]=it)}if(0!==et)for(nt=0;nt<et;nt++){var st;if(Q=null,null!=(st=(B=i[nt]).key))Z&&void 0!==Y[st]&&(Q=Y[st],Y[st]=void 0,Z--);else if(X<tt)for($=X;$<tt;$++)if(void 0!==K[$]&&h(O=K[$],B,x)){Q=O,K[$]=void 0,$===tt-1&&tt--,$===X&&X++;break}Q=E(Q,B,o,w),A=W[nt],Q&&Q!==e&&Q!==A&&(null==A?e.appendChild(Q):Q===A.nextSibling?y(A):e.insertBefore(Q,A))}if(Z)for(var nt in Y)void 0!==Y[nt]&&I(Y[nt],!1);for(;X<=tt;)void 0!==(Q=K[tt--])&&I(Q,!1)}($,X,o,w,W||null!=Z.dangerouslySetInnerHTML),function(e,i,o){var w;for(w in o)i&&null!=i[w]||null==o[w]||g(e,w,o[w],o[w]=void 0,Q);for(w in i)"children"===w||"innerHTML"===w||w in o&&i[w]===("value"===w||"checked"===w?e[w]:o[w])||g(e,w,o[w],o[w]=i[w],Q)}($,i.attributes,Z),Q=O,$}function I(e,i){var o=e._component;o?R(o):(null!=e.__preactattr_&&c(e.__preactattr_.ref,null),!1!==i&&null!=e.__preactattr_||y(e),j(e))}function j(e){for(e=e.lastChild;e;){var i=e.previousSibling;I(e,!0),e=i}}var K=[];function P(e,i,o){var w,x=K.length;for(e.prototype&&e.prototype.render?(w=new e(i,o),M.call(w,i,o)):((w=new M(i,o)).constructor=e,w.render=N);x--;)if(K[x].constructor===e)return w.nextBase=K[x].nextBase,K.splice(x,1),w;return w}function N(e,i,o){return this.constructor(e,o)}function k(i,o,w,x,$){i._disable||(i._disable=!0,i.__ref=o.ref,i.__key=o.key,delete o.ref,delete o.key,void 0===i.constructor.getDerivedStateFromProps&&(!i.base||$?i.componentWillMount&&i.componentWillMount():i.componentWillReceiveProps&&i.componentWillReceiveProps(o,x)),x&&x!==i.context&&(i.prevContext||(i.prevContext=i.context),i.context=x),i.prevProps||(i.prevProps=i.props),i.props=o,i._disable=!1,0!==w&&(1!==w&&!1===e.syncComponentUpdates&&i.base?p(i):T(i,1,$)),c(i.__ref,i))}function T(i,o,w,x){if(!i._disable){var $,O,Q,W=i.props,K=i.state,Y=i.context,Z=i.prevProps||W,X=i.prevState||K,J=i.prevContext||Y,tt=i.base,et=i.nextBase,nt=tt||et,it=i._component,ot=!1,st=J;if(i.constructor.getDerivedStateFromProps&&(K=a(a({},K),i.constructor.getDerivedStateFromProps(W,K)),i.state=K),tt&&(i.props=Z,i.state=X,i.context=J,2!==o&&i.shouldComponentUpdate&&!1===i.shouldComponentUpdate(W,K,Y)?ot=!0:i.componentWillUpdate&&i.componentWillUpdate(W,K,Y),i.props=W,i.state=K,i.context=Y),i.prevProps=i.prevState=i.prevContext=i.nextBase=null,i._dirty=!1,!ot){$=i.render(W,K,Y),i.getChildContext&&(Y=a(a({},Y),i.getChildContext())),tt&&i.getSnapshotBeforeUpdate&&(st=i.getSnapshotBeforeUpdate(Z,X));var rt,at,ut=$&&$.nodeName;if("function"==typeof ut){var ct=m($);(O=it)&&O.constructor===ut&&ct.key==O.__key?k(O,ct,1,Y,!1):(rt=O,i._component=O=P(ut,ct,Y),O.nextBase=O.nextBase||et,O._parentComponent=i,k(O,ct,0,Y,!1),T(O,1,w,!0)),at=O.base}else Q=nt,(rt=it)&&(Q=i._component=null),(nt||1===o)&&(Q&&(Q._component=null),at=C(Q,$,Y,w||!tt,nt&&nt.parentNode,!0));if(nt&&at!==nt&&O!==it){var lt=nt.parentNode;lt&&at!==lt&&(lt.replaceChild(at,nt),rt||(nt._component=null,I(nt,!1)))}if(rt&&R(rt),i.base=at,at&&!x){for(var ht=i,dt=i;dt=dt._parentComponent;)(ht=dt).base=at;at._component=ht,at._componentConstructor=ht.constructor}}for(!tt||w?A.push(i):ot||(i.componentDidUpdate&&i.componentDidUpdate(Z,X,st),e.afterUpdate&&e.afterUpdate(i));i._renderCallbacks.length;)i._renderCallbacks.pop().call(i);B||x||S()}}function R(i){e.beforeUnmount&&e.beforeUnmount(i);var o=i.base;i._disable=!0,i.componentWillUnmount&&i.componentWillUnmount(),i.base=null;var w=i._component;w?R(w):o&&(null!=o.__preactattr_&&c(o.__preactattr_.ref,null),i.nextBase=o,y(o),K.push(i),j(o)),c(i.__ref,null)}function M(e,i){this._dirty=!0,this.context=i,this.props=e,this.state=this.state||{},this._renderCallbacks=[]}function L(e,i,o){return C(o,e,{},!1,i,!1)}function D(e,i){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,i){return e.__proto__=i,e},D(e,i)}a(M.prototype,{setState:function(e,i){this.prevState||(this.prevState=this.state),this.state=a(a({},this.state),"function"==typeof e?e(this.state,this.props):e),i&&this._renderCallbacks.push(i),p(this)},forceUpdate:function(e){e&&this._renderCallbacks.push(e),T(this,2)},render:function(){}}),n(700),n(4728),n(880),n(9836),n(7476);var Y=function(e){var i,o;function r(){for(var i,o=arguments.length,w=new Array(o),x=0;x<o;x++)w[x]=arguments[x];return(i=e.call.apply(e,[this].concat(w))||this).state={bump:!1,debounced:!1},i}o=e,(i=r).prototype=Object.create(o.prototype),i.prototype.constructor=i,D(i,o);var w=r.prototype;return w.componentWillMount=function(){var e,i,o,w=this;this.debounceStatusUpdate=(e=function(){if(!w.state.debounced){var e=!w.props.isInFocus||w.props.validChoiceMade;w.setState((function(i){return{bump:!i.bump,debounced:!0,silenced:e}}))}},i=1400,function(){var w=this,x=arguments;clearTimeout(o),o=setTimeout((function(){o=null,e.apply(w,x)}),i)})},w.componentWillReceiveProps=function(e){e.queryLength,this.setState({debounced:!1})},w.render=function(){var e=this.props,i=e.id,o=e.length,w=e.queryLength,x=e.minQueryLength,$=e.selectedOption,O=e.selectedOptionIndex,A=e.tQueryTooShort,B=e.tNoResults,Q=e.tSelectedOption,W=e.tResults,K=e.className,Y=this.state,Z=Y.bump,X=Y.debounced,J=Y.silenced,tt=w<x,et=0===o,nt=$?Q($,o,O):"",it=null;return it=tt?A(x):et?B():W(o,nt),this.debounceStatusUpdate(),u("div",{className:K,style:{border:"0",clip:"rect(0 0 0 0)",height:"1px",marginBottom:"-1px",marginRight:"-1px",overflow:"hidden",padding:"0",position:"absolute",whiteSpace:"nowrap",width:"1px"}},u("div",{id:i+"__status--A",role:"status","aria-atomic":"true","aria-live":"polite"},!J&&X&&Z?it:""),u("div",{id:i+"__status--B",role:"status","aria-atomic":"true","aria-live":"polite"},J||!X||Z?"":it))},r}(M);Y.defaultProps={tQueryTooShort:function(e){return"Type in "+e+" or more characters for results"},tNoResults:function(){return"No search results"},tSelectedOption:function(e,i,o){return e+" "+(o+1)+" of "+i+" is highlighted"},tResults:function(e,i){return e+" "+(1===e?"result":"results")+" "+(1===e?"is":"are")+" available. "+i}};var F=function(e){return u("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",className:e.className,focusable:"false"},u("g",{stroke:"none",fill:"none","fill-rule":"evenodd"},u("polygon",{fill:"#000000",points:"0 0 22 0 11 17"})))};function U(){return U=Object.assign?Object.assign.bind():function(e){for(var i=1;i<arguments.length;i++){var o=arguments[i];for(var w in o)Object.prototype.hasOwnProperty.call(o,w)&&(e[w]=o[w])}return e},U.apply(this,arguments)}function V(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function q(e,i){return q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,i){return e.__proto__=i,e},q(e,i)}var Z={13:"enter",27:"escape",32:"space",38:"up",40:"down"};function H(){return"undefined"!=typeof navigator&&!(!navigator.userAgent.match(/(iPod|iPhone|iPad)/g)||!navigator.userAgent.match(/AppleWebKit/g))}var X=function(e){var i,o;function r(i){var o;return(o=e.call(this,i)||this).elementReferences={},o.state={focused:null,hovered:null,menuOpen:!1,options:i.defaultValue?[i.defaultValue]:[],query:i.defaultValue,validChoiceMade:!1,selected:null,ariaHint:!0},o.handleComponentBlur=o.handleComponentBlur.bind(V(o)),o.handleKeyDown=o.handleKeyDown.bind(V(o)),o.handleUpArrow=o.handleUpArrow.bind(V(o)),o.handleDownArrow=o.handleDownArrow.bind(V(o)),o.handleEnter=o.handleEnter.bind(V(o)),o.handlePrintableKey=o.handlePrintableKey.bind(V(o)),o.handleListMouseLeave=o.handleListMouseLeave.bind(V(o)),o.handleOptionBlur=o.handleOptionBlur.bind(V(o)),o.handleOptionClick=o.handleOptionClick.bind(V(o)),o.handleOptionFocus=o.handleOptionFocus.bind(V(o)),o.handleOptionMouseDown=o.handleOptionMouseDown.bind(V(o)),o.handleOptionMouseEnter=o.handleOptionMouseEnter.bind(V(o)),o.handleInputBlur=o.handleInputBlur.bind(V(o)),o.handleInputChange=o.handleInputChange.bind(V(o)),o.handleInputClick=o.handleInputClick.bind(V(o)),o.handleInputFocus=o.handleInputFocus.bind(V(o)),o.pollInputElement=o.pollInputElement.bind(V(o)),o.getDirectInputChanges=o.getDirectInputChanges.bind(V(o)),o}o=e,(i=r).prototype=Object.create(o.prototype),i.prototype.constructor=i,q(i,o);var w=r.prototype;return w.isQueryAnOption=function(e,i){var o=this;return-1!==i.map((function(e){return o.templateInputValue(e).toLowerCase()})).indexOf(e.toLowerCase())},w.componentDidMount=function(){this.pollInputElement()},w.componentWillUnmount=function(){clearTimeout(this.$pollInput)},w.pollInputElement=function(){var e=this;this.getDirectInputChanges(),this.$pollInput=setTimeout((function(){e.pollInputElement()}),100)},w.getDirectInputChanges=function(){var e=this.elementReferences[-1];e&&e.value!==this.state.query&&this.handleInputChange({target:{value:e.value}})},w.componentDidUpdate=function(e,i){var o=this.state.focused,w=null===o,x=i.focused!==o;x&&!w&&this.elementReferences[o].focus();var $=-1===o,O=x&&null===i.focused;if($&&O){var A=this.elementReferences[o];A.setSelectionRange(0,A.value.length)}},w.hasAutoselect=function(){return!H()&&this.props.autoselect},w.templateInputValue=function(e){var i=this.props.templates&&this.props.templates.inputValue;return i?i(e):e},w.templateSuggestion=function(e){var i=this.props.templates&&this.props.templates.suggestion;return i?i(e):e},w.handleComponentBlur=function(e){var i,o=this.state,w=o.options,x=o.query,$=o.selected;this.props.confirmOnBlur?(i=e.query||x,this.props.onConfirm(w[$])):i=x,this.setState({focused:null,menuOpen:e.menuOpen||!1,query:i,selected:null,validChoiceMade:this.isQueryAnOption(i,w)})},w.handleListMouseLeave=function(e){this.setState({hovered:null})},w.handleOptionBlur=function(e,i){var o=this.state,w=o.focused,x=o.menuOpen,$=o.options,O=o.selected,A=null===e.relatedTarget,B=e.relatedTarget===this.elementReferences[-1],Q=w!==i&&-1!==w;if(!Q&&A||!Q&&!B){var W=x&&H();this.handleComponentBlur({menuOpen:W,query:this.templateInputValue($[O])})}},w.handleInputBlur=function(e){var i=this.state,o=i.focused,w=i.menuOpen,x=i.options,$=i.query,O=i.selected;if(-1===o){var A=w&&H(),B=H()?$:this.templateInputValue(x[O]);this.handleComponentBlur({menuOpen:A,query:B})}},w.handleInputChange=function(e){var i=this,o=this.props,w=o.minLength,x=o.source,$=o.showAllValues,O=this.hasAutoselect(),A=e.target.value,B=0===A.length,Q=this.state.query!==A,W=A.length>=w;this.setState({query:A,ariaHint:B}),$||!B&&Q&&W?x(A,(function(e){var o=e.length>0;i.setState({menuOpen:o,options:e,selected:O&&o?0:-1,validChoiceMade:!1})})):!B&&W||this.setState({menuOpen:!1,options:[]})},w.handleInputClick=function(e){this.handleInputChange(e)},w.handleInputFocus=function(e){var i=this.state,o=i.query,w=i.validChoiceMade,x=i.options,$=this.props.minLength,O=!w&&o.length>=$&&x.length>0;O?this.setState((function(e){var i=e.menuOpen;return{focused:-1,menuOpen:O||i,selected:-1}})):this.setState({focused:-1})},w.handleOptionFocus=function(e){this.setState({focused:e,hovered:null,selected:e})},w.handleOptionMouseEnter=function(e,i){H()||this.setState({hovered:i})},w.handleOptionClick=function(e,i){var o=this.state.options[i],w=this.templateInputValue(o);this.props.onConfirm(o),this.setState({focused:-1,hovered:null,menuOpen:!1,query:w,selected:-1,validChoiceMade:!0}),this.forceUpdate()},w.handleOptionMouseDown=function(e){e.preventDefault()},w.handleUpArrow=function(e){e.preventDefault();var i=this.state,o=i.menuOpen,w=i.selected;-1!==w&&o&&this.handleOptionFocus(w-1)},w.handleDownArrow=function(e){var i=this;if(e.preventDefault(),this.props.showAllValues&&!1===this.state.menuOpen)e.preventDefault(),this.props.source("",(function(e){i.setState({menuOpen:!0,options:e,selected:0,focused:0,hovered:null})}));else if(!0===this.state.menuOpen){var o=this.state,w=o.menuOpen,x=o.options,$=o.selected;$!==x.length-1&&w&&this.handleOptionFocus($+1)}},w.handleSpace=function(e){var i=this;this.props.showAllValues&&!1===this.state.menuOpen&&""===this.state.query&&(e.preventDefault(),this.props.source("",(function(e){i.setState({menuOpen:!0,options:e})}))),-1!==this.state.focused&&(e.preventDefault(),this.handleOptionClick(e,this.state.focused))},w.handleEnter=function(e){this.state.menuOpen&&(e.preventDefault(),this.state.selected>=0&&this.handleOptionClick(e,this.state.selected))},w.handlePrintableKey=function(e){var i=this.elementReferences[-1];e.target===i||i.focus()},w.handleKeyDown=function(e){switch(Z[e.keyCode]){case"up":this.handleUpArrow(e);break;case"down":this.handleDownArrow(e);break;case"space":this.handleSpace(e);break;case"enter":this.handleEnter(e);break;case"escape":this.handleComponentBlur({query:this.state.query});break;default:((i=e.keyCode)>47&&i<58||32===i||8===i||i>64&&i<91||i>95&&i<112||i>185&&i<193||i>218&&i<223)&&this.handlePrintableKey(e)}var i},w.render=function(){var e,i=this,o=this.props,w=o.cssNamespace,x=o.displayMenu,$=o.id,O=o.minLength,A=o.name,B=o.placeholder,Q=o.required,W=o.showAllValues,K=o.tNoResults,Z=o.tStatusQueryTooShort,X=o.tStatusNoResults,J=o.tStatusSelectedOption,tt=o.tStatusResults,et=o.tAssistiveHint,nt=o.dropdownArrow,it=o.menuAttributes,ot=o.inputClasses,st=o.hintClasses,rt=o.menuClasses,at=this.state,ut=at.focused,ct=at.hovered,lt=at.menuOpen,ht=at.options,dt=at.query,pt=at.selected,ft=at.ariaHint,mt=at.validChoiceMade,gt=this.hasAutoselect(),vt=-1===ut,bt=0===ht.length,yt=0!==dt.length,wt=dt.length>=O,xt=this.props.showNoOptionsFound&&vt&&bt&&yt&&wt,$t=w+"__wrapper",Ct=w+"__status",kt=w+"__dropdown-arrow-down",St=-1!==ut&&null!==ut,Lt=w+"__option",_t=w+"__hint",It=this.templateInputValue(ht[pt]),Tt=It&&0===It.toLowerCase().indexOf(dt.toLowerCase())&&gt?dt+It.substr(dt.length):"",Rt=$+"__assistiveHint",Ot={"aria-describedby":ft?Rt:null,"aria-expanded":lt?"true":"false","aria-activedescendant":St?$+"__option--"+ut:null,"aria-controls":$+"__listbox","aria-autocomplete":this.hasAutoselect()?"both":"list"};W&&"string"==typeof(e=nt({className:kt}))&&(e=u("div",{className:w+"__dropdown-arrow-down-wrapper",dangerouslySetInnerHTML:{__html:e}}));var Et=w+"__input",At=[Et,this.props.showAllValues?Et+"--show-all-values":Et+"--default"];null!==ut&&At.push(Et+"--focused"),ot&&At.push(ot);var Bt=w+"__menu",Nt=[Bt,Bt+"--"+x,Bt+"--"+(lt||xt?"visible":"hidden")];rt&&Nt.push(rt),(null!=it&&it.class||null!=it&&it.className)&&Nt.push((null==it?void 0:it.class)||(null==it?void 0:it.className));var jt=Object.assign({"aria-labelledby":$},it,{id:$+"__listbox",role:"listbox",className:Nt.join(" "),onMouseLeave:this.handleListMouseLeave});return delete jt.class,u("div",{className:$t,onKeyDown:this.handleKeyDown},u(Y,{id:$,length:ht.length,queryLength:dt.length,minQueryLength:O,selectedOption:this.templateInputValue(ht[pt]),selectedOptionIndex:pt,validChoiceMade:mt,isInFocus:null!==this.state.focused,tQueryTooShort:Z,tNoResults:X,tSelectedOption:J,tResults:tt,className:Ct}),Tt&&u("span",null,u("input",{className:[_t,null===st?ot:st].filter(Boolean).join(" "),readonly:!0,tabIndex:"-1",value:Tt})),u("input",U({},Ot,{autoComplete:"off",className:At.join(" "),id:$,onClick:this.handleInputClick,onBlur:this.handleInputBlur},{onInput:this.handleInputChange},{onFocus:this.handleInputFocus,name:A,placeholder:B,ref:function(e){i.elementReferences[-1]=e},type:"text",role:"combobox",required:Q,value:dt})),e,u("ul",jt,ht.map((function(e,o){var w=(-1===ut?pt===o:ut===o)&&null===ct?" "+Lt+"--focused":"",x=o%2?" "+Lt+"--odd":"",O=H()?"<span id="+$+"__option-suffix--"+o+' style="border:0;clip:rect(0 0 0 0);height:1px;marginBottom:-1px;marginRight:-1px;overflow:hidden;padding:0;position:absolute;whiteSpace:nowrap;width:1px"> '+(o+1)+" of "+ht.length+"</span>":"";return u("li",{"aria-selected":ut===o?"true":"false",className:""+Lt+w+x,dangerouslySetInnerHTML:{__html:i.templateSuggestion(e)+O},id:$+"__option--"+o,key:o,onBlur:function(e){return i.handleOptionBlur(e,o)},onClick:function(e){return i.handleOptionClick(e,o)},onMouseDown:i.handleOptionMouseDown,onMouseEnter:function(e){return i.handleOptionMouseEnter(e,o)},ref:function(e){i.elementReferences[o]=e},role:"option",tabIndex:"-1","aria-posinset":o+1,"aria-setsize":ht.length})})),xt&&u("li",{className:Lt+" "+Lt+"--no-results",role:"option","aria-disabled":"true"},K())),u("span",{id:Rt,style:{display:"none"}},et()))},r}(M);function z(e){if(!e.element)throw new Error("element is not defined");if(!e.id)throw new Error("id is not defined");if(!e.source)throw new Error("source is not defined");Array.isArray(e.source)&&(e.source=G(e.source)),L(u(X,e),e.element)}X.defaultProps={autoselect:!1,cssNamespace:"autocomplete",defaultValue:"",displayMenu:"inline",minLength:0,name:"input-autocomplete",placeholder:"",onConfirm:function(){},confirmOnBlur:!0,showNoOptionsFound:!0,showAllValues:!1,required:!1,tNoResults:function(){return"No results found"},tAssistiveHint:function(){return"When autocomplete results are available use up and down arrows to review and enter to select.  Touch device users, explore by touch or with swipe gestures."},dropdownArrow:F,menuAttributes:{},inputClasses:null,hintClasses:null,menuClasses:null};var G=function(e){return function(i,o){o(e.filter((function(e){return-1!==e.toLowerCase().indexOf(i.toLowerCase())})))}};z.enhanceSelectElement=function(e){if(!e.selectElement)throw new Error("selectElement is not defined");if(!e.source){var i=[].filter.call(e.selectElement.options,(function(i){return i.value||e.preserveNullOptions}));e.source=i.map((function(e){return e.textContent||e.innerText}))}if(e.onConfirm=e.onConfirm||function(i){var o=[].filter.call(e.selectElement.options,(function(e){return(e.textContent||e.innerText)===i}))[0];o&&(o.selected=!0)},e.selectElement.value||void 0===e.defaultValue){var o=e.selectElement.options[e.selectElement.options.selectedIndex];e.defaultValue=o.textContent||o.innerText}void 0===e.name&&(e.name=""),void 0===e.id&&(void 0===e.selectElement.id?e.id="":e.id=e.selectElement.id),void 0===e.autoselect&&(e.autoselect=!0);var w=document.createElement("div");e.selectElement.parentNode.insertBefore(w,e.selectElement),z(Object.assign({},e,{element:w})),e.selectElement.style.display="none",e.selectElement.id=e.selectElement.id+"-select"};var J=z}(),o.default}()),et.exports));class SelectCountryFromForm{static moduleName="dm-select-country-from-form";$module;constructor(e){this.$module=e}init(){nt.enhanceSelectElement({selectElement:this.$module.get(0)})}}const createAll=e=>{$(`[data-module="${e.moduleName}"]`).each(((i,o)=>{new e($(o)).init()}))},initAll=()=>{[ComplianceCommunicationAttachments,CookieSettings,CookieBanner,ListInput,OptionSelect,OptionTree,QuestionCheckboxTree,QuestionList,QuestionListMultiquestionClientSide,Question,SearchBox,SelectCountryFromForm].forEach((e=>{createAll(e)})),initGoogleAnalytics()};export{ComplianceCommunicationAttachments,CookieBanner,CookieSettings,ListInput,OptionSelect,OptionTree,Question,QuestionCheckboxTree,QuestionList,QuestionListMultiquestionClientSide,SearchBox,SelectCountryFromForm,createAll,initAll,initGoogleAnalytics,version};//# sourceMappingURL=digitalmarketplace-frontend.min.js.map