{
  "version": 3,
  "sources": ["../src/index.ts", "../src/services/binding-event.service.ts", "../src/locales/multiple-select-en-US.ts", "../src/constants.ts", "../src/utils/utils.ts", "../src/utils/domUtils.ts", "../src/services/virtual-scroll.ts", "../src/MultipleSelectInstance.ts", "../src/multiple-select.ts"],
  "sourcesContent": ["export type * from './models/interfaces.js';\nexport type * from './models/locale.interface.js';\nexport type * from './models/multipleSelectOption.interface.js';\nexport { BindingEventService, type ElementEventListener } from './services/binding-event.service.js';\nexport { VirtualScroll } from './services/virtual-scroll.js';\nexport {\n  type HtmlElementPosition,\n  calculateAvailableSpace,\n  classNameToList,\n  convertItemRowToHtml,\n  createDomElement,\n  createDomStructure,\n  emptyElement,\n  findParent,\n  getElementOffset,\n  getElementSize,\n  insertAfter,\n  omitProp,\n  toggleElement,\n  toggleElementClass,\n  windowScrollPosition,\n} from './utils/domUtils.js';\nexport {\n  compareObjects,\n  deepCopy,\n  findByParam,\n  isDefined,\n  objectRemoveEmptyProps,\n  removeDiacritics,\n  removeUndefined,\n  setDataKeys,\n  stripScripts,\n  toCamelCase,\n} from './utils/utils.js';\nexport { multipleSelect } from './multiple-select.js';\nexport { MultipleSelectInstance } from './MultipleSelectInstance.js';\n", "export interface ElementEventListener {\n  element: Element;\n  eventName: keyof HTMLElementEventMap;\n  listener: EventListener;\n  groupName?: string;\n}\n\nexport class BindingEventService {\n  protected _distinctEvent: boolean;\n  protected _boundedEvents: ElementEventListener[] = [];\n\n  get boundedEvents(): ElementEventListener[] {\n    return this._boundedEvents;\n  }\n\n  constructor(options?: { distinctEvent: boolean }) {\n    this._distinctEvent = options?.distinctEvent ?? false;\n  }\n\n  dispose() {\n    this.unbindAll();\n    this._boundedEvents = [];\n  }\n\n  /** Bind an event listener to any element */\n  bind<H extends HTMLElement = HTMLElement>(\n    elementOrElements: H | NodeListOf<H> | Window,\n    eventNameOrNames: keyof HTMLElementEventMap | Array<keyof HTMLElementEventMap>,\n    listener: EventListener,\n    listenerOptions?: boolean | AddEventListenerOptions,\n    groupName = '',\n  ) {\n    // convert to array for looping in next task\n    const eventNames = Array.isArray(eventNameOrNames) ? eventNameOrNames : [eventNameOrNames];\n\n    if (typeof (elementOrElements as NodeListOf<H>)?.forEach === 'function') {\n      // multiple elements to bind to\n      (elementOrElements as NodeListOf<H>).forEach(element => {\n        for (const eventName of eventNames) {\n          if (!this._distinctEvent || (this._distinctEvent && !this.hasBinding(element, eventName))) {\n            element.addEventListener(eventName, listener as EventListener, listenerOptions);\n            this._boundedEvents.push({ element, eventName, listener: listener as EventListener, groupName });\n          }\n        }\n      });\n    } else {\n      // single elements to bind to\n      for (const eventName of eventNames) {\n        if (!this._distinctEvent || (this._distinctEvent && !this.hasBinding(elementOrElements as H, eventName))) {\n          (elementOrElements as H).addEventListener(eventName, listener as EventListener, listenerOptions);\n          this._boundedEvents.push({\n            element: elementOrElements as H,\n            eventName,\n            listener: listener as EventListener,\n            groupName,\n          });\n        }\n      }\n    }\n  }\n\n  hasBinding(elm: Element, eventNameOrNames?: keyof HTMLElementEventMap | Array<keyof HTMLElementEventMap>): boolean {\n    return this._boundedEvents.some(f => f.element === elm && (!eventNameOrNames || f.eventName === eventNameOrNames));\n  }\n\n  /** Unbind a specific listener that was bounded earlier */\n  unbind(\n    elementOrElements?: Element | NodeListOf<Element> | null,\n    eventNameOrNames?: keyof HTMLElementEventMap | Array<keyof HTMLElementEventMap>,\n    listener?: EventListenerOrEventListenerObject | null,\n  ) {\n    if (elementOrElements) {\n      const elements = Array.isArray(elementOrElements) ? elementOrElements : [elementOrElements];\n      const eventNames = Array.isArray(eventNameOrNames) ? eventNameOrNames || '' : [eventNameOrNames || ''];\n\n      for (const element of elements) {\n        if (!listener) {\n          listener = this._boundedEvents.find(f => {\n            if (f.element === element && (!eventNameOrNames || f.eventName === eventNameOrNames)) {\n              return f.listener;\n            }\n            return undefined;\n          }) as EventListener | undefined;\n        }\n\n        for (const eventName of eventNames) {\n          element?.removeEventListener?.(eventName, listener);\n        }\n      }\n    }\n  }\n\n  /**\n   * Unbind all event listeners that were bounded, optionally provide a group name to unbind all listeners assigned to that specific group only.\n   */\n  unbindAll(groupName?: string | string[]) {\n    if (groupName) {\n      const groupNames = Array.isArray(groupName) ? groupName : [groupName];\n      // unbind only the bounded event with a specific group\n      // Note: we need to loop in reverse order to avoid array reindexing (causing index offset) after a splice is called\n      for (let i = this._boundedEvents.length - 1; i >= 0; --i) {\n        const boundedEvent = this._boundedEvents[i];\n        if (groupNames.some(g => g === boundedEvent.groupName)) {\n          const { element, eventName, listener } = boundedEvent;\n          this.unbind(element, eventName, listener);\n          this._boundedEvents.splice(i, 1);\n        }\n      }\n    } else {\n      // unbind everything\n      while (this._boundedEvents.length > 0) {\n        const boundedEvent = this._boundedEvents.pop() as ElementEventListener;\n        const { element, eventName, listener } = boundedEvent;\n        this.unbind(element, eventName, listener);\n      }\n    }\n  }\n}\n", "/**\n * Multiple Select en-US translation\n * Author: Zhixin Wen<wenzhixin2010@gmail.com>\n */\n\nimport type { MultipleSelectInstance } from '../MultipleSelectInstance.js';\nimport type { MultipleSelectLocale, MultipleSelectLocales } from '../models/locale.interface.js';\n\nconst ms =\n  typeof window !== 'undefined' && window.multipleSelect !== undefined\n    ? window.multipleSelect\n    : ({ locales: {} as MultipleSelectLocales } as Partial<MultipleSelectInstance>);\n\nexport const English = {\n  formatSelectAll() {\n    return '[Select all]';\n  },\n  formatAllSelected() {\n    return 'All selected';\n  },\n  formatCountSelected(count: number, total: number) {\n    return `${count} of ${total} selected`;\n  },\n  formatNoMatchesFound() {\n    return 'No matches found';\n  },\n  formatOkButton() {\n    return 'OK';\n  },\n} as MultipleSelectLocale;\n\n(ms.locales as MultipleSelectLocales)['en-US'] = English;\n\nexport default ms.locales;\n", "import type { LabelFilter, TextFilter } from './models/interfaces.js';\nimport type { MultipleSelectOption } from './models/multipleSelectOption.interface.js';\nimport English from './locales/multiple-select-en-US.js';\n\nconst BLOCK_ROWS = 50;\nconst CLUSTER_BLOCKS = 4;\n\nconst DEFAULTS: Partial<MultipleSelectOption> = {\n  name: '',\n  placeholder: '',\n  classes: '',\n  classPrefix: '',\n  data: undefined,\n  locale: undefined,\n\n  selectAll: true,\n  single: undefined,\n  singleRadio: false,\n  multiple: false,\n  hideOptgroupCheckboxes: false,\n  multipleWidth: 80,\n  width: undefined,\n  dropWidth: undefined,\n  maxHeight: 250,\n  maxHeightUnit: 'px',\n  position: 'bottom',\n\n  displayValues: false,\n  displayTitle: false,\n  displayDelimiter: ', ',\n  minimumCountSelected: 3,\n  ellipsis: false,\n\n  isOpen: false,\n  keepOpen: false,\n  openOnHover: false,\n  container: null,\n\n  filter: false,\n  filterGroup: false,\n  filterPlaceholder: '',\n  filterAcceptOnEnter: false,\n  filterByDataLength: undefined,\n  customFilter(filterOptions) {\n    const { text, label, search } = filterOptions as LabelFilter & TextFilter;\n    return (label || text || '').includes(search);\n  },\n\n  showClear: false,\n\n  // auto-position the drop\n  autoAdjustDropHeight: false,\n  autoAdjustDropPosition: false,\n  autoAdjustDropWidthByTextSize: false,\n  adjustedHeightPadding: 10,\n  useSelectOptionLabel: false,\n  useSelectOptionLabelToHtml: false,\n\n  navigationHighlight: true,\n  infiniteScroll: false,\n  virtualScroll: true,\n\n  cssStyler: () => null,\n  textTemplate: (elm: HTMLOptionElement) => elm.innerHTML.trim(),\n  labelTemplate: (elm: HTMLOptionElement) => elm.label,\n\n  onOpen: () => false,\n  onClose: () => false,\n  onCheckAll: () => false,\n  onUncheckAll: () => false,\n  onFocus: () => false,\n  onBlur: () => false,\n  onOptgroupClick: () => false,\n  onBeforeClick: () => true,\n  onClick: () => false,\n  onFilter: () => false,\n  onFilterClear: () => false,\n  onClear: () => false,\n  onAfterCreate: () => false,\n  onDestroy: () => false,\n  onAfterDestroy: () => false,\n  onDestroyed: () => false,\n};\n\nconst METHODS = [\n  'init',\n  'getOptions',\n  'refreshOptions',\n  'getSelects',\n  'setSelects',\n  'enable',\n  'disable',\n  'open',\n  'close',\n  'check',\n  'uncheck',\n  'checkAll',\n  'uncheckAll',\n  'checkInvert',\n  'focus',\n  'blur',\n  'refresh',\n  'destroy',\n];\n\nObject.assign(DEFAULTS, English!['en-US']); // load English as default locale\n\nconst Constants = {\n  BLOCK_ROWS,\n  CLUSTER_BLOCKS,\n  DEFAULTS,\n  METHODS,\n};\n\nexport default Constants;\n", "/** Compare two objects */\nexport function compareObjects(objectA: any, objectB: any, compareLength = false) {\n  const aKeys = Object.keys(objectA);\n  const bKeys = Object.keys(objectB);\n\n  if (compareLength && aKeys.length !== bKeys.length) {\n    return false;\n  }\n\n  for (const key of aKeys) {\n    if (bKeys.includes(key) && objectA[key] !== objectB[key]) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\n/**\n * Create an immutable clone of an array or object\n * (c) 2019 Chris Ferdinandi, MIT License, https://gomakethings.com\n * @param  {Array|Object} objectOrArray - the array or object to copy\n * @return {Array|Object} - the clone of the array or object\n */\nexport function deepCopy(objectOrArray: any | any[]): any | any[] {\n  const cloneObj = () => {\n    const clone = {}; // create new object\n\n    // Loop through each item in the original, recursively copy it's value and add to the clone\n    // eslint-disable-next-line no-restricted-syntax\n    for (const key in objectOrArray) {\n      if (Object.prototype.hasOwnProperty.call(objectOrArray, key)) {\n        (clone as any)[key] = deepCopy(objectOrArray[key]);\n      }\n    }\n    return clone;\n  };\n\n  // Create an immutable copy of an array\n  const cloneArr = () => objectOrArray.map((item: any) => deepCopy(item));\n\n  // Get object type\n  const type = Object.prototype.toString.call(objectOrArray).slice(8, -1).toLowerCase();\n  if (type === 'object') {\n    return cloneObj(); // if it's an object\n  }\n  if (type === 'array') {\n    return cloneArr(); // if it's an array\n  }\n  return objectOrArray; // otherwise, return it as-is, could be primitive or else\n}\n\nexport function isDefined(val: any) {\n  return val !== undefined && val !== null && val !== '';\n}\n\n/**\n * Remove all empty props from an object,\n * we can optionally provide a fixed list of props to consider for removal (anything else will be excluded)\n * @param {*} obj\n * @param {Array<String>} [clearProps] - optional list of props to consider for removal (anything else will be excluded)\n * @returns cleaned object\n */\nexport function objectRemoveEmptyProps(obj: any, clearProps?: string[]) {\n  if (typeof obj === 'object') {\n    if (clearProps) {\n      return Object.fromEntries(Object.entries(obj).filter(([name, val]) => (!isDefined(val) && !clearProps.includes(name)) || isDefined(val)));\n    }\n    return Object.fromEntries(Object.entries(obj).filter(([_, v]) => isDefined(v)));\n  }\n  return obj;\n}\n\nexport function setDataKeys(data: any[]) {\n  let total = 0;\n\n  data.forEach((row, i) => {\n    if (row.type === 'optgroup') {\n      row._key = `group_${i}`;\n      row.visible = typeof row.visible === 'undefined' ? true : row.visible;\n\n      row.children.forEach((child: any, j: number) => {\n        if (child) {\n          child.visible = typeof child?.visible === 'undefined' ? true : child.visible;\n\n          if (!child.divider) {\n            child._key = `option_${i}_${j}`;\n            total += 1;\n          }\n        }\n      });\n    } else {\n      row.visible = typeof row.visible === 'undefined' ? true : row.visible;\n\n      if (!row.divider) {\n        row._key = `option_${i}`;\n        total += 1;\n      }\n    }\n  });\n\n  return total;\n}\n\nexport function findByParam(data: any, param: any, value: any) {\n  if (Array.isArray(data)) {\n    for (const row of data) {\n      if (row[param] === value || (row[param] === `${+row[param]}` && +row[param] === value)) {\n        return row;\n      }\n      if (row.type === 'optgroup') {\n        for (const child of row.children) {\n          if (child && (child[param] === value || (child[param] === `${+child[param]}` && +child[param] === value))) {\n            return child;\n          }\n        }\n      }\n    }\n  }\n}\n\nexport function stripScripts(dirtyHtml: string) {\n  return dirtyHtml.replace(\n    /(\\b)(on[a-z]+)(\\s*)=([^>]*)|javascript:([^>]*)[^>]*|(<\\s*)(\\/*)script([<>]*).*(<\\s*)(\\/*)script(>*)|(&lt;|&#60;)(\\/*)(script|script defer)(.*)(&#62;|&gt;|&gt;\">)/gi,\n    '',\n  );\n}\n\nexport function removeUndefined(obj: any) {\n  Object.keys(obj).forEach(key => (obj[key] === undefined ? delete obj[key] : ''));\n  return obj;\n}\n\nexport function toCamelCase(str: string) {\n  return str.replace(/[\\W_]+(.)/g, (_match, char) => char.toUpperCase());\n}\n\nexport function removeDiacritics(str: string, customParser?: (t: string) => string): string {\n  if (typeof str !== 'string') {\n    return str;\n  }\n  if (typeof customParser === 'function') {\n    return customParser(str);\n  }\n  if (typeof str.normalize === 'function') {\n    return str.normalize('NFD').replace(/[\\u0300-\\u036F]/g, '');\n  }\n  throw new Error(\n    '[Multiple-Select-Vanilla] `normalize()` function is not defined, you can optionally provide a custom parser via the `diacriticParser` option.',\n  );\n}\n", "import type { HtmlStruct, InferDOMType } from '../models/interfaces.js';\nimport { objectRemoveEmptyProps } from './utils.js';\n\nexport interface HtmlElementPosition {\n  top: number;\n  bottom: number;\n  left: number;\n  right: number;\n}\n\n/** calculate available space for each side of the DOM element */\nexport function calculateAvailableSpace(element: HTMLElement): { top: number; bottom: number; left: number; right: number } {\n  let bottom = 0;\n  let top = 0;\n  let left = 0;\n  let right = 0;\n\n  const windowHeight = window.innerHeight ?? 0;\n  const windowWidth = window.innerWidth ?? 0;\n  const scrollPosition = windowScrollPosition();\n  const pageScrollTop = scrollPosition.top;\n  const pageScrollLeft = scrollPosition.left;\n  const elmOffset = getElementOffset(element);\n\n  if (elmOffset) {\n    const elementOffsetTop = elmOffset.top ?? 0;\n    const elementOffsetLeft = elmOffset.left ?? 0;\n    top = elementOffsetTop - pageScrollTop;\n    bottom = windowHeight - (elementOffsetTop - pageScrollTop);\n    left = elementOffsetLeft - pageScrollLeft;\n    right = windowWidth - (elementOffsetLeft - pageScrollLeft);\n  }\n\n  return { top, bottom, left, right };\n}\n\n/**\n * Accepts string containing the class or space-separated list of classes, and\n * returns list of individual classes.\n * Method properly takes into account extra whitespaces in the `className`\n * e.g.: \" class1    class2   \" => will result in `['class1', 'class2']`.\n * @param {String} className - space separated list of class names\n */\nexport function classNameToList(className = ''): string[] {\n  return className.split(' ').filter(cls => cls); // filter will remove whitespace entries\n}\n\n/**\n * Create a DOM Element with any optional attributes or properties.\n * It will only accept valid DOM element properties that `createElement` would accept.\n * For example: `createDomElement('div', { className: 'my-css-class' })`,\n * for style or dataset you need to use nested object `{ style: { display: 'none' }}\n * The last argument is to optionally append the created element to a parent container element.\n * @param {String} tagName - html tag\n * @param {Object} options - element properties\n * @param {[HTMLElement]} appendToParent - parent element to append to\n */\nexport function createDomElement<T extends keyof HTMLElementTagNameMap, K extends keyof HTMLElementTagNameMap[T]>(\n  tagName: T,\n  elementOptions?: { [P in K]: InferDOMType<HTMLElementTagNameMap[T][P]> },\n  appendToParent?: HTMLElement,\n): HTMLElementTagNameMap[T] {\n  const elm = document.createElement<T>(tagName);\n\n  if (elementOptions) {\n    Object.keys(elementOptions).forEach(elmOptionKey => {\n      const elmValue = elementOptions[elmOptionKey as keyof typeof elementOptions];\n      if (typeof elmValue === 'object') {\n        Object.assign(elm[elmOptionKey as K] as object, elmValue);\n      } else {\n        elm[elmOptionKey as K] = (elementOptions as any)[elmOptionKey as keyof typeof elementOptions];\n      }\n    });\n  }\n  if (appendToParent?.appendChild) {\n    appendToParent.appendChild(elm);\n  }\n  return elm;\n}\n\n/**\n * From an HtmlBlock, create the DOM structure and append it to dedicated DOM element, for example:\n *   `{ tagName: 'li', props: { className: 'some-class' }, attrs: { 'aria-label': 'some label' }, children: [] }`\n * @param item\n * @param appendToElm\n */\nexport function createDomStructure(item: HtmlStruct, appendToElm?: HTMLElement, parentElm?: HTMLElement): HTMLElement {\n  // to be CSP safe, we'll omit `innerHTML` and assign it manually afterward\n  const itemPropsOmitHtml = item.props?.innerHTML ? omitProp(item.props, 'innerHTML') : item.props;\n\n  const elm = createDomElement(item.tagName, objectRemoveEmptyProps(itemPropsOmitHtml, ['className', 'title', 'style']), appendToElm);\n  let parent: HTMLElement | null | undefined = parentElm;\n  if (!parent) {\n    parent = elm;\n  }\n\n  if (item.props.innerHTML) {\n    elm.innerHTML = item.props.innerHTML; // at this point, string type should already be as TrustedHTML\n  }\n\n  // add all custom DOM element attributes\n  if (item.attrs) {\n    for (const attrName of Object.keys(item.attrs)) {\n      elm.setAttribute(attrName, item.attrs[attrName]);\n    }\n  }\n\n  // use recursion when finding item children\n  if (item.children) {\n    for (const childItem of item.children) {\n      createDomStructure(childItem, elm, parent);\n    }\n  }\n\n  appendToElm?.appendChild(elm);\n  return elm;\n}\n\n/** takes an html block object and converts to a real HTMLElement */\nexport function convertItemRowToHtml(item: HtmlStruct): HTMLElement {\n  if (item.hasOwnProperty('tagName')) {\n    return createDomStructure(item);\n  }\n  return document.createElement('li');\n}\n\n/**\n * Empty a DOM element by removing all of its DOM element children leaving with an empty element (basically an empty shell)\n * @return {object} element - updated element\n */\nexport function emptyElement<T extends Element = Element>(element?: T | null): T | undefined | null {\n  while (element?.firstChild) {\n    if (element.lastChild) {\n      element.removeChild(element.lastChild);\n    }\n  }\n  return element;\n}\n\n/** Get HTML element offset with pure JS */\nexport function getElementOffset(element?: HTMLElement): HtmlElementPosition | undefined {\n  if (!element) {\n    return undefined;\n  }\n  const rect = element?.getBoundingClientRect?.();\n  let top = 0;\n  let left = 0;\n  let bottom = 0;\n  let right = 0;\n\n  if (rect?.top !== undefined && rect.left !== undefined) {\n    top = rect.top + window.pageYOffset;\n    left = rect.left + window.pageXOffset;\n    right = rect.right;\n    bottom = rect.bottom;\n  }\n  return { top, left, bottom, right };\n}\n\nexport function getElementSize(elm: HTMLElement | undefined, mode: 'inner' | 'outer' | 'scroll', type: 'height' | 'width') {\n  if (!elm) {\n    return 0;\n  }\n\n  // first try defined style width or offsetWidth (which include scroll & padding)\n  let size = Number.parseFloat(elm.style[type]);\n  if (!size || Number.isNaN(size)) {\n    switch (mode) {\n      case 'outer':\n        size = elm[type === 'width' ? 'offsetWidth' : 'offsetHeight'];\n        break;\n      case 'scroll':\n        size = elm[type === 'width' ? 'scrollWidth' : 'scrollHeight'];\n        break;\n      case 'inner':\n      default:\n        size = elm[type === 'width' ? 'clientWidth' : 'clientHeight'];\n        break;\n    }\n    size = elm.getBoundingClientRect()[type];\n  }\n\n  if (!size || Number.isNaN(size)) {\n    // when 0 width, we'll try different ways\n    // when element is auto or 0, we'll keep previous style values to get width and then reapply original values\n    const prevDisplay = elm.style.display;\n    const prevPosition = elm.style.position;\n    elm.style.display = 'block';\n    elm.style.position = 'absolute';\n    const widthStr = window.getComputedStyle(elm)[type];\n    size = Number.parseFloat(widthStr);\n    if (Number.isNaN(size)) {\n      size = 0;\n    }\n\n    // reapply original values\n    elm.style.display = prevDisplay;\n    elm.style.position = prevPosition;\n  }\n\n  return size || 0;\n}\n\n/**\n * Find a single parent by a simple selector, it only works with a simple selector\n * for example: \"input.some-class\", \".some-class\", \"input#some-id\"\n * Note: it won't work with complex selector like \"div.some-class input.my-class\"\n * @param elm\n * @param selector\n * @returns\n */\nexport function findParent(elm: HTMLElement, selector: string) {\n  let targetElm: HTMLElement | null = null;\n  let parentElm = elm?.parentElement;\n\n  while (parentElm) {\n    // query selector id (#some-id) or class (.some-class other-class)\n    const [_, nodeType, selectorType, classOrIdName] = selector.match(/^([a-z]*)([#.]{1})([a-z\\-]+)$/i) || [];\n    if (selectorType && classOrIdName) {\n      // class or id selector type\n      for (const q of classOrIdName.replace(selectorType, '').split(' ')) {\n        if (parentElm.classList.contains(q)) {\n          if (nodeType) {\n            if (parentElm?.tagName.toLowerCase() === nodeType) {\n              targetElm = parentElm;\n            }\n          } else {\n            targetElm = parentElm;\n          }\n        }\n      }\n    }\n    parentElm = parentElm.parentElement;\n  }\n\n  return targetElm;\n}\n\nexport function insertAfter(referenceNode: HTMLElement, newNode: HTMLElement) {\n  referenceNode.parentNode?.insertBefore(newNode, referenceNode.nextSibling);\n}\n\nexport function omitProp(obj: any, key: string) {\n  const { [key]: omitted, ...rest } = obj;\n  return rest;\n}\n\n/** Display or hide matched element */\nexport function toggleElement(elm?: HTMLElement | null, display?: boolean) {\n  if (elm?.style) {\n    elm.style.display = (elm.style.display === 'none' && display !== false) || display === true ? 'block' : 'none';\n  }\n}\n\nexport function toggleElementClass(elm?: HTMLElement | null, state?: boolean) {\n  if (elm?.classList) {\n    const adding = state === true || !elm.classList.contains('selected');\n    const action = adding ? 'add' : 'remove';\n    elm.classList[action]('selected');\n  }\n}\n\n/**\n * Get the Window Scroll top/left Position\n * @returns\n */\nexport function windowScrollPosition(): { left: number; top: number } {\n  return {\n    left: window.pageXOffset || document.documentElement.scrollLeft || 0,\n    top: window.pageYOffset || document.documentElement.scrollTop || 0,\n  };\n}\n", "import Constants from '../constants.js';\nimport type { HtmlStruct, VirtualCache, VirtualScrollOption } from '../models/interfaces.js';\nimport { convertItemRowToHtml, emptyElement } from '../utils/domUtils.js';\n\nexport class VirtualScroll {\n  protected clusterRows?: number;\n  protected cache: VirtualCache;\n  protected scrollEl: HTMLElement;\n  protected blockHeight?: number;\n  protected clusterHeight?: number;\n  protected contentEl: HTMLElement;\n  protected parentEl: HTMLElement | null;\n  protected itemHeight?: number;\n  protected lastCluster: number;\n  protected scrollTop: number;\n  dataStart!: number;\n  dataEnd!: number;\n  rows: HtmlStruct[];\n  destroy: () => void;\n  callback: () => void;\n  sanitizer?: (dirtyHtml: string) => string;\n\n  constructor(options: VirtualScrollOption) {\n    this.rows = options.rows;\n    this.scrollEl = options.scrollEl;\n    this.contentEl = options.contentEl;\n    this.parentEl = options.contentEl?.parentElement;\n    this.callback = options.callback;\n\n    this.cache = {} as VirtualCache;\n    this.scrollTop = this.scrollEl.scrollTop;\n\n    this.initDOM(this.rows);\n\n    this.scrollEl.scrollTop = this.scrollTop;\n    this.lastCluster = 0;\n\n    const onScroll = () => {\n      if (this.lastCluster !== (this.lastCluster = this.getNum())) {\n        this.initDOM(this.rows);\n        this.callback();\n      }\n    };\n\n    this.scrollEl.addEventListener('scroll', onScroll, false);\n    this.destroy = () => {\n      this.scrollEl.removeEventListener('scroll', onScroll, false);\n      emptyElement(this.contentEl);\n    };\n  }\n\n  reset(rows: HtmlStruct[]) {\n    this.lastCluster = 0;\n    this.cache = {} as any;\n    emptyElement(this.contentEl);\n    this.initDOM(rows);\n  }\n\n  protected initDOM(rows: HtmlStruct[]) {\n    if (typeof this.clusterHeight === 'undefined') {\n      this.cache.scrollTop = this.scrollEl.scrollTop;\n      const firstRowElm = convertItemRowToHtml(rows[0]);\n\n      this.contentEl.appendChild(firstRowElm);\n      this.contentEl.appendChild(firstRowElm);\n      this.contentEl.appendChild(firstRowElm);\n      this.cache.data = [rows[0]];\n      this.getRowsHeight();\n    }\n\n    const data = this.initData(rows, this.getNum());\n    const dataChanged = this.checkChanges('data', data.rows);\n    const topOffsetChanged = this.checkChanges('top', data.topOffset);\n    const bottomOffsetChanged = this.checkChanges('bottom', data.bottomOffset);\n\n    emptyElement(this.contentEl);\n\n    if (dataChanged && topOffsetChanged) {\n      if (data.topOffset) {\n        this.contentEl.appendChild(this.getExtra('top', data.topOffset));\n      }\n      data.rows.forEach(h => this.contentEl.appendChild(convertItemRowToHtml(h)));\n\n      if (data.bottomOffset) {\n        this.contentEl.appendChild(this.getExtra('bottom', data.bottomOffset));\n      }\n    } else if (bottomOffsetChanged && this.contentEl.lastChild) {\n      (this.contentEl.lastChild as HTMLElement).style.height = `${data.bottomOffset}px`;\n    }\n  }\n\n  protected getRowsHeight() {\n    if (typeof this.itemHeight === 'undefined') {\n      // make sure parent is not hidden before reading item list height\n      const prevParentDisplay = this.parentEl?.style.display || '';\n      if (this.parentEl && (prevParentDisplay === '' || prevParentDisplay === 'none')) {\n        this.parentEl.style.display = 'block';\n      }\n      const nodes = this.contentEl.children;\n      const node = nodes[Math.floor(nodes.length / 2)];\n      this.itemHeight = (node as HTMLElement).offsetHeight;\n      if (this.parentEl) {\n        this.parentEl.style.display = prevParentDisplay;\n      }\n    }\n    this.blockHeight = this.itemHeight * Constants.BLOCK_ROWS;\n    this.clusterRows = Constants.BLOCK_ROWS * Constants.CLUSTER_BLOCKS;\n    this.clusterHeight = this.blockHeight * Constants.CLUSTER_BLOCKS;\n  }\n\n  protected getNum() {\n    this.scrollTop = this.scrollEl.scrollTop;\n    const blockSize = (this.clusterHeight || 0) - (this.blockHeight || 0);\n    if (blockSize) {\n      return Math.floor(this.scrollTop / blockSize) || 0;\n    }\n    return 0;\n  }\n\n  protected initData(rows: HtmlStruct[], num: number) {\n    if (rows.length < Constants.BLOCK_ROWS) {\n      return {\n        topOffset: 0,\n        bottomOffset: 0,\n        rowsAbove: 0,\n        rows,\n      };\n    }\n    const start = Math.max((this.clusterRows! - Constants.BLOCK_ROWS) * num, 0);\n    const end = start + this.clusterRows!;\n    const topOffset = Math.max(start * this.itemHeight!, 0);\n    const bottomOffset = Math.max((rows.length - end) * this.itemHeight!, 0);\n    const thisRows: HtmlStruct[] = [];\n    let rowsAbove = start;\n    if (topOffset < 1) {\n      rowsAbove++;\n    }\n    for (let i = start; i < end; i++) {\n      rows[i] && thisRows.push(rows[i]);\n    }\n\n    this.dataStart = start;\n    this.dataEnd = end;\n\n    return {\n      topOffset,\n      bottomOffset,\n      rowsAbove,\n      rows: thisRows,\n    };\n  }\n\n  protected checkChanges<T extends keyof VirtualCache>(type: T, value: VirtualCache[T]) {\n    const changed = value !== this.cache[type];\n    this.cache[type] = value;\n    return changed;\n  }\n\n  protected getExtra(className: string, height: number) {\n    const tag = document.createElement('li');\n    tag.className = `virtual-scroll-${className}`;\n    if (height) {\n      tag.style.height = `${height}px`;\n    }\n    return tag;\n  }\n}\n", "/**\n * @author zhixin wen <wenzhixin2010@gmail.com>\n */\nimport Constants from './constants.js';\nimport type { HtmlStruct, OptGroupRowData, OptionDataObject, OptionRowData } from './models/interfaces.js';\nimport type { MultipleSelectLocales } from './models/locale.interface.js';\nimport type { CloseReason, MultipleSelectOption } from './models/multipleSelectOption.interface.js';\nimport { BindingEventService } from './services/binding-event.service.js';\nimport { VirtualScroll } from './services/virtual-scroll.js';\nimport { compareObjects, deepCopy, findByParam, removeDiacritics, removeUndefined, setDataKeys, stripScripts } from './utils/utils.js';\nimport {\n  calculateAvailableSpace,\n  classNameToList,\n  convertItemRowToHtml,\n  createDomElement,\n  emptyElement,\n  findParent,\n  getElementOffset,\n  getElementSize,\n  insertAfter,\n  toggleElement,\n} from './utils/domUtils.js';\nimport type { HtmlElementPosition } from './utils/domUtils.js';\n\nconst OPTIONS_LIST_SELECTOR = '.ms-select-all, ul li[data-key]';\nconst OPTIONS_HIGHLIGHT_LIST_SELECTOR = '.ms-select-all.highlighted, ul li[data-key].highlighted';\n\nexport class MultipleSelectInstance {\n  protected _bindEventService: BindingEventService;\n  protected isAllSelected = false;\n  protected isPartiallyAllSelected = false;\n  protected fromHtml = false;\n  protected choiceElm!: HTMLButtonElement;\n  protected selectClearElm?: HTMLDivElement | null;\n  protected closeElm?: HTMLElement | null;\n  protected clearSearchIconElm?: HTMLElement | null;\n  protected filterText = '';\n  protected updateData: any[] = [];\n  protected data?: Array<OptionRowData | OptGroupRowData> = [];\n  protected dataTotal?: any;\n  protected dropElm?: HTMLDivElement;\n  protected okButtonElm?: HTMLButtonElement;\n  protected filterParentElm?: HTMLDivElement | null;\n  protected lastFocusedItemKey = '';\n  protected lastMouseOverPosition = '';\n  protected ulElm?: HTMLUListElement | null;\n  protected parentElm!: HTMLDivElement;\n  protected labelElm?: HTMLLabelElement | null;\n  protected selectAllParentElm?: HTMLDivElement | null;\n  protected selectAllElm?: HTMLInputElement | null;\n  protected searchInputElm?: HTMLInputElement | null;\n  protected selectGroupElms?: NodeListOf<HTMLInputElement>;\n  protected selectItemElms?: NodeListOf<HTMLInputElement>;\n  protected noResultsElm?: HTMLDivElement | null;\n  protected options: MultipleSelectOption;\n  protected selectAllName = '';\n  protected selectGroupName = '';\n  protected selectItemName = '';\n  protected scrolledByMouse = false;\n  protected openDelayTimer?: number;\n\n  protected updateDataStart?: number;\n  protected updateDataEnd?: number;\n  protected virtualScroll?: VirtualScroll | null;\n  protected _currentHighlightIndex = -1;\n  protected _currentSelectedElm?: HTMLLIElement | HTMLDivElement;\n  protected isMoveUpRecalcRequired = false;\n  locales = {} as MultipleSelectLocales;\n\n  get isRenderAsHtml() {\n    return this.options.renderOptionLabelAsHtml || this.options.useSelectOptionLabelToHtml;\n  }\n\n  constructor(\n    protected elm: HTMLSelectElement,\n    options?: Partial<Omit<MultipleSelectOption, 'onHardDestroy' | 'onAfterHardDestroy'>>,\n  ) {\n    this.options = Object.assign({}, Constants.DEFAULTS, this.elm.dataset, options) as MultipleSelectOption;\n    this._bindEventService = new BindingEventService({ distinctEvent: true });\n  }\n\n  init() {\n    this.initLocale();\n    this.initContainer();\n    this.initData();\n    this.initSelected(true);\n    this.initFilter();\n    this.initDrop();\n    this.initView();\n    this.options.onAfterCreate();\n  }\n\n  /**\n   * destroy the element, if a hard destroy is enabled then we'll also nullify it on the multipleSelect instance array.\n   * When a soft destroy is called, we'll only remove it from the DOM but we'll keep all multipleSelect instances\n   */\n  destroy(hardDestroy = true) {\n    if (this.elm && this.parentElm) {\n      this.options.onDestroy({ hardDestroy });\n      if (hardDestroy) {\n        this.options.onHardDestroy();\n      }\n      if (this.elm.parentElement && this.parentElm.parentElement) {\n        this.elm.parentElement.insertBefore(this.elm, this.parentElm.parentElement!.firstChild);\n      }\n      this.elm.classList.remove('ms-offscreen');\n      this._bindEventService.unbindAll();\n\n      this.virtualScroll?.destroy();\n      this.dropElm?.remove();\n      this.dropElm = undefined;\n      this.parentElm.parentNode?.removeChild(this.parentElm);\n\n      if (this.fromHtml) {\n        delete this.options.data;\n        this.fromHtml = false;\n      }\n      this.options.onAfterDestroy({ hardDestroy });\n\n      // on a hard destroy, we will also nullify all variables & call event so that _multipleSelect can also nullify its own instance\n      if (hardDestroy) {\n        this.options.onAfterHardDestroy?.();\n        Object.keys(this.options).forEach(o => delete (this as any)[o]);\n      }\n    }\n  }\n\n  protected initLocale() {\n    if (this.options.locale) {\n      if (typeof this.options.locale === 'object') {\n        Object.assign(this.options, this.options.locale);\n        return;\n      }\n\n      const locales = window.multipleSelect.locales;\n      const parts = this.options.locale.split(/-|_/);\n\n      parts[0] = parts[0].toLowerCase();\n      if (parts[1]) {\n        parts[1] = parts[1].toUpperCase();\n      }\n\n      if (locales[this.options.locale]) {\n        Object.assign(this.options, locales[this.options.locale]);\n      } else if (locales[parts.join('-')]) {\n        Object.assign(this.options, locales[parts.join('-')]);\n      } else if (locales[parts[0]]) {\n        Object.assign(this.options, locales[parts[0]]);\n      } else {\n        throw new Error(`[multiple-select-vanilla] invalid locales \"${this.options.locale}\", make sure to import it before using it`);\n      }\n    }\n  }\n\n  protected initContainer() {\n    const name = this.elm.getAttribute('name') || this.options.name || '';\n\n    if (this.options.classes) {\n      this.elm.classList.add(this.options.classes);\n    }\n    if (this.options.classPrefix) {\n      this.elm.classList.add(this.options.classPrefix);\n\n      if (this.options.size) {\n        this.elm.classList.add(`${this.options.classPrefix}-${this.options.size}`);\n      }\n    }\n\n    // hide select element\n    this.elm.style.display = 'none';\n\n    // label element\n    this.labelElm = this.elm.closest('label');\n    if (!this.labelElm && this.elm.id) {\n      this.labelElm = document.createElement('label');\n      this.labelElm.htmlFor = this.elm.id;\n    }\n    if (this.labelElm?.querySelector('input')) {\n      this.labelElm = null;\n    }\n\n    // single or multiple\n    if (typeof this.options.single === 'undefined') {\n      this.options.single = !this.elm.multiple;\n    }\n\n    // restore class and title from select element\n    this.parentElm = createDomElement('div', {\n      className: classNameToList(`ms-parent ${this.elm.className || ''} ${this.options.classes}`).join(' '),\n      dataset: { test: 'sel' },\n    });\n\n    if (this.options.darkMode) {\n      this.parentElm.classList.add('ms-dark-mode');\n    }\n\n    // add tooltip title only when provided\n    const parentTitle = this.elm.getAttribute('title') || '';\n    if (parentTitle) {\n      this.parentElm.title = parentTitle;\n    }\n\n    // add placeholder to choice button\n    this.options.placeholder = this.options.placeholder || this.elm.getAttribute('placeholder') || '';\n\n    this.choiceElm = createDomElement('button', { className: 'ms-choice', type: 'button' }, this.parentElm);\n\n    if (this.options.labelId) {\n      this.choiceElm.id = this.options.labelId;\n      this.choiceElm.setAttribute('aria-labelledby', this.options.labelId);\n    }\n\n    this.choiceElm.appendChild(createDomElement('span', { className: 'ms-placeholder', textContent: this.options.placeholder }));\n\n    if (this.options.showClear) {\n      this.selectClearElm = createDomElement('div', { className: 'ms-icon ms-icon-close' });\n      this.selectClearElm.style.display = 'none'; // don't show unless filled\n      this.choiceElm.appendChild(this.selectClearElm);\n    }\n\n    this.choiceElm.appendChild(createDomElement('div', { className: 'ms-icon ms-icon-caret' }));\n\n    // default position is bottom\n    this.dropElm = createDomElement('div', { className: `ms-drop ${this.options.position}`, ariaExpanded: 'false' }, this.parentElm);\n\n    if (this.options.darkMode) {\n      this.dropElm.classList.add('ms-dark-mode');\n    }\n\n    // add data-name attribute when name option is defined\n    if (name) {\n      this.dropElm.dataset.name = name;\n    }\n\n    // add [data-test=\"name\"] attribute to both ms-parent & ms-drop\n    const dataTest = this.elm.getAttribute('data-test') || this.options.dataTest;\n    if (dataTest) {\n      this.parentElm.dataset.test = dataTest;\n      this.dropElm.dataset.test = dataTest;\n    }\n\n    this.closeElm = this.choiceElm.querySelector('.ms-icon-close');\n\n    if (this.options.dropWidth) {\n      this.dropElm.style.width = typeof this.options.dropWidth === 'string' ? this.options.dropWidth : `${this.options.dropWidth}px`;\n    }\n\n    insertAfter(this.elm, this.parentElm);\n\n    if (this.elm.disabled) {\n      this.choiceElm.classList.add('disabled');\n      this.choiceElm.disabled = true;\n    }\n\n    this.selectAllName = `selectAll${name}`;\n    this.selectGroupName = `selectGroup${name}`;\n    this.selectItemName = `selectItem${name}`;\n\n    if (!this.options.keepOpen) {\n      this._bindEventService.unbindAll('body-click');\n      this._bindEventService.bind(\n        document.body,\n        'click',\n        ((e: MouseEvent & { target: HTMLElement }) => {\n          if (this.getEventTarget(e) === this.choiceElm || findParent(this.getEventTarget(e), '.ms-choice') === this.choiceElm) {\n            return;\n          }\n\n          if (\n            (this.getEventTarget(e) === this.dropElm ||\n              (findParent(this.getEventTarget(e), '.ms-drop') !== this.dropElm && this.getEventTarget(e) !== this.elm)) &&\n            this.options.isOpen\n          ) {\n            this.close('body.click');\n          }\n        }) as EventListener,\n        undefined,\n        'body-click',\n      );\n    }\n  }\n\n  protected initData() {\n    const data: Array<OptionRowData> = [];\n\n    if (this.options.data) {\n      if (Array.isArray(this.options.data)) {\n        this.data = this.options.data.map((it: any) => {\n          if (typeof it === 'string' || typeof it === 'number') {\n            return {\n              text: it,\n              value: it,\n            };\n          }\n          return it;\n        });\n      } else if (typeof this.options.data === 'object') {\n        for (const [value, text] of Object.entries(this.options.data as OptionDataObject)) {\n          data.push({\n            value,\n            text: `${text}`,\n          });\n        }\n        this.data = data;\n      }\n    } else {\n      this.elm.childNodes.forEach(elm => {\n        const row = this.initRow(elm as HTMLOptionElement);\n        if (row) {\n          data.push(row as OptionRowData);\n        }\n      });\n\n      this.options.data = data;\n      this.data = data;\n      this.fromHtml = true;\n    }\n\n    this.dataTotal = setDataKeys(this.data || []);\n  }\n\n  protected initRow(elm: HTMLOptionElement, groupDisabled?: boolean) {\n    const row = {} as OptionRowData | OptGroupRowData;\n    if (elm.tagName?.toLowerCase() === 'option') {\n      row.type = 'option';\n      (row as OptionRowData).text = this.options.textTemplate(elm);\n      row.value = elm.value;\n      row.visible = true;\n      row.selected = !!elm.selected;\n      row.disabled = groupDisabled || elm.disabled;\n      row.classes = elm.getAttribute('class') || '';\n      row.title = elm.getAttribute('title') || '';\n\n      if (elm.dataset.value) {\n        row._value = elm.dataset.value; // value for object\n      }\n      if (Object.keys(elm.dataset).length) {\n        row._data = elm.dataset;\n\n        if (row._data.divider) {\n          row.divider = row._data.divider;\n        }\n      }\n\n      return row;\n    }\n\n    if (elm.tagName?.toLowerCase() === 'optgroup') {\n      row.type = 'optgroup';\n      (row as OptGroupRowData).label = this.options.labelTemplate(elm);\n      row.visible = true;\n      row.selected = !!elm.selected;\n      row.disabled = elm.disabled;\n      (row as OptGroupRowData).children = [];\n      if (Object.keys(elm.dataset).length) {\n        row._data = elm.dataset;\n      }\n\n      elm.childNodes.forEach(childNode => {\n        (row as OptGroupRowData).children.push(this.initRow(childNode as HTMLOptionElement, row.disabled) as OptionRowData);\n      });\n\n      return row;\n    }\n\n    return null;\n  }\n\n  protected initDrop() {\n    this.initList();\n    this.update(true);\n\n    if (this.options.isOpen) {\n      this.open(10);\n    }\n\n    if (this.options.openOnHover && this.parentElm) {\n      this._bindEventService.bind(this.parentElm, 'mouseover', () => this.open(null));\n      this._bindEventService.bind(this.parentElm, 'mouseout', () => this.close('hover.mouseout'));\n    }\n  }\n\n  protected initFilter() {\n    this.filterText = '';\n\n    if (this.options.filter || !this.options.filterByDataLength) {\n      return;\n    }\n\n    let length = 0;\n    for (const option of this.data || []) {\n      if ((option as OptGroupRowData).type === 'optgroup') {\n        length += (option as OptGroupRowData).children.length;\n      } else {\n        length += 1;\n      }\n    }\n    this.options.filter = length > this.options.filterByDataLength;\n  }\n\n  protected initList() {\n    if (this.options.filter) {\n      this.filterParentElm = createDomElement('div', { className: 'ms-search' }, this.dropElm);\n      this.filterParentElm.appendChild(\n        createDomElement('input', {\n          autocomplete: 'off',\n          autocapitalize: 'off',\n          spellcheck: false,\n          type: 'text',\n          placeholder: this.options.filterPlaceholder || '\uD83D\uDD0E\uFE0E',\n        }),\n      );\n\n      if (this.options.showSearchClear) {\n        this.filterParentElm.appendChild(createDomElement('span', { className: 'ms-icon ms-icon-close' }));\n      }\n    }\n\n    if (this.options.selectAll && !this.options.single) {\n      const selectName = this.elm.getAttribute('name') || this.options.name || '';\n      this.selectAllParentElm = createDomElement('div', { className: 'ms-select-all', dataset: { key: 'select_all' } });\n      const saLabelElm = document.createElement('label');\n      const saIconClass = this.isAllSelected ? 'ms-icon-check' : this.isPartiallyAllSelected ? 'ms-icon-minus' : 'ms-icon-uncheck';\n      const selectAllIconClass = `ms-icon ${saIconClass}`;\n      const saIconContainerElm = createDomElement('div', { className: 'icon-checkbox-container' }, saLabelElm);\n      createDomElement(\n        'input',\n        {\n          type: 'checkbox',\n          ariaChecked: String(this.isAllSelected),\n          checked: this.isAllSelected,\n          dataset: { name: `selectAll${selectName}` },\n        },\n        saIconContainerElm,\n      );\n      createDomElement('div', { className: selectAllIconClass }, saIconContainerElm);\n\n      saLabelElm.appendChild(createDomElement('span', { textContent: this.formatSelectAll() }));\n      this.selectAllParentElm.appendChild(saLabelElm);\n      this.dropElm?.appendChild(this.selectAllParentElm);\n    }\n\n    this.ulElm = document.createElement('ul');\n    this.ulElm.role = 'combobox';\n    this.ulElm.ariaExpanded = 'false';\n    this.ulElm.ariaMultiSelectable = String(!this.options.single);\n    this.dropElm?.appendChild(this.ulElm);\n\n    if (this.options.showOkButton && !this.options.single) {\n      this.okButtonElm = createDomElement(\n        'button',\n        { className: 'ms-ok-button', type: 'button', textContent: this.formatOkButton() },\n        this.dropElm,\n      );\n    }\n    this.initListItems();\n  }\n\n  protected initListItems(): HtmlStruct[] {\n    let offset = 0;\n    const rows = this.getListRows();\n\n    if (this.options.selectAll && !this.options.single) {\n      offset = -1;\n    }\n\n    if (rows.length > Constants.BLOCK_ROWS * Constants.CLUSTER_BLOCKS) {\n      const dropVisible = this.dropElm && this.dropElm?.style.display !== 'none';\n      if (!dropVisible && this.dropElm) {\n        this.dropElm.style.left = '-10000';\n        this.dropElm.style.display = 'block';\n        this.dropElm.ariaExpanded = 'true';\n      }\n\n      const updateDataOffset = () => {\n        if (this.virtualScroll) {\n          this._currentHighlightIndex = 0;\n          this.updateDataStart = this.virtualScroll.dataStart + offset;\n          this.updateDataEnd = this.virtualScroll.dataEnd + offset;\n\n          if (this.updateDataStart < 0) {\n            this.updateDataStart = 0;\n            this._currentHighlightIndex = 0;\n          }\n          const dataLn = this.getDataLength();\n          if (this.updateDataEnd > dataLn) {\n            this.updateDataEnd = dataLn;\n          }\n\n          if (this.ulElm) {\n            if (this.isMoveUpRecalcRequired) {\n              this.recalculateArrowMove('up');\n            } else if (this.virtualScroll.dataStart > this.updateDataStart) {\n              this.recalculateArrowMove('down');\n            }\n          }\n        }\n      };\n\n      if (this.ulElm) {\n        if (!this.virtualScroll) {\n          this.virtualScroll = new VirtualScroll({\n            rows,\n            scrollEl: this.ulElm,\n            contentEl: this.ulElm,\n            sanitizer: this.options.sanitizer,\n            callback: () => {\n              updateDataOffset();\n              this.events();\n            },\n          });\n        } else {\n          this.virtualScroll.reset(rows);\n        }\n      }\n      updateDataOffset();\n\n      if (!dropVisible && this.dropElm) {\n        this.dropElm.style.left = '0';\n        this.dropElm.style.display = 'none';\n        this.dropElm.ariaExpanded = 'false';\n      }\n    } else {\n      if (this.ulElm) {\n        emptyElement(this.ulElm);\n        rows.forEach(itemRow => this.ulElm!.appendChild(convertItemRowToHtml(itemRow)));\n      }\n      this.updateDataStart = 0;\n      this.updateDataEnd = this.updateData.length;\n    }\n\n    this.events();\n\n    return rows;\n  }\n\n  protected getEventTarget(e: Event & { target: HTMLElement }): HTMLElement {\n    if (e.composedPath) {\n      return e.composedPath()[0] as HTMLElement;\n    }\n    return e.target as HTMLElement;\n  }\n\n  protected getListRows(): HtmlStruct[] {\n    const rows: HtmlStruct[] = [];\n    this.updateData = [];\n    this.data?.forEach(dataRow => rows.push(...this.initListItem(dataRow)));\n\n    // when infinite scroll is enabled, we'll add an empty <li> element (that will never be clickable)\n    // so that scrolling to the last valid item will NOT automatically scroll back to the top of the list.\n    // However scrolling by 1 more item (the last invisible item) will at that time trigger the scroll back to the top of the list\n    if (this.options.infiniteScroll) {\n      rows.push({\n        tagName: 'li',\n        props: { className: 'ms-infinite-option', role: 'option' },\n      });\n    }\n\n    // add a \"No Results\" option that is hidden by default\n    rows.push({ tagName: 'li', props: { className: 'ms-no-results', textContent: this.formatNoMatchesFound() } });\n\n    return rows;\n  }\n\n  protected initListItem(dataRow: OptionRowData | OptGroupRowData, level = 0): HtmlStruct[] {\n    const title = dataRow?.title || '';\n    const multiple = this.options.multiple ? 'multiple' : '';\n    const type = this.options.single ? 'radio' : 'checkbox';\n    const isChecked = !!dataRow?.selected;\n    const isSingleWithoutRadioIcon = this.options.single && !this.options.singleRadio;\n    let classes = '';\n\n    if (!dataRow?.visible) {\n      return [];\n    }\n\n    this.updateData.push(dataRow);\n\n    if (isSingleWithoutRadioIcon) {\n      classes = 'hide-radio ';\n    }\n\n    if (dataRow.selected) {\n      classes += 'selected ';\n    }\n\n    if (dataRow.type === 'optgroup') {\n      // - group option row -\n      const htmlBlocks: HtmlStruct[] = [];\n\n      let itemOrGroupBlock: HtmlStruct;\n      if (this.options.hideOptgroupCheckboxes || this.options.single) {\n        itemOrGroupBlock = { tagName: 'span', props: { dataset: { name: this.selectGroupName, key: dataRow._key } } };\n      } else {\n        const inputCheckboxStruct: HtmlStruct = {\n          tagName: 'input',\n          props: {\n            type: 'checkbox',\n            dataset: { name: this.selectGroupName, key: dataRow._key },\n            checked: isChecked,\n            disabled: dataRow.disabled,\n          },\n        };\n\n        // when creating a block that has multiple selections, we'll add the icon checkbox container\n        // otherwise it will be just the input checkbox\n        if (isSingleWithoutRadioIcon) {\n          itemOrGroupBlock = inputCheckboxStruct;\n        } else {\n          itemOrGroupBlock = {\n            tagName: 'div',\n            props: { className: `icon-checkbox-container${type === 'radio' ? ' radio' : ''}` },\n            children: [\n              inputCheckboxStruct,\n              {\n                tagName: 'div',\n                props: { className: `ms-icon ${isChecked ? (type === 'radio' ? 'ms-icon-radio' : 'ms-icon-check') : 'ms-icon-uncheck'}` },\n              },\n            ],\n          };\n        }\n      }\n\n      if (!classes.includes('hide-radio') && (this.options.hideOptgroupCheckboxes || this.options.single)) {\n        classes += 'hide-radio ';\n      }\n\n      const spanLabelBlock: HtmlStruct = { tagName: 'span', props: {} };\n      this.applyAsTextOrHtmlWhenEnabled(spanLabelBlock.props, (dataRow as OptGroupRowData).label);\n      const liBlock: HtmlStruct = {\n        tagName: 'li',\n        props: {\n          className: classNameToList(`group${this.options.single || dataRow.disabled ? ' disabled' : ''} ${classes}`).join(' '),\n          role: 'option',\n          ariaSelected: String(isChecked),\n          dataset: { key: dataRow._key },\n        },\n        children: [\n          {\n            tagName: 'label',\n            props: { className: classNameToList(`optgroup${this.options.single || dataRow.disabled ? ' disabled' : ''}`).join(' ') },\n            children: [itemOrGroupBlock, spanLabelBlock],\n          },\n        ],\n      };\n\n      const customStyleRules = this.options.cssStyler(dataRow);\n      if (customStyleRules) {\n        liBlock.props.style = customStyleRules;\n      }\n      htmlBlocks.push(liBlock);\n\n      (dataRow as OptGroupRowData).children.forEach(child => htmlBlocks.push(...this.initListItem(child, 1)));\n\n      return htmlBlocks;\n    }\n\n    // - regular row -\n    classes += dataRow.classes || '';\n\n    if (level && this.options.single) {\n      classes += `option-level-${level} `;\n    }\n\n    if (dataRow.divider) {\n      return [{ tagName: 'li', props: { className: 'option-divider' } } as HtmlStruct];\n    }\n\n    let liClasses = multiple || classes ? (multiple + classes).trim() : '';\n    if (dataRow.disabled) {\n      liClasses += ' disabled';\n    }\n    const labelClasses = `${dataRow.disabled ? 'disabled' : ''}`;\n    const spanLabelBlock: HtmlStruct = { tagName: 'span', props: {} };\n    this.applyAsTextOrHtmlWhenEnabled(spanLabelBlock.props, (dataRow as OptionRowData).text);\n    const inputBlock: HtmlStruct = {\n      tagName: 'input',\n      props: {\n        type,\n        value: encodeURI(dataRow.value as string),\n        dataset: { key: dataRow._key, name: this.selectItemName },\n        checked: isChecked,\n        disabled: !!dataRow.disabled,\n      },\n    };\n\n    if (dataRow.selected) {\n      inputBlock.attrs = { checked: 'checked' };\n    }\n\n    const iconContainerBlock: HtmlStruct = {\n      tagName: 'div',\n      props: { className: `icon-checkbox-container${type === 'radio' ? ' radio' : ''}` },\n      children: [\n        inputBlock,\n        {\n          tagName: 'div',\n          props: {\n            className: `ms-icon ${inputBlock.props.checked ? (type === 'radio' ? 'ms-icon-radio' : 'ms-icon-check') : 'ms-icon-uncheck'}`,\n          },\n        },\n      ],\n    };\n\n    const liBlock: HtmlStruct = {\n      tagName: 'li',\n      props: {\n        role: 'option',\n        title,\n        ariaSelected: String(isChecked),\n        dataset: { key: dataRow._key },\n      },\n      children: [\n        {\n          tagName: 'label',\n          props: { className: labelClasses },\n          children: [\n            // add icon container when showing radio OR using multiple select\n            isSingleWithoutRadioIcon ? inputBlock : iconContainerBlock,\n            spanLabelBlock,\n          ],\n        },\n      ],\n    };\n\n    if (liClasses) {\n      liBlock.props.className = liClasses;\n    }\n\n    const customStyleRules = this.options.cssStyler(dataRow);\n    if (customStyleRules) {\n      liBlock.props.style = customStyleRules;\n    }\n\n    return [liBlock];\n  }\n\n  protected initSelected(ignoreTrigger = false) {\n    let selectedTotal = 0;\n\n    for (const row of this.data || []) {\n      if ((row as OptGroupRowData).type === 'optgroup') {\n        const selectedCount = (row as OptGroupRowData).children.filter(child => child?.selected && !child.disabled && child.visible).length;\n\n        if ((row as OptGroupRowData).children.length) {\n          row.selected =\n            !this.options.single &&\n            selectedCount &&\n            selectedCount ===\n              (row as OptGroupRowData).children.filter((child: any) => child && !child.disabled && child.visible && !child.divider).length;\n        }\n        selectedTotal += selectedCount;\n      } else {\n        selectedTotal += row.selected && !row.disabled && row.visible ? 1 : 0;\n      }\n    }\n\n    this.isAllSelected =\n      this.data?.filter((row: OptionRowData | OptGroupRowData) => {\n        return row.selected && !row.disabled && row.visible;\n      }).length === this.data?.filter(row => !row.disabled && row.visible && !row.divider).length;\n    this.isPartiallyAllSelected = !this.isAllSelected && selectedTotal > 0;\n\n    if (!ignoreTrigger) {\n      if (this.isAllSelected) {\n        this.options.onCheckAll();\n      } else if (selectedTotal === 0) {\n        this.options.onUncheckAll();\n      }\n    }\n  }\n\n  protected initView() {\n    let computedWidth: number | string;\n\n    if (window.getComputedStyle) {\n      computedWidth = window.getComputedStyle(this.elm).width;\n      if (computedWidth === 'auto') {\n        computedWidth = getElementSize(this.dropElm, 'outer', 'width') + 20;\n      }\n    } else {\n      computedWidth = getElementSize(this.elm, 'outer', 'width') + 20;\n    }\n\n    this.parentElm.style.width = `${this.options.width || computedWidth}px`;\n    this.elm.classList.add('ms-offscreen');\n  }\n\n  protected events() {\n    this._bindEventService.unbindAll([\n      'ok-button',\n      'search-input',\n      'select-all-checkbox',\n      'input-checkbox-list',\n      'group-checkbox-list',\n      'hover-highlight',\n      'arrow-highlight',\n      'option-list-scroll',\n    ]);\n\n    this.clearSearchIconElm = this.filterParentElm?.querySelector('.ms-icon-close');\n    this.searchInputElm = this.dropElm?.querySelector<HTMLInputElement>('.ms-search input');\n    this.selectAllElm = this.dropElm?.querySelector<HTMLInputElement>(`input[data-name=\"${this.selectAllName}\"]`);\n    this.selectGroupElms = this.dropElm?.querySelectorAll<HTMLInputElement>(\n      `input[data-name=\"${this.selectGroupName}\"],span[data-name=\"${this.selectGroupName}\"]`,\n    );\n    this.selectItemElms = this.dropElm?.querySelectorAll<HTMLInputElement>(`input[data-name=\"${this.selectItemName}\"]:enabled`);\n    this.noResultsElm = this.dropElm?.querySelector<HTMLDivElement>('.ms-no-results');\n\n    const toggleOpen = (e: MouseEvent & { target: HTMLElement }) => {\n      e.preventDefault();\n      if (this.getEventTarget(e).classList.contains('ms-icon-close')) {\n        return;\n      }\n      this.options.isOpen ? this.close('toggle.close') : this.open();\n    };\n\n    if (this.labelElm) {\n      this._bindEventService.bind(this.labelElm, 'click', ((e: MouseEvent & { target: HTMLElement }) => {\n        if (this.getEventTarget(e).nodeName.toLowerCase() !== 'label') {\n          return;\n        }\n        toggleOpen(e);\n        if (!this.options.filter || !this.options.isOpen) {\n          this.focus();\n        }\n        e.stopPropagation(); // Causes lost focus otherwise\n      }) as EventListener);\n    }\n\n    this._bindEventService.bind(this.choiceElm, 'click', toggleOpen as EventListener);\n    if (this.options.onFocus) {\n      this._bindEventService.bind(this.choiceElm, 'focus', this.options.onFocus as EventListener);\n    }\n    if (this.options.onBlur) {\n      this._bindEventService.bind(this.choiceElm, 'blur', this.options.onBlur as EventListener);\n    }\n\n    this._bindEventService.bind(this.parentElm, 'keydown', ((e: KeyboardEvent) => {\n      if (e.code === 'Escape') {\n        this.handleEscapeKey();\n      }\n    }) as EventListener);\n\n    if (this.closeElm) {\n      this._bindEventService.bind(this.closeElm, 'click', ((e: MouseEvent) => {\n        e.preventDefault();\n        this._checkAll(false, true);\n        this.initSelected(false);\n        this.updateSelected();\n        this.update();\n        this.options.onClear();\n      }) as EventListener);\n    }\n\n    if (this.clearSearchIconElm) {\n      this._bindEventService.bind(this.clearSearchIconElm, 'click', ((e: MouseEvent) => {\n        e.preventDefault();\n        if (this.searchInputElm) {\n          this.searchInputElm.value = '';\n          this.searchInputElm.focus();\n        }\n        // move highlight back to top of the list\n        this._currentHighlightIndex = -1;\n        this.moveHighlightDown();\n        this.filter();\n        this.options.onFilterClear();\n      }) as EventListener);\n    }\n\n    if (this.searchInputElm) {\n      this._bindEventService.bind(\n        this.searchInputElm,\n        'keydown',\n        ((e: KeyboardEvent) => {\n          // Ensure shift-tab causes lost focus from filter as with clicking away\n          if (e.code === 'Tab' && e.shiftKey) {\n            this.close('key.shift+tab');\n          }\n        }) as EventListener,\n        undefined,\n        'search-input',\n      );\n\n      this._bindEventService.bind(\n        this.searchInputElm,\n        'keyup',\n        ((e: KeyboardEvent) => {\n          // enter or space\n          // Avoid selecting/deselecting if no choices made\n          if (this.options.filterAcceptOnEnter && ['Enter', 'Space'].includes(e.code) && this.searchInputElm?.value) {\n            if (this.options.single) {\n              const visibleLiElms: HTMLInputElement[] = [];\n              this.selectItemElms?.forEach(selectedElm => {\n                if (selectedElm.closest('li')?.style.display !== 'none') {\n                  visibleLiElms.push(selectedElm);\n                }\n              });\n              if (visibleLiElms.length && visibleLiElms[0].hasAttribute('data-name')) {\n                this.setSelects([visibleLiElms[0].value]);\n              }\n            } else {\n              this.selectAllElm?.click();\n            }\n            this.close(`key.${e.code.toLowerCase() as 'enter' | 'space'}`);\n            this.focus();\n            return;\n          }\n          this.filter();\n        }) as EventListener,\n        undefined,\n        'search-input',\n      );\n    }\n\n    if (this.selectAllElm) {\n      this._bindEventService.bind(\n        this.selectAllElm,\n        'click',\n        ((e: MouseEvent & { currentTarget: HTMLInputElement }) => this._checkAll(e.currentTarget?.checked)) as EventListener,\n        undefined,\n        'select-all-checkbox',\n      );\n    }\n\n    if (this.okButtonElm) {\n      this._bindEventService.bind(\n        this.okButtonElm,\n        'click',\n        ((e: MouseEvent & { target: HTMLElement }) => {\n          toggleOpen(e);\n          e.stopPropagation(); // Causes lost focus otherwise\n        }) as EventListener,\n        undefined,\n        'ok-button',\n      );\n    }\n\n    if (this.selectGroupElms) {\n      this._bindEventService.bind(\n        this.selectGroupElms,\n        'click',\n        ((e: MouseEvent & { currentTarget: HTMLInputElement }) => {\n          const selectElm = e.currentTarget;\n          const checked = selectElm.checked;\n          const group = findByParam(this.data, '_key', selectElm.dataset.key);\n\n          this._checkGroup(group, checked);\n          this.options.onOptgroupClick(\n            removeUndefined({\n              label: group.label,\n              selected: group.selected,\n              data: group._data,\n              children: group.children.map((child: any) => {\n                if (child) {\n                  return removeUndefined({\n                    text: child.text,\n                    value: child.value,\n                    selected: child.selected,\n                    disabled: child.disabled,\n                    data: child._data,\n                  });\n                }\n              }),\n            }),\n          );\n        }) as EventListener,\n        undefined,\n        'group-checkbox-list',\n      );\n    }\n\n    if (this.selectItemElms) {\n      this._bindEventService.bind(\n        this.selectItemElms,\n        'click',\n        ((e: MouseEvent & { currentTarget: HTMLInputElement }) => {\n          const selectElm = e.currentTarget;\n          const checked = selectElm.checked;\n          const option = findByParam(this.data, '_key', selectElm.dataset.key);\n          const close = () => {\n            if (this.options.single && this.options.isOpen && !this.options.keepOpen) {\n              this.close('selection');\n            }\n          };\n\n          if (this.options.onBeforeClick(option) === false) {\n            close();\n            return;\n          }\n\n          this._check(option, checked);\n          this.options.onClick(\n            removeUndefined({\n              text: option.text,\n              value: option.value,\n              selected: option.selected,\n              data: option._data,\n            }),\n          );\n\n          close();\n        }) as EventListener,\n        undefined,\n        'input-checkbox-list',\n      );\n    }\n\n    if (this.lastFocusedItemKey && this.dropElm) {\n      // if we previously had an item focused and the VirtualScroll recreates the list, we need to refocus on last item by its input data-key\n      const input = this.dropElm.querySelector<HTMLInputElement>(`li[data-key=${this.lastFocusedItemKey}]`);\n      input?.focus();\n    }\n\n    if (this.options.navigationHighlight && this.dropElm) {\n      // when hovering an select option, we will also change the highlight to that option\n      this._bindEventService.bind(\n        this.dropElm,\n        'mouseover',\n        ((e: MouseEvent & { target: HTMLDivElement | HTMLLIElement }) => {\n          const liElm = (this.getEventTarget(e).closest('.ms-select-all') || this.getEventTarget(e).closest('li')) as HTMLLIElement;\n\n          if (this.dropElm?.contains(liElm) && this.lastMouseOverPosition !== `${e.clientX}:${e.clientY}`) {\n            const optionElms = this.dropElm?.querySelectorAll<HTMLLIElement>(OPTIONS_LIST_SELECTOR) || [];\n            const newIdx = Array.from(optionElms).findIndex(el => el.dataset.key === liElm.dataset.key);\n            if (this._currentHighlightIndex !== newIdx && !liElm.classList.contains('disabled')) {\n              this._currentSelectedElm = liElm;\n              this._currentHighlightIndex = newIdx;\n              this.changeCurrentOptionHighlight(liElm);\n            }\n          }\n          this.lastMouseOverPosition = `${e.clientX}:${e.clientY}`;\n        }) as EventListener,\n        undefined,\n        'hover-highlight',\n      );\n\n      // add keydown event listeners to watch for up/down arrows and focus on previous/next item\n      // we will ignore divider and if key pressed is the Enter/Space key then we'll instead select/deselect input checkbox\n      // we will also remove any previous bindings that might exist which happen when we use VirtualScroll\n      this._bindEventService.bind(\n        this.dropElm,\n        'keydown',\n        ((e: KeyboardEvent & { target: HTMLDivElement | HTMLLIElement }) => {\n          switch (e.key) {\n            case 'ArrowUp':\n              e.preventDefault();\n              this.moveHighlightUp();\n              break;\n            case 'ArrowDown':\n              e.preventDefault();\n              this.moveHighlightDown();\n              break;\n            case 'Escape':\n              this.handleEscapeKey();\n              break;\n            case 'Enter':\n            case ' ': {\n              // if we're focused on the OK button then don't execute following block\n              if (document.activeElement !== this.okButtonElm) {\n                const liElm = this.getEventTarget(e).closest('.ms-select-all') || this.getEventTarget(e).closest('li');\n                if ((e.key === ' ' && this.options.filter) || (this.options.filterAcceptOnEnter && !liElm)) {\n                  return;\n                }\n                e.preventDefault();\n                this._currentSelectedElm?.querySelector('input')?.click();\n\n                // on single select, we should focus directly\n                if (this.options.single) {\n                  this.choiceElm.focus();\n                  this.lastFocusedItemKey = this.choiceElm?.dataset.key || '';\n                }\n              }\n              break;\n            }\n            case 'Tab': {\n              // when clicking Tab, we'll focus on OK button when available\n              // or with Shift+Tab we'll either focus first option when coming\n              // from OK button or close drop if we're already in the lsit\n              e.preventDefault();\n              if (e.shiftKey) {\n                if (document.activeElement === this.okButtonElm) {\n                  this.focusSelectAllOrList();\n                  this.highlightCurrentOption();\n                } else {\n                  this.close('key.shift+tab');\n                  this.choiceElm.focus();\n                }\n              } else {\n                this.changeCurrentOptionHighlight();\n                this.okButtonElm?.focus();\n              }\n              break;\n            }\n          }\n        }) as EventListener,\n        undefined,\n        'arrow-highlight',\n      );\n    }\n\n    if (this.ulElm && this.options.infiniteScroll) {\n      this._bindEventService.bind(this.ulElm, 'scroll', this.infiniteScrollHandler.bind(this) as EventListener, undefined, 'option-list-scroll');\n    }\n  }\n\n  protected handleEscapeKey() {\n    if (!this.options.keepOpen) {\n      this.close('key.escape');\n      this.choiceElm.focus();\n    }\n  }\n\n  /**\n   * Checks if user reached the end of the list through mouse scrolling and/or arrow down,\n   * then scroll back to the top whenever that happens.\n   */\n  protected infiniteScrollHandler(e: (MouseEvent & { target: HTMLElement }) | null, idx?: number, fullCount?: number) {\n    let needHighlightRecalc = false;\n\n    if (e && this.getEventTarget(e) && this.ulElm && this.scrolledByMouse) {\n      const scrollPos = this.getEventTarget(e).scrollTop + this.getEventTarget(e).clientHeight;\n      if (scrollPos === this.ulElm.scrollHeight) {\n        needHighlightRecalc = true;\n      }\n    } else if (idx !== undefined && idx + 1 === fullCount) {\n      needHighlightRecalc = true;\n    }\n\n    if (needHighlightRecalc && this.ulElm) {\n      if (this.virtualScroll) {\n        this.initListItems();\n      } else {\n        this.ulElm.scrollTop = 0;\n      }\n      this._currentHighlightIndex = 0;\n      this.highlightCurrentOption();\n    }\n  }\n\n  /**\n   * Open the drop method, user could optionally provide a delay in ms to open the drop.\n   * The default delay is 0ms (which is 1 CPU cycle) when nothing is provided, to avoid a delay we can pass `-1` or `null`\n   * @param {number} [openDelay=0] - provide an optional delay, defaults to 0\n   */\n  open(openDelay: number | null = 0): Promise<void> {\n    return new Promise(resolve => {\n      if (openDelay !== null && openDelay >= 0) {\n        // eslint-disable-next-line prefer-const\n        window.clearTimeout(this.openDelayTimer);\n        this.openDelayTimer = window.setTimeout(() => {\n          this.openDrop();\n          resolve();\n        }, openDelay);\n      } else {\n        this.openDrop();\n        resolve();\n      }\n    });\n  }\n\n  protected openDrop() {\n    if (!this.dropElm || this.choiceElm?.classList.contains('disabled')) {\n      return;\n    }\n    this.options.isOpen = true;\n    this.parentElm.classList.add('ms-parent-open');\n    this.choiceElm?.querySelector('div.ms-icon-caret')?.classList.add('open');\n    this.dropElm.style.display = 'block';\n    this.dropElm.ariaExpanded = 'true';\n\n    if (this.selectAllElm?.parentElement) {\n      this.selectAllElm.parentElement.style.display = 'inline-flex';\n    }\n\n    if (this.noResultsElm) {\n      this.noResultsElm.style.display = 'none';\n    }\n\n    if (!this.getDataLength()) {\n      if (this.selectAllElm?.parentElement) {\n        this.selectAllElm.parentElement.style.display = 'none';\n      }\n      if (this.noResultsElm) {\n        this.noResultsElm.style.display = 'block';\n      }\n    }\n\n    if (this.options.container) {\n      const offset = getElementOffset(this.dropElm);\n      let container: HTMLElement;\n      if (this.options.container instanceof Node) {\n        container = this.options.container as HTMLElement;\n      } else if (typeof this.options.container === 'string') {\n        container = this.options.container === 'body' ? document.body : (document.querySelector(this.options.container) as HTMLElement);\n      }\n      container!.appendChild(this.dropElm);\n      this.dropElm.style.top = `${offset?.top ?? 0}px`;\n      this.dropElm.style.left = `${offset?.left ?? 0}px`;\n      this.dropElm.style.minWidth = 'auto';\n      this.dropElm.style.width = `${getElementSize(this.parentElm, 'outer', 'width')}px`;\n    }\n\n    const minHeight = this.options.minHeight;\n    let maxHeight = this.options.maxHeight;\n    if (this.options.maxHeightUnit === 'row') {\n      maxHeight = getElementSize(this.dropElm.querySelector('ul>li') as HTMLLIElement, 'outer', 'height') * this.options.maxHeight;\n    }\n    this.ulElm ??= this.dropElm.querySelector('ul');\n    if (this.ulElm) {\n      if (minHeight) {\n        this.ulElm.style.minHeight = `${minHeight}px`;\n      }\n      this.ulElm.style.maxHeight = `${maxHeight}px`;\n    }\n    this.dropElm.querySelectorAll<HTMLDivElement>('.multiple').forEach(multElm => {\n      multElm.style.width = `${this.options.multipleWidth}px`;\n    });\n\n    if (this.getDataLength() && this.options.filter) {\n      if (this.searchInputElm) {\n        this.searchInputElm.value = '';\n        this.searchInputElm.focus();\n      }\n      this.filter(true);\n    } else {\n      // highlight SelectAll or 1st select option when opening dropdown\n      this.focusSelectAllOrList();\n    }\n\n    if (this._currentHighlightIndex < 0) {\n      // on open drop initial, we'll focus on next available option\n      this.moveHighlightDown();\n    } else {\n      // if it was already opened earlier, we'll keep same option index focused\n      this.highlightCurrentOption();\n    }\n\n    if (this.options.autoAdjustDropWidthByTextSize) {\n      this.adjustDropWidthByText();\n    }\n\n    let newPosition = this.options.position;\n    if (this.options.autoAdjustDropHeight) {\n      // if autoAdjustDropPosition is enable, we 1st need to see what position the drop will be located\n      // without necessary toggling it's position just yet, we just want to know the future position for calculation\n      if (this.options.autoAdjustDropPosition) {\n        const { bottom: spaceBottom, top: spaceTop } = calculateAvailableSpace(this.dropElm);\n        const msDropHeight = this.dropElm.getBoundingClientRect().height;\n        newPosition = spaceBottom < msDropHeight && spaceTop > spaceBottom ? 'top' : 'bottom';\n      }\n\n      // now that we know which drop position will be used, let's adjust the drop height\n      this.adjustDropHeight(newPosition);\n    }\n\n    if (this.options.autoAdjustDropPosition) {\n      this.adjustDropPosition(true);\n    }\n\n    this.options.onOpen();\n  }\n\n  protected focusSelectAllOrList() {\n    if (this.selectAllElm) {\n      this.selectAllElm.focus();\n    } else if (this.ulElm) {\n      this.ulElm.tabIndex = 0;\n      this.ulElm.focus();\n    }\n  }\n\n  protected highlightCurrentOption() {\n    const optionElms = this.dropElm?.querySelectorAll<HTMLLIElement>(OPTIONS_LIST_SELECTOR) || [];\n\n    if (this._currentHighlightIndex <= optionElms.length) {\n      const currentOption = optionElms[this._currentHighlightIndex];\n\n      if (currentOption) {\n        this.lastFocusedItemKey = currentOption.dataset.key || '';\n        this._currentSelectedElm = currentOption;\n\n        // Scroll the current option into view\n        // use a global flag to differentiate scroll by mouse or by scrollIntoView\n        this.scrolledByMouse = false;\n        currentOption.scrollIntoView({ block: 'nearest' });\n        this.changeCurrentOptionHighlight(currentOption);\n        window.setTimeout(() => (this.scrolledByMouse = true), 10);\n      }\n    }\n  }\n\n  /** Change highlighted option, or remove highlight when nothing is provided */\n  protected changeCurrentOptionHighlight(optionElm?: HTMLLIElement | HTMLDivElement) {\n    optionElm?.classList.add('highlighted');\n    const currentElms = this.dropElm?.querySelectorAll<HTMLLIElement>(OPTIONS_HIGHLIGHT_LIST_SELECTOR) || [];\n    currentElms.forEach(option => {\n      if (option !== optionElm) {\n        option.classList.remove('highlighted');\n      }\n    });\n  }\n\n  protected moveHighlightDown() {\n    const optionElms = this.dropElm?.querySelectorAll<HTMLLIElement>(OPTIONS_LIST_SELECTOR) || [];\n    const domOptionsCount = optionElms.length;\n\n    if (this._currentHighlightIndex < domOptionsCount - 1) {\n      this._currentHighlightIndex++;\n      if (optionElms[this._currentHighlightIndex]?.classList.contains('disabled')) {\n        this.moveHighlightDown();\n      }\n    } else if (this.options.infiniteScroll) {\n      this.infiniteScrollHandler(null, this._currentHighlightIndex, domOptionsCount);\n    }\n    this.highlightCurrentOption();\n  }\n\n  protected moveHighlightUp() {\n    const optionElms = this.dropElm?.querySelectorAll<HTMLLIElement>(OPTIONS_LIST_SELECTOR) || [];\n    const idxToCompare = this.options.single ? 0 : 1;\n    if (this.virtualScroll && this._currentHighlightIndex <= idxToCompare && this.updateDataStart! > 0 && this.ulElm) {\n      const currentOptionElm = optionElms[this._currentHighlightIndex + (this.options.single ? 0 : 1)]; // skip SelectAll when using multiple\n      const dataKey = currentOptionElm?.dataset.key;\n      this.lastFocusedItemKey = dataKey as string;\n\n      // scroll up by 1 option row to trick the v-scroll in thinking it changed v-scroll page and it needs to recalculate its new offset\n      this.ulElm.scrollTop = this.ulElm.scrollTop - currentOptionElm?.getBoundingClientRect().height || 10;\n\n      // moveUp will be recalled by vScroll callback\n      this.isMoveUpRecalcRequired = true;\n      return;\n    }\n\n    if (this._currentHighlightIndex > 0) {\n      this._currentHighlightIndex--;\n      if (optionElms[this._currentHighlightIndex]?.classList.contains('disabled')) {\n        this.moveHighlightUp();\n      }\n    }\n\n    this.highlightCurrentOption();\n  }\n\n  protected recalculateArrowMove(direction: 'up' | 'down') {\n    const optionElms = this.dropElm?.querySelectorAll<HTMLLIElement>(OPTIONS_LIST_SELECTOR) || [];\n    const newIdx = Array.from(optionElms).findIndex(el => el.dataset.key === this.lastFocusedItemKey);\n    this._currentHighlightIndex = newIdx - 1;\n    if (direction === 'down') {\n      this.moveHighlightDown();\n    } else if (direction === 'up') {\n      this.moveHighlightUp();\n      this.isMoveUpRecalcRequired = false;\n    }\n  }\n\n  close(reason?: CloseReason) {\n    this.options.isOpen = false;\n    this.parentElm.classList.remove('ms-parent-open');\n    this.choiceElm?.querySelector('div.ms-icon-caret')?.classList.remove('open');\n    if (this.dropElm) {\n      this.dropElm.style.display = 'none';\n      this.dropElm.ariaExpanded = 'false';\n\n      if (this.options.container) {\n        this.parentElm.appendChild(this.dropElm);\n        this.dropElm.style.top = 'auto';\n        this.dropElm.style.left = 'auto';\n      }\n    }\n    this.options.onClose(reason);\n  }\n\n  /**\n   * apply value to an HTML element as text or as HTML with innerHTML when enabled\n   * @param elm\n   * @param value\n   */\n  protected applyAsTextOrHtmlWhenEnabled(elmOrProp: HTMLElement | any, value: string) {\n    if (!elmOrProp) {\n      elmOrProp = {};\n    }\n    if (this.isRenderAsHtml) {\n      elmOrProp.innerHTML = (typeof this.options.sanitizer === 'function' ? this.options.sanitizer(value) : value) as unknown as string;\n    } else {\n      elmOrProp.textContent = value;\n    }\n  }\n\n  protected update(ignoreTrigger = false) {\n    const valueSelects = this.getSelects();\n    let textSelects = this.getSelects('text');\n\n    if (this.options.displayValues) {\n      textSelects = valueSelects;\n    }\n\n    const spanElm = this.choiceElm?.querySelector<HTMLSpanElement>('span');\n    const sl = valueSelects.length;\n    let html = null;\n\n    const getSelectOptionHtml = () => {\n      if (this.options.useSelectOptionLabel || this.options.useSelectOptionLabelToHtml) {\n        const labels = valueSelects.join(this.options.displayDelimiter);\n        return this.options.useSelectOptionLabelToHtml ? stripScripts(labels) : labels;\n      }\n      return textSelects.join(this.options.displayDelimiter);\n    };\n\n    if (spanElm) {\n      if (sl === 0) {\n        const placeholder = this.options.placeholder || '';\n        spanElm.classList.add('ms-placeholder');\n        this.applyAsTextOrHtmlWhenEnabled(spanElm, placeholder);\n      } else if (sl < this.options.minimumCountSelected) {\n        html = getSelectOptionHtml();\n      } else if (this.formatAllSelected() && sl === this.dataTotal) {\n        html = this.formatAllSelected();\n      } else if (this.options.ellipsis && sl > this.options.minimumCountSelected) {\n        html = `${textSelects.slice(0, this.options.minimumCountSelected).join(this.options.displayDelimiter)}...`;\n      } else if (this.formatCountSelected(sl, this.dataTotal) && sl > this.options.minimumCountSelected) {\n        html = this.formatCountSelected(sl, this.dataTotal);\n      } else {\n        html = getSelectOptionHtml();\n      }\n\n      if (html !== null) {\n        spanElm?.classList.remove('ms-placeholder');\n        this.applyAsTextOrHtmlWhenEnabled(spanElm, html);\n      }\n\n      // when showClear option is enabled, show clear icon only when drop has an actual selection\n      if (this.options.showClear && this.selectClearElm) {\n        const displayState = html ? 'block' : 'none';\n        this.selectClearElm.style.display = displayState;\n      }\n\n      if (this.options.displayTitle) {\n        const selectType = this.options.useSelectOptionLabel || this.options.useSelectOptionLabelToHtml ? 'value' : 'text';\n        spanElm.title = this.getSelects(selectType).join(this.options.displayDelimiter);\n      }\n    }\n\n    // set selects to select\n    const selectedValues = this.getSelects();\n    if (this.options.single) {\n      this.elm.value = selectedValues.length ? selectedValues[0] : '';\n    } else {\n      // when multiple values could be set, we need to loop through each\n      Array.from(this.elm.options).forEach(option => {\n        option.selected = selectedValues.some(val => val === option.value);\n      });\n    }\n\n    // trigger <select> change event\n    if (!ignoreTrigger) {\n      this.elm.dispatchEvent(new Event('change'));\n    }\n  }\n\n  protected updateSelected(rows?: HtmlStruct[]) {\n    for (let i = this.updateDataStart!; i < this.updateDataEnd!; i++) {\n      const row = this.updateData[i];\n      const inputElm = this.dropElm?.querySelector<HTMLInputElement>(`input[data-key=${row._key}]`);\n      if (inputElm) {\n        inputElm.checked = row.selected;\n        const closestLiElm = inputElm.closest('li');\n        const iconDivElm = closestLiElm?.querySelector('.icon-checkbox-container div');\n        if (closestLiElm) {\n          if (row.selected && !closestLiElm.classList.contains('selected')) {\n            closestLiElm.classList.add('selected');\n            closestLiElm.ariaSelected = 'true';\n            if (iconDivElm) {\n              iconDivElm.className = `ms-icon ms-icon-${inputElm.type === 'radio' ? 'radio' : 'check'}`;\n            }\n          } else if (!row.selected) {\n            closestLiElm.classList.remove('selected');\n            closestLiElm.ariaSelected = 'false';\n            if (iconDivElm) {\n              iconDivElm.className = 'ms-icon ms-icon-uncheck';\n            }\n          }\n        }\n      }\n    }\n\n    const noResult = this.data?.filter(row => row.visible).length === 0;\n\n    if (this.selectAllElm) {\n      this.selectAllElm.ariaChecked = String(this.isAllSelected);\n      const checkboxIconElm = this.dropElm?.querySelector('.ms-select-all .icon-checkbox-container div');\n      if (checkboxIconElm) {\n        let iconClass = '';\n        if (this.isAllSelected) {\n          iconClass = 'ms-icon-check';\n        } else if (this.isPartiallyAllSelected) {\n          iconClass = 'ms-icon-minus';\n        } else {\n          iconClass = 'ms-icon-uncheck';\n        }\n        checkboxIconElm.className = `ms-icon ${iconClass}`;\n      }\n\n      this.selectAllElm.checked = this.isAllSelected;\n      toggleElement(this.selectAllElm.closest('li'), !noResult);\n    }\n\n    toggleElement(this.noResultsElm, noResult);\n\n    if (this.virtualScroll) {\n      this.virtualScroll.rows = rows ?? this.getListRows(); // recreate the rows list only when not already created\n    }\n  }\n\n  getData() {\n    return this.options.data;\n  }\n\n  getDataLength() {\n    return this.data?.length ?? 0;\n  }\n\n  /**\n   * Get current options, by default we'll return an immutable deep copy of the options to avoid conflicting with the lib\n   * but in rare occasion we might want to the return the actual, but mutable, options\n   * @param {Boolean} [returnDeepCopy]\n   */\n  getOptions(returnDeepCopy = true) {\n    // deep copy and remove data\n    const options = Object.assign({}, this.options);\n    delete options.data;\n\n    return returnDeepCopy ? deepCopy(options) : this.options;\n  }\n\n  refreshOptions(options: Partial<MultipleSelectOption>) {\n    // If the objects are equivalent then avoid the call of destroy / init methods\n    if (compareObjects(this.options, options, true)) {\n      return;\n    }\n    this.options = Object.assign(this.options, options);\n    this.destroy(false);\n    this.init();\n  }\n\n  getDropElement() {\n    return this.dropElm;\n  }\n\n  getParentElement() {\n    return this.parentElm;\n  }\n\n  // value html, or text, default: 'value'\n  getSelects(type = 'value') {\n    const values = [];\n    for (const row of this.data || []) {\n      if ((row as OptGroupRowData).type === 'optgroup') {\n        const selectedChildren = (row as OptGroupRowData).children.filter(child => child?.selected);\n        if (!selectedChildren.length) {\n          continue;\n        }\n\n        if (type === 'value' || this.options.single) {\n          values.push(\n            ...selectedChildren.map((child: any) => {\n              return type === 'value' ? child._value || child[type] : child[type];\n            }),\n          );\n        } else {\n          const value = [];\n          value.push('[');\n          value.push((row as OptGroupRowData).label);\n          value.push(`: ${selectedChildren.map((child: any) => child[type]).join(', ')}`);\n          value.push(']');\n          values.push(value.join(''));\n        }\n      } else if (row.selected) {\n        values.push(type === 'value' ? row._value || (row as OptionRowData)[type] : (row as any)[type]);\n      }\n    }\n    return values;\n  }\n\n  setSelects(values: any[], type = 'value', ignoreTrigger = false) {\n    let hasChanged = false;\n    const _setSelects = (rows: Array<OptionRowData | OptGroupRowData>) => {\n      for (const row of rows) {\n        let selected = false;\n        if (type === 'text') {\n          const divElm = document.createElement('div');\n          this.applyAsTextOrHtmlWhenEnabled(divElm, (row as OptionRowData).text);\n          selected = values.includes(divElm.textContent?.trim() ?? '');\n        } else {\n          selected = values.includes(row._value || row.value);\n          if (!selected && row.value === `${+(row as OptionRowData).value}`) {\n            selected = values.includes(+row.value);\n          }\n        }\n        if (row.selected !== selected) {\n          hasChanged = true;\n        }\n        row.selected = selected;\n      }\n    };\n\n    for (const row of this.data || []) {\n      if ((row as OptGroupRowData).type === 'optgroup') {\n        _setSelects((row as OptGroupRowData).children);\n      } else {\n        _setSelects([row]);\n      }\n    }\n\n    if (hasChanged) {\n      this.initSelected(ignoreTrigger);\n      this.updateSelected();\n      this.update(ignoreTrigger);\n    }\n  }\n\n  enable() {\n    if (this.choiceElm) {\n      this.choiceElm.classList.remove('disabled');\n      this.choiceElm.disabled = false;\n    }\n  }\n\n  disable() {\n    if (this.choiceElm) {\n      this.choiceElm?.classList.add('disabled');\n      this.choiceElm.disabled = true;\n    }\n  }\n\n  check(value: any) {\n    const option = findByParam(this.data, 'value', value);\n    if (!option) {\n      return;\n    }\n    this._check(option, true);\n  }\n\n  uncheck(value: any) {\n    const option = findByParam(this.data, 'value', value);\n    if (!option) {\n      return;\n    }\n    this._check(option, false);\n  }\n\n  protected _check(option: OptGroupRowData | OptionRowData, checked: boolean) {\n    if (this.options.single) {\n      this._checkAll(false, true);\n    }\n    option.selected = checked;\n    this.initSelected();\n    this.updateSelected();\n    this.update();\n  }\n\n  checkAll() {\n    this._checkAll(true);\n  }\n\n  uncheckAll() {\n    this._checkAll(false);\n  }\n\n  protected _checkAll(checked: boolean, ignoreUpdate?: boolean) {\n    for (const row of this.data || []) {\n      if ((row as OptGroupRowData).type === 'optgroup') {\n        this._checkGroup(row, checked, true);\n      } else if (!row.disabled && !row.divider && (ignoreUpdate || row.visible)) {\n        row.selected = checked;\n      }\n    }\n\n    if (!ignoreUpdate) {\n      this.initSelected();\n      this.updateSelected();\n      this.update();\n    }\n  }\n\n  protected _checkGroup(group: any, checked: boolean, ignoreUpdate?: boolean) {\n    group.selected = checked;\n    group.children.forEach((row: OptionRowData) => {\n      if (row && !row.disabled && !row.divider && (ignoreUpdate || row.visible)) {\n        row.selected = checked;\n      }\n    });\n\n    if (!ignoreUpdate) {\n      this.initSelected();\n      this.updateSelected();\n      this.update();\n    }\n  }\n\n  checkInvert() {\n    if (this.options.single) {\n      return;\n    }\n    for (const row of this.data || []) {\n      if ((row as OptGroupRowData).type === 'optgroup') {\n        for (const child of (row as OptGroupRowData).children) {\n          if (child) {\n            if (!child.divider) {\n              child.selected = !child.selected;\n            }\n          }\n        }\n      } else if (row && !row.divider) {\n        row.selected = !row.selected;\n      }\n    }\n    this.initSelected();\n    this.updateSelected();\n    this.update();\n  }\n\n  focus() {\n    this.choiceElm?.focus();\n    this.options.onFocus();\n  }\n\n  blur() {\n    this.choiceElm?.blur();\n    this.options.onBlur();\n  }\n\n  refresh() {\n    this.destroy(false);\n    this.init();\n  }\n\n  protected filter(ignoreTrigger?: boolean) {\n    const originalSearch = this.searchInputElm?.value.trim() ?? '';\n    const search = originalSearch.toLowerCase();\n\n    if (this.filterText === search) {\n      return;\n    }\n    this.filterText = search;\n\n    for (const row of this.data || []) {\n      if ((row as OptGroupRowData).type === 'optgroup') {\n        if (this.options.filterGroup) {\n          const rowLabel = `${(row as OptGroupRowData)?.label ?? ''}`;\n          if (row !== undefined && row !== null) {\n            const visible = this.options.customFilter({\n              label: removeDiacritics(rowLabel.toString().toLowerCase(), this.options.diacriticParser),\n              search: removeDiacritics(search, this.options.diacriticParser),\n              originalLabel: rowLabel,\n              originalSearch,\n              row,\n            });\n\n            row.visible = visible;\n            for (const child of (row as OptGroupRowData).children) {\n              if (child) {\n                child.visible = visible;\n              }\n            }\n          }\n        } else {\n          for (const child of (row as OptGroupRowData).children) {\n            if (child !== undefined && child !== null) {\n              const childText = `${(child as OptionRowData)?.text ?? ''}`;\n              child.visible = this.options.customFilter({\n                text: removeDiacritics(childText.toString().toLowerCase(), this.options.diacriticParser),\n                search: removeDiacritics(search, this.options.diacriticParser),\n                originalText: childText,\n                originalSearch,\n                row: child,\n                parent: row,\n              });\n            }\n          }\n          row.visible = (row as OptGroupRowData).children.filter((child: any) => child?.visible).length > 0;\n        }\n      } else {\n        const rowText = `${(row as OptionRowData)?.text ?? ''}`;\n        row.visible = this.options.customFilter({\n          text: removeDiacritics(rowText.toString().toLowerCase(), this.options.diacriticParser),\n          search: removeDiacritics(search, this.options.diacriticParser),\n          originalText: rowText,\n          originalSearch,\n          row,\n        });\n      }\n    }\n\n    const rows = this.initListItems();\n    this.initSelected(ignoreTrigger);\n    this.updateSelected(rows); // no need to recreate the rows list twice\n\n    if (!ignoreTrigger) {\n      this.options.onFilter(originalSearch);\n    }\n  }\n\n  protected adjustDropHeight(position: 'bottom' | 'top') {\n    const isDropPositionBottom = position !== 'top';\n    const filterHeight = this.filterParentElm?.getBoundingClientRect().height ?? 0;\n    const okButtonHeight = this.okButtonElm?.getBoundingClientRect().height ?? 0;\n    const selectAllHeight = this.options.single ? 0 : (this.selectAllParentElm?.getBoundingClientRect().height ?? 0);\n    const msDropMinimalHeight = filterHeight + okButtonHeight + selectAllHeight + 5;\n\n    const { bottom: spaceBottom, top: spaceTop } = calculateAvailableSpace(this.parentElm);\n\n    let newHeight = this.options.maxHeight;\n    if (isDropPositionBottom) {\n      newHeight = spaceBottom - msDropMinimalHeight - this.options.adjustedHeightPadding;\n    } else {\n      newHeight = spaceTop - msDropMinimalHeight - this.options.adjustedHeightPadding;\n    }\n\n    if (!this.options.maxHeight || (this.options.maxHeight && newHeight < this.options.maxHeight)) {\n      const ulElm = this.dropElm?.querySelector('ul');\n      if (ulElm) {\n        ulElm.style.maxHeight = `${newHeight}px`;\n      }\n      return true; // return true, since we adjusted the drop height\n    }\n\n    // if we reached this line, we can assume that the drop height wasn't adjusted\n    return false;\n  }\n\n  protected adjustDropPosition(forceToggle: boolean) {\n    let position = 'bottom';\n\n    if (this.dropElm && this.parentElm) {\n      const { bottom: spaceBottom, top: spaceTop } = calculateAvailableSpace(this.dropElm);\n      const { top: selectOffsetTop, left: selectOffsetLeft } = getElementOffset(this.parentElm) as HtmlElementPosition;\n      const msDropHeight = this.dropElm.getBoundingClientRect().height;\n      const msDropWidth = this.dropElm.getBoundingClientRect().width;\n      const windowWidth = document.body.offsetWidth || window.innerWidth;\n      const selectParentWidth = this.parentElm.getBoundingClientRect().width;\n\n      // find the optimal position of the drop (always choose \"bottom\" as the default to use)\n      if (spaceBottom > msDropHeight) {\n        position = 'bottom';\n      } else if (msDropHeight > spaceBottom && spaceTop > spaceBottom) {\n        if (this.options.container) {\n          // when using a container, we need to offset the drop ourself\n          // and also make sure there's space available on top before doing so\n          let newOffsetTop = selectOffsetTop - msDropHeight;\n          if (newOffsetTop < 0) {\n            newOffsetTop = 0;\n          }\n\n          if (newOffsetTop > 0 || forceToggle) {\n            position = 'top';\n            this.dropElm.style.top = `${newOffsetTop < 0 ? 0 : newOffsetTop}px`;\n          }\n        } else {\n          // without container, we simply need to add the \"top\" class to the drop\n          position = 'top';\n          this.dropElm.classList.add(position);\n        }\n        this.dropElm.classList.remove('bottom');\n      }\n\n      // auto-adjust left/right position\n      if (windowWidth - msDropWidth < selectOffsetLeft) {\n        this.dropElm.style.left = `${selectOffsetLeft - (msDropWidth - selectParentWidth)}px`;\n      }\n    }\n\n    return position;\n  }\n\n  protected adjustDropWidthByText() {\n    if (this.dropElm) {\n      const parentWidth = this.parentElm.scrollWidth;\n\n      // keep the dropWidth/width as reference, if our new calculated width is below then we will re-adjust (else do nothing)\n      let currentDefinedWidth: number | string = parentWidth;\n      if (this.options.dropWidth || this.options.width) {\n        currentDefinedWidth = this.options.dropWidth || this.options.width || 0;\n      }\n\n      // calculate the \"Select All\" element width, this text is configurable which is why we recalculate every time\n      const selectAllSpanElm = this.dropElm.querySelector<HTMLSpanElement>('.ms-select-all span');\n      const dropUlElm = this.dropElm.querySelector('ul') as HTMLUListElement;\n\n      const liPadding = 26; // there are multiple padding involved, let's fix it at 26px\n\n      const selectAllElmWidth = selectAllSpanElm?.clientWidth ?? 0 + liPadding;\n      const hasScrollbar = dropUlElm.scrollHeight > dropUlElm.clientHeight;\n      const scrollbarWidth = hasScrollbar ? this.getScrollbarWidth() : 0;\n      let contentWidth = 0;\n\n      this.dropElm.querySelectorAll('li label').forEach(elm => {\n        if (elm.scrollWidth > contentWidth) {\n          contentWidth = elm.scrollWidth;\n        }\n      });\n\n      // add a padding & include the browser scrollbar width\n      contentWidth += liPadding + scrollbarWidth;\n\n      // make sure the new calculated width is wide enough to include the \"Select All\" text (this text is configurable)\n      if (contentWidth < selectAllElmWidth) {\n        contentWidth = selectAllElmWidth;\n      }\n\n      // if a maxWidth is defined, make sure our new calculate width is not over the maxWidth\n      if (this.options.maxWidth && contentWidth > this.options.maxWidth) {\n        contentWidth = this.options.maxWidth;\n      }\n\n      // if a minWidth is defined, make sure our new calculate width is not below the minWidth\n      if (this.options.minWidth && contentWidth < this.options.minWidth) {\n        contentWidth = this.options.minWidth;\n      }\n\n      // finally re-adjust the drop to the new calculated width when necessary\n      if (currentDefinedWidth === '100%' || +currentDefinedWidth < contentWidth) {\n        this.dropElm.style.width = `${contentWidth}px`;\n        this.dropElm.style.maxWidth = `${contentWidth}px`;\n      }\n    }\n  }\n\n  getScrollbarWidth() {\n    const outer = document.createElement('div');\n    outer.style.visibility = 'hidden';\n    outer.style.width = '100px';\n\n    document.body.appendChild(outer);\n\n    const widthNoScroll = outer.offsetWidth;\n    // force scrollbars\n    outer.style.overflow = 'scroll';\n\n    // add innerdiv\n    const inner = document.createElement('div');\n    inner.style.width = '100%';\n    outer.appendChild(inner);\n\n    const widthWithScroll = inner.offsetWidth;\n\n    // remove divs\n    outer.parentNode?.removeChild(outer);\n\n    return widthNoScroll - widthWithScroll;\n  }\n\n  // five text formatters, it could be string patterns or formatter callback functions\n\n  formatAllSelected() {\n    return this.options.allSelectedText || this.options.formatAllSelected();\n  }\n\n  formatCountSelected(selectedCount: number, totalCount: number) {\n    if (this.options.countSelectedText) {\n      return this.options.countSelectedText.replace('#', `${selectedCount}`).replace('%', `${totalCount}`);\n    }\n    return this.options.formatCountSelected(selectedCount, totalCount);\n  }\n\n  formatNoMatchesFound() {\n    return this.options.noMatchesFoundText || this.options.formatNoMatchesFound();\n  }\n\n  formatOkButton() {\n    return this.options.okButtonText || this.options.formatOkButton();\n  }\n\n  formatSelectAll() {\n    return this.options.selectAllText || this.options.formatSelectAll();\n  }\n}\n", "/**\n * Multiple-Select-Vanilla\n * @author zhixin wen <wenzhixin2010@gmail.com>\n */\n\nimport { MultipleSelectInstance } from './MultipleSelectInstance.js';\nimport Constants from './constants.js';\nimport type { MultipleSelectLocales } from './models/locale.interface.js';\nimport type { MultipleSelectOption } from './models/multipleSelectOption.interface.js';\nimport English from './locales/multiple-select-en-US.js';\n\n/**\n * The multiplseSelect function is your entry to creating a MultipleSelect instance on any HTML Select Element.\n * You can provide a query selector as a string, a html node or an array of html nodes\n */\nexport const multipleSelect = (\n  selector: ArrayLike<Node> | Node | string,\n  config?: Partial<Omit<MultipleSelectOption, 'onHardDestroy' | 'onAfterHardDestroy'>>,\n): MultipleSelectInstance | MultipleSelectInstance[] => {\n  if (typeof selector === 'string') {\n    return _multipleSelect(document.querySelectorAll(selector), config);\n  }\n  if (selector instanceof Node) {\n    return _multipleSelect([selector], config);\n  }\n  return _multipleSelect(selector, config);\n};\n\nfunction _multipleSelect(nodeList: ArrayLike<Node>, config?: Partial<MultipleSelectOption>): MultipleSelectInstance | MultipleSelectInstance[] {\n  // static list\n  const nodes = Array.from(nodeList) as HTMLElement[];\n  const instances: MultipleSelectInstance[] = [];\n\n  for (let i = 0; i < nodes.length; i++) {\n    const node = nodes[i] as HTMLElement & { _multipleSelect?: MultipleSelectInstance };\n    try {\n      // destroy any previous element when found prior to recreating it\n      if (node._multipleSelect !== undefined) {\n        node._multipleSelect.destroy();\n        delete node._multipleSelect;\n      }\n\n      node._multipleSelect = new MultipleSelectInstance(node as HTMLSelectElement, config || {});\n      node._multipleSelect.init();\n\n      // when a hard destroyed is called, we need to first delete the _multipleSelect instance before the DOM Element is removed\n      // then after it's destroyed, we'll also have to nullify the instance\n      const msOptions = node._multipleSelect.getOptions(false);\n      msOptions.onHardDestroy = () => delete node._multipleSelect;\n      msOptions.onAfterHardDestroyed = () => (instances[i] = null as any);\n\n      instances.push(node._multipleSelect);\n    } catch (e) {\n      console.error(e);\n    }\n  }\n\n  return instances.length === 1 ? instances[0] : instances;\n}\n\nmultipleSelect.defaults = Constants.DEFAULTS;\nmultipleSelect.locales = { ...English } as MultipleSelectLocales; // load English as default locale\nmultipleSelect.methods = Constants.METHODS;\n\n// add it to the window object so it can be used as standalone\nif (typeof window !== 'undefined') {\n  window.multipleSelect = multipleSelect;\n}\n"],
  "mappings": "6jBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,yBAAAE,EAAA,2BAAAC,EAAA,kBAAAC,EAAA,4BAAAC,EAAA,oBAAAC,EAAA,mBAAAC,EAAA,yBAAAC,EAAA,qBAAAC,EAAA,uBAAAC,EAAA,aAAAC,EAAA,iBAAAC,EAAA,gBAAAC,EAAA,eAAAC,EAAA,qBAAAC,EAAA,mBAAAC,EAAA,gBAAAC,EAAA,cAAAC,EAAA,mBAAAC,EAAA,2BAAAC,EAAA,aAAAC,EAAA,qBAAAC,EAAA,oBAAAC,EAAA,gBAAAC,EAAA,iBAAAC,EAAA,gBAAAC,GAAA,kBAAAC,EAAA,uBAAAC,GAAA,yBAAAC,IAAA,eAAAC,GAAA9B,ICOO,IAAM+B,EAAN,KAA0B,CAQ/B,YAAYC,EAAsC,CAPlDC,EAAA,KAAU,kBACVA,EAAA,KAAU,iBAAyC,CAAC,GAOlD,KAAK,eAAiBD,GAAS,eAAiB,EAClD,CANA,IAAI,eAAwC,CAC1C,OAAO,KAAK,cACd,CAMA,SAAU,CACR,KAAK,UAAU,EACf,KAAK,eAAiB,CAAC,CACzB,CAGA,KACEE,EACAC,EACAC,EACAC,EACAC,EAAY,GACZ,CAEA,IAAMC,EAAa,MAAM,QAAQJ,CAAgB,EAAIA,EAAmB,CAACA,CAAgB,EAEzF,GAAI,OAAQD,GAAq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,SACfE,EAAgB,SAAS,iBAAiBF,CAAQ,EAAGC,CAAM,EAEhED,aAAoB,KACfE,EAAgB,CAACF,CAAQ,EAAGC,CAAM,EAEpCC,EAAgBF,EAAUC,CAAM,EAGzC,SAASC,EAAgBC,EAA2BF,EAA2F,CAE7I,IAAMG,EAAQ,MAAM,KAAKD,CAAQ,EAC3BE,EAAsC,CAAC,EAE7C,QAASC,EAAI,EAAGA,EAAIF,EAAM,OAAQE,IAAK,CACrC,IAAMC,EAAOH,EAAME,CAAC,EACpB,GAAI,CAEEC,EAAK,kBAAoB,SAC3BA,EAAK,gBAAgB,QAAQ,EAC7B,OAAOA,EAAK,iBAGdA,EAAK,gBAAkB,IAAIC,EAAuBD,EAA2BN,GAAU,CAAC,CAAC,EACzFM,EAAK,gBAAgB,KAAK,EAI1B,IAAME,EAAYF,EAAK,gBAAgB,WAAW,EAAK,EACvDE,EAAU,cAAgB,IAAM,OAAOF,EAAK,gBAC5CE,EAAU,qBAAuB,IAAOJ,EAAUC,CAAC,EAAI,KAEvDD,EAAU,KAAKE,EAAK,eAAe,CACrC,OAASG,EAAG,CACV,QAAQ,MAAMA,CAAC,CACjB,CACF,CAEA,OAAOL,EAAU,SAAW,EAAIA,EAAU,CAAC,EAAIA,CACjD,CAEAN,EAAe,SAAWY,EAAU,SACpCZ,EAAe,QAAU,CAAE,GAAGa,CAAQ,EACtCb,EAAe,QAAUY,EAAU,QAG/B,OAAO,OAAW,MACpB,OAAO,eAAiBZ",
  "names": ["index_exports", "__export", "BindingEventService", "MultipleSelectInstance", "VirtualScroll", "calculateAvailableSpace", "classNameToList", "compareObjects", "convertItemRowToHtml", "createDomElement", "createDomStructure", "deepCopy", "emptyElement", "findByParam", "findParent", "getElementOffset", "getElementSize", "insertAfter", "isDefined", "multipleSelect", "objectRemoveEmptyProps", "omitProp", "removeDiacritics", "removeUndefined", "setDataKeys", "stripScripts", "toCamelCase", "toggleElement", "toggleElementClass", "windowScrollPosition", "__toCommonJS", "BindingEventService", "options", "__publicField", "elementOrElements", "eventNameOrNames", "listener", "listenerOptions", "groupName", "eventNames", "element", "eventName", "elm", "f", "elements", "groupNames", "boundedEvent", "g", "ms", "English", "count", "total", "multiple_select_en_US_default", "BLOCK_ROWS", "CLUSTER_BLOCKS", "DEFAULTS", "filterOptions", "text", "label", "search", "elm", "METHODS", "multiple_select_en_US_default", "Constants", "constants_default", "compareObjects", "objectA", "objectB", "compareLength", "aKeys", "bKeys", "key", "deepCopy", "objectOrArray", "cloneObj", "clone", "cloneArr", "item", "type", "isDefined", "val", "objectRemoveEmptyProps", "obj", "clearProps", "name", "_", "v", "setDataKeys", "data", "total", "row", "child", "j", "findByParam", "param", "value", "stripScripts", "dirtyHtml", "removeUndefined", "toCamelCase", "str", "_match", "char", "removeDiacritics", "customParser", "calculateAvailableSpace", "element", "bottom", "top", "left", "right", "windowHeight", "windowWidth", "scrollPosition", "windowScrollPosition", "pageScrollTop", "pageScrollLeft", "elmOffset", "getElementOffset", "elementOffsetTop", "elementOffsetLeft", "classNameToList", "className", "cls", "createDomElement", "tagName", "elementOptions", "appendToParent", "elm", "elmOptionKey", "elmValue", "createDomStructure", "item", "appendToElm", "parentElm", "itemPropsOmitHtml", "omitProp", "objectRemoveEmptyProps", "parent", "attrName", "childItem", "convertItemRowToHtml", "emptyElement", "rect", "getElementSize", "mode", "type", "size", "prevDisplay", "prevPosition", "widthStr", "findParent", "selector", "targetElm", "_", "nodeType", "selectorType", "classOrIdName", "q", "insertAfter", "referenceNode", "newNode", "obj", "key", "omitted", "rest", "toggleElement", "display", "toggleElementClass", "state", "action", "VirtualScroll", "options", "__publicField", "onScroll", "emptyElement", "rows", "firstRowElm", "convertItemRowToHtml", "data", "dataChanged", "topOffsetChanged", "bottomOffsetChanged", "h", "prevParentDisplay", "nodes", "node", "constants_default", "blockSize", "num", "start", "end", "topOffset", "bottomOffset", "thisRows", "rowsAbove", "i", "type", "value", "changed", "className", "height", "tag", "OPTIONS_LIST_SELECTOR", "OPTIONS_HIGHLIGHT_LIST_SELECTOR", "MultipleSelectInstance", "elm", "options", "__publicField", "constants_default", "BindingEventService", "hardDestroy", "o", "locales", "parts", "name", "createDomElement", "classNameToList", "parentTitle", "dataTest", "insertAfter", "e", "findParent", "data", "it", "value", "text", "row", "setDataKeys", "groupDisabled", "childNode", "length", "option", "selectName", "saLabelElm", "selectAllIconClass", "saIconContainerElm", "offset", "rows", "dropVisible", "updateDataOffset", "dataLn", "VirtualScroll", "emptyElement", "itemRow", "convertItemRowToHtml", "dataRow", "level", "title", "multiple", "type", "isChecked", "isSingleWithoutRadioIcon", "classes", "htmlBlocks", "itemOrGroupBlock", "inputCheckboxStruct", "spanLabelBlock", "liBlock", "customStyleRules", "child", "liClasses", "labelClasses", "inputBlock", "iconContainerBlock", "ignoreTrigger", "selectedTotal", "selectedCount", "computedWidth", "getElementSize", "toggleOpen", "visibleLiElms", "selectedElm", "selectElm", "checked", "group", "findByParam", "removeUndefined", "close", "liElm", "optionElms", "newIdx", "el", "idx", "fullCount", "needHighlightRecalc", "openDelay", "resolve", "getElementOffset", "container", "minHeight", "maxHeight", "multElm", "newPosition", "spaceBottom", "spaceTop", "calculateAvailableSpace", "msDropHeight", "currentOption", "optionElm", "domOptionsCount", "idxToCompare", "currentOptionElm", "dataKey", "direction", "reason", "elmOrProp", "valueSelects", "textSelects", "spanElm", "sl", "html", "getSelectOptionHtml", "labels", "stripScripts", "placeholder", "displayState", "selectType", "selectedValues", "val", "inputElm", "closestLiElm", "iconDivElm", "noResult", "checkboxIconElm", "iconClass", "toggleElement", "returnDeepCopy", "deepCopy", "compareObjects", "values", "selectedChildren", "hasChanged", "_setSelects", "selected", "divElm", "ignoreUpdate", "originalSearch", "search", "rowLabel", "visible", "removeDiacritics", "childText", "rowText", "position", "isDropPositionBottom", "filterHeight", "okButtonHeight", "selectAllHeight", "msDropMinimalHeight", "newHeight", "ulElm", "forceToggle", "selectOffsetTop", "selectOffsetLeft", "msDropWidth", "windowWidth", "selectParentWidth", "newOffsetTop", "currentDefinedWidth", "selectAllSpanElm", "dropUlElm", "liPadding", "selectAllElmWidth", "scrollbarWidth", "contentWidth", "outer", "widthNoScroll", "inner", "widthWithScroll", "totalCount", "multipleSelect", "selector", "config", "_multipleSelect", "nodeList", "nodes", "instances", "i", "node", "MultipleSelectInstance", "msOptions", "e", "constants_default", "multiple_select_en_US_default"]
}
