{"version":3,"sources":["jsdelivr-header.js","/npm/@material/mwc-base@0.27.0/base-element.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;OCKQ,eAAiB,aAKjB,sBAAwB,oBAG1B,MAAgB,oBAAoB,WA+B/B,KAAA,GACP,GAAI,KAAK,QAGP,OAFA,KAAK,QAAQ,aACb,KAAK,QAAQ,QAIf,MAAM,OACR,CAKU,gBAAA,QACmB,IAAvB,KAAK,eACP,KAAK,cAAc,UAEjB,KAAK,qBACP,KAAK,cAAgB,IAAI,KAAK,mBAAmB,KAAK,iBACtD,KAAK,cAAc,OAEvB,CAEmB,YAAA,GACjB,KAAK,kBACP","file":"/npm/@material/mwc-base@0.27.0/base-element.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@material/mwc-base@0.27.0/base-element.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// Style preference for leading underscores.\n// tslint:disable:strip-private-property-underscore\n\n\nimport {MDCFoundation} from '@material/base/foundation.js';\nimport {LitElement} from 'lit';\n\nimport {Constructor} from './utils.js';\n\nexport {CustomEventListener, EventType, SpecificEventListener} from '@material/base/types.js';\nexport {addHasRemoveClass} from './utils.js';\n\n/** @soyCompatible */\nexport abstract class BaseElement extends LitElement {\n  /**\n   * Root element for MDC Foundation usage.\n   *\n   * Define in your component with the `@query` decorator\n   */\n  protected abstract mdcRoot: HTMLElement;\n\n  /**\n   * Return the foundation class for this component\n   */\n  protected abstract readonly mdcFoundationClass?: Constructor<MDCFoundation>;\n\n  /**\n   * An instance of the MDC Foundation class to attach to the root element\n   */\n  protected abstract mdcFoundation?: MDCFoundation;\n\n  /**\n   * Create the adapter for the `mdcFoundation`.\n   *\n   * Override and return an object with the Adapter's functions implemented:\n   *\n   *    {\n   *      addClass: () => {},\n   *      removeClass: () => {},\n   *      ...\n   *    }\n   */\n  protected abstract createAdapter(): unknown;\n\n  override click() {\n    if (this.mdcRoot) {\n      this.mdcRoot.focus();\n      this.mdcRoot.click();\n      return;\n    }\n\n    super.click();\n  }\n\n  /**\n   * Create and attach the MDC Foundation to the instance\n   */\n  protected createFoundation() {\n    if (this.mdcFoundation !== undefined) {\n      this.mdcFoundation.destroy();\n    }\n    if (this.mdcFoundationClass) {\n      this.mdcFoundation = new this.mdcFoundationClass(this.createAdapter());\n      this.mdcFoundation.init();\n    }\n  }\n\n  protected override firstUpdated() {\n    this.createFoundation();\n  }\n}\n"]}