1"use strict";(self.webpackChunkEightshiftForms=self.webpackChunkEightshiftForms||[]).push([[693],{1693:(e,t,i)=>{i.r(t),i.d(t,{default:()=>eU});var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)};function s(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var r=function(){return(r=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var s in t=arguments[i])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var o={ADD_CHOICE:"ADD_CHOICE",REMOVE_CHOICE:"REMOVE_CHOICE",FILTER_CHOICES:"FILTER_CHOICES",ACTIVATE_CHOICES:"ACTIVATE_CHOICES",CLEAR_CHOICES:"CLEAR_CHOICES",ADD_GROUP:"ADD_GROUP",ADD_ITEM:"ADD_ITEM",REMOVE_ITEM:"REMOVE_ITEM",HIGHLIGHT_ITEM:"HIGHLIGHT_ITEM"},a={showDropdown:"showDropdown",hideDropdown:"hideDropdown",change:"change",choice:"choice",search:"search",addItem:"addItem",removeItem:"removeItem",highlightItem:"highlightItem",highlightChoice:"highlightChoice",unhighlightItem:"unhighlightItem"},c={TAB_KEY:9,SHIFT_KEY:16,BACK_KEY:46,DELETE_KEY:8,ENTER_KEY:13,A_KEY:65,ESC_KEY:27,UP_KEY:38,DOWN_KEY:40,PAGE_UP_KEY:33,PAGE_DOWN_KEY:34},l=["fuseOptions","classNames"],h={Text:"text",SelectOne:"select-one",SelectMultiple:"select-multiple"},u=function(e){return{type:o.ADD_CHOICE,choice:e}},d=function(e){return{type:o.ADD_ITEM,item:e}},p=function(e){return{type:o.REMOVE_ITEM,item:e}},f=function(e,t){return{type:o.HIGHLIGHT_ITEM,item:e,highlighted:t}},m=function(e){return Array.from({length:e},function(){return Math.floor(36*Math.random()+0).toString(36)}).join("")},v=function(e,t){var i=e.id||e.name&&"".concat(e.name,"-").concat(m(2))||m(4);return i=i.replace(/(:|\.|\[|\]|,)/g,""),i="".concat(t,"-").concat(i)},_=function(e,t,i){void 0===i&&(i=1);for(var n="".concat(i>0?"next":"previous","ElementSibling"),s=e[n];s;){if(s.matches(t))return s;s=s[n]}return null},g=function(e,t,i){return void 0===i&&(i=1),i>0?t.scrollTop+t.offsetHeight>=e.offsetTop+e.offsetHeight:e.offsetTop>=t.scrollTop},y=function(e){if("string"!=typeof e){if(null==e)return"";if("object"==typeof e){if("raw"in e)return y(e.raw);if("trusted"in e)return e.trusted}return e}return e.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,""")},b=function(){var e=document.createElement("div");return function(t){e.innerHTML=t.trim();for(var i=e.children[0];e.firstChild;)e.removeChild(e.firstChild);return i}}(),E=function(e){return"function"==typeof e?e():e},C=function(e){if("string"==typeof e)return e;if("object"==typeof e){if("trusted"in e)return e.trusted;if("raw"in e)return e.raw}return""},S=function(e){if("string"==typeof e)return e;if("object"==typeof e){if("escaped"in e)return e.escaped;if("trusted"in e)return e.trusted}return""},I=function(e,t){return{id:e.id,highlighted:e.highlighted,labelClass:e.labelClass,labelDescription:C(e.labelDescription),customProperties:e.customProperties,disabled:e.disabled,active:e.active,label:e.label,placeholder:e.placeholder,value:e.value,groupValue:e.group?e.group.label:void 0,element:e.element,keyCode:t}},w=function(e,t,i){return"function"==typeof e?e(y(t),C(t),i):e},A=function(e,t){return e?S(t):y(t)},O=function(e,t,i){e.innerHTML=A(t,i)},x=function(e,t){return e.rank-t.rank},T=function(e,t,i){void 0===i&&(i=null);var n=new CustomEvent(t,{detail:i,bubbles:!0,cancelable:!0});return e.dispatchEvent(n)},D=function(e,t){var i=Object.keys(e).sort(),n=Object.keys(t).sort();return i.filter(function(e){return 0>n.indexOf(e)})},L=function(e){return Array.isArray(e)?e:[e]},N=function(e){return e&&Array.isArray(e)?e.map(function(e){return".".concat(e)}).join(""):".".concat(e)},M=function(e,t){var i;(i=e.classList).add.apply(i,L(t))},P=function(e,t){var i;(i=e.classList).remove.apply(i,L(t))},k=function(e){if(void 0!==e)try{return JSON.parse(e)}catch(t){return e}return{}},F=function(e,t,i){var n=e.itemEl;n&&(P(n,i),M(n,t))},R=function(){function e(e){var t=e.element,i=e.type,n=e.classNames;this.element=t,this.classNames=n,this.type=i,this.isActive=!1}return e.prototype.show=function(){return M(this.element,this.classNames.activeState),this.element.setAttribute("aria-expanded","true"),this.isActive=!0,this},e.prototype.hide=function(){return P(this.element,this.classNames.activeState),this.element.setAttribute("aria-expanded","fal
1se"),this.isActive=!1,this},e}(),K=function(){function e(e){var t=e.element,i=e.type,n=e.classNames,s=e.position;this.element=t,this.classNames=n,this.type=i,this.position=s,this.isOpen=!1,this.isFlipped=!1,this.isDisabled=!1,this.isLoading=!1}return e.prototype.shouldFlip=function(e,t){var i=!1;return"auto"===this.position?i=this.element.getBoundingClientRect().top-t>=0&&!window.matchMedia("(min-height: ".concat(e+1,"px)")).matches:"top"===this.position&&(i=!0),i},e.prototype.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},e.prototype.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},e.prototype.open=function(e,t){M(this.element,this.classNames.openState),this.element.setAttribute("aria-expanded","true"),this.isOpen=!0,this.shouldFlip(e,t)&&(M(this.element,this.classNames.flippedState),this.isFlipped=!0)},e.prototype.close=function(){P(this.element,this.classNames.openState),this.element.setAttribute("aria-expanded","false"),this.removeActiveDescendant(),this.isOpen=!1,this.isFlipped&&(P(this.element,this.classNames.flippedState),this.isFlipped=!1)},e.prototype.addFocusState=function(){M(this.element,this.classNames.focusState)},e.prototype.removeFocusState=function(){P(this.element,this.classNames.focusState)},e.prototype.addInvalidState=function(){M(this.element,this.classNames.invalidState)},e.prototype.removeInvalidState=function(){P(this.element,this.classNames.invalidState)},e.prototype.enable=function(){P(this.element,this.classNames.disabledState),this.element.removeAttribute("aria-disabled"),this.type===h.SelectOne&&this.element.setAttribute("tabindex","0"),this.isDisabled=!1},e.prototype.disable=function(){M(this.element,this.classNames.disabledState),this.element.setAttribute("aria-disabled","true"),this.type===h.SelectOne&&this.element.setAttribute("tabindex","-1"),this.isDisabled=!0},e.prototype.wrap=function(e){var t=this.element,i=e.parentNode;i&&(e.nextSibling?i.insertBefore(t,e.nextSibling):i.appendChild(t)),t.appendChild(e)},e.prototype.unwrap=function(e){var t=this.element,i=t.parentNode;i&&(i.insertBefore(e,t),i.removeChild(t))},e.prototype.addLoadingState=function(){M(this.element,this.classNames.loadingState),this.element.setAttribute("aria-busy","true"),this.isLoading=!0},e.prototype.removeLoadingState=function(){P(this.element,this.classNames.loadingState),this.element.removeAttribute("aria-busy"),this.isLoading=!1},e}(),j=function(){function e(e){var t=e.element,i=e.type,n=e.classNames,s=e.preventPaste;this.element=t,this.type=i,this.classNames=n,this.preventPaste=s,this.isFocussed=this.element.isEqualNode(document.activeElement),this.isDisabled=t.disabled,this._onPaste=this._onPaste.bind(this),this._onInput=this._onInput.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this)}return Object.defineProperty(e.prototype,"placeholder",{set:function(e){this.element.placeholder=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.value=e},enumerable:!1,configurable:!0}),e.prototype.addEventListeners=function(){var e=this.element;e.addEventListener("paste",this._onPaste),e.addEventListener("input",this._onInput,{passive:!0}),e.addEventListener("focus",this._onFocus,{passive:!0}),e.addEventListener("blur",this._onBlur,{passive:!0})},e.prototype.removeEventListeners=function(){var e=this.element;e.removeEventListener("input",this._onInput),e.removeEventListener("paste",this._onPaste),e.removeEventListener("focus",this._onFocus),e.removeEventListener("blur",this._onBlur)},e.prototype.enable=function(){this.element.removeAttribute("disabled"),this.isDisabled=!1},e.prototype.disable=function(){this.element.setAttribute("disabled",""),this.isDisabled=!0},e.prototype.focus=function(){this.isFocussed||this.element.focus()},e.prototype.blur=function(){this.isFocussed&&this.element.blur()},e.prototype.clear=function(e){return void 0===e&&(e=!0),this.element.value="",e&&this.setWidth(),this},e.prototype.setWidth=function(){var e=this.element,t=e.value,i=e.placeholder,n=0,s=0;if(t||i){var r=document.createElement("span");r.style.position="absolute",r.style.visibility="hidden",r.style.whiteSpace="pre",r.style.height="auto",r.style.width="auto",r.style.minWidth="1ch",M(r,Array.from(e.classList)),e.after(r);var o=parseFloat(getComputedStyle(r).width);Number.isNaN(o)?(n=i.length,s=t.length):(i&&(r.innerText=i,n=parseFloat(getComputedStyle(r).width)/o),t&&(r.innerText=t,s=parseFloat(getComputedStyle(r).width)/o)),r.remove()}e.style.minWidth="".concat(Math.ceil(n)+1,"ch"),e.style.width="".concat(Math.ceil(s)+1,"ch")},e.prototype.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},e.prototype.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},e.prototype._onInput=function(){this.type!==h.SelectOne&&this.setWidth()},e.prototype._onPaste=function(e){this.preventPaste&&e.preventDefault()},e.prototype._onFocus=function(){this.isFocussed=!0},e.prototype._onBlur=function(){this.isFocussed=!1},e}(),H=function(){function e(e){var t=e.element;this.element=t,this.scrollPos=this.element.scrollTop,this.height=this.element.offsetHeight}return e.prototype.prepend=function(e){var t=this.element.firstElementChild;t?this.element.insertBefore(e,t):this.element.append(e)},e.prototype.scrollToTop=function(){this.element.scrollTop=0},e.prototype.scrollToChildElement=function(e,t){var i=this;if(e){var n=this.element.offsetHeight,s=this.element.scrollTop+n,r=e.offsetHeight,o=e.offsetTop+r,a=t>0?this.element.scrollTop+o-s:e.offsetTop;requestAnimationFrame(function(){i._animateScroll(a,t)}
1)}},e.prototype._scrollDown=function(e,t,i){var n=(i-e)/t;this.element.scrollTop=e+(n>1?n:1)},e.prototype._scrollUp=function(e,t,i){var n=(e-i)/t;this.element.scrollTop=e-(n>1?n:1)},e.prototype._animateScroll=function(e,t){var i=this,n=this.element.scrollTop,s=!1;t>0?(this._scrollDown(n,4,e),n<e&&(s=!0)):(this._scrollUp(n,4,e),n>e&&(s=!0)),s&&requestAnimationFrame(function(){i._animateScroll(e,t)})},e}(),V=function(){function e(e){var t=e.element,i=e.classNames;this.element=t,this.classNames=i,this.isDisabled=!1}return Object.defineProperty(e.prototype,"isActive",{get:function(){return"active"===this.element.dataset.choice},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dir",{get:function(){return this.element.dir},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.setAttribute("value",e),this.element.value=e},enumerable:!1,configurable:!0}),e.prototype.conceal=function(){var e=this.element;M(e,this.classNames.input),e.hidden=!0,e.tabIndex=-1;var t=e.getAttribute("style");t&&e.setAttribute("data-choice-orig-style",t),e.setAttribute("data-choice","active")},e.prototype.reveal=function(){var e=this.element;P(e,this.classNames.input),e.hidden=!1,e.removeAttribute("tabindex");var t=e.getAttribute("data-choice-orig-style");t?(e.removeAttribute("data-choice-orig-style"),e.setAttribute("style",t)):e.removeAttribute("style"),e.removeAttribute("data-choice")},e.prototype.enable=function(){this.element.removeAttribute("disabled"),this.element.disabled=!1,this.isDisabled=!1},e.prototype.disable=function(){this.element.setAttribute("disabled",""),this.element.disabled=!0,this.isDisabled=!0},e.prototype.triggerEvent=function(e,t){T(this.element,e,t||{})},e}(),B=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t}(V),G=function(e,t){return void 0===t&&(t=!0),void 0===e?t:!!e},q=function(e){if("string"==typeof e&&(e=e.split(" ").filter(function(e){return e.length})),Array.isArray(e)&&e.length)return e},$=function(e,t,i){if(void 0===i&&(i=!0),"string"==typeof e){var n=y(e),s=i||n===e?e:{escaped:n,raw:e};return $({value:e,label:s,selected:!0},!1)}if("choices"in e){if(!t)throw TypeError("optGroup is not allowed");var r=e.choices.map(function(e){return $(e,!1)});return{id:0,label:C(e.label)||e.value,active:!!r.length,disabled:!!e.disabled,choices:r}}return{id:0,group:null,score:0,rank:0,value:e.value,label:e.label||e.value,active:G(e.active),selected:G(e.selected,!1),disabled:G(e.disabled,!1),placeholder:G(e.placeholder,!1),highlighted:!1,labelClass:q(e.labelClass),labelDescription:e.labelDescription,customProperties:e.customProperties}},U=function(e){return"SELECT"===e.tagName},Y=function(e){function t(t){var i=t.element,n=t.classNames,s=t.template,r=t.extractPlaceholder,o=e.call(this,{element:i,classNames:n})||this;return o.template=s,o.extractPlaceholder=r,o}return s(t,e),Object.defineProperty(t.prototype,"placeholderOption",{get:function(){return this.element.querySelector('option[value=""]')||this.element.querySelector("option[placeholder]")},enumerable:!1,configurable:!0}),t.prototype.addOptions=function(e){var t=this,i=document.createDocumentFragment();e.forEach(function(e){if(!e.element){var n=t.template(e);i.appendChild(n),e.element=n}}),this.element.appendChild(i)},t.prototype.optionsAsChoices=function(){var e=this,t=[];return this.element.querySelectorAll(":scope > option, :scope > optgroup").forEach(function(i){"OPTION"===i.tagName?t.push(e._optionToChoice(i)):"OPTGROUP"===i.tagName&&t.push(e._optgroupToChoice(i))}),t},t.prototype._optionToChoice=function(e){return!e.hasAttribute("value")&&e.hasAttribute("placeholder")&&(e.setAttribute("value",""),e.value=""),{id:0,group:null,score:0,rank:0,value:e.value,label:e.label,element:e,active:!0,selected:this.extractPlaceholder?e.selected:e.hasAttribute("selected"),disabled:e.disabled,highlighted:!1,placeholder:this.extractPlaceholder&&(!e.value||e.hasAttribute("placeholder")),labelClass:void 0!==e.dataset.labelClass?q(e.dataset.labelClass):void 0,labelDescription:void 0!==e.dataset.labelDescription?{trusted:e.dataset.labelDescription}:void 0,customProperties:k(e.dataset.customProperties)}},t.prototype._optgroupToChoice=function(e){var t=this,i=Array.from(e.querySelectorAll("option")).map(function(e){return t._optionToChoice(e)});return{id:0,label:e.label||"",element:e,active:!!i.length,disabled:e.disabled,choices:i}},t}(V),W={items:[],choices:[],silent:!1,renderChoiceLimit:-1,maxItemCount:-1,closeDropdownOnSelect:"auto",singleModeForMultiSelect:!1,addChoices:!1,addItems:!0,addItemFilter:function(e){return!!e&&""!==e},removeItems:!0,removeItemButton:!1,removeItemButtonAlignLeft:!1,editItems:!1,allowHTML:!1,allowHtmlUserInput:!1,duplicateItemsAllowed:!0,delimiter:",",paste:!0,searchEnabled:!0,searchChoices:!0,searchDisabledChoices:!1,searchFloor:1,searchResultLimit:4,searchFields:["label","value"],position:"auto",resetScrollPosition:!0,shouldSort:!0,shouldSortItems:!1,sorter:function(e,t){var i=e.value,n=e.label,s=t.value,r=t.label;return C(void 0===n?i:n).localeCompare(C(void 0===r?s:r),[],{sensitivity:"base",ignorePunctuation:!0,numeric:!0})},shadowRoot:null,placeholder:!0,placeholderValue:null,searchPlaceholderValue:null,prepe
1ndValue:null,appendValue:null,renderSelectedChoices:"auto",searchRenderSelectedChoices:!0,loadingText:"Loading...",noResultsText:"No results found",noChoicesText:"No choices to choose from",itemSelectText:"Press to select",uniqueItemText:"Only unique values can be added",customAddItemText:"Only values matching specific conditions can be added",addItemText:function(e){return'Press Enter to add <b>"'.concat(e,'"</b>')},removeItemIconText:function(){return"Remove item"},removeItemLabelText:function(e,t,i){return"Remove item: ".concat(i?y(i.label):e)},maxItemText:function(e){return"Only ".concat(e," values can be added")},valueComparer:function(e,t){return e===t},fuseOptions:{includeScore:!0},labelId:"",callbackOnInit:null,callbackOnCreateTemplates:null,classNames:{containerOuter:["choices"],containerInner:["choices__inner"],input:["choices__input"],inputCloned:["choices__input--cloned"],list:["choices__list"],listItems:["choices__list--multiple"],listSingle:["choices__list--single"],listDropdown:["choices__list--dropdown"],item:["choices__item"],itemSelectable:["choices__item--selectable"],itemDisabled:["choices__item--disabled"],itemChoice:["choices__item--choice"],description:["choices__description"],placeholder:["choices__placeholder"],group:["choices__group"],groupHeading:["choices__heading"],button:["choices__button"],activeState:["is-active"],focusState:["is-focused"],openState:["is-open"],disabledState:["is-disabled"],highlightedState:["is-highlighted"],selectedState:["is-selected"],flippedState:["is-flipped"],loadingState:["is-loading"],invalidState:["is-invalid"],notice:["choices__notice"],addChoice:["choices__item--selectable","add-choice"],noResults:["has-no-results"],noChoices:["has-no-choices"]},appendGroupInSearch:!1},z=function(e){var t=e.itemEl;t&&(t.remove(),e.itemEl=void 0)},J={groups:function(e,t){var i=e,n=!0;switch(t.type){case o.ADD_GROUP:i.push(t.group);break;case o.CLEAR_CHOICES:i=[];break;default:n=!1}return{state:i,update:n}},items:function(e,t,i){var n=e,s=!0;switch(t.type){case o.ADD_ITEM:t.item.selected=!0;var r=t.item.element;r&&(r.selected=!0,r.setAttribute("selected","")),n.push(t.item);break;case o.REMOVE_ITEM:t.item.selected=!1;var r=t.item.element;if(r){r.selected=!1,r.removeAttribute("selected");var a=r.parentElement;a&&U(a)&&a.type===h.SelectOne&&(a.value="")}z(t.item),n=n.filter(function(e){return e.id!==t.item.id});break;case o.REMOVE_CHOICE:z(t.choice),n=n.filter(function(e){return e.id!==t.choice.id});break;case o.HIGHLIGHT_ITEM:var c=t.highlighted,l=n.find(function(e){return e.id===t.item.id});l&&l.highlighted!==c&&(l.highlighted=c,i&&F(l,c?i.classNames.highlightedState:i.classNames.selectedState,c?i.classNames.selectedState:i.classNames.highlightedState));break;default:s=!1}return{state:n,update:s}},choices:function(e,t,i){var n=e,s=!0;switch(t.type){case o.ADD_CHOICE:n.push(t.choice);break;case o.REMOVE_CHOICE:t.choice.choiceEl=void 0,t.choice.group&&(t.choice.group.choices=t.choice.group.choices.filter(function(e){return e.id!==t.choice.id})),n=n.filter(function(e){return e.id!==t.choice.id});break;case o.ADD_ITEM:case o.REMOVE_ITEM:t.item.choiceEl=void 0;break;case o.FILTER_CHOICES:var r=[];t.results.forEach(function(e){r[e.item.id]=e}),n.forEach(function(e){var t=r[e.id];void 0!==t?(e.score=t.score,e.rank=t.rank,e.active=!0):(e.score=0,e.rank=0,e.active=!1),i&&i.appendGroupInSearch&&(e.choiceEl=void 0)});break;case o.ACTIVATE_CHOICES:n.forEach(function(e){e.active=t.active,i&&i.appendGroupInSearch&&(e.choiceEl=void 0)});break;case o.CLEAR_CHOICES:n=[];break;default:s=!1}return{state:n,update:s}}},X=function(){function e(e){this._state=this.defaultState,this._listeners=[],this._txn=0,this._context=e}return Object.defineProperty(e.prototype,"defaultState",{get:function(){return{groups:[],items:[],choices:[]}},enumerable:!1,configurable:!0}),e.prototype.changeSet=function(e){return{groups:e,items:e,choices:e}},e.prototype.reset=function(){this._state=this.defaultState;var e=this.changeSet(!0);this._txn?this._changeSet=e:this._listeners.forEach(function(t){return t(e)})},e.prototype.subscribe=function(e){return this._listeners.push(e),this},e.prototype.dispatch=function(e){var t=this,i=this._state,n=!1,s=this._changeSet||this.changeSet(!1);Object.keys(J).forEach(function(r){var o=J[r](i[r],e,t._context);o.update&&(n=!0,s[r]=!0,i[r]=o.state)}
vendor: 6,194 bytes, line 1
1),n&&(this._txn?this._changeSet=s:this._listeners.forEach(function(e){return e(s)}))},e.prototype.withTxn=function(e){this._txn++;try{e()}finally{if(this._txn=Math.max(0,this._txn-1),!this._txn){var t=this._changeSet;t&&(this._changeSet=void 0,this._listeners.forEach(function(e){return e(t)}))}}},Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this.state.items},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"highlightedActiveItems",{get:function(){return this.items.filter(function(e){return e.active&&e.highlighted})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"choices",{get:function(){return this.state.choices},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeChoices",{get:function(){return this.choices.filter(function(e){return e.active})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"searchableChoices",{get:function(){var e=this._context;return this.choices.filter(function(t){return!t.placeholder&&(e.searchDisabledChoices||!t.disabled)})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groups",{get:function(){return this.state.groups},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeGroups",{get:function(){var e=this;return this.state.groups.filter(function(t){var i=t.active&&!t.disabled,n=e.state.choices.some(function(e){return e.active&&!e.disabled});return i&&n},[])},enumerable:!1,configurable:!0}),e.prototype.inTxn=function(){return this._txn>0},e.prototype.getChoiceById=function(e){return this.activeChoices.find(function(t){return t.id===e})},e.prototype.getGroupById=function(e){return this.groups.find(function(t){return t.id===e})},e}(),Q={noChoices:"no-choices",noResults:"no-results",addChoice:"add-choice",generic:""};function Z(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function ee(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(i),!0).forEach(function(t){var n,s;n=t,s=i[t],(n=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t);if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(n))in e?Object.defineProperty(e,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[n]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Z(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function et(e){return Array.isArray?Array.isArray(e):"[object Array]"===ea(e)}function ei(e){return"string"==typeof e}function en(e){return"number"==typeof e}function es(e){return"object"==typeof e}function er(e){return null!=e}function eo(e){return!e.trim().length}function ea(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}let ec=Object.prototype.hasOwnProperty;class el{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let i=eh(e);this._keys.push(i),this._keyMap[i.id]=i,t+=i.weight}),this._keys.forEach(e=>{e.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function eh(e){let t=null,i=null,n=null,s=1,r=null;if(ei(e)||et(e))n=e,t=eu(e),i=ed(e);else{if(!ec.call(e,"name"))throw Error("Missing name property in key");let o=e.name;if(n=o,ec.call(e,"weight")&&(s=e.weight)<=0)throw Error(`Property 'weight' in key '${o}' must be a positive integer`);t=eu(o),i=ed(o),r=e.getFn}return{path:t,id:i,weight:s,src:n,getFn:r}}function eu(e){return et(e)?e:e.split(".")}function ed(e){return et(e)?e.join("."):e}var ep=ee(ee(ee(ee({},{isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1}),{includeMatches:!1,findAllMatches:!1,minMatchCharLength:1}),{location:0,threshold:.6,distance:100}),{useExtendedSearch:!1,getFn:function(e,t){let i=[],n=!1,s=(e,t,r)=>{if(er(e))if(t[r]){var o,a;let c=e[t[r]];if(!er(c))return;if(r===t.length-1&&(ei(c)||en(c)||!0===(o=c)||!1===o||es(a=o)&&null!==a&&"[object Boolean]"==ea(o)))i.push(null==c?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(c));else if(et(c)){n=!0;for(let e=0,i=c.length;e<i;e+=1)s(c[e],t,r+1)}else t.length&&s(c,t,r+1)}else i.push(e)};return s(e,ei(t)?t.split("."):t,0),n?i:i[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1});let ef=/[^ ]+/g;class em{constructor({getFn:e=ep.getFn,fieldNormWeight:t=ep.fieldNormWeight}={}){this.norm=function(e=1,t=3){let i=new Map,n=Math.pow(10,t);return{get(t){let s=t.match(ef).length;if(i.has(s))return i.get(s);let r=parseFloat(Math.round(1/Math.pow(s,.5*e)*n)/n);return i.set(s,r),r},clear(){i.clear()}}}(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((e,t)=>{this._keysMap[e.id]=t})}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,ei(this.docs[0])?this.docs.forEach((e,t)=>{this._addString(e,t)}):this.docs.forEach((e,t)=>{this._addObject(e,t)}),this.norm.clear())}add(e){let t=this.size();ei(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,i=this.size();t<i;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!er(e)||eo(e))return;let i={v:e,i:t,n:this.norm.get(e)};this.records.push(i)}_addObject(e,t){let i={i:t,$:{}};this.keys.forEach((t,n)=>{let s=t.getFn?t.getFn(e):this.getFn(e,t.path);if(er(s)){if(et(s)){let e=[],t=[{nestedArrIndex:-1,value:s}];for(;t.length;){let{nestedArrIndex:i,value:n}=t.pop();if(er(n))if(ei(n)&&!eo(n)){let t={v:n,i:i,n:this.norm.get(n)};e.push(t)}
1else et(n)&&n.forEach((e,i)=>{t.push({nestedArrIndex:i,value:e})})}i.$[n]=e}else if(ei(s)&&!eo(s)){let e={v:s,n:this.norm.get(s)};i.$[n]=e}}}),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function ev(e,t,{getFn:i=ep.getFn,fieldNormWeight:n=ep.fieldNormWeight}={}){let s=new em({getFn:i,fieldNormWeight:n});return s.setKeys(e.map(eh)),s.setSources(t),s.create(),s}function e_(e,{errors:t=0,currentLocation:i=0,expectedLocation:n=0,distance:s=ep.distance,ignoreLocation:r=ep.ignoreLocation}={}){let o=t/e.length;if(r)return o;let a=Math.abs(n-i);return s?o+a/s:a?1:o}class eg{constructor(e,{location:t=ep.location,threshold:i=ep.threshold,distance:n=ep.distance,includeMatches:s=ep.includeMatches,findAllMatches:r=ep.findAllMatches,minMatchCharLength:o=ep.minMatchCharLength,isCaseSensitive:a=ep.isCaseSensitive,ignoreLocation:c=ep.ignoreLocation}={}){if(this.options={location:t,threshold:i,distance:n,includeMatches:s,findAllMatches:r,minMatchCharLength:o,isCaseSensitive:a,ignoreLocation:c},this.pattern=a?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;let l=(e,t)=>{this.chunks.push({pattern:e,alphabet:function(e){let t={};for(let i=0,n=e.length;i<n;i+=1){let s=e.charAt(i);t[s]=(t[s]||0)|1<<n-i-1}return t}(e),startIndex:t})},h=this.pattern.length;if(h>32){let e=0,t=h%32,i=h-t;for(;e<i;)l(this.pattern.substr(e,32),e),e+=32;if(t){let e=h-32;l(this.pattern.substr(e),e)}}else l(this.pattern,0)}searchIn(e){let{isCaseSensitive:t,includeMatches:i}=this.options;if(t||(e=e.toLowerCase()),this.pattern===e){let t={isMatch:!0,score:0};return i&&(t.indices=[[0,e.length-1]]),t}let{location:n,distance:s,threshold:r,findAllMatches:o,minMatchCharLength:a,ignoreLocation:c}=this.options,l=[],h=0,u=!1;this.chunks.forEach(({pattern:t,alphabet:d,startIndex:p})=>{let{isMatch:f,score:m,indices:v}=function(e,t,i,{location:n=ep.location,distance:s=ep.distance,threshold:r=ep.threshold,findAllMatches:o=ep.findAllMatches,minMatchCharLength:a=ep.minMatchCharLength,includeMatches:c=ep.includeMatches,ignoreLocation:l=ep.ignoreLocation}={}){let h;if(t.length>32)throw Error("Pattern length exceeds max of 32.");let u=t.length,d=e.length,p=Math.max(0,Math.min(n,d)),f=r,m=p,v=a>1||c,_=v?Array(d):[];for(;(h=e.indexOf(t,m))>-1;)if(f=Math.min(e_(t,{currentLocation:h,expectedLocation:p,distance:s,ignoreLocation:l}),f),m=h+u,v){let e=0;for(;e<u;)_[h+e]=1,e+=1}m=-1;let g=[],y=1,b=u+d,E=1<<u-1;for(let n=0;n<u;n+=1){let r=0,a=b;for(;r<a;)e_(t,{errors:n,currentLocation:p+a,expectedLocation:p,distance:s,ignoreLocation:l})<=f?r=a:b=a,a=Math.floor((b-r)/2+r);b=a;let c=Math.max(1,p-a+1),h=o?d:Math.min(p+a,d)+u,C=Array(h+2);C[h+1]=(1<<n)-1;for(let r=h;r>=c;r-=1){let o=r-1,a=i[e.charAt(o)];if(v&&(_[o]=+!!a),C[r]=(C[r+1]<<1|1)&a,n&&(C[r]|=(g[r+1]|g[r])<<1|1|g[r+1]),C[r]&E&&(y=e_(t,{errors:n,currentLocation:o,expectedLocation:p,distance:s,ignoreLocation:l}))<=f){if(f=y,(m=o)<=p)break;c=Math.max(1,2*p-m)}}if(e_(t,{errors:n+1,currentLocation:p,expectedLocation:p,distance:s,ignoreLocation:l})>f)break;g=C}let C={isMatch:m>=0,score:Math.max(.001,y)};if(v){let e=function(e=[],t=ep.minMatchCharLength){let i=[],n=-1,s=-1,r=0;for(let o=e.length;r<o;r+=1){let o=e[r];o&&-1===n?n=r:o||-1===n||((s=r-1)-n+1>=t&&i.push([n,s]),n=-1)}return e[r-1]&&r-n>=t&&i.push([n,r-1]),i}(_,a);e.length?c&&(C.indices=e):C.isMatch=!1}return C}(e,t,d,{location:n+p,distance:s,threshold:r,findAllMatches:o,minMatchCharLength:a,includeMatches:i,ignoreLocation:c});f&&(u=!0),h+=m,f&&v&&(l=[...l,...v])});let d={isMatch:u,score:u?h/this.chunks.length:1};return u&&i&&(d.indices=l),d}}class ey{constructor(e){this.pattern=e}static isMultiMatch(e){return eb(e,this.multiRegex)}static isSingleMatch(e){return eb(e,this.singleRegex)}search(){}}function eb(e,t){let i=e.match(t);return i?i[1]:null}class eE extends ey{constructor(e,{location:t=ep.location,threshold:i=ep.threshold,distance:n=ep.distance,includeMatches:s=ep.includeMatches,findAllMatches:r=ep.findAllMatches,minMatchCharLength:o=ep.minMatchCharLength,isCaseSensitive:a=ep.isCaseSensitive,ignoreLocation:c=ep.ignoreLocation}={}){super(e),this._bitapSearch=new eg(e,{location:t,threshold:i,distance:n,includeMatches:s,findAllMatches:r,minMatchCharLength:o,isCaseSensitive:a,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class eC extends ey{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,i=0,n=[],s=this.pattern.length;for(;(t=e.indexOf(this.pattern,i))>-1;)i=t+s,n.push([t,i-1]);let r=!!n.length;return{isMatch:r,score:+!r,indices:n}}}let eS=[class extends ey{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}
1search(e){let t=e===this.pattern;return{isMatch:t,score:+!t,indices:[0,this.pattern.length-1]}}},eC,class extends ey{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){let t=e.startsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,this.pattern.length-1]}}},class extends ey{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){let t=!e.startsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}},class extends ey{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){let t=!e.endsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}},class extends ey{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){let t=e.endsWith(this.pattern);return{isMatch:t,score:+!t,indices:[e.length-this.pattern.length,e.length-1]}}},class extends ey{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){let t=-1===e.indexOf(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}},eE],eI=eS.length,ew=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,eA=new Set([eE.type,eC.type]),eO=[];function ex(e,t){for(let i=0,n=eO.length;i<n;i+=1){let n=eO[i];if(n.condition(e,t))return new n(e,t)}return new eg(e,t)}let eT={AND:"$and",OR:"$or"},eD={PATH:"$path",PATTERN:"$val"},eL=e=>!!(e[eT.AND]||e[eT.OR]),eN=e=>({[eT.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function eM(e,t,{auto:i=!0}={}){let n=e=>{let s=Object.keys(e),r=!!e[eD.PATH];if(!r&&s.length>1&&!eL(e))return n(eN(e));if(!et(e)&&es(e)&&!eL(e)){let n=r?e[eD.PATH]:s[0],o=r?e[eD.PATTERN]:e[n];if(!ei(o))throw Error(`Invalid value for key ${n}`);let a={keyId:ed(n),pattern:o};return i&&(a.searcher=ex(o,t)),a}let o={children:[],operator:s[0]};return s.forEach(t=>{let i=e[t];et(i)&&i.forEach(e=>{o.children.push(n(e))})}),o};return eL(e)||(e=eN(e)),n(e)}function eP(e,t){let i=e.matches;t.matches=[],er(i)&&i.forEach(e=>{if(!er(e.indices)||!e.indices.length)return;let{indices:i,value:n}=e,s={indices:i,value:n};e.key&&(s.key=e.key.src),e.idx>-1&&(s.refIndex=e.idx),t.matches.push(s)})}function ek(e,t){t.score=e.score}class eF{constructor(e,t={},i){this.options=ee(ee({},ep),t),this.options.useExtendedSearch,this._keyStore=new el(this.options.keys),this.setCollection(e,i)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof em))throw Error("Incorrect 'index' type");this._myIndex=t||ev(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){er(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){let t=[];for(let i=0,n=this._docs.length;i<n;i+=1){let s=this._docs[i];e(s,i)&&(this.removeAt(i),i-=1,n-=1,t.push(s))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}){let{includeMatches:i,includeScore:n,shouldSort:s,sortFn:r,ignoreFieldNorm:o}=this.options,a=ei(e)?ei(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return!function(e,{ignoreFieldNorm:t=ep.ignoreFieldNorm}){e.forEach(e=>{let i=1;e.matches.forEach(({key:e,norm:n,score:s})=>{let r=e?e.weight:null;i*=Math.pow(0===s&&r?Number.EPSILON:s,(r||1)*(t?1:n))}),e.score=i})}(a,{ignoreFieldNorm:o}),s&&a.sort(r),en(t)&&t>-1&&(a=a.slice(0,t)),function(e,t,{includeMatches:i=ep.includeMatches,includeScore:n=ep.includeScore}={}){let s=[];return i&&s.push(eP),n&&s.push(ek),e.map(e=>{let{idx:i}=e,n={item:t[i],refIndex:i};return s.length&&s.forEach(t=>{t(e,n)}),n})}(a,this._docs,{includeMatches:i,includeScore:n})}_searchStringList(e){let t=ex(e,this.options),{records:i}=this._myIndex,n=[];return i.forEach(({v:e,i:i,n:s})=>{if(!er(e))return;let{isMatch:r,score:o,indices:a}=t.searchIn(e);r&&n.push({item:e,idx:i,matches:[{score:o,value:e,norm:s,indices:a}]})}),n}_searchLogical(e){let t=eM(e,this.options),i=(e,t,n)=>{if(!e.children){let{keyId:i,searcher:s}=e,r=this._findMatches({key:this._keyStore.get(i),value:this._myIndex.getValueForItemAtKeyId(t,i),searcher:s});return r&&r.length?[{idx:n,item:t,matches:r}]:[]}let s=[];for(let r=0,o=e.children.length;r<o;r+=1){let o=i(e.children[r],t,n);if(o.length)s.push(...o);else if(e.operator===eT.AND)return[]}return s},n=this._myIndex.records,s={},r=[];
vendor: 4,120 bytes, line 1
1return n.forEach(({$:e,i:n})=>{if(er(e)){let o=i(t,e,n);o.length&&(s[n]||(s[n]={idx:n,item:e,matches:[]},r.push(s[n])),o.forEach(({matches:e})=>{s[n].matches.push(...e)}))}}),r}_searchObjectList(e){let t=ex(e,this.options),{keys:i,records:n}=this._myIndex,s=[];return n.forEach(({$:e,i:n})=>{if(!er(e))return;let r=[];i.forEach((i,n)=>{r.push(...this._findMatches({key:i,value:e[n],searcher:t}))}),r.length&&s.push({idx:n,item:e,matches:r})}),s}_findMatches({key:e,value:t,searcher:i}){if(!er(t))return[];let n=[];if(et(t))t.forEach(({v:t,i:s,n:r})=>{if(!er(t))return;let{isMatch:o,score:a,indices:c}=i.searchIn(t);o&&n.push({score:a,key:e,value:t,idx:s,norm:r,indices:c})});else{let{v:s,n:r}=t,{isMatch:o,score:a,indices:c}=i.searchIn(s);o&&n.push({score:a,key:e,value:s,norm:r,indices:c})}return n}}eF.version="7.0.0",eF.createIndex=ev,eF.parseIndex=function(e,{getFn:t=ep.getFn,fieldNormWeight:i=ep.fieldNormWeight}={}){let{keys:n,records:s}=e,r=new em({getFn:t,fieldNormWeight:i});return r.setKeys(n),r.setIndexRecords(s),r},eF.config=ep,eF.parseQuery=eM,function(...e){eO.push(...e)}(class{constructor(e,{isCaseSensitive:t=ep.isCaseSensitive,includeMatches:i=ep.includeMatches,minMatchCharLength:n=ep.minMatchCharLength,ignoreLocation:s=ep.ignoreLocation,findAllMatches:r=ep.findAllMatches,location:o=ep.location,threshold:a=ep.threshold,distance:c=ep.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:i,minMatchCharLength:n,findAllMatches:r,ignoreLocation:s,location:o,threshold:a,distance:c},this.pattern=t?e:e.toLowerCase(),this.query=function(e,t={}){return e.split("|").map(e=>{let i=e.trim().split(ew).filter(e=>e&&!!e.trim()),n=[];for(let e=0,s=i.length;e<s;e+=1){let s=i[e],r=!1,o=-1;for(;!r&&++o<eI;){let e=eS[o],i=e.isMultiMatch(s);i&&(n.push(new e(i,t)),r=!0)}if(!r)for(o=-1;++o<eI;){let e=eS[o],i=e.isSingleMatch(s);if(i){n.push(new e(i,t));break}}}return n})}(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:i,isCaseSensitive:n}=this.options;e=n?e:e.toLowerCase();let s=0,r=[],o=0;for(let n=0,a=t.length;n<a;n+=1){let a=t[n];r.length=0,s=0;for(let t=0,n=a.length;t<n;t+=1){let n=a[t],{isMatch:c,indices:l,score:h}=n.search(e);if(c){if(s+=1,o+=h,i){let e=n.constructor.type;eA.has(e)?r=[...r,...l]:r.push(l)}}else{o=0,s=0,r.length=0;break}}if(s){let e={isMatch:!0,score:o/s};return i&&(e.indices=r),e}}return{isMatch:!1,score:1}}});var eR=function(){function e(e){this._haystack=[],this._fuseOptions=r(r({},e.fuseOptions),{keys:function(e,t,i){if(i||2==arguments.length)for(var n,s=0,r=t.length;s<r;s++)!n&&s in t||(n||(n=Array.prototype.slice.call(t,0,s)),n[s]=t[s]);return e.concat(n||Array.prototype.slice.call(t))}([],e.searchFields,!0),includeMatches:!0})}return e.prototype.index=function(e){this._haystack=e,this._fuse&&this._fuse.setCollection(e)},e.prototype.reset=function(){this._haystack=[],this._fuse=void 0},e.prototype.isEmptyIndex=function(){return!this._haystack.length},e.prototype.search=function(e){return this._fuse||(this._fuse=new eF(this._haystack,this._fuseOptions)),this._fuse.search(e).map(function(e,t){return{item:e.item,score:e.score||0,rank:t+1}})},e}(),eK=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0},ej=function(e,t,i){var n=e.dataset,s=t.customProperties,r=t.labelClass,o=t.labelDescription;r&&(n.labelClass=L(r).join(" ")),o&&(n.labelDescription=C(o)),i&&s&&("string"==typeof s?n.customProperties=s:"object"!=typeof s||eK(s)||(n.customProperties=JSON.stringify(s)))},eH=function(e,t,i){var n=t&&e.querySelector("label[for='".concat(t,"']")),s=n&&n.innerText;s&&i.setAttribute("aria-label",s)},eV={containerOuter:function(e,t,i,n,s,r,o){var a=e.classNames.containerOuter,c=document.createElement("div");return M(c,a),c.dataset.type=r,t&&(c.dir=t),n&&(c.tabIndex=0),i&&(c.setAttribute("role",s?"combobox":"listbox"),s?c.setAttribute("aria-autocomplete","list"):o||eH(this._docRoot,this.passedElement.element.id,c),c.setAttribute("aria-haspopup","true"),c.setAttribute("aria-expanded","fal
1se")),o&&c.setAttribute("aria-labelledby",o),c},containerInner:function(e){var t=e.classNames.containerInner,i=document.createElement("div");return M(i,t),i},itemList:function(e,t){var i=e.searchEnabled,n=e.classNames,s=n.list,r=n.listSingle,o=n.listItems,a=document.createElement("div");return M(a,s),M(a,t?r:o),this._isSelectElement&&i&&a.setAttribute("role","listbox"),a},placeholder:function(e,t){var i=e.allowHTML,n=e.classNames.placeholder,s=document.createElement("div");return M(s,n),O(s,i,t),s},item:function(e,t,i){var n=e.allowHTML,s=e.removeItemButtonAlignLeft,r=e.removeItemIconText,o=e.removeItemLabelText,a=e.classNames,c=a.item,l=a.button,h=a.highlightedState,u=a.itemSelectable,d=a.placeholder,p=C(t.value),f=document.createElement("div");if(M(f,c),t.labelClass){var m=document.createElement("span");O(m,n,t.label),M(m,t.labelClass),f.appendChild(m)}else O(f,n,t.label);if(f.dataset.item="",f.dataset.id=t.id,f.dataset.value=p,ej(f,t,!0),(t.disabled||this.containerOuter.isDisabled)&&f.setAttribute("aria-disabled","true"),this._isSelectElement&&(f.setAttribute("aria-selected","true"),f.setAttribute("role","option")),t.placeholder&&(M(f,d),f.dataset.placeholder=""),M(f,t.highlighted?h:u),i){t.disabled&&P(f,u),f.dataset.deletable="";var v=document.createElement("button");v.type="button",M(v,l);var _=I(t);O(v,!0,w(r,t.value,_));var g=w(o,t.value,_);g&&v.setAttribute("aria-label",g),v.dataset.button="",s?f.insertAdjacentElement("afterbegin",v):f.appendChild(v)}return f},choiceList:function(e,t){var i=e.classNames.list,n=document.createElement("div");return M(n,i),t||n.setAttribute("aria-multiselectable","true"),n.setAttribute("role","listbox"),n},choiceGroup:function(e,t){var i=e.allowHTML,n=e.classNames,s=n.group,r=n.groupHeading,o=n.itemDisabled,a=t.id,c=t.label,l=t.disabled,h=C(c),u=document.createElement("div");M(u,s),l&&M(u,o),u.setAttribute("role","group"),u.dataset.group="",u.dataset.id=a,u.dataset.value=h,l&&u.setAttribute("aria-disabled","true");var d=document.createElement("div");return M(d,r),O(d,i,c||""),u.appendChild(d),u},choice:function(e,t,i,n){var s=e.allowHTML,r=e.classNames,o=r.item,a=r.itemChoice,c=r.itemSelectable,l=r.selectedState,h=r.itemDisabled,u=r.description,d=r.placeholder,p=t.label,f=C(t.value),m=document.createElement("div");m.id=t.elementId,M(m,o),M(m,a),n&&"string"==typeof p&&(p={trusted:p=A(s,p)+" (".concat(n,")")});var v=m;if(t.labelClass){var _=document.createElement("span");O(_,s,p),M(_,t.labelClass),v=_,m.appendChild(_)}else O(m,s,p);if(t.labelDescription){var g="".concat(t.elementId,"-description");v.setAttribute("aria-describedby",g);var y=document.createElement("span");O(y,s,t.labelDescription),y.id=g,M(y,u),m.appendChild(y)}return t.selected&&M(m,l),t.placeholder&&M(m,d),m.setAttribute("role",t.group?"treeitem":"option"),m.dataset.choice="",m.dataset.id=t.id,m.dataset.value=f,i&&(m.dataset.selectText=i),t.group&&(m.dataset.groupId="".concat(t.group.id)),ej(m,t,!1),t.disabled?(M(m,h),m.dataset.choiceDisabled="",m.setAttribute("aria-disabled","true")):(M(m,c),m.dataset.choiceSelectable="",m.setAttribute("aria-selected",t.selected?"true":"false")),m},input:function(e,t){var i=e.classNames,n=i.input,s=i.inputCloned,r=e.labelId,o=document.createElement("input");return o.type="search",M(o,n),M(o,s),o.autocomplete="off",o.autocapitalize="off",o.spellcheck=!1,o.setAttribute("aria-autocomplete","list"),t?o.setAttribute("aria-label",t):r||eH(this._docRoot,this.passedElement.element.id,o),o},dropdown:function(e){var t=e.classNames,i=t.list,n=t.listDropdown,s=document.createElement("div");return M(s,i),M(s,n),s.setAttribute("aria-expanded","false"),s},notice:function(e,t,i){var n=e.classNames,s=n.item,r=n.itemChoice,o=n.addChoice,a=n.noResults,c=n.noChoices,l=n.notice;void 0===i&&(i=Q.generic);var h=document.createElement("div");switch(O(h,!0,t),M(h,s),M(h,r),M(h,l),i){case Q.addChoice:M(h,o);break;case Q.noResults:M(h,a);break;case Q.noChoices:M(h,c)}return i===Q.addChoice&&(h.dataset.choiceSelectable="",h.dataset.choice=""),h},option:function(e){var t=new Option(C(e.label),e.value,!1,e.selected);return ej(t,e,!0),t.disabled=e.disabled,e.selected&&t.setAttribute("selected",""),t}},eB="-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style,eG={},eq=function(e){if(e)return e.dataset.id?parseInt(e.dataset.id,10):void 0},e$="[data-choice-selectable]",eU=function(){function e(t,i){void 0===t&&(t="[data-choice]"),void 0===i&&(i={});var n=this;this.initialisedOK=void 0,this._hasNonChoicePlaceholder=!1,this._lastAddedChoiceId=0,this._lastAddedGroupId=0;var s=e.defaults;this.config=r(r(r({},s.allOptions),s.options),i),l.forEach(function(e){n.config[e]=r(r(r({},s.allOptions[e]),s.options[e]),i[e])});var o=this.config;
1o.silent||this._validateConfig();var a=o.shadowRoot||document.documentElement;this._docRoot=a;var c="string"==typeof t?a.querySelector(t):t;if(!c||"object"!=typeof c||!("INPUT"===c.tagName||U(c))){if(!c&&"string"==typeof t)throw TypeError("Selector ".concat(t," failed to find an element"));throw TypeError("Expected one of the following types text|select-one|select-multiple")}var u=c.type,d=u===h.Text;(d||1!==o.maxItemCount)&&(o.singleModeForMultiSelect=!1),o.singleModeForMultiSelect&&(u=h.SelectMultiple);var p=u===h.SelectOne,f=u===h.SelectMultiple,m=p||f;if(this._elementType=u,this._isTextElement=d,this._isSelectOneElement=p,this._isSelectMultipleElement=f,this._isSelectElement=p||f,this._canAddUserChoices=d&&o.addItems||m&&o.addChoices,"boolean"!=typeof o.renderSelectedChoices&&(o.renderSelectedChoices="always"===o.renderSelectedChoices||p),"auto"===o.closeDropdownOnSelect?o.closeDropdownOnSelect=d||p||o.singleModeForMultiSelect:o.closeDropdownOnSelect=G(o.closeDropdownOnSelect),o.placeholder&&(o.placeholderValue?this._hasNonChoicePlaceholder=!0:c.dataset.placeholder&&(this._hasNonChoicePlaceholder=!0,o.placeholderValue=c.dataset.placeholder)),i.addItemFilter&&"function"!=typeof i.addItemFilter){var _=i.addItemFilter instanceof RegExp?i.addItemFilter:new RegExp(i.addItemFilter);o.addItemFilter=_.test.bind(_)}if(this._isTextElement?this.passedElement=new B({element:c,classNames:o.classNames}):this.passedElement=new Y({element:c,classNames:o.classNames,template:function(e){return n._templates.option(e)},extractPlaceholder:o.placeholder&&!this._hasNonChoicePlaceholder}),this.initialised=!1,this._store=new X(o),this._currentValue="",o.searchEnabled=!d&&o.searchEnabled,this._canSearch=o.searchEnabled,this._isScrollingOnIe=!1,this._highlightPosition=0,this._wasTap=!0,this._placeholderValue=this._generatePlaceholderValue(),this._baseId=v(c,"choices-"),this._direction=c.dir,!this._direction){var g=window.getComputedStyle(c).direction;g!==window.getComputedStyle(document.documentElement).direction&&(this._direction=g)}if(this._idNames={itemChoice:"item-choice"},this._templates=s.templates,this._render=this._render.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onKeyUp=this._onKeyUp.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onInput=this._onInput.bind(this),this._onClick=this._onClick.bind(this),this._onTouchMove=this._onTouchMove.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onMouseDown=this._onMouseDown.bind(this),this._onMouseOver=this._onMouseOver.bind(this),this._onFormReset=this._onFormReset.bind(this),this._onSelectKey=this._onSelectKey.bind(this),this._onEnterKey=this._onEnterKey.bind(this),this._onEscapeKey=this._onEscapeKey.bind(this),this._onDirectionKey=this._onDirectionKey.bind(this),this._onDeleteKey=this._onDeleteKey.bind(this),this._onChange=this._onChange.bind(this),this._onInvalid=this._onInvalid.bind(this),this.passedElement.isActive){o.silent,this.initialised=!0,this.initialisedOK=!1;return}this.init(),this._initialItems=this._store.items.map(function(e){return e.value})}return Object.defineProperty(e,"defaults",{get:function(){return Object.preventExtensions({get options(){return eG},get allOptions(){return W},get templates(){return eV}})},enumerable:!1,configurable:!0}),e.prototype.init=function(){if(!this.initialised&&void 0===this.initialisedOK){this._searcher=new eR(this.config),this._loadChoices(),this._createTemplates(),this._createElements(),this._createStructure(),this._isTextElement&&!this.config.addItems||this.passedElement.element.hasAttribute("disabled")||this.passedElement.element.closest("fieldset:disabled")?this.disable():(this.enable(),this._addEventListeners()),this._initStore(),this.initialised=!0,this.initialisedOK=!0;var e=this.config.callbackOnInit;"function"==typeof e&&e.call(this)}},e.prototype.destroy=function(){this.initialised&&(this._removeEventListeners(),this.passedElement.reveal(),this.containerOuter.unwrap(this.passedElement.element),this._store._listeners=[],this.clearStore(!1),this._stopSearch(),this._templates=e.defaults.templates,this.initialised=!1,this.initialisedOK=void 0)},e.prototype.enable=function(){return this.passedElement.isDisabled&&this.passedElement.enable(),this.containerOuter.isDisabled&&(this._addEventListeners(),this.input.enable(),this.containerOuter.enable()),this},e.prototype.disable=function(){return this.passedElement.isDisabled||this.passedElement.disable(),this.containerOuter.isDisabled||(this._removeEventListeners(),this.input.disable(),this.containerOuter.disable()),this},e.prototype.highlightItem=function(e,t){if(void 0===t&&(t=!0),!e||!e.id)return this;var i=this._store.items.find(function(t){return t.id===e.id});return!i||i.highlighted||(this._store.dispatch(f(i,!0)),t&&this.passedElement.triggerEvent(a.highlightItem,I(i))),this},e.prototype.unhighlightItem=function(e,t){if(void 0===t&&(t=!0),!e||!e.id)return this;var i=this._store.items.find(function(t){return t.id===e.id});return i&&i.highlighted&&(this._store.dispatch(f(i,!1)),t&&this.passedElement.triggerEvent(a.unhighlightItem,I(i))),this},e.prototype.highlightAll=function(){var e=this;
1return this._store.withTxn(function(){e._store.items.forEach(function(t){t.highlighted||(e._store.dispatch(f(t,!0)),e.passedElement.triggerEvent(a.highlightItem,I(t)))})}),this},e.prototype.unhighlightAll=function(){var e=this;return this._store.withTxn(function(){e._store.items.forEach(function(t){t.highlighted&&(e._store.dispatch(f(t,!1)),e.passedElement.triggerEvent(a.highlightItem,I(t)))})}),this},e.prototype.removeActiveItemsByValue=function(e){var t=this;return this._store.withTxn(function(){t._store.items.filter(function(t){return t.value===e}).forEach(function(e){return t._removeItem(e)})}),this},e.prototype.removeActiveItems=function(e){var t=this;return this._store.withTxn(function(){t._store.items.filter(function(t){return t.id!==e}).forEach(function(e){return t._removeItem(e)})}),this},e.prototype.removeHighlightedItems=function(e){var t=this;return void 0===e&&(e=!1),this._store.withTxn(function(){t._store.highlightedActiveItems.forEach(function(i){t._removeItem(i),e&&t._triggerChange(i.value)})}),this},e.prototype.showDropdown=function(e){var t=this;return this.dropdown.isActive||(void 0===e&&(e=!this._canSearch),requestAnimationFrame(function(){t.dropdown.show();var i=t.dropdown.element.getBoundingClientRect();t.containerOuter.open(i.bottom,i.height),e||t.input.focus(),t.passedElement.triggerEvent(a.showDropdown);var n=t.choiceList.element.querySelector(N(t.config.classNames.selectedState));null===n||g(n,t.choiceList.element)||(t.choiceList.element.scrollTop=n.offsetTop)})),this},e.prototype.hideDropdown=function(e){var t=this;return this.dropdown.isActive&&(this._removeHighlightedChoices(),requestAnimationFrame(function(){t.dropdown.hide(),t.containerOuter.close(),!e&&t._canSearch&&(t.input.removeActiveDescendant(),t.input.blur()),t.passedElement.triggerEvent(a.hideDropdown)})),this},e.prototype.getValue=function(e){var t=this._store.items.map(function(t){return e?t.value:I(t)});return this._isSelectOneElement||this.config.singleModeForMultiSelect?t[0]:t},e.prototype.setValue=function(e){var t=this;return this.initialisedOK?(this._store.withTxn(function(){e.forEach(function(e){e&&t._addChoice($(e,!1))})}),this._searcher.reset()):this._warnChoicesInitFailed("setValue"),this},e.prototype.setChoiceByValue=function(e){var t=this;return this.initialisedOK?this._isTextElement||(this._store.withTxn(function(){(Array.isArray(e)?e:[e]).forEach(function(e){return t._findAndSelectChoiceByValue(e)}),t.unhighlightAll()}),this._searcher.reset()):this._warnChoicesInitFailed("setChoiceByValue"),this},e.prototype.setChoices=function(e,t,i,n,s,o){var a=this;if(void 0===e&&(e=[]),void 0===t&&(t="value"),void 0===i&&(i="label"),void 0===n&&(n=!1),void 0===s&&(s=!0),void 0===o&&(o=!1),!this.initialisedOK)return this._warnChoicesInitFailed("setChoices"),this;if(!this._isSelectElement)throw TypeError("setChoices can't be used with INPUT based Choices");if("string"!=typeof t||!t)throw TypeError("value parameter must be a name of 'value' field in passed objects");if("function"==typeof e){var c=e(this);if("function"==typeof Promise&&c instanceof Promise)return new Promise(function(e){return requestAnimationFrame(e)}).then(function(){return a._handleLoadingState(!0)}).then(function(){return c}).then(function(e){return a.setChoices(e,t,i,n,s,o)}).catch(function(e){a.config.silent}).then(function(){return a._handleLoadingState(!1)}).then(function(){return a});if(!Array.isArray(c))throw TypeError(".setChoices first argument function must return either array of choices or Promise, got: ".concat(typeof c));e=c}if(!Array.isArray(e))throw TypeError(".setChoices must be called either with array of choices with a function resulting into Promise of array of choices");return this.containerOuter.removeLoadingState(),this._store.withTxn(function(){s&&(a._isSearching=!1),n&&a.clearChoices(!0,o);var c="value"===t,l="label"===i;e.forEach(function(e){if("choices"in e){var n=e;l||(n=r(r({},n),{label:n[i]})),a._addGroup($(n,!0))}else{var s=e;l&&c||(s=r(r({},s),{value:s[t],label:s[i]}));var o=$(s,!1);a._addChoice(o),o.placeholder&&!a._hasNonChoicePlaceholder&&(a._placeholderValue=S(o.label))}}),a.unhighlightAll()}),this.dropdown.isActive&&this._canAddUserChoices&&this._canCreateItem(this.input.value),this._searcher.reset(),this},e.prototype.refresh=function(e,t,i){var n=this;return(void 0===e&&(e=!1),void 0===t&&(t=!1),void 0===i&&(i=!1),this._isSelectElement)?this._store.withTxn(function(){var s=n.passedElement.optionsAsChoices(),r={};
1i||n._store.items.forEach(function(e){e.id&&e.active&&e.selected&&(r[e.value]=!0)}),n.clearStore(!1);var o=function(e){i?n._store.dispatch(p(e)):r[e.value]&&(e.selected=!0)};s.forEach(function(e){if("choices"in e)return void e.choices.forEach(o);o(e)}),n._addPredefinedChoices(s,t,e),n._isSearching&&n._searchChoices(n.input.value)}):!this.config.silent,this},e.prototype.removeChoice=function(e){var t=this._store.choices.find(function(t){return t.value===e});return t?(this._clearNotice(),this._store.dispatch({type:o.REMOVE_CHOICE,choice:t}),this._searcher.reset(),t.selected&&this.passedElement.triggerEvent(a.removeItem,I(t)),this):this},e.prototype.clearChoices=function(e,t){var i=this;return void 0===e&&(e=!0),void 0===t&&(t=!1),e&&(t?this.passedElement.element.replaceChildren(""):this.passedElement.element.querySelectorAll(":not([selected])").forEach(function(e){e.remove()})),this.itemList.element.replaceChildren(""),this.choiceList.element.replaceChildren(""),this._clearNotice(),this._store.withTxn(function(){var e=t?[]:i._store.items;i._store.reset(),e.forEach(function(e){i._store.dispatch(u(e)),i._store.dispatch(d(e))})}),this._searcher.reset(),this},e.prototype.clearStore=function(e){return void 0===e&&(e=!0),this.clearChoices(e,!0),this._stopSearch(),this._lastAddedChoiceId=0,this._lastAddedGroupId=0,this},e.prototype.clearInput=function(){var e=!this._isSelectOneElement;return this.input.clear(e),this._stopSearch(),this},e.prototype._validateConfig=function(){var e=this.config;D(e,W).length,e.allowHTML&&e.allowHtmlUserInput&&(e.addItems,e.addChoices)},e.prototype._render=function(e){void 0===e&&(e={choices:!0,groups:!0,items:!0}),!this._store.inTxn()&&(this._isSelectElement&&(e.choices||e.groups)&&this._renderChoices(),e.items&&this._renderItems())},e.prototype._renderChoices=function(){var e=this;if(this._canAddItems()){var t=this.config,i=this._isSearching,n=this._store,s=n.activeGroups,r=n.activeChoices,o=i?t.searchResultLimit:t.renderChoiceLimit;if(this._isSelectElement){var a=r.filter(function(e){return!e.element});a.length&&this.passedElement.addOptions(a)}var c=document.createDocumentFragment(),l=function(e){return e.filter(function(e){return!e.placeholder&&(i?(t.searchRenderSelectedChoices||!e.selected)&&!!e.rank:t.render
vendor: 4,794 bytes, line 1
1SelectedChoices||!e.selected)})},h=t.appendGroupInSearch&&i,u=!1,d=null,p=function(n,s){i?n.sort(x):t.shouldSort&&n.sort(t.sorter);var r=n.length;r=!s&&o>0&&r>o?o:r,r--,n.every(function(n,s){var o=n.choiceEl||e._templates.choice(t,n,t.itemSelectText,h&&n.group?n.group.label:void 0);return n.choiceEl=o,c.appendChild(o),i||!n.selected?u=!0:d||(d=o),s<r})};r.length&&(t.resetScrollPosition&&requestAnimationFrame(function(){return e.choiceList.scrollToTop()}),this._hasNonChoicePlaceholder||i||!this._isSelectOneElement||p(r.filter(function(e){return e.placeholder&&!e.group}),!1),s.length&&!i?(t.shouldSort&&s.sort(t.sorter),p(r.filter(function(e){return!e.placeholder&&!e.group}),!1),s.forEach(function(t){var i=l(t.choices);if(i.length){if(t.label){var n=t.groupEl||e._templates.choiceGroup(e.config,t);t.groupEl=n,n.remove(),c.appendChild(n)}p(i,!0)}})):p(l(r),!1)),u||!i&&c.children.length&&t.renderSelectedChoices||(this._notice||(this._notice={text:E(i?t.noResultsText:t.noChoicesText),type:i?Q.noResults:Q.noChoices}),c.replaceChildren("")),this._renderNotice(c),this.choiceList.element.replaceChildren(c),this._highlightChoice(d)}},e.prototype._renderItems=function(){var e=this,t=this._store.items||[],i=this.itemList.element,n=this.config,s=document.createDocumentFragment(),r=function(e){return i.querySelector('[data-item][data-id="'.concat(e.id,'"]'))},o=function(t){var i=t.itemEl;i&&i.parentElement||(i=r(t)||e._templates.item(n,t,n.removeItemButton),t.itemEl=i,s.appendChild(i))};t.forEach(o);var a=!!s.childNodes.length;if(this._isSelectOneElement){var c=i.children.length;if(a||c>1){var l=i.querySelector(N(n.classNames.placeholder));l&&l.remove()}else a||c||!this._placeholderValue||(a=!0,o($({selected:!0,value:"",label:this._placeholderValue,placeholder:!0},!1)))}a&&(i.append(s),n.shouldSortItems&&!this._isSelectOneElement&&(t.sort(n.sorter),t.forEach(function(e){var t=r(e);t&&(t.remove(),s.append(t))}),i.append(s))),this._isTextElement&&(this.passedElement.value=t.map(function(e){return e.value}).join(n.delimiter))},e.prototype._displayNotice=function(e,t,i){void 0===i&&(i=!0);var n=this._notice;if(n&&(n.type===t&&n.text===e||n.type===Q.addChoice&&(t===Q.noResults||t===Q.noChoices))){i&&this.showDropdown(!0);return}this._clearNotice(),this._notice=e?{text:e,type:t}:void 0,this._renderNotice(),i&&e&&this.showDropdown(!0)},e.prototype._clearNotice=function(){if(this._notice){var e=this.choiceList.element.querySelector(N(this.config.classNames.notice));e&&e.remove(),this._notice=void 0}},e.prototype._renderNotice=function(e){var t=this._notice;if(t){var i=this._templates.notice(this.config,t.text,t.type);e?e.append(i):this.choiceList.prepend(i)}},e.prototype._getChoiceForOutput=function(e,t){return I(e,t)},e.prototype._triggerChange=function(e){null!=e&&this.passedElement.triggerEvent(a.change,{value:e})},e.prototype._handleButtonAction=function(e){var t=this,i=this._store.items;if(i.length&&this.config.removeItems&&this.config.removeItemButton){var n=e&&eq(e.closest("[data-id]")),s=n&&i.find(function(e){return e.id===n});s&&this._store.withTxn(function(){if(t._removeItem(s),t._triggerChange(s.value),t._isSelectOneElement&&!t._hasNonChoicePlaceholder){var e=(t.config.shouldSort?t._store.choices.reverse():t._store.choices).find(function(e){return e.placeholder});e&&(t._addItem(e),t.unhighlightAll(),e.value&&t._triggerChange(e.value))}})}},e.prototype._handleItemAction=function(e,t){var i=this;void 0===t&&(t=!1);var n=this._store.items;if(n.length&&this.config.removeItems&&!this._isSelectOneElement){var s=eq(e);s&&(n.forEach(function(e){e.id!==s||e.highlighted?!t&&e.highlighted&&i.unhighlightItem(e):i.highlightItem(e)}),this.input.focus())}},e.prototype._handleChoiceAction=function(e){var t=this,i=eq(e),n=i&&this._store.getChoiceById(i);if(!n||n.disabled)return!1;var s=this.dropdown.isActive;if(!n.selected){if(!this._canAddItems())return!0;this._store.withTxn(function(){t._addItem(n,!0,!0),t.clearInput(),t.unhighlightAll()}),this._triggerChange(n.value)}return s&&this.config.closeDropdownOnSelect&&(this.hideDropdown(!0),this.containerOuter.element.focus()),!0},e.prototype._handleBackspace=function(e){var t=this.config;if(t.removeItems&&e.length){var i=e[e.length-1],n=e.some(function(e){return e.highlighted});t.editItems&&!n&&i?(this.input.value=i.value,this.input.setWidth(),this._removeItem(i),this._triggerChange(i.value)):(n||this.highlightItem(i,!1),this.removeHighlightedItems(!0))}},e.prototype._loadChoices=function(){var e,t=this,i=this.config;if(this._isTextElement){if(this._presetChoices=i.items.map(function(e){return $(e,!1)}),this.passedElement.value){var n=this.passedElement.value.split(i.delimiter).map(function(e){return $(e,!1,t.config.allowHtmlUserInput)});this._presetChoices=this._presetChoices.concat(n)}
1this._presetChoices.forEach(function(e){e.selected=!0})}else if(this._isSelectElement){this._presetChoices=i.choices.map(function(e){return $(e,!0)});var s=this.passedElement.optionsAsChoices();s&&(e=this._presetChoices).push.apply(e,s)}},e.prototype._handleLoadingState=function(e){void 0===e&&(e=!0);var t=this.itemList.element;e?(this.disable(),this.containerOuter.addLoadingState(),this._isSelectOneElement?t.replaceChildren(this._templates.placeholder(this.config,this.config.loadingText)):this.input.placeholder=this.config.loadingText):(this.enable(),this.containerOuter.removeLoadingState(),this._isSelectOneElement?(t.replaceChildren(""),this._render()):this.input.placeholder=this._placeholderValue||"")},e.prototype._handleSearch=function(e){if(this.input.isFocussed)if(null!=e&&e.length>=this.config.searchFloor){var t=this.config.searchChoices?this._searchChoices(e):0;null!==t&&this.passedElement.triggerEvent(a.search,{value:e,resultCount:t})}else this._store.choices.some(function(e){return!e.active})&&this._stopSearch()},e.prototype._canAddItems=function(){var e=this.config,t=e.maxItemCount,i=e.maxItemText;return!e.singleModeForMultiSelect&&t>0&&t<=this._store.items.length?(this.choiceList.element.replaceChildren(""),this._notice=void 0,this._displayNotice("function"==typeof i?i(t):i,Q.addChoice,!1),!1):(this._notice&&this._notice.type===Q.addChoice&&this._clearNotice(),!0)},e.prototype._canCreateItem=function(e){var t=this.config,i=!0,n="";if("function"!=typeof t.addItemFilter||t.addItemFilter(e)||(i=!1,n=w(t.customAddItemText,e,void 0)),i&&this._store.choices.find(function(i){return t.valueComparer(i.value,e)})){if(this._isSelectElement)return this._displayNotice("",Q.addChoice),!1;t.duplicateItemsAllowed||(i=!1,n=w(t.uniqueItemText,e,void 0))}return i&&(n=w(t.addItemText,e,void 0)),n&&this._displayNotice(n,Q.addChoice),i},e.prototype._searchChoices=function(e){var t=e.trim().replace(/\s{2,}/," ");if(!t.length||t===this._currentValue)return null;var i=this._searcher;i.isEmptyIndex()&&i.index(this._store.searchableChoices);var n=i.search(t);this._currentValue=t,this._highlightPosition=0,this._isSearching=!0;var s=this._notice;return(s&&s.type)!==Q.addChoice&&(n.length?this._clearNotice():this._displayNotice(E(this.config.noResultsText),Q.noResults)),this._store.dispatch({type:o.FILTER_CHOICES,results:n}),n.length},e.prototype._stopSearch=function(){this._isSearching&&(this._currentValue="",this._isSearching=!1,this._clearNotice(),this._store.dispatch({type:o.ACTIVATE_CHOICES,active:!0}),this.passedElement.triggerEvent(a.search,{value:"",resultCount:0}))},e.prototype._addEventListeners=function(){var e=this._docRoot,t=this.containerOuter.element,i=this.input.element,n=this.passedElement.element;e.addEventListener("touchend",this._onTouchEnd,!0),t.addEventListener("keydown",this._onKeyDown,!0),t.addEventListener("mousedown",this._onMouseDown,!0),e.addEventListener("click",this._onClick,{passive:!0}),e.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.dropdown.element.addEventListener("mouseover",this._onMouseOver,{passive:!0}),this._isSelectOneElement&&(t.addEventListener("focus",this._onFocus,{passive:!0}),t.addEventListener("blur",this._onBlur,{passive:!0})),i.addEventListener("keyup",this._onKeyUp,{passive:!0}),i.addEventListener("input",this._onInput,{passive:!0}),i.addEventListener("focus",this._onFocus,{passive:!0}),i.addEventListener("blur",this._onBlur,{passive:!0}),i.form&&i.form.addEventListener("reset",this._onFormReset,{passive:!0}),n.hasAttribute("required")&&(n.addEventListener("change",this._onChange,{passive:!0}),n.addEventListener("invalid",this._onInvalid,{passive:!0})),this.input.addEventListeners()},e.prototype._removeEventListeners=function(){var e=this._docRoot,t=this.containerOuter.element,i=this.input.element,n=this.passedElement.element;e.removeEventListener("touchend",this._onTouchEnd,!0),t.removeEventListener("keydown",this._onKeyDown,!0),t.removeEventListener("mousedown",this._onMouseDown,!0),e.removeEventListener("click",this._onClick),e.removeEventListener("touchmove",this._onTouchMove),this.dropdown.element.removeEventListener("mouseover",this._onMouseOver),this._isSelectOneElement&&(t.removeEventListener("focus",this._onFocus),t.removeEventListener("blur",this._onBlur)),i.removeEventListener("keyup",this._onKeyUp),i.removeEventListener("input",this._onInput),i.removeEventListener("focus",this._onFocus),i.removeEventListener("blur",this._onBlur),i.form&&i.form.removeEventListener("reset",this._onFormReset),n.hasAttribute("required")&&(n.removeEventListener("change",this._onChange),n.removeEventListener("invalid",this._onInvalid)),this.input.removeEventListeners()},e.prototype._onKeyDown=function(e){var t=e.keyCode,i=this.dropdown.isActive,n=1===e.ke
1y.length||2===e.key.length&&e.key.charCodeAt(0)>=55296||"Unidentified"===e.key;switch(!this._isTextElement&&!i&&t!==c.ESC_KEY&&t!==c.TAB_KEY&&t!==c.SHIFT_KEY&&(this.showDropdown(),!this.input.isFocussed&&n&&(this.input.value+=e.key," "===e.key&&e.preventDefault())),t){case c.A_KEY:return this._onSelectKey(e,this.itemList.element.hasChildNodes());case c.ENTER_KEY:return this._onEnterKey(e,i);case c.ESC_KEY:return this._onEscapeKey(e,i);case c.UP_KEY:case c.PAGE_UP_KEY:case c.DOWN_KEY:case c.PAGE_DOWN_KEY:return this._onDirectionKey(e,i);case c.DELETE_KEY:case c.BACK_KEY:return this._onDeleteKey(e,this._store.items,this.input.isFocussed)}},e.prototype._onKeyUp=function(){this._canSearch=this.config.searchEnabled},e.prototype._onInput=function(){var e=this.input.value;if(!e)return void(this._isTextElement?this.hideDropdown(!0):this._stopSearch());this._canAddItems()&&(this._canSearch&&this._handleSearch(e),this._canAddUserChoices&&(this._canCreateItem(e),this._isSelectElement&&(this._highlightPosition=0,this._highlightChoice())))},e.prototype._onSelectKey=function(e,t){(e.ctrlKey||e.metaKey)&&t&&(this._canSearch=!1,this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement&&this.highlightAll())},e.prototype._onEnterKey=function(e,t){var i=this,n=this.input.value,s=e.target;if(e.preventDefault(),s&&s.hasAttribute("data-button"))return void this._handleButtonAction(s);if(!t){(this._isSelectElement||this._notice)&&this.showDropdown();return}var r=this.dropdown.element.querySelector(N(this.config.classNames.highlightedState));if(!(r&&this._handleChoiceAction(r))){if(!s||!n)return void this.hideDropdown(!0);if(this._canAddItems()){var o=!1;this._store.withTxn(function(){if(!(o=i._findAndSelectChoiceByValue(n,!0))){if(!i._canAddUserChoices||!i._canCreateItem(n))return;i._addChoice($(n,!1,i.config.allowHtmlUserInput),!0,!0),o=!0}i.clearInput(),i.unhighlightAll()}),o&&(this._triggerChange(n),this.config.closeDropdownOnSelect&&this.hideDropdown(!0))}}},e.prototype._onEscapeKey=function(e,t){t&&(e.stopPropagation(),this.hideDropdown(!0),this._stopSearch(),this.containerOuter.element.focus())},e.prototype._onDirectionKey=function(e,t){var i=e.keyCode;if(t||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var n=i===c.DOWN_KEY||i===c.PAGE_DOWN_KEY?1:-1,s=e.metaKey||i===c.PAGE_DOWN_KEY||i===c.PAGE_UP_KEY,r=void 0;if(s)r=n>0?this.dropdown.element.querySelector("".concat(e$,":last-of-type")):this.dropdown.element.querySelector(e$);else{var o=this.dropdown.element.querySelector(N(this.config.classNames.highlightedState));r=o?_(o,e$,n):this.dropdown.element.querySelector(e$)}r&&(g(r,this.choiceList.element,n)||this.choiceList.scrollToChildElement(r,n),this._highlightChoice(r)),e.preventDefault()}},e.prototype._onDeleteKey=function(e,t,i){this._isSelectOneElement||e.target.value||!i||(this._handleBackspace(t),e.preventDefault())},e.prototype._onTouchMove=function(){this._wasTap&&(this._wasTap=!1)},e.prototype._onTouchEnd=function(e){var t=(e||e.touches[0]).target;this._wasTap&&this.containerOuter.element.contains(t)&&((t===this.containerOuter.element||t===this.containerInner.element)&&(this._isTextElement?this.input.focus():this._isSelectMultipleElement&&this.showDropdown()),e.stopPropagation()),this._wasTap=!0},e.prototype._onMouseDown=function(e){var t=e.target;if(t instanceof Element){if(eB&&this.choiceList.element.contains(t)){var i=this.choiceList.element.firstElementChild;this._isScrollingOnIe="ltr"===this._direction?e.offsetX>=i.offsetWidth:e.offsetX<i.offsetLeft}if(t!==this.input.element){var n=t.closest("[data-button],[data-item],[data-choice]");n instanceof HTMLElement&&("button"in n.dataset?this._handleButtonAction(n):"item"in n.dataset?this._handleItemAction(n,e.shiftKey):"choice"in n.dataset&&this._handleChoiceAction(n)),e.preventDefault()}}},e.prototype._onMouseOver=function(e){var t=e.target;t instanceof HTMLElement&&"choice"in t.dataset&&this._highlightChoice(t)},e.prototype._onClick=function(e){var t=e.target,i=this.containerOuter;i.element.contains(t)?this.dropdown.isActive||i.isDisabled?this._isSelectOneElement&&t!==this.input.element&&!this.dropdown.element.contains(t)&&this.hideDropdown():this._isTextElement?document.activeElement!==this.input.element&&this.input.focus():(this.showDropdown(),i.element.focus()):(i.removeFocusState(),this.hideDropdown(!0),this.unhighlightAll())},e.prototype._onFocus=function(e){var t=e.target,i=this.containerOuter;if(t&&i.element.contains(t)){var n=t===this.input.element;this._isTextElement?n&&i.addFocusState():this._isSelectMultipleElement?n&&(this.showDropdown(!0),i.addFocusState()):(i.addFocusState(),n&&this.showDropdown(!0))}},e.prototype._onBlur=function(e){var t=e.target,i=this.containerOuter;t&&i.element.contains(t)&&!this._isScrollingOnIe?t===this.input.element?(i.removeFocusState(),this.hideDropdown(!0),(this._isTextElement||this._isSelectMultipleElement)&&this.unhighlightAll()):t===this.containerOuter.element&&(i.removeFocusState(),this.config.searchEnabled||this.hideDropdown(!0)):(this._isScrollingOnIe=!1,this.input.element.focus())},e.prototype._onFormReset=function(){var e=this;this._store.withTxn(function(){e.clearInput(),e.hideDropdown(),e.refresh(!1,!1,!0),e._initialItems.length&&e.setChoiceByValue(e._initialItems)})},e.prototype._onChange=function(e){e.target.checkValidity()&&this.containerOuter.removeInvalidState()},e.prototype._onInvalid=function(){this.containerOuter.addInvalidState()},e.prototype._removeHighlightedChoices=function(){var e=this.config.classNames.highlightedState;
1Array.from(this.dropdown.element.querySelectorAll(N(e))).forEach(function(t){P(t,e),t.setAttribute("aria-selected","false")})},e.prototype._highlightChoice=function(e){void 0===e&&(e=null);var t=Array.from(this.dropdown.element.querySelectorAll(e$));if(t.length){var i=e,n=this.config.classNames.highlightedState;this._removeHighlightedChoices(),i?this._highlightPosition=t.indexOf(i):(i=t.length>this._highlightPosition?t[this._highlightPosition]:t[t.length-1])||(i=t[0]),M(i,n),i.setAttribute("aria-selected","true"),this.passedElement.triggerEvent(a.highlightChoice,{el:i}),this.dropdown.isActive&&(this.input.setActiveDescendant(i.id),this.containerOuter.setActiveDescendant(i.id))}},e.prototype._addItem=function(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),!e.id)throw TypeError("item.id must be set before _addItem is called for a choice/item");if((this.config.singleModeForMultiSelect||this._isSelectOneElement)&&this.removeActiveItems(e.id),this._store.dispatch(d(e)),t){var n=I(e);this.passedElement.triggerEvent(a.addItem,n),i&&this.passedElement.triggerEvent(a.choice,n)}},e.prototype._removeItem=function(e){if(e.id){this._store.dispatch(p(e));var t=this._notice;t&&t.type===Q.noChoices&&this._clearNotice(),this.passedElement.triggerEvent(a.removeItem,I(e))}},e.prototype._addChoice=function(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),e.id)throw TypeError("Can not re-add a choice which has already been added");var n=this.config;if(!(!n.duplicateItemsAllowed&&this._store.choices.find(function(t){return n.valueComparer(t.value,e.value)}))){this._lastAddedChoiceId++,e.id=this._lastAddedChoiceId,e.elementId="".concat(this._baseId,"-").concat(this._idNames.itemChoice,"-").concat(e.id);var s=n.prependValue,r=n.appendValue;s&&(e.value=s+e.value),r&&(e.value+=r.toString()),(s||r)&&e.element&&(e.element.value=e.value),this._clearNotice(),this._store.dispatch(u(e)),e.selected&&this._addItem(e,t,i)}},e.prototype._addGroup=function(e,t){var i=this;if(void 0===t&&(t=!0),e.id)throw TypeError("Can not re-add a group which has already been added");this._store.dispatch({type:o.ADD_GROUP,group:e}),e.choices&&(this._lastAddedGroupId++,e.id=this._lastAddedGroupId,e.choices.forEach(function(n){n.group=e,e.disabled&&(n.disabled=!0),i._addChoice(n,t)}))},e.prototype._createTemplates=function(){var e=this,t=this.config.callbackOnCreateTemplates,i={};"function"==typeof t&&(i=t.call(this,b,A,L));var n={};Object.keys(this._templates).forEach(function(t){t in i?n[t]=i[t].bind(e):n[t]=e._templates[t].bind(e)}),this._templates=n},e.prototype._createElements=function(){var e=this._templates,t=this.config,i=this._isSelectOneElement,n=t.position,s=t.classNames,r=this._elementType;this.containerOuter=new K({element:e.containerOuter(t,this._direction,this._isSelectElement,i,t.searchEnabled,r,t.labelId),classNames:s,type:r,position:n}),this.containerInner=new K({element:e.containerInner(t),classNames:s,type:r,position:n}),this.input=new j({element:e.input(t,this._placeholderValue),classNames:s,type:r,preventPaste:!t.paste}),this.choiceList=new H({element:e.choiceList(t,i)}),this.itemList=new H({element:e.itemList(t,i)}),this.dropdown=new R({element:e.dropdown(t),classNames:s,type:r})},e.prototype._createStructure=function(){var e=this.containerInner,t=this.containerOuter,i=this.passedElement,n=this.dropdown.element;i.conceal(),e.wrap(i.element),t.wrap(e.element),t.element.appendChild(e.element),t.element.appendChild(n),e.element.appendChild(this.itemList.element),n.appendChild(this.choiceList.element),this._isSelectOneElement?(this.input.placeholder=this.config.searchPlaceholderValue||"",this.config.searchEnabled&&n.insertBefore(this.input.element,n.firstChild)):((!this._isSelectMultipleElement||this.config.searchEnabled)&&e.element.appendChild(this.input.element),this._placeholderValue&&(this.input.placeholder=this._placeholderValue),this.input.setWidth()),this._highlightPosition=0,this._isSearching=!1},e.prototype._initStore=function(){var e=this;this._store.subscribe(this._render).withTxn(function(){e._addPredefinedChoices(e._presetChoices,e._isSelectOneElement&&!e._hasNonChoicePlaceholder,!1)}),(!this._store.choices.length||this._isSelectOneElement&&this._hasNonChoicePlaceholder)&&this._render()},e.prototype._addPredefinedChoices=function(e,t,i){var n=this;void 0===t&&(t=!1),void 0===i&&(i=!0),t&&-1===e.findIndex(function(e){return e.selected})&&e.some(function(e){return!e.disabled&&!("choices"in e)&&(e.selected=!0,!0)}),e.forEach(function(e){"choices"in e?n._isSelectElement&&n._addGroup(e,i):n._addChoice(e,i
1)})},e.prototype._findAndSelectChoiceByValue=function(e,t){var i=this;void 0===t&&(t=!1);var n=this._store.choices.find(function(t){return i.config.valueComparer(t.value,e)});return!!n&&!n.disabled&&!n.selected&&(this._addItem(n,!0,t),!0)},e.prototype._generatePlaceholderValue=function(){var e=this.config;if(!e.placeholder)return null;if(this._hasNonChoicePlaceholder)return e.placeholderValue;if(this._isSelectElement){var t=this.passedElement.placeholderOption;return t?t.text:null}return null},e.prototype._warnChoicesInitFailed=function(e){if(!this.config.silent)if(this.initialised){if(!this.initialisedOK)throw TypeError("".concat(e," called for an element which has multiple instances of Choices initialised on it"))}else throw TypeError("".concat(e," called on a non-initialised instance of Choices"))},e.version="11.2.3",e}()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.