{"version":3,"sources":["jsdelivr-header.js","/npm/@aurodesignsystem/auro-library@5.4.0/scripts/utils/runtimeUtils.mjs"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACCe,MAAM,EAUnB,iBAAA,CAAkB,EAAM,GACjB,eAAe,IAAI,IACtB,eAAe,OAAO,EAAM,cAAc,IAEhD,CAME,cAAA,CACE,EACA,EAAO,KACP,EAAY,CAAC,EAAI,EAAQ,GAAM,EAAG,QAAQ,KACvC,GAAM,IAAO,UAAY,IAAO,OAE7B,GAEE,EAAU,EAAG,cAAc,MAH7B,MAKN,OAAO,EAAU,EACrB,CASE,wBAAA,CAAyB,EAAM,GAC7B,MAAM,EAAM,EAAQ,cACJ,EAAK,QAAQ,gBAEb,GACd,EAAK,aAAa,GAAK,EAE7B,CAQE,YAAA,CAAa,EAAM,GACjB,MAAM,EAAM,EAAQ,cAGpB,OAFgB,EAAK,QAAQ,gBAEV,GAAO,EAAK,aAAa,EAChD,S","file":"/npm/@aurodesignsystem/auro-library@5.4.0/scripts/utils/runtimeUtils.mjs/+esm","sourceRoot":"","sourcesContent":["/**\n * Bundled by jsDelivr using Rollup v2.79.2 and Terser v5.39.0.\n * Original file: /npm/@aurodesignsystem/auro-library@5.4.0/scripts/utils/runtimeUtils.mjs\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license\n// See LICENSE in the project root for license information.\n\n// ---------------------------------------------------------------------\n\n/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */\n\nexport default class AuroLibraryRuntimeUtils {\n\n  /* eslint-disable jsdoc/require-param */\n\n  /**\n   * This will register a new custom element with the browser.\n   * @param {String} name - The name of the custom element.\n   * @param {Object} componentClass - The class to register as a custom element.\n   * @returns {void}\n   */\n  registerComponent(name, componentClass) {\n    if (!customElements.get(name)) {\n      customElements.define(name, class extends componentClass {});\n    }\n  }\n\n  /**\n   * Finds and returns the closest HTML Element based on a selector.\n   * @returns {void}\n   */\n  closestElement(\n    selector, // selector like in .closest()\n    base = this, // extra functionality to skip a parent\n    __Closest = (el, found = el && el.closest(selector)) =>\n      !el || el === document || el === window\n        ? null // standard .closest() returns null for non-found selectors also\n        : found\n          ? found // found a selector INside this element\n          : __Closest(el.getRootNode().host) // recursion!! break out to parent DOM\n  ) {\n    return __Closest(base);\n  }\n  /* eslint-enable jsdoc/require-param */\n\n  /**\n   * If the element passed is registered with a different tag name than what is passed in, the tag name is added as an attribute to the element.\n   * @param {Object} elem - The element to check.\n   * @param {String} tagName - The name of the Auro component to check for or add as an attribute.\n   * @returns {void}\n   */\n  handleComponentTagRename(elem, tagName) {\n    const tag = tagName.toLowerCase();\n    const elemTag = elem.tagName.toLowerCase();\n\n    if (elemTag !== tag) {\n      elem.setAttribute(tag, true);\n    }\n  }\n\n  /**\n   * Validates if an element is a specific Auro component.\n   * @param {Object} elem - The element to validate.\n   * @param {String} tagName - The name of the Auro component to check against.\n   * @returns {Boolean} - Returns true if the element is the specified Auro component.\n   */\n  elementMatch(elem, tagName) {\n    const tag = tagName.toLowerCase();\n    const elemTag = elem.tagName.toLowerCase();\n\n    return elemTag === tag || elem.hasAttribute(tag);\n  }\n}\n\n"]}