{"version":3,"sources":["jsdelivr-header.js","/npm/deep-focus-trap@0.0.3/src/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OCNS,qBAAwB,0BACxB,cAAiB,eAQ1B,MAAM,sBAAsB,UAW1B,WAAA,CAAY,GACV,MAAM,GACN,KAAK,KAAO,EAAO,OAAQ,CAC7B,CAQA,WAAA,CAAY,IACQ,IAAd,KAAK,KACP,KAAK,kBAAoB,GAAO,KAAK,GAAG,iBAAiB,KAAK,6BAE9D,KAAK,kBAAoB,GAAO,iBAAiB,KAAK,4BAA6B,KAAK,IAG1F,KAAK,iBAAmB,KAAK,kBAAkB,GAC/C,KAAK,gBAAkB,KAAK,kBAAkB,KAAK,kBAAkB,OAAS,GAC9E,KAAK,eAAiB,KAAK,aAAe,KAAK,aAAe,KAAK,iBACnE,KAAK,kBACP,SAGO","file":"/npm/deep-focus-trap@0.0.3/src/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/deep-focus-trap@0.0.3/src/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import { querySelectorAll } from 'shadow-dom-utils'\nimport { focusTrap } from './focus-trap'\n\n/**\n * @description Used as a focus trap that can pierce the shadow dom. Meaning if you are using native\n * web components and you have a component within a component. This focus trap will be able to peirce through the shadow dom and make a focus trap\n * out of the child components as well.\n *\n */\nclass deepFocusTrap extends focusTrap {\n  /**\n   * @param {object} config\n   * @param {string | HTMLElement} config.el - A selector or element used to trap focus within\n   * @param {boolean} [config.returnFocus=true] - An option when set to true returns focus upon deactivation to the last element that had focus before the trap was activated. Defaults to true.\n   * @param {HTMLElement} [config.focusElement] - An element to focus on as soon as the focus trap is activated.\n   * @param {boolean} [config.deep=true] - When set to false focusTrap will not peirce the shadowDOM.\n   * @param {callback} [config.escCallback] - A callback to be called when the user presses the escape key.\n   * @param {boolean} [config.includeActiveElement=false] - Includes element currently in focus when focusTrap is activated within the focusable elements.\n   * @param {boolean} [config.unordered=false] - Allows for elements to be in an order in the dom. Then follows the order of appearance in the focusableElements array instead.\n   */\n  constructor(config) {\n    super(config)\n    this.deep = config.deep ?? true\n  }\n\n  /**\n   * Set the elements to cycle focus on within the focus trap. Uses the\n   * config.el selector to get its focusable children or takes a custom list of elements to cycle focus on.\n   *\n   * @param {HTMLElement[] | NodeList} [els] An array of elements or Nodelist of the elements to cycle through in the focus trap.\n   */\n  setElements(els) {\n    if (this.deep === false) {\n      this.focusableElements = els ?? this.el.querySelectorAll(this.FOCUSABLE_ELEMENT_SELECTORS)\n    } else {\n      this.focusableElements = els ?? querySelectorAll(this.FOCUSABLE_ELEMENT_SELECTORS, this.el)\n    }\n\n    this.firstFocusableEl = this.focusableElements[0]\n    this.lastFocusableEl = this.focusableElements[this.focusableElements.length - 1]\n    this.elementToFocus = this.focusElement ? this.focusElement : this.firstFocusableEl\n    this.setReturnFocusEl()\n  }\n}\n\nexport { deepFocusTrap }\n"]}