1 |
- {"version":3,"sources":["webpack://mdc/webpack/universalModuleDefinition","webpack://mdc/webpack/bootstrap","webpack://mdc/./packages/material-components-web/index.ts","webpack://mdc/./packages/mdc-animation/util.ts","webpack://mdc/./packages/mdc-auto-init/constants.ts","webpack://mdc/./packages/mdc-auto-init/index.ts","webpack://mdc/./packages/mdc-base/component.ts","webpack://mdc/./packages/mdc-base/foundation.ts","webpack://mdc/./packages/mdc-base/index.ts","webpack://mdc/./packages/mdc-checkbox/component.ts","webpack://mdc/./packages/mdc-checkbox/constants.ts","webpack://mdc/./packages/mdc-checkbox/foundation.ts","webpack://mdc/./packages/mdc-checkbox/index.ts","webpack://mdc/./packages/mdc-chips/chip-set/component.ts","webpack://mdc/./packages/mdc-chips/chip-set/constants.ts","webpack://mdc/./packages/mdc-chips/chip-set/foundation.ts","webpack://mdc/./packages/mdc-chips/chip-set/index.ts","webpack://mdc/./packages/mdc-chips/chip/component.ts","webpack://mdc/./packages/mdc-chips/chip/constants.ts","webpack://mdc/./packages/mdc-chips/chip/foundation.ts","webpack://mdc/./packages/mdc-chips/chip/index.ts","webpack://mdc/./packages/mdc-chips/index.ts","webpack://mdc/./packages/mdc-chips/trailingaction/component.ts","webpack://mdc/./packages/mdc-chips/trailingaction/constants.ts","webpack://mdc/./packages/mdc-chips/trailingaction/foundation.ts","webpack://mdc/./packages/mdc-chips/trailingaction/index.ts","webpack://mdc/./packages/mdc-circular-progress/component.ts","webpack://mdc/./packages/mdc-circular-progress/constants.ts","webpack://mdc/./packages/mdc-circular-progress/foundation.ts","webpack://mdc/./packages/mdc-circular-progress/index.ts","webpack://mdc/./packages/mdc-data-table/component.ts","webpack://mdc/./packages/mdc-data-table/constants.ts","webpack://mdc/./packages/mdc-data-table/foundation.ts","webpack://mdc/./packages/mdc-data-table/index.ts","webpack://mdc/./packages/mdc-dialog/component.ts","webpack://mdc/./packages/mdc-dialog/constants.ts","webpack://mdc/./packages/mdc-dialog/foundation.ts","webpack://mdc/./packages/mdc-dialog/index.ts","webpack://mdc/./packages/mdc-dialog/util.ts","webpack://mdc/./packages/mdc-dom/announce.ts","webpack://mdc/./packages/mdc-dom/events.ts","webpack://mdc/./packages/mdc-dom/focus-trap.ts","webpack://mdc/./packages/mdc-dom/index.ts","webpack://mdc/./packages/mdc-dom/keyboard.ts","webpack://mdc/./packages/mdc-dom/ponyfill.ts","webpack://mdc/./packages/mdc-drawer/component.ts","webpack://mdc/./packages/mdc-drawer/constants.ts","webpack://mdc/./packages/mdc-drawer/dismissible/foundation.ts","webpack://mdc/./packages/mdc-drawer/index.ts","webpack://mdc/./packages/mdc-drawer/modal/foundation.ts","webpack://mdc/./packages/mdc-drawer/util.ts","webpack://mdc/./packages/mdc-floating-label/component.ts","webpack://mdc/./packages/mdc-floating-label/constants.ts","webpack://mdc/./packages/mdc-floating-label/foundation.ts","webpack://mdc/./packages/mdc-floating-label/index.ts","webpack://mdc/./packages/mdc-form-field/component.ts","webpack://mdc/./packages/mdc-form-field/constants.ts","webpack://mdc/./packages/mdc-form-field/foundation.ts","webpack://mdc/./packages/mdc-form-field/index.ts","webpack://mdc/./packages/mdc-icon-button/component.ts","webpack://mdc/./packages/mdc-icon-button/constants.ts","webpack://mdc/./packages/mdc-icon-button/foundation.ts","webpack://mdc/./packages/mdc-icon-button/index.ts","webpack://mdc/./packages/mdc-line-ripple/component.ts","webpack://mdc/./packages/mdc-line-ripple/constants.ts","webpack://mdc/./packages/mdc-line-ripple/foundation.ts","webpack://mdc/./packages/mdc-line-ripple/index.ts","webpack://mdc/./packages/mdc-linear-progress/component.ts","webpack://mdc/./packages/mdc-linear-progress/constants.ts","webpack://mdc/./packages/mdc-linear-progress/foundation.ts","webpack://mdc/./packages/mdc-linear-progress/index.ts","webpack://mdc/./packages/mdc-list/component.ts","webpack://mdc/./packages/mdc-list/constants.ts","webpack://mdc/./packages/mdc-list/events.ts","webpack://mdc/./packages/mdc-list/foundation.ts","webpack://mdc/./packages/mdc-list/index.ts","webpack://mdc/./packages/mdc-list/typeahead.ts","webpack://mdc/./packages/mdc-menu-surface/component.ts","webpack://mdc/./packages/mdc-menu-surface/constants.ts","webpack://mdc/./packages/mdc-menu-surface/foundation.ts","webpack://mdc/./packages/mdc-menu-surface/index.ts","webpack://mdc/./packages/mdc-menu-surface/util.ts","webpack://mdc/./packages/mdc-menu/component.ts","webpack://mdc/./packages/mdc-menu/constants.ts","webpack://mdc/./packages/mdc-menu/foundation.ts","webpack://mdc/./packages/mdc-menu/index.ts","webpack://mdc/./packages/mdc-notched-outline/component.ts","webpack://mdc/./packages/mdc-notched-outline/constants.ts","webpack://mdc/./packages/mdc-notched-outline/foundation.ts","webpack://mdc/./packages/mdc-notched-outline/index.ts","webpack://mdc/./packages/mdc-radio/component.ts","webpack://mdc/./packages/mdc-radio/constants.ts","webpack://mdc/./packages/mdc-radio/foundation.ts","webpack://mdc/./packages/mdc-radio/index.ts","webpack://mdc/./packages/mdc-ripple/component.ts","webpack://mdc/./packages/mdc-ripple/constants.ts","webpack://mdc/./packages/mdc-ripple/foundation.ts","webpack://mdc/./packages/mdc-ripple/index.ts","webpack://mdc/./packages/mdc-ripple/util.ts","webpack://mdc/./packages/mdc-select/component.ts","webpack://mdc/./packages/mdc-select/constants.ts","webpack://mdc/./packages/mdc-select/foundation.ts","webpack://mdc/./packages/mdc-select/helper-text/component.ts","webpack://mdc/./packages/mdc-select/helper-text/constants.ts","webpack://mdc/./packages/mdc-select/helper-text/foundation.ts","webpack://mdc/./packages/mdc-select/helper-text/index.ts","webpack://mdc/./packages/mdc-select/icon/component.ts","webpack://mdc/./packages/mdc-select/icon/constants.ts","webpack://mdc/./packages/mdc-select/icon/foundation.ts","webpack://mdc/./packages/mdc-select/icon/index.ts","webpack://mdc/./packages/mdc-select/index.ts","webpack://mdc/./packages/mdc-slider/component.ts","webpack://mdc/./packages/mdc-slider/constants.ts","webpack://mdc/./packages/mdc-slider/foundation.ts","webpack://mdc/./packages/mdc-slider/index.ts","webpack://mdc/./packages/mdc-snackbar/component.ts","webpack://mdc/./packages/mdc-snackbar/constants.ts","webpack://mdc/./packages/mdc-snackbar/foundation.ts","webpack://mdc/./packages/mdc-snackbar/index.ts","webpack://mdc/./packages/mdc-snackbar/util.ts","webpack://mdc/./packages/mdc-switch/component.ts","webpack://mdc/./packages/mdc-switch/constants.ts","webpack://mdc/./packages/mdc-switch/foundation.ts","webpack://mdc/./packages/mdc-switch/index.ts","webpack://mdc/./packages/mdc-tab-bar/component.ts","webpack://mdc/./packages/mdc-tab-bar/constants.ts","webpack://mdc/./packages/mdc-tab-bar/foundation.ts","webpack://mdc/./packages/mdc-tab-bar/index.ts","webpack://mdc/./packages/mdc-tab-indicator/component.ts","webpack://mdc/./packages/mdc-tab-indicator/constants.ts","webpack://mdc/./packages/mdc-tab-indicator/fading-foundation.ts","webpack://mdc/./packages/mdc-tab-indicator/foundation.ts","webpack://mdc/./packages/mdc-tab-indicator/index.ts","webpack://mdc/./packages/mdc-tab-indicator/sliding-foundation.ts","webpack://mdc/./packages/mdc-tab-scroller/component.ts","webpack://mdc/./packages/mdc-tab-scroller/constants.ts","webpack://mdc/./packages/mdc-tab-scroller/foundation.ts","webpack://mdc/./packages/mdc-tab-scroller/index.ts","webpack://mdc/./packages/mdc-tab-scroller/rtl-default-scroller.ts","webpack://mdc/./packages/mdc-tab-scroller/rtl-negative-scroller.ts","webpack://mdc/./packages/mdc-tab-scroller/rtl-reverse-scroller.ts","webpack://mdc/./packages/mdc-tab-scroller/rtl-scroller.ts","webpack://mdc/./packages/mdc-tab-scroller/util.ts","webpack://mdc/./packages/mdc-tab/component.ts","webpack://mdc/./packages/mdc-tab/constants.ts","webpack://mdc/./packages/mdc-tab/foundation.ts","webpack://mdc/./packages/mdc-tab/index.ts","webpack://mdc/./packages/mdc-textfield/character-counter/component.ts","webpack://mdc/./packages/mdc-textfield/character-counter/constants.ts","webpack://mdc/./packages/mdc-textfield/character-counter/foundation.ts","webpack://mdc/./packages/mdc-textfield/character-counter/index.ts","webpack://mdc/./packages/mdc-textfield/component.ts","webpack://mdc/./packages/mdc-textfield/constants.ts","webpack://mdc/./packages/mdc-textfield/foundation.ts","webpack://mdc/./packages/mdc-textfield/helper-text/component.ts","webpack://mdc/./packages/mdc-textfield/helper-text/constants.ts","webpack://mdc/./packages/mdc-textfield/helper-text/foundation.ts","webpack://mdc/./packages/mdc-textfield/helper-text/index.ts","webpack://mdc/./packages/mdc-textfield/icon/component.ts","webpack://mdc/./packages/mdc-textfield/icon/constants.ts","webpack://mdc/./packages/mdc-textfield/icon/foundation.ts","webpack://mdc/./packages/mdc-textfield/icon/index.ts","webpack://mdc/./packages/mdc-textfield/index.ts","webpack://mdc/./packages/mdc-top-app-bar/component.ts","webpack://mdc/./packages/mdc-top-app-bar/constants.ts","webpack://mdc/./packages/mdc-top-app-bar/fixed/foundation.ts","webpack://mdc/./packages/mdc-top-app-bar/foundation.ts","webpack://mdc/./packages/mdc-top-app-bar/index.ts","webpack://mdc/./packages/mdc-top-app-bar/short/foundation.ts","webpack://mdc/./packages/mdc-top-app-bar/standard/foundation.ts"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;A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;AACxD,YAAQ,KAAiB,qBAAkB,eAAE;AACvC,iBAAW,aAAS;AAE2D;AACb;AACK;AACvE,iBAAwB,2BAAQ,KAAiB,mBAAiB;AAClE,iBAAiB,mBAAiB;AACvC;AACG,aACN;AAAC;AACH,WAAC;AAAA,EAnK2C,aAmK3C;AAnKY,iCAAsB;AAqK8E;AACjH,kBAAsC,uB","file":"material-components-web.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"mdc\"] = factory();\n\telse\n\t\troot[\"mdc\"] = factory();\n})(this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./packages/material-components-web/index.ts\");\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport autoInit from '@material/auto-init/index';\nimport * as base from '@material/base/index';\nimport * as checkbox from '@material/checkbox/index';\nimport * as chips from '@material/chips/index';\nimport * as circularProgress from '@material/circular-progress/index';\nimport * as dataTable from '@material/data-table/index';\nimport * as dialog from '@material/dialog/index';\nimport * as dom from '@material/dom/index';\nimport * as drawer from '@material/drawer/index';\nimport * as floatingLabel from '@material/floating-label/index';\nimport * as formField from '@material/form-field/index';\nimport * as iconButton from '@material/icon-button/index';\nimport * as lineRipple from '@material/line-ripple/index';\nimport * as linearProgress from '@material/linear-progress/index';\nimport * as list from '@material/list/index';\nimport * as menuSurface from '@material/menu-surface/index';\nimport * as menu from '@material/menu/index';\nimport * as notchedOutline from '@material/notched-outline/index';\nimport * as radio from '@material/radio/index';\nimport * as ripple from '@material/ripple/index';\nimport * as select from '@material/select/index';\nimport * as slider from '@material/slider/index';\nimport * as snackbar from '@material/snackbar/index';\nimport * as switchControl from '@material/switch/index';\nimport * as tabBar from '@material/tab-bar/index';\nimport * as tabIndicator from '@material/tab-indicator/index';\nimport * as tabScroller from '@material/tab-scroller/index';\nimport * as tab from '@material/tab/index';\nimport * as textField from '@material/textfield/index';\nimport * as topAppBar from '@material/top-app-bar/index';\n\n// Register all components\nautoInit.register('MDCCheckbox', checkbox.MDCCheckbox);\nautoInit.register('MDCChip', chips.MDCChip);\nautoInit.register('MDCChipSet', chips.MDCChipSet);\nautoInit.register('MDCCircularProgress', circularProgress.MDCCircularProgress);\nautoInit.register('MDCDataTable', dataTable.MDCDataTable);\nautoInit.register('MDCDialog', dialog.MDCDialog);\nautoInit.register('MDCDrawer', drawer.MDCDrawer);\nautoInit.register('MDCFloatingLabel', floatingLabel.MDCFloatingLabel);\nautoInit.register('MDCFormField', formField.MDCFormField);\nautoInit.register('MDCIconButtonToggle', iconButton.MDCIconButtonToggle);\nautoInit.register('MDCLineRipple', lineRipple.MDCLineRipple);\nautoInit.register('MDCLinearProgress', linearProgress.MDCLinearProgress);\nautoInit.register('MDCList', list.MDCList);\nautoInit.register('MDCMenu', menu.MDCMenu);\nautoInit.register('MDCMenuSurface', menuSurface.MDCMenuSurface);\nautoInit.register('MDCNotchedOutline', notchedOutline.MDCNotchedOutline);\nautoInit.register('MDCRadio', radio.MDCRadio);\nautoInit.register('MDCRipple', ripple.MDCRipple);\nautoInit.register('MDCSelect', select.MDCSelect);\nautoInit.register('MDCSlider', slider.MDCSlider);\nautoInit.register('MDCSnackbar', snackbar.MDCSnackbar);\nautoInit.register('MDCSwitch', switchControl.MDCSwitch);\nautoInit.register('MDCTabBar', tabBar.MDCTabBar);\nautoInit.register('MDCTextField', textField.MDCTextField);\nautoInit.register('MDCTopAppBar', topAppBar.MDCTopAppBar);\n\n// Export all components.\nexport {\n autoInit,\n base,\n checkbox,\n chips,\n circularProgress,\n dataTable,\n dialog,\n dom,\n drawer,\n floatingLabel,\n formField,\n iconButton,\n lineRipple,\n linearProgress,\n list,\n menu,\n menuSurface,\n notchedOutline,\n radio,\n ripple,\n select,\n slider,\n snackbar,\n switchControl,\n tab,\n tabBar,\n tabIndicator,\n tabScroller,\n textField,\n topAppBar,\n};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {\n CssVendorPropertyMap, JsVendorPropertyMap,\n PrefixedCssPropertyName, PrefixedJsEventType,\n StandardCssPropertyName, StandardJsEventType,\n} from './types';\n\nconst cssPropertyNameMap: CssVendorPropertyMap = {\n animation: {\n prefixed: '-webkit-animation',\n standard: 'animation',\n },\n transform: {\n prefixed: '-webkit-transform',\n standard: 'transform',\n },\n transition: {\n prefixed: '-webkit-transition',\n standard: 'transition',\n },\n};\n\nconst jsEventTypeMap: JsVendorPropertyMap = {\n animationend: {\n cssProperty: 'animation',\n prefixed: 'webkitAnimationEnd',\n standard: 'animationend',\n },\n animationiteration: {\n cssProperty: 'animation',\n prefixed: 'webkitAnimationIteration',\n standard: 'animationiteration',\n },\n animationstart: {\n cssProperty: 'animation',\n prefixed: 'webkitAnimationStart',\n standard: 'animationstart',\n },\n transitionend: {\n cssProperty: 'transition',\n prefixed: 'webkitTransitionEnd',\n standard: 'transitionend',\n },\n};\n\nfunction isWindow(windowObj: Window): boolean {\n return Boolean(windowObj.document) && typeof windowObj.document.createElement === 'function';\n}\n\nexport function getCorrectPropertyName(windowObj: Window, cssProperty: StandardCssPropertyName):\n StandardCssPropertyName | PrefixedCssPropertyName {\n if (isWindow(windowObj) && cssProperty in cssPropertyNameMap) {\n const el = windowObj.document.createElement('div');\n const {standard, prefixed} = cssPropertyNameMap[cssProperty];\n const isStandard = standard in el.style;\n return isStandard ? standard : prefixed;\n }\n return cssProperty;\n}\n\nexport function getCorrectEventName(windowObj: Window, eventType: StandardJsEventType):\n StandardJsEventType | PrefixedJsEventType {\n if (isWindow(windowObj) && eventType in jsEventTypeMap) {\n const el = windowObj.document.createElement('div');\n const {standard, prefixed, cssProperty} = jsEventTypeMap[eventType];\n const isStandard = cssProperty in el.style;\n return isStandard ? standard : prefixed;\n }\n return eventType;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const strings = {\n AUTO_INIT_ATTR: 'data-mdc-auto-init',\n AUTO_INIT_STATE_ATTR: 'data-mdc-auto-init-state',\n INITIALIZED_STATE: 'initialized',\n};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n// tslint:disable:only-arrow-functions\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCFoundation} from '@material/base/foundation';\n\nimport {strings} from './constants';\n\nconst {AUTO_INIT_ATTR, AUTO_INIT_STATE_ATTR, INITIALIZED_STATE} = strings;\n\nexport interface MDCAttachable {\n new<F extends MDCFoundation>(root: Element, foundation?: F, ...args: Array<unknown>): MDCComponent<F>;\n\n // Static method.\n attachTo<F extends MDCFoundation>(root: Element): MDCComponent<F>;\n}\n\ninterface InternalComponentRegistry {\n [key: string]: MDCAttachable;\n}\n\nconst registry: InternalComponentRegistry = {};\n\nconst CONSOLE_WARN = console.warn.bind(console); // tslint:disable-line:no-console\n\nfunction emit<T extends object>(evtType: string, evtData: T, shouldBubble = false) {\n let evt;\n if (typeof CustomEvent === 'function') {\n evt = new CustomEvent<T>(evtType, {\n bubbles: shouldBubble,\n detail: evtData,\n });\n } else {\n evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(evtType, shouldBubble, false, evtData);\n }\n\n document.dispatchEvent(evt);\n}\n\n/* istanbul ignore next: optional argument is not a branch statement */\n/**\n * Auto-initializes all MDC components on a page.\n */\nfunction mdcAutoInit(root = document) {\n const components = [];\n let nodes: Element[] = [].slice.call(root.querySelectorAll(`[${AUTO_INIT_ATTR}]`));\n nodes = nodes.filter((node) => node.getAttribute(AUTO_INIT_STATE_ATTR) !== INITIALIZED_STATE);\n\n for (const node of nodes) {\n const ctorName = node.getAttribute(AUTO_INIT_ATTR);\n if (!ctorName) {\n throw new Error('(mdc-auto-init) Constructor name must be given.');\n }\n\n const Constructor = registry[ctorName]; // tslint:disable-line:variable-name\n if (typeof Constructor !== 'function') {\n throw new Error(\n `(mdc-auto-init) Could not find constructor in registry for ${ctorName}`);\n }\n\n // TODO: Should we make an eslint rule for an attachTo() static method?\n // See https://github.com/Microsoft/TypeScript/issues/14600 for discussion of static interface support in TS\n const component = Constructor.attachTo(node);\n Object.defineProperty(node, ctorName, {\n configurable: true,\n enumerable: false,\n value: component,\n writable: false,\n });\n components.push(component);\n node.setAttribute(AUTO_INIT_STATE_ATTR, INITIALIZED_STATE);\n }\n\n emit('MDCAutoInit:End', {});\n return components;\n}\n\n// Constructor is PascalCased because it is a direct reference to a class, rather than an instance of a class.\n// tslint:disable-next-line:variable-name\nmdcAutoInit.register = function(componentName: string, Constructor: MDCAttachable, warn = CONSOLE_WARN) {\n if (typeof Constructor !== 'function') {\n throw new Error(`(mdc-auto-init) Invalid Constructor value: ${Constructor}. Expected function.`);\n }\n const registryValue = registry[componentName];\n if (registryValue) {\n warn(`(mdc-auto-init) Overriding registration for ${componentName} with ${Constructor}. Was: ${registryValue}`);\n }\n registry[componentName] = Constructor;\n};\n\nmdcAutoInit.deregister = function(componentName: string) {\n delete registry[componentName];\n};\n\n/** @nocollapse */\nmdcAutoInit.deregisterAll = function() {\n const keys = Object.keys(registry) as string[];\n keys.forEach(this.deregister, this);\n};\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default mdcAutoInit;\nexport {mdcAutoInit};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from './foundation';\nimport {CustomEventListener, EventType, SpecificEventListener} from './types';\n\nexport class MDCComponent<FoundationType extends MDCFoundation> {\n static attachTo(root: Element): MDCComponent<MDCFoundation<{}>> {\n // Subclasses which extend MDCBase should provide an attachTo() method that takes a root element and\n // returns an instantiated component with its root set to that element. Also note that in the cases of\n // subclasses, an explicit foundation class will not have to be passed in; it will simply be initialized\n // from getDefaultFoundation().\n return new MDCComponent(root, new MDCFoundation({}));\n }\n\n protected foundation: FoundationType;\n\n constructor(\n public root: Element, foundation?: FoundationType, ...args: unknown[]) {\n this.initialize(...args);\n // Note that we initialize foundation here and not within the constructor's default param so that\n // this.root_ is defined and can be used within the foundation class.\n this.foundation =\n foundation === undefined ? this.getDefaultFoundation() : foundation;\n this.foundation.init();\n this.initialSyncWithDOM();\n }\n\n /* istanbul ignore next: method param only exists for typing purposes; it does not need to be unit tested */\n initialize(..._args: Array<unknown>) {\n // Subclasses can override this to do any additional setup work that would be considered part of a\n // \"constructor\". Essentially, it is a hook into the parent constructor before the foundation is\n // initialized. Any additional arguments besides root and foundation will be passed in here.\n }\n\n getDefaultFoundation(): FoundationType {\n // Subclasses must override this method to return a properly configured foundation class for the\n // component.\n throw new Error('Subclasses must override getDefaultFoundation to return a properly configured ' +\n 'foundation class');\n }\n\n initialSyncWithDOM() {\n // Subclasses should override this method if they need to perform work to synchronize with a host DOM\n // object. An example of this would be a form control wrapper that needs to synchronize its internal state\n // to some property or attribute of the host DOM. Please note: this is *not* the place to perform DOM\n // reads/writes that would cause layout / paint, as this is called synchronously from within the constructor.\n }\n\n destroy() {\n // Subclasses may implement this method to release any resources / deregister any listeners they have\n // attached. An example of this might be deregistering a resize event from the window object.\n this.foundation.destroy();\n }\n\n /**\n * Wrapper method to add an event listener to the component's root element. This is most useful when\n * listening for custom events.\n */\n listen<K extends EventType>(\n evtType: K, handler: SpecificEventListener<K>, options?: AddEventListenerOptions | boolean): void;\n listen<E extends Event>(\n evtType: string, handler: CustomEventListener<E>, options?: AddEventListenerOptions | boolean): void;\n listen(evtType: string, handler: EventListener, options?: AddEventListenerOptions | boolean) {\n this.root.addEventListener(evtType, handler, options);\n }\n\n /**\n * Wrapper method to remove an event listener to the component's root element. This is most useful when\n * unlistening for custom events.\n */\n unlisten<K extends EventType>(\n evtType: K, handler: SpecificEventListener<K>, options?: AddEventListenerOptions | boolean): void;\n unlisten<E extends Event>(\n evtType: string, handler: CustomEventListener<E>, options?: AddEventListenerOptions | boolean): void;\n unlisten(evtType: string, handler: EventListener, options?: AddEventListenerOptions | boolean) {\n this.root.removeEventListener(evtType, handler, options);\n }\n\n /**\n * Fires a cross-browser-compatible custom event from the component root of the given type, with the given data.\n */\n emit<T extends object>(evtType: string, evtData: T, shouldBubble = false) {\n let evt: CustomEvent<T>;\n if (typeof CustomEvent === 'function') {\n evt = new CustomEvent<T>(evtType, {\n bubbles: shouldBubble,\n detail: evtData,\n });\n } else {\n evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(evtType, shouldBubble, false, evtData);\n }\n\n this.root.dispatchEvent(evt);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCComponent;\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport class MDCFoundation<AdapterType extends {} = {}> {\n static get cssClasses(): { [key: string]: string } {\n // Classes extending MDCFoundation should implement this method to return an object which exports every\n // CSS class the foundation class needs as a property. e.g. {ACTIVE: 'mdc-component--active'}\n return {};\n }\n\n static get strings(): { [key: string]: string } {\n // Classes extending MDCFoundation should implement this method to return an object which exports all\n // semantic strings as constants. e.g. {ARIA_ROLE: 'tablist'}\n return {};\n }\n\n static get numbers(): { [key: string]: number } {\n // Classes extending MDCFoundation should implement this method to return an object which exports all\n // of its semantic numbers as constants. e.g. {ANIMATION_DELAY_MS: 350}\n return {};\n }\n\n static get defaultAdapter(): {} {\n // Classes extending MDCFoundation may choose to implement this getter in order to provide a convenient\n // way of viewing the necessary methods of an adapter. In the future, this could also be used for adapter\n // validation.\n return {};\n }\n\n constructor(protected adapter: AdapterType = {} as AdapterType) {}\n\n init() {\n // Subclasses should override this method to perform initialization routines (registering events, etc.)\n }\n\n destroy() {\n // Subclasses should override this method to perform de-initialization routines (de-registering events, etc.)\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './component';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {getCorrectEventName} from '@material/animation/util';\nimport {MDCComponent} from '@material/base/component';\nimport {applyPassive} from '@material/dom/events';\nimport {matches} from '@material/dom/ponyfill';\nimport {MDCRippleAdapter} from '@material/ripple/adapter';\nimport {MDCRipple} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCRippleCapableSurface} from '@material/ripple/types';\n\nimport {MDCCheckboxAdapter} from './adapter';\nimport {strings} from './constants';\nimport {MDCCheckboxFoundation} from './foundation';\n\n/**\n * This type is needed for compatibility with Closure Compiler.\n */\ntype PropertyDescriptorGetter = (() => unknown) | undefined;\n\nconst CB_PROTO_PROPS = ['checked', 'indeterminate'];\n\nexport type MDCCheckboxFactory = (el: Element, foundation?: MDCCheckboxFoundation) => MDCCheckbox;\n\nexport class MDCCheckbox extends MDCComponent<MDCCheckboxFoundation> implements MDCRippleCapableSurface {\n static attachTo(root: Element) {\n return new MDCCheckbox(root);\n }\n\n get ripple(): MDCRipple {\n return this.ripple_;\n }\n\n get checked(): boolean {\n return this.nativeControl_.checked;\n }\n\n set checked(checked: boolean) {\n this.nativeControl_.checked = checked;\n }\n\n get indeterminate(): boolean {\n return this.nativeControl_.indeterminate;\n }\n\n set indeterminate(indeterminate: boolean) {\n this.nativeControl_.indeterminate = indeterminate;\n }\n\n get disabled(): boolean {\n return this.nativeControl_.disabled;\n }\n\n set disabled(disabled: boolean) {\n this.foundation.setDisabled(disabled);\n }\n\n get value(): string {\n return this.nativeControl_.value;\n }\n\n set value(value: string) {\n this.nativeControl_.value = value;\n }\n\n private readonly ripple_: MDCRipple = this.createRipple_();\n private handleChange_!: EventListener; // assigned in initialSyncWithDOM()\n private handleAnimationEnd_!: EventListener; // assigned in initialSyncWithDOM()\n\n initialize() {\n const {DATA_INDETERMINATE_ATTR} = strings;\n this.nativeControl_.indeterminate =\n this.nativeControl_.getAttribute(DATA_INDETERMINATE_ATTR) === 'true';\n this.nativeControl_.removeAttribute(DATA_INDETERMINATE_ATTR);\n }\n\n initialSyncWithDOM() {\n this.handleChange_ = () => this.foundation.handleChange();\n this.handleAnimationEnd_ = () => this.foundation.handleAnimationEnd();\n this.nativeControl_.addEventListener('change', this.handleChange_);\n this.listen(getCorrectEventName(window, 'animationend'), this.handleAnimationEnd_);\n this.installPropertyChangeHooks_();\n }\n\n destroy() {\n this.ripple_.destroy();\n this.nativeControl_.removeEventListener('change', this.handleChange_);\n this.unlisten(getCorrectEventName(window, 'animationend'), this.handleAnimationEnd_);\n this.uninstallPropertyChangeHooks_();\n super.destroy();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCCheckboxAdapter = {\n addClass: (className) => this.root.classList.add(className),\n forceLayout: () => (this.root as HTMLElement).offsetWidth,\n hasNativeControl: () => !!this.nativeControl_,\n isAttachedToDOM: () => Boolean(this.root.parentNode),\n isChecked: () => this.checked,\n isIndeterminate: () => this.indeterminate,\n removeClass: (className) => {\n this.root.classList.remove(className);\n },\n removeNativeControlAttr: (attr) => {\n this.nativeControl_.removeAttribute(attr);\n },\n setNativeControlAttr: (attr, value) => {\n this.nativeControl_.setAttribute(attr, value);\n },\n setNativeControlDisabled: (disabled) => {\n this.nativeControl_.disabled = disabled;\n },\n };\n return new MDCCheckboxFoundation(adapter);\n }\n\n private createRipple_(): MDCRipple {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCRippleAdapter = {\n ...MDCRipple.createAdapter(this),\n deregisterInteractionHandler: (evtType, handler) => this.nativeControl_.removeEventListener(\n evtType, handler, applyPassive()),\n isSurfaceActive: () => matches(this.nativeControl_, ':active'),\n isUnbounded: () => true,\n registerInteractionHandler: (evtType, handler) => this.nativeControl_.addEventListener(\n evtType, handler, applyPassive()),\n };\n return new MDCRipple(this.root, new MDCRippleFoundation(adapter));\n }\n\n private installPropertyChangeHooks_() {\n const nativeCb = this.nativeControl_;\n const cbProto = Object.getPrototypeOf(nativeCb);\n\n CB_PROTO_PROPS.forEach((controlState) => {\n const desc = Object.getOwnPropertyDescriptor(cbProto, controlState);\n // We have to check for this descriptor, since some browsers (Safari) don't support its return.\n // See: https://bugs.webkit.org/show_bug.cgi?id=49739\n if (!validDescriptor(desc)) {\n return;\n }\n\n // Type cast is needed for compatibility with Closure Compiler.\n const nativeGetter = (desc as {get: PropertyDescriptorGetter}).get;\n\n const nativeCbDesc = {\n configurable: desc.configurable,\n enumerable: desc.enumerable,\n get: nativeGetter,\n set: (state: boolean) => {\n desc.set!.call(nativeCb, state);\n this.foundation.handleChange();\n },\n };\n Object.defineProperty(nativeCb, controlState, nativeCbDesc);\n });\n }\n\n private uninstallPropertyChangeHooks_() {\n const nativeCb = this.nativeControl_;\n const cbProto = Object.getPrototypeOf(nativeCb);\n\n CB_PROTO_PROPS.forEach((controlState) => {\n const desc = Object.getOwnPropertyDescriptor(cbProto, controlState);\n if (!validDescriptor(desc)) {\n return;\n }\n Object.defineProperty(nativeCb, controlState, desc);\n });\n }\n\n private get nativeControl_(): HTMLInputElement {\n const {NATIVE_CONTROL_SELECTOR} = strings;\n const el =\n this.root.querySelector<HTMLInputElement>(NATIVE_CONTROL_SELECTOR);\n if (!el) {\n throw new Error(`Checkbox component requires a ${NATIVE_CONTROL_SELECTOR} element`);\n }\n return el;\n }\n}\n\nfunction validDescriptor(inputPropDesc: PropertyDescriptor | undefined): inputPropDesc is PropertyDescriptor {\n return !!inputPropDesc && typeof inputPropDesc.set === 'function';\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const cssClasses = {\n ANIM_CHECKED_INDETERMINATE: 'mdc-checkbox--anim-checked-indeterminate',\n ANIM_CHECKED_UNCHECKED: 'mdc-checkbox--anim-checked-unchecked',\n ANIM_INDETERMINATE_CHECKED: 'mdc-checkbox--anim-indeterminate-checked',\n ANIM_INDETERMINATE_UNCHECKED: 'mdc-checkbox--anim-indeterminate-unchecked',\n ANIM_UNCHECKED_CHECKED: 'mdc-checkbox--anim-unchecked-checked',\n ANIM_UNCHECKED_INDETERMINATE: 'mdc-checkbox--anim-unchecked-indeterminate',\n BACKGROUND: 'mdc-checkbox__background',\n CHECKED: 'mdc-checkbox--checked',\n CHECKMARK: 'mdc-checkbox__checkmark',\n CHECKMARK_PATH: 'mdc-checkbox__checkmark-path',\n DISABLED: 'mdc-checkbox--disabled',\n INDETERMINATE: 'mdc-checkbox--indeterminate',\n MIXEDMARK: 'mdc-checkbox__mixedmark',\n NATIVE_CONTROL: 'mdc-checkbox__native-control',\n ROOT: 'mdc-checkbox',\n SELECTED: 'mdc-checkbox--selected',\n UPGRADED: 'mdc-checkbox--upgraded',\n};\n\nexport const strings = {\n ARIA_CHECKED_ATTR: 'aria-checked',\n ARIA_CHECKED_INDETERMINATE_VALUE: 'mixed',\n DATA_INDETERMINATE_ATTR: 'data-indeterminate',\n NATIVE_CONTROL_SELECTOR: '.mdc-checkbox__native-control',\n TRANSITION_STATE_CHECKED: 'checked',\n TRANSITION_STATE_INDETERMINATE: 'indeterminate',\n TRANSITION_STATE_INIT: 'init',\n TRANSITION_STATE_UNCHECKED: 'unchecked',\n};\n\nexport const numbers = {\n ANIM_END_LATCH_MS: 250,\n};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCCheckboxAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\n\nexport class MDCCheckboxFoundation extends MDCFoundation<MDCCheckboxAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get defaultAdapter(): MDCCheckboxAdapter {\n return {\n addClass: () => undefined,\n forceLayout: () => undefined,\n hasNativeControl: () => false,\n isAttachedToDOM: () => false,\n isChecked: () => false,\n isIndeterminate: () => false,\n removeClass: () => undefined,\n removeNativeControlAttr: () => undefined,\n setNativeControlAttr: () => undefined,\n setNativeControlDisabled: () => undefined,\n };\n }\n\n private currentCheckState_ = strings.TRANSITION_STATE_INIT;\n private currentAnimationClass_ = '';\n private animEndLatchTimer_ = 0;\n private enableAnimationEndHandler_ = false;\n\n constructor(adapter?: Partial<MDCCheckboxAdapter>) {\n super({...MDCCheckboxFoundation.defaultAdapter, ...adapter});\n }\n\n init() {\n this.currentCheckState_ = this.determineCheckState_();\n this.updateAriaChecked_();\n this.adapter.addClass(cssClasses.UPGRADED);\n }\n\n destroy() {\n clearTimeout(this.animEndLatchTimer_);\n }\n\n setDisabled(disabled: boolean) {\n this.adapter.setNativeControlDisabled(disabled);\n if (disabled) {\n this.adapter.addClass(cssClasses.DISABLED);\n } else {\n this.adapter.removeClass(cssClasses.DISABLED);\n }\n }\n\n /**\n * Handles the animationend event for the checkbox\n */\n handleAnimationEnd() {\n if (!this.enableAnimationEndHandler_) {\n return;\n }\n\n clearTimeout(this.animEndLatchTimer_);\n\n this.animEndLatchTimer_ = setTimeout(() => {\n this.adapter.removeClass(this.currentAnimationClass_);\n this.enableAnimationEndHandler_ = false;\n }, numbers.ANIM_END_LATCH_MS);\n }\n\n /**\n * Handles the change event for the checkbox\n */\n handleChange() {\n this.transitionCheckState_();\n }\n\n private transitionCheckState_() {\n if (!this.adapter.hasNativeControl()) {\n return;\n }\n const oldState = this.currentCheckState_;\n const newState = this.determineCheckState_();\n\n if (oldState === newState) {\n return;\n }\n\n this.updateAriaChecked_();\n\n const {TRANSITION_STATE_UNCHECKED} = strings;\n const {SELECTED} = cssClasses;\n if (newState === TRANSITION_STATE_UNCHECKED) {\n this.adapter.removeClass(SELECTED);\n } else {\n this.adapter.addClass(SELECTED);\n }\n\n // Check to ensure that there isn't a previously existing animation class, in case for example\n // the user interacted with the checkbox before the animation was finished.\n if (this.currentAnimationClass_.length > 0) {\n clearTimeout(this.animEndLatchTimer_);\n this.adapter.forceLayout();\n this.adapter.removeClass(this.currentAnimationClass_);\n }\n\n this.currentAnimationClass_ = this.getTransitionAnimationClass_(oldState, newState);\n this.currentCheckState_ = newState;\n\n // Check for parentNode so that animations are only run when the element is attached\n // to the DOM.\n if (this.adapter.isAttachedToDOM() &&\n this.currentAnimationClass_.length > 0) {\n this.adapter.addClass(this.currentAnimationClass_);\n this.enableAnimationEndHandler_ = true;\n }\n }\n\n private determineCheckState_(): string {\n const {\n TRANSITION_STATE_INDETERMINATE,\n TRANSITION_STATE_CHECKED,\n TRANSITION_STATE_UNCHECKED,\n } = strings;\n\n if (this.adapter.isIndeterminate()) {\n return TRANSITION_STATE_INDETERMINATE;\n }\n return this.adapter.isChecked() ? TRANSITION_STATE_CHECKED :\n TRANSITION_STATE_UNCHECKED;\n }\n\n private getTransitionAnimationClass_(oldState: string, newState: string): string {\n const {\n TRANSITION_STATE_INIT,\n TRANSITION_STATE_CHECKED,\n TRANSITION_STATE_UNCHECKED,\n } = strings;\n\n const {\n ANIM_UNCHECKED_CHECKED,\n ANIM_UNCHECKED_INDETERMINATE,\n ANIM_CHECKED_UNCHECKED,\n ANIM_CHECKED_INDETERMINATE,\n ANIM_INDETERMINATE_CHECKED,\n ANIM_INDETERMINATE_UNCHECKED,\n } = MDCCheckboxFoundation.cssClasses;\n\n switch (oldState) {\n case TRANSITION_STATE_INIT:\n if (newState === TRANSITION_STATE_UNCHECKED) {\n return '';\n }\n return newState === TRANSITION_STATE_CHECKED ? ANIM_INDETERMINATE_CHECKED : ANIM_INDETERMINATE_UNCHECKED;\n case TRANSITION_STATE_UNCHECKED:\n return newState === TRANSITION_STATE_CHECKED ? ANIM_UNCHECKED_CHECKED : ANIM_UNCHECKED_INDETERMINATE;\n case TRANSITION_STATE_CHECKED:\n return newState === TRANSITION_STATE_UNCHECKED ? ANIM_CHECKED_UNCHECKED : ANIM_CHECKED_INDETERMINATE;\n default: // TRANSITION_STATE_INDETERMINATE\n return newState === TRANSITION_STATE_CHECKED ? ANIM_INDETERMINATE_CHECKED : ANIM_INDETERMINATE_UNCHECKED;\n }\n }\n\n private updateAriaChecked_() {\n // Ensure aria-checked is set to mixed if checkbox is in indeterminate state.\n if (this.adapter.isIndeterminate()) {\n this.adapter.setNativeControlAttr(\n strings.ARIA_CHECKED_ATTR, strings.ARIA_CHECKED_INDETERMINATE_VALUE);\n } else {\n // The on/off state does not need to keep track of aria-checked, since\n // the screenreader uses the checked property on the checkbox element.\n this.adapter.removeNativeControlAttr(strings.ARIA_CHECKED_ATTR);\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCCheckboxFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {announce} from '@material/dom/announce';\nimport {MDCChip, MDCChipFactory} from '../chip/component';\nimport {MDCChipFoundation} from '../chip/foundation';\nimport {MDCChipInteractionEvent, MDCChipNavigationEvent, MDCChipRemovalEvent,\n MDCChipSelectionEvent} from '../chip/types';\nimport {MDCChipSetAdapter} from './adapter';\nimport {MDCChipSetFoundation} from './foundation';\n\nconst {INTERACTION_EVENT, SELECTION_EVENT, REMOVAL_EVENT, NAVIGATION_EVENT} = MDCChipFoundation.strings;\nconst {CHIP_SELECTOR} = MDCChipSetFoundation.strings;\n\nlet idCounter = 0;\n\nexport class MDCChipSet extends MDCComponent<MDCChipSetFoundation> {\n static attachTo(root: Element) {\n return new MDCChipSet(root);\n }\n\n get chips(): ReadonlyArray<MDCChip> {\n return this.chips_.slice();\n }\n\n /**\n * @return An array of the IDs of all selected chips.\n */\n get selectedChipIds(): ReadonlyArray<string> {\n return this.foundation.getSelectedChipIds();\n }\n\n private chips_!: MDCChip[]; // assigned in initialize()\n private chipFactory_!: (el: Element) => MDCChip; // assigned in initialize()\n private handleChipInteraction_!: (evt: MDCChipInteractionEvent) => void; // assigned in initialSyncWithDOM()\n private handleChipSelection_!: (evt: MDCChipSelectionEvent) => void; // assigned in initialSyncWithDOM()\n private handleChipRemoval_!: (evt: MDCChipRemovalEvent) => void; // assigned in initialSyncWithDOM()\n private handleChipNavigation_!: (evt: MDCChipNavigationEvent) => void; // assigned in initialSyncWithDOM()\n\n /**\n * @param chipFactory A function which creates a new MDCChip.\n */\n initialize(chipFactory: MDCChipFactory = (el) => new MDCChip(el)) {\n this.chipFactory_ = chipFactory;\n this.chips_ = this.instantiateChips_(this.chipFactory_);\n }\n\n initialSyncWithDOM() {\n this.chips_.forEach((chip) => {\n if (chip.id && chip.selected) {\n this.foundation.select(chip.id);\n }\n });\n\n this.handleChipInteraction_ = (evt) =>\n this.foundation.handleChipInteraction(evt.detail);\n this.handleChipSelection_ = (evt) =>\n this.foundation.handleChipSelection(evt.detail);\n this.handleChipRemoval_ = (evt) =>\n this.foundation.handleChipRemoval(evt.detail);\n this.handleChipNavigation_ = (evt) =>\n this.foundation.handleChipNavigation(evt.detail);\n this.listen(INTERACTION_EVENT, this.handleChipInteraction_);\n this.listen(SELECTION_EVENT, this.handleChipSelection_);\n this.listen(REMOVAL_EVENT, this.handleChipRemoval_);\n this.listen(NAVIGATION_EVENT, this.handleChipNavigation_);\n }\n\n destroy() {\n this.chips_.forEach((chip) => {\n chip.destroy();\n });\n\n this.unlisten(INTERACTION_EVENT, this.handleChipInteraction_);\n this.unlisten(SELECTION_EVENT, this.handleChipSelection_);\n this.unlisten(REMOVAL_EVENT, this.handleChipRemoval_);\n this.unlisten(NAVIGATION_EVENT, this.handleChipNavigation_);\n\n super.destroy();\n }\n\n /**\n * Adds a new chip object to the chip set from the given chip element.\n */\n addChip(chipEl: Element) {\n chipEl.id = chipEl.id || `mdc-chip-${++idCounter}`;\n this.chips_.push(this.chipFactory_(chipEl));\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCChipSetAdapter = {\n announceMessage: (message) => {\n announce(message);\n },\n focusChipPrimaryActionAtIndex: (index) => {\n this.chips_[index].focusPrimaryAction();\n },\n focusChipTrailingActionAtIndex: (index) => {\n this.chips_[index].focusTrailingAction();\n },\n getChipListCount: () => this.chips_.length,\n getIndexOfChipById: (chipId) => {\n return this.findChipIndex_(chipId);\n },\n hasClass: (className) => this.root.classList.contains(className),\n isRTL: () => window.getComputedStyle(this.root).getPropertyValue(\n 'direction') === 'rtl',\n removeChipAtIndex: (index) => {\n if (index >= 0 && index < this.chips_.length) {\n this.chips_[index].destroy();\n this.chips_[index].remove();\n this.chips_.splice(index, 1);\n }\n },\n removeFocusFromChipAtIndex: (index) => {\n this.chips_[index].removeFocus();\n },\n selectChipAtIndex: (index, selected, shouldNotifyClients) => {\n if (index >= 0 && index < this.chips_.length) {\n this.chips_[index].setSelectedFromChipSet(selected, shouldNotifyClients);\n }\n },\n };\n return new MDCChipSetFoundation(adapter);\n }\n\n /**\n * Instantiates chip components on all of the chip set's child chip elements.\n */\n private instantiateChips_(chipFactory: MDCChipFactory): MDCChip[] {\n const chipElements: Element[] =\n [].slice.call(this.root.querySelectorAll(CHIP_SELECTOR));\n return chipElements.map((el) => {\n el.id = el.id || `mdc-chip-${++idCounter}`;\n return chipFactory(el);\n });\n }\n\n /**\n * Returns the index of the chip with the given id, or -1 if the chip does not exist.\n */\n private findChipIndex_(chipId: string): number {\n for (let i = 0; i < this.chips_.length; i++) {\n if (this.chips_[i].id === chipId) {\n return i;\n }\n }\n return -1;\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const strings = {\n CHIP_SELECTOR: '.mdc-chip',\n};\n\nexport const cssClasses = {\n CHOICE: 'mdc-chip-set--choice',\n FILTER: 'mdc-chip-set--filter',\n};\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\n\nimport {Direction, EventSource, jumpChipKeys, navigationKeys, strings as chipStrings} from '../chip/constants';\nimport {MDCChipInteractionEventDetail, MDCChipNavigationEventDetail, MDCChipRemovalEventDetail, MDCChipSelectionEventDetail} from '../chip/types';\n\nimport {MDCChipSetAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCChipSetFoundation extends MDCFoundation<MDCChipSetAdapter> {\n static get strings() {\n return strings;\n }\n\n static get cssClasses() {\n return cssClasses;\n }\n\n static get defaultAdapter(): MDCChipSetAdapter {\n return {\n announceMessage: () => undefined,\n focusChipPrimaryActionAtIndex: () => undefined,\n focusChipTrailingActionAtIndex: () => undefined,\n getChipListCount: () => -1,\n getIndexOfChipById: () => -1,\n hasClass: () => false,\n isRTL: () => false,\n removeChipAtIndex: () => undefined,\n removeFocusFromChipAtIndex: () => undefined,\n selectChipAtIndex: () => undefined,\n };\n }\n\n /**\n * The ids of the selected chips in the set. Only used for choice chip set or filter chip set.\n */\n private selectedChipIds_: string[] = [];\n\n constructor(adapter?: Partial<MDCChipSetAdapter>) {\n super({...MDCChipSetFoundation.defaultAdapter, ...adapter});\n }\n\n /**\n * Returns an array of the IDs of all selected chips.\n */\n getSelectedChipIds(): ReadonlyArray<string> {\n return this.selectedChipIds_.slice();\n }\n\n /**\n * Selects the chip with the given id. Deselects all other chips if the chip set is of the choice variant.\n * Does not notify clients of the updated selection state.\n */\n select(chipId: string) {\n this.select_(chipId, false);\n }\n\n /**\n * Handles a chip interaction event\n */\n handleChipInteraction({chipId}: MDCChipInteractionEventDetail) {\n const index = this.adapter.getIndexOfChipById(chipId);\n this.removeFocusFromChipsExcept_(index);\n if (this.adapter.hasClass(cssClasses.CHOICE) ||\n this.adapter.hasClass(cssClasses.FILTER)) {\n this.toggleSelect_(chipId);\n }\n }\n\n /**\n * Handles a chip selection event, used to handle discrepancy when selection state is set directly on the Chip.\n */\n handleChipSelection({chipId, selected, shouldIgnore}:\n MDCChipSelectionEventDetail) {\n // Early exit if we should ignore the event\n if (shouldIgnore) {\n return;\n }\n\n const chipIsSelected = this.selectedChipIds_.indexOf(chipId) >= 0;\n if (selected && !chipIsSelected) {\n this.select(chipId);\n } else if (!selected && chipIsSelected) {\n this.deselect_(chipId);\n }\n }\n\n /**\n * Handles the event when a chip is removed.\n */\n handleChipRemoval({chipId, removedAnnouncement}: MDCChipRemovalEventDetail) {\n if (removedAnnouncement) {\n this.adapter.announceMessage(removedAnnouncement);\n }\n\n const index = this.adapter.getIndexOfChipById(chipId);\n this.deselectAndNotifyClients_(chipId);\n this.adapter.removeChipAtIndex(index);\n const maxIndex = this.adapter.getChipListCount() - 1;\n const nextIndex = Math.min(index, maxIndex);\n this.removeFocusFromChipsExcept_(nextIndex);\n // After removing a chip, we should focus the trailing action for the next chip.\n this.adapter.focusChipTrailingActionAtIndex(nextIndex);\n }\n\n /**\n * Handles a chip navigation event.\n */\n handleChipNavigation({chipId, key, source}: MDCChipNavigationEventDetail) {\n const maxIndex = this.adapter.getChipListCount() - 1;\n let index = this.adapter.getIndexOfChipById(chipId);\n // Early exit if the index is out of range or the key is unusable\n if (index === -1 || !navigationKeys.has(key)) {\n return;\n }\n\n const isRTL = this.adapter.isRTL();\n const isLeftKey = key === chipStrings.ARROW_LEFT_KEY ||\n key === chipStrings.IE_ARROW_LEFT_KEY;\n const isRightKey = key === chipStrings.ARROW_RIGHT_KEY ||\n key === chipStrings.IE_ARROW_RIGHT_KEY;\n const isDownKey = key === chipStrings.ARROW_DOWN_KEY ||\n key === chipStrings.IE_ARROW_DOWN_KEY;\n const shouldIncrement =\n !isRTL && isRightKey || isRTL && isLeftKey || isDownKey;\n const isHome = key === chipStrings.HOME_KEY;\n const isEnd = key === chipStrings.END_KEY;\n if (shouldIncrement) {\n index++;\n } else if (isHome) {\n index = 0;\n } else if (isEnd) {\n index = maxIndex;\n } else {\n index--;\n }\n\n // Early exit if the index is out of bounds\n if (index < 0 || index > maxIndex) {\n return;\n }\n\n this.removeFocusFromChipsExcept_(index);\n this.focusChipAction_(index, key, source);\n }\n\n private focusChipAction_(index: number, key: string, source: EventSource) {\n const shouldJumpChips = jumpChipKeys.has(key);\n if (shouldJumpChips && source === EventSource.PRIMARY) {\n return this.adapter.focusChipPrimaryActionAtIndex(index);\n }\n\n if (shouldJumpChips && source === EventSource.TRAILING) {\n return this.adapter.focusChipTrailingActionAtIndex(index);\n }\n\n const dir = this.getDirection_(key);\n if (dir === Direction.LEFT) {\n return this.adapter.focusChipTrailingActionAtIndex(index);\n }\n\n if (dir === Direction.RIGHT) {\n return this.adapter.focusChipPrimaryActionAtIndex(index);\n }\n }\n\n private getDirection_(key: string): Direction {\n const isRTL = this.adapter.isRTL();\n const isLeftKey = key === chipStrings.ARROW_LEFT_KEY ||\n key === chipStrings.IE_ARROW_LEFT_KEY;\n const isRightKey = key === chipStrings.ARROW_RIGHT_KEY ||\n key === chipStrings.IE_ARROW_RIGHT_KEY;\n if (!isRTL && isLeftKey || isRTL && isRightKey) {\n return Direction.LEFT;\n }\n\n return Direction.RIGHT;\n }\n\n /**\n * Deselects the chip with the given id and optionally notifies clients.\n */\n private deselect_(chipId: string, shouldNotifyClients = false) {\n const index = this.selectedChipIds_.indexOf(chipId);\n if (index >= 0) {\n this.selectedChipIds_.splice(index, 1);\n const chipIndex = this.adapter.getIndexOfChipById(chipId);\n this.adapter.selectChipAtIndex(\n chipIndex, /** isSelected */ false, shouldNotifyClients);\n }\n }\n\n /**\n * Deselects the chip with the given id and notifies clients.\n */\n private deselectAndNotifyClients_(chipId: string) {\n this.deselect_(chipId, true);\n }\n\n /**\n * Toggles selection of the chip with the given id.\n */\n private toggleSelect_(chipId: string) {\n if (this.selectedChipIds_.indexOf(chipId) >= 0) {\n this.deselectAndNotifyClients_(chipId);\n } else {\n this.selectAndNotifyClients_(chipId);\n }\n }\n\n private removeFocusFromChipsExcept_(index: number) {\n const chipCount = this.adapter.getChipListCount();\n for (let i = 0; i < chipCount; i++) {\n if (i !== index) {\n this.adapter.removeFocusFromChipAtIndex(i);\n }\n }\n }\n\n private selectAndNotifyClients_(chipId: string) {\n this.select_(chipId, true);\n }\n\n private select_(chipId: string, shouldNotifyClients: boolean) {\n if (this.selectedChipIds_.indexOf(chipId) >= 0) {\n return;\n }\n\n if (this.adapter.hasClass(cssClasses.CHOICE) &&\n this.selectedChipIds_.length > 0) {\n const previouslySelectedChip = this.selectedChipIds_[0];\n const previouslySelectedIndex =\n this.adapter.getIndexOfChipById(previouslySelectedChip);\n this.selectedChipIds_ = [];\n this.adapter.selectChipAtIndex(\n previouslySelectedIndex, /** isSelected */ false,\n shouldNotifyClients);\n }\n this.selectedChipIds_.push(chipId);\n const index = this.adapter.getIndexOfChipById(chipId);\n this.adapter.selectChipAtIndex(\n index, /** isSelected */ true, shouldNotifyClients);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCChipSetFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport {cssClasses as chipSetCssClasses, strings as chipSetStrings} from './constants';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {CustomEventListener, SpecificEventListener} from '@material/base/types';\nimport {MDCRippleAdapter} from '@material/ripple/adapter';\nimport {MDCRipple, MDCRippleFactory} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCRippleCapableSurface} from '@material/ripple/types';\n\nimport {MDCChipTrailingAction, MDCChipTrailingActionFactory} from '../trailingaction/component';\nimport {strings as trailingActionStrings} from '../trailingaction/constants';\nimport {MDCChipTrailingActionInteractionEvent, MDCChipTrailingActionNavigationEvent} from '../trailingaction/types';\n\nimport {MDCChipAdapter} from './adapter';\nimport {strings} from './constants';\nimport {MDCChipFoundation} from './foundation';\nimport {MDCChipInteractionEventDetail, MDCChipNavigationEventDetail, MDCChipRemovalEventDetail, MDCChipSelectionEventDetail} from './types';\n\nexport type MDCChipFactory = (el: Element, foundation?: MDCChipFoundation) => MDCChip;\n\nexport class MDCChip extends MDCComponent<MDCChipFoundation> implements MDCRippleCapableSurface {\n /**\n * @return Whether the chip is selected.\n */\n get selected(): boolean {\n return this.foundation.isSelected();\n }\n\n /**\n * Sets selected state on the chip.\n */\n set selected(selected: boolean) {\n this.foundation.setSelected(selected);\n }\n\n /**\n * @return Whether a trailing icon click should trigger exit/removal of the chip.\n */\n get shouldRemoveOnTrailingIconClick(): boolean {\n return this.foundation.getShouldRemoveOnTrailingIconClick();\n }\n\n /**\n * Sets whether a trailing icon click should trigger exit/removal of the chip.\n */\n set shouldRemoveOnTrailingIconClick(shouldRemove: boolean) {\n this.foundation.setShouldRemoveOnTrailingIconClick(shouldRemove);\n }\n\n /**\n * Sets whether a clicking on the chip should focus the primary action.\n */\n set setShouldFocusPrimaryActionOnClick(shouldFocus: boolean) {\n this.foundation.setShouldFocusPrimaryActionOnClick(shouldFocus);\n }\n\n get ripple(): MDCRipple {\n return this.ripple_;\n }\n\n get id(): string {\n return this.root.id;\n }\n\n static attachTo(root: Element) {\n return new MDCChip(root);\n }\n\n private leadingIcon_!: Element | null; // assigned in initialize()\n private checkmark_!: Element | null; // assigned in initialize()\n private primaryAction_!: Element|null; // assigned in initialize()\n private trailingAction_!: MDCChipTrailingAction|\n null; // assigned in initialize()\n private ripple_!: MDCRipple; // assigned in initialize()\n\n private handleTrailingActionInteraction_!: CustomEventListener<\n MDCChipTrailingActionInteractionEvent>; // assigned in\n // initialSyncWithDOM()\n private handleTrailingActionNavigation_!: CustomEventListener<\n MDCChipTrailingActionNavigationEvent>; // assigned in\n // initialSyncWithDOM()\n private handleTransitionEnd_!: SpecificEventListener<'transitionend'>; // assigned in initialSyncWithDOM()\n private handleClick_!:\n SpecificEventListener<'click'>; // assigned in initialSyncWithDOM()\n private handleKeydown_!: SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n private handleFocusIn_!:\n SpecificEventListener<'focusin'>; // assigned in initialSyncWIthDOM()\n private handleFocusOut_!:\n SpecificEventListener<'focusout'>; // assigned in initialSyncWIthDOM()\n\n initialize(\n rippleFactory:\n MDCRippleFactory = (el, foundation) => new MDCRipple(el, foundation),\n trailingActionFactory:\n MDCChipTrailingActionFactory = (el) => new MDCChipTrailingAction(el),\n ) {\n this.leadingIcon_ = this.root.querySelector(strings.LEADING_ICON_SELECTOR);\n this.checkmark_ = this.root.querySelector(strings.CHECKMARK_SELECTOR);\n this.primaryAction_ =\n this.root.querySelector(strings.PRIMARY_ACTION_SELECTOR);\n\n const trailingActionEl =\n this.root.querySelector(strings.TRAILING_ACTION_SELECTOR);\n\n if (trailingActionEl) {\n this.trailingAction_ = trailingActionFactory(trailingActionEl);\n }\n\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const rippleAdapter: MDCRippleAdapter = {\n ...MDCRipple.createAdapter(this),\n computeBoundingRect: () => this.foundation.getDimensions(),\n };\n this.ripple_ =\n rippleFactory(this.root, new MDCRippleFoundation(rippleAdapter));\n }\n\n initialSyncWithDOM() {\n // Custom events\n this.handleTrailingActionInteraction_ = () => {\n this.foundation.handleTrailingActionInteraction();\n };\n this.handleTrailingActionNavigation_ =\n (evt: MDCChipTrailingActionNavigationEvent) => {\n this.foundation.handleTrailingActionNavigation(evt);\n };\n // Native events\n this.handleClick_ = () => {\n this.foundation.handleClick();\n };\n this.handleKeydown_ = (evt: KeyboardEvent) => {\n this.foundation.handleKeydown(evt);\n };\n this.handleTransitionEnd_ = (evt: TransitionEvent) => {\n this.foundation.handleTransitionEnd(evt);\n };\n this.handleFocusIn_ = (evt: FocusEvent) => {\n this.foundation.handleFocusIn(evt);\n };\n this.handleFocusOut_ = (evt: FocusEvent) => {\n this.foundation.handleFocusOut(evt);\n };\n\n\n this.listen('transitionend', this.handleTransitionEnd_);\n this.listen('click', this.handleClick_);\n this.listen('keydown', this.handleKeydown_);\n this.listen('focusin', this.handleFocusIn_);\n this.listen('focusout', this.handleFocusOut_);\n\n if (this.trailingAction_) {\n this.listen(\n trailingActionStrings.INTERACTION_EVENT,\n this.handleTrailingActionInteraction_);\n this.listen(\n trailingActionStrings.NAVIGATION_EVENT,\n this.handleTrailingActionNavigation_);\n }\n }\n\n destroy() {\n this.ripple_.destroy();\n\n this.unlisten('transitionend', this.handleTransitionEnd_);\n this.unlisten('keydown', this.handleKeydown_);\n this.unlisten('click', this.handleClick_);\n this.unlisten('focusin', this.handleFocusIn_);\n this.unlisten('focusout', this.handleFocusOut_);\n\n if (this.trailingAction_) {\n this.unlisten(\n trailingActionStrings.INTERACTION_EVENT,\n this.handleTrailingActionInteraction_);\n this.unlisten(\n trailingActionStrings.NAVIGATION_EVENT,\n this.handleTrailingActionNavigation_);\n }\n\n super.destroy();\n }\n\n /**\n * Begins the exit animation which leads to removal of the chip.\n */\n beginExit() {\n this.foundation.beginExit();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCChipAdapter = {\n addClass: (className) => this.root.classList.add(className),\n addClassToLeadingIcon: (className) => {\n if (this.leadingIcon_) {\n this.leadingIcon_.classList.add(className);\n }\n },\n eventTargetHasClass: (target, className) =>\n target ? (target as Element).classList.contains(className) : false,\n focusPrimaryAction: () => {\n if (this.primaryAction_) {\n (this.primaryAction_ as HTMLElement).focus();\n }\n },\n focusTrailingAction: () => {\n if (this.trailingAction_) {\n this.trailingAction_.focus();\n }\n },\n getAttribute: (attr) => this.root.getAttribute(attr),\n getCheckmarkBoundingClientRect: () =>\n this.checkmark_ ? this.checkmark_.getBoundingClientRect() : null,\n getComputedStyleValue: (propertyName) =>\n window.getComputedStyle(this.root).getPropertyValue(propertyName),\n getRootBoundingClientRect: () => this.root.getBoundingClientRect(),\n hasClass: (className) => this.root.classList.contains(className),\n hasLeadingIcon: () => !!this.leadingIcon_,\n isRTL: () => window.getComputedStyle(this.root).getPropertyValue(\n 'direction') === 'rtl',\n isTrailingActionNavigable: () => {\n if (this.trailingAction_) {\n return this.trailingAction_.isNavigable();\n }\n return false;\n },\n notifyInteraction: () => this.emit<MDCChipInteractionEventDetail>(\n strings.INTERACTION_EVENT, {chipId: this.id},\n true /* shouldBubble */),\n notifyNavigation: (key, source) =>\n this.emit<MDCChipNavigationEventDetail>(\n strings.NAVIGATION_EVENT, {chipId: this.id, key, source},\n true /* shouldBubble */),\n notifyRemoval: (removedAnnouncement) => {\n this.emit<MDCChipRemovalEventDetail>(\n strings.REMOVAL_EVENT, {chipId: this.id, removedAnnouncement},\n true /* shouldBubble */);\n },\n notifySelection: (selected, shouldIgnore) =>\n this.emit<MDCChipSelectionEventDetail>(\n strings.SELECTION_EVENT,\n {chipId: this.id, selected, shouldIgnore},\n true /* shouldBubble */),\n notifyTrailingIconInteraction: () =>\n this.emit<MDCChipInteractionEventDetail>(\n strings.TRAILING_ICON_INTERACTION_EVENT, {chipId: this.id},\n true /* shouldBubble */),\n notifyEditStart: () => { /* Not Implemented. */ },\n notifyEditFinish: () => { /* Not Implemented. */ },\n removeClass: (className) => this.root.classList.remove(className),\n removeClassFromLeadingIcon: (className) => {\n if (this.leadingIcon_) {\n this.leadingIcon_.classList.remove(className);\n }\n },\n removeTrailingActionFocus: () => {\n if (this.trailingAction_) {\n this.trailingAction_.removeFocus();\n }\n },\n setPrimaryActionAttr: (attr, value) => {\n if (this.primaryAction_) {\n this.primaryAction_.setAttribute(attr, value);\n }\n },\n setStyleProperty: (propertyName, value) =>\n (this.root as HTMLElement).style.setProperty(propertyName, value),\n };\n return new MDCChipFoundation(adapter);\n }\n\n setSelectedFromChipSet(selected: boolean, shouldNotifyClients: boolean) {\n this.foundation.setSelectedFromChipSet(selected, shouldNotifyClients);\n }\n\n focusPrimaryAction() {\n this.foundation.focusPrimaryAction();\n }\n\n focusTrailingAction() {\n this.foundation.focusTrailingAction();\n }\n\n removeFocus() {\n this.foundation.removeFocus();\n }\n\n remove() {\n const parent = this.root.parentNode;\n if (parent !== null) {\n parent.removeChild(this.root);\n }\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport enum Direction {\n LEFT = 'left',\n RIGHT = 'right',\n}\n\nexport enum EventSource {\n PRIMARY = 'primary',\n TRAILING = 'trailing',\n NONE = 'none',\n}\n\nexport const strings = {\n ADDED_ANNOUNCEMENT_ATTRIBUTE: 'data-mdc-chip-added-announcement',\n ARIA_CHECKED: 'aria-checked',\n ARROW_DOWN_KEY: 'ArrowDown',\n ARROW_LEFT_KEY: 'ArrowLeft',\n ARROW_RIGHT_KEY: 'ArrowRight',\n ARROW_UP_KEY: 'ArrowUp',\n BACKSPACE_KEY: 'Backspace',\n CHECKMARK_SELECTOR: '.mdc-chip__checkmark',\n DELETE_KEY: 'Delete',\n END_KEY: 'End',\n ENTER_KEY: 'Enter',\n ENTRY_ANIMATION_NAME: 'mdc-chip-entry',\n HOME_KEY: 'Home',\n IE_ARROW_DOWN_KEY: 'Down',\n IE_ARROW_LEFT_KEY: 'Left',\n IE_ARROW_RIGHT_KEY: 'Right',\n IE_ARROW_UP_KEY: 'Up',\n IE_DELETE_KEY: 'Del',\n INTERACTION_EVENT: 'MDCChip:interaction',\n LEADING_ICON_SELECTOR: '.mdc-chip__icon--leading',\n NAVIGATION_EVENT: 'MDCChip:navigation',\n PRIMARY_ACTION_SELECTOR: '.mdc-chip__primary-action',\n REMOVED_ANNOUNCEMENT_ATTRIBUTE: 'data-mdc-chip-removed-announcement',\n REMOVAL_EVENT: 'MDCChip:removal',\n SELECTION_EVENT: 'MDCChip:selection',\n SPACEBAR_KEY: ' ',\n TAB_INDEX: 'tabindex',\n TRAILING_ACTION_SELECTOR: '.mdc-chip-trailing-action',\n TRAILING_ICON_INTERACTION_EVENT: 'MDCChip:trailingIconInteraction',\n TRAILING_ICON_SELECTOR: '.mdc-chip__icon--trailing',\n};\n\nexport const cssClasses = {\n CHECKMARK: 'mdc-chip__checkmark',\n CHIP_EXIT: 'mdc-chip--exit',\n DELETABLE: 'mdc-chip--deletable',\n EDITABLE: 'mdc-chip--editable',\n EDITING: 'mdc-chip--editing',\n HIDDEN_LEADING_ICON: 'mdc-chip__icon--leading-hidden',\n LEADING_ICON: 'mdc-chip__icon--leading',\n PRIMARY_ACTION: 'mdc-chip__primary-action',\n PRIMARY_ACTION_FOCUSED: 'mdc-chip--primary-action-focused',\n SELECTED: 'mdc-chip--selected',\n TEXT: 'mdc-chip__text',\n TRAILING_ACTION: 'mdc-chip__trailing-action',\n TRAILING_ICON: 'mdc-chip__icon--trailing',\n};\n\nexport const navigationKeys = new Set<string>();\n// IE11 has no support for new Set with iterable so we need to initialize this by hand\nnavigationKeys.add(strings.ARROW_LEFT_KEY);\nnavigationKeys.add(strings.ARROW_RIGHT_KEY);\nnavigationKeys.add(strings.ARROW_DOWN_KEY);\nnavigationKeys.add(strings.ARROW_UP_KEY);\nnavigationKeys.add(strings.END_KEY);\nnavigationKeys.add(strings.HOME_KEY);\nnavigationKeys.add(strings.IE_ARROW_LEFT_KEY);\nnavigationKeys.add(strings.IE_ARROW_RIGHT_KEY);\nnavigationKeys.add(strings.IE_ARROW_DOWN_KEY);\nnavigationKeys.add(strings.IE_ARROW_UP_KEY);\n\nexport const jumpChipKeys = new Set<string>();\n// IE11 has no support for new Set with iterable so we need to initialize this by hand\njumpChipKeys.add(strings.ARROW_UP_KEY);\njumpChipKeys.add(strings.ARROW_DOWN_KEY);\njumpChipKeys.add(strings.HOME_KEY);\njumpChipKeys.add(strings.END_KEY);\njumpChipKeys.add(strings.IE_ARROW_UP_KEY);\njumpChipKeys.add(strings.IE_ARROW_DOWN_KEY);\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\n\nimport {MDCChipTrailingActionNavigationEvent} from '../trailingaction/types';\n\nimport {MDCChipAdapter} from './adapter';\nimport {cssClasses, Direction, EventSource, jumpChipKeys, navigationKeys, strings} from './constants';\n\nconst emptyClientRect = {\n bottom: 0,\n height: 0,\n left: 0,\n right: 0,\n top: 0,\n width: 0,\n};\n\nenum FocusBehavior {\n SHOULD_FOCUS,\n SHOULD_NOT_FOCUS,\n}\n\nexport class MDCChipFoundation extends MDCFoundation<MDCChipAdapter> {\n static get strings() {\n return strings;\n }\n\n static get cssClasses() {\n return cssClasses;\n }\n\n static get defaultAdapter(): MDCChipAdapter {\n return {\n addClass: () => undefined,\n addClassToLeadingIcon: () => undefined,\n eventTargetHasClass: () => false,\n focusPrimaryAction: () => undefined,\n focusTrailingAction: () => undefined,\n getAttribute: () => null,\n getCheckmarkBoundingClientRect: () => emptyClientRect,\n getComputedStyleValue: () => '',\n getRootBoundingClientRect: () => emptyClientRect,\n hasClass: () => false,\n hasLeadingIcon: () => false,\n isRTL: () => false,\n isTrailingActionNavigable: () => false,\n notifyEditFinish: () => undefined,\n notifyEditStart: () => undefined,\n notifyInteraction: () => undefined,\n notifyNavigation: () => undefined,\n notifyRemoval: () => undefined,\n notifySelection: () => undefined,\n notifyTrailingIconInteraction: () => undefined,\n removeClass: () => undefined,\n removeClassFromLeadingIcon: () => undefined,\n removeTrailingActionFocus: () => undefined,\n setPrimaryActionAttr: () => undefined,\n setStyleProperty: () => undefined,\n };\n }\n\n /** Whether a trailing icon click should immediately trigger exit/removal of the chip. */\n private shouldRemoveOnTrailingIconClick_ = true;\n\n /**\n * Whether the primary action should receive focus on click. Should only be\n * set to true for clients who programmatically give focus to a different\n * element on the page when a chip is clicked (like a menu).\n */\n private shouldFocusPrimaryActionOnClick_ = true;\n\n constructor(adapter?: Partial<MDCChipAdapter>) {\n super({...MDCChipFoundation.defaultAdapter, ...adapter});\n }\n\n isSelected() {\n return this.adapter.hasClass(cssClasses.SELECTED);\n }\n\n isEditable() {\n return this.adapter.hasClass(cssClasses.EDITABLE);\n }\n\n isEditing() {\n return this.adapter.hasClass(cssClasses.EDITING);\n }\n\n setSelected(selected: boolean) {\n this.setSelected_(selected);\n this.notifySelection_(selected);\n }\n\n setSelectedFromChipSet(selected: boolean, shouldNotifyClients: boolean) {\n this.setSelected_(selected);\n if (shouldNotifyClients) {\n this.notifyIgnoredSelection_(selected);\n }\n }\n\n getShouldRemoveOnTrailingIconClick() {\n return this.shouldRemoveOnTrailingIconClick_;\n }\n\n setShouldRemoveOnTrailingIconClick(shouldRemove: boolean) {\n this.shouldRemoveOnTrailingIconClick_ = shouldRemove;\n }\n\n setShouldFocusPrimaryActionOnClick(shouldFocus: boolean) {\n this.shouldFocusPrimaryActionOnClick_ = shouldFocus;\n }\n\n getDimensions(): ClientRect {\n const getRootRect = () => this.adapter.getRootBoundingClientRect();\n const getCheckmarkRect = () =>\n this.adapter.getCheckmarkBoundingClientRect();\n\n // When a chip has a checkmark and not a leading icon, the bounding rect changes in size depending on the current\n // size of the checkmark.\n if (!this.adapter.hasLeadingIcon()) {\n const checkmarkRect = getCheckmarkRect();\n if (checkmarkRect) {\n const rootRect = getRootRect();\n // Checkmark is a square, meaning the client rect's width and height are identical once the animation completes.\n // However, the checkbox is initially hidden by setting the width to 0.\n // To account for an initial width of 0, we use the checkbox's height instead (which equals the end-state width)\n // when adding it to the root client rect's width.\n return {\n bottom: rootRect.bottom,\n height: rootRect.height,\n left: rootRect.left,\n right: rootRect.right,\n top: rootRect.top,\n width: rootRect.width + checkmarkRect.height,\n };\n }\n }\n\n return getRootRect();\n }\n\n /**\n * Begins the exit animation which leads to removal of the chip.\n */\n beginExit() {\n this.adapter.addClass(cssClasses.CHIP_EXIT);\n }\n\n handleClick() {\n this.adapter.notifyInteraction();\n this.setPrimaryActionFocusable_(this.getFocusBehavior_());\n }\n\n handleDoubleClick() {\n if (this.isEditable()) {\n this.startEditing();\n }\n }\n\n /**\n * Handles a transition end event on the root element.\n */\n handleTransitionEnd(evt: TransitionEvent) {\n // Handle transition end event on the chip when it is about to be removed.\n const shouldHandle =\n this.adapter.eventTargetHasClass(evt.target, cssClasses.CHIP_EXIT);\n const widthIsAnimating = evt.propertyName === 'width';\n const opacityIsAnimating = evt.propertyName === 'opacity';\n\n if (shouldHandle && opacityIsAnimating) {\n // See: https://css-tricks.com/using-css-transitions-auto-dimensions/#article-header-id-5\n const chipWidth = this.adapter.getComputedStyleValue('width');\n\n // On the next frame (once we get the computed width), explicitly set the chip's width\n // to its current pixel width, so we aren't transitioning out of 'auto'.\n requestAnimationFrame(() => {\n this.adapter.setStyleProperty('width', chipWidth);\n\n // To mitigate jitter, start transitioning padding and margin before width.\n this.adapter.setStyleProperty('padding', '0');\n this.adapter.setStyleProperty('margin', '0');\n\n // On the next frame (once width is explicitly set), transition width to 0.\n requestAnimationFrame(() => {\n this.adapter.setStyleProperty('width', '0');\n });\n });\n return;\n }\n\n if (shouldHandle && widthIsAnimating) {\n this.removeFocus();\n const removedAnnouncement =\n this.adapter.getAttribute(strings.REMOVED_ANNOUNCEMENT_ATTRIBUTE);\n\n this.adapter.notifyRemoval(removedAnnouncement);\n }\n\n // Handle a transition end event on the leading icon or checkmark, since the transition end event bubbles.\n if (!opacityIsAnimating) {\n return;\n }\n\n const shouldHideLeadingIcon =\n this.adapter.eventTargetHasClass(evt.target, cssClasses.LEADING_ICON) &&\n this.adapter.hasClass(cssClasses.SELECTED);\n const shouldShowLeadingIcon =\n this.adapter.eventTargetHasClass(evt.target, cssClasses.CHECKMARK) &&\n !this.adapter.hasClass(cssClasses.SELECTED);\n\n if (shouldHideLeadingIcon) {\n this.adapter.addClassToLeadingIcon(cssClasses.HIDDEN_LEADING_ICON);\n return;\n }\n\n if (shouldShowLeadingIcon) {\n this.adapter.removeClassFromLeadingIcon(cssClasses.HIDDEN_LEADING_ICON);\n return;\n }\n }\n\n handleFocusIn(evt: FocusEvent) {\n // Early exit if the event doesn't come from the primary action\n if (!this.eventFromPrimaryAction_(evt)) {\n return;\n }\n\n this.adapter.addClass(cssClasses.PRIMARY_ACTION_FOCUSED);\n }\n\n handleFocusOut(evt: FocusEvent) {\n // Early exit if the event doesn't come from the primary action\n if (!this.eventFromPrimaryAction_(evt)) {\n return;\n }\n\n if (this.isEditing()) {\n this.finishEditing();\n }\n\n this.adapter.removeClass(cssClasses.PRIMARY_ACTION_FOCUSED);\n }\n\n /**\n * Handles an interaction event on the trailing icon element. This is used to\n * prevent the ripple from activating on interaction with the trailing icon.\n */\n handleTrailingActionInteraction() {\n this.adapter.notifyTrailingIconInteraction();\n this.removeChip_();\n }\n\n /**\n * Handles a keydown event from the root element.\n */\n handleKeydown(evt: KeyboardEvent) {\n if (this.isEditing()) {\n if (this.shouldFinishEditing(evt)) {\n evt.preventDefault();\n this.finishEditing();\n }\n // When editing, the foundation should only handle key events that finish\n // the editing process.\n return;\n }\n\n if (this.isEditable()) {\n if (this.shouldStartEditing(evt)) {\n evt.preventDefault();\n this.startEditing();\n }\n }\n\n if (this.shouldNotifyInteraction_(evt)) {\n this.adapter.notifyInteraction();\n this.setPrimaryActionFocusable_(this.getFocusBehavior_());\n return;\n }\n\n if (this.isDeleteAction_(evt)) {\n evt.preventDefault();\n this.removeChip_();\n return;\n }\n\n // Early exit if the key is not usable\n if (!navigationKeys.has(evt.key)) {\n return;\n }\n\n // Prevent default behavior for movement keys which could include scrolling\n evt.preventDefault();\n this.focusNextAction_(evt.key, EventSource.PRIMARY);\n }\n\n handleTrailingActionNavigation(evt: MDCChipTrailingActionNavigationEvent) {\n return this.focusNextAction_(evt.detail.key, EventSource.TRAILING);\n }\n\n /**\n * Called by the chip set to remove focus from the chip actions.\n */\n removeFocus() {\n this.adapter.setPrimaryActionAttr(strings.TAB_INDEX, '-1');\n this.adapter.removeTrailingActionFocus();\n }\n\n /**\n * Called by the chip set to focus the primary action.\n *\n */\n focusPrimaryAction() {\n this.setPrimaryActionFocusable_(FocusBehavior.SHOULD_FOCUS);\n }\n\n /**\n * Called by the chip set to focus the trailing action (if present), otherwise\n * gives focus to the trailing action.\n */\n focusTrailingAction() {\n const trailingActionIsNavigable = this.adapter.isTrailingActionNavigable();\n if (trailingActionIsNavigable) {\n this.adapter.setPrimaryActionAttr(strings.TAB_INDEX, '-1');\n this.adapter.focusTrailingAction();\n return;\n }\n\n this.focusPrimaryAction();\n }\n\n private setPrimaryActionFocusable_(focusBehavior: FocusBehavior) {\n this.adapter.setPrimaryActionAttr(strings.TAB_INDEX, '0');\n if (focusBehavior === FocusBehavior.SHOULD_FOCUS) {\n this.adapter.focusPrimaryAction();\n }\n this.adapter.removeTrailingActionFocus();\n }\n\n private getFocusBehavior_(): FocusBehavior {\n if (this.shouldFocusPrimaryActionOnClick_) {\n return FocusBehavior.SHOULD_FOCUS;\n }\n return FocusBehavior.SHOULD_NOT_FOCUS;\n }\n\n private focusNextAction_(key: string, source: EventSource) {\n const isTrailingActionNavigable = this.adapter.isTrailingActionNavigable();\n const dir = this.getDirection_(key);\n\n // Early exit if the key should jump chips\n if (jumpChipKeys.has(key) || !isTrailingActionNavigable) {\n return this.adapter.notifyNavigation(key, source);\n }\n\n if (source === EventSource.PRIMARY && dir === Direction.RIGHT) {\n return this.focusTrailingAction();\n }\n\n if (source === EventSource.TRAILING && dir === Direction.LEFT) {\n return this.focusPrimaryAction();\n }\n\n this.adapter.notifyNavigation(key, EventSource.NONE);\n }\n\n private getDirection_(key: string): Direction {\n const isRTL = this.adapter.isRTL();\n const isLeftKey =\n key === strings.ARROW_LEFT_KEY || key === strings.IE_ARROW_LEFT_KEY;\n const isRightKey =\n key === strings.ARROW_RIGHT_KEY || key === strings.IE_ARROW_RIGHT_KEY;\n if (!isRTL && isLeftKey || isRTL && isRightKey) {\n return Direction.LEFT;\n }\n\n return Direction.RIGHT;\n }\n\n private removeChip_() {\n if (this.shouldRemoveOnTrailingIconClick_) {\n this.beginExit();\n }\n }\n\n private shouldStartEditing(evt: KeyboardEvent): boolean {\n return this.eventFromPrimaryAction_(evt) && evt.key === strings.ENTER_KEY;\n }\n\n private shouldFinishEditing(evt: KeyboardEvent): boolean {\n return evt.key === strings.ENTER_KEY;\n }\n\n private shouldNotifyInteraction_(evt: KeyboardEvent): boolean {\n return evt.key === strings.ENTER_KEY || evt.key === strings.SPACEBAR_KEY;\n }\n\n private isDeleteAction_(evt: KeyboardEvent): boolean {\n const isDeletable = this.adapter.hasClass(cssClasses.DELETABLE);\n return isDeletable &&\n (evt.key === strings.BACKSPACE_KEY || evt.key === strings.DELETE_KEY ||\n evt.key === strings.IE_DELETE_KEY);\n }\n\n private setSelected_(selected: boolean) {\n if (selected) {\n this.adapter.addClass(cssClasses.SELECTED);\n this.adapter.setPrimaryActionAttr(strings.ARIA_CHECKED, 'true');\n } else {\n this.adapter.removeClass(cssClasses.SELECTED);\n this.adapter.setPrimaryActionAttr(strings.ARIA_CHECKED, 'false');\n }\n }\n\n private notifySelection_(selected: boolean) {\n this.adapter.notifySelection(selected, false);\n }\n\n private notifyIgnoredSelection_(selected: boolean) {\n this.adapter.notifySelection(selected, true);\n }\n\n private eventFromPrimaryAction_(evt: Event) {\n return this.adapter.eventTargetHasClass(\n evt.target, cssClasses.PRIMARY_ACTION);\n }\n\n private startEditing() {\n this.adapter.addClass(cssClasses.EDITING);\n this.adapter.notifyEditStart();\n }\n\n private finishEditing() {\n this.adapter.removeClass(cssClasses.EDITING);\n this.adapter.notifyEditFinish();\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCChipFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport * from './types';\nexport {cssClasses as chipCssClasses, strings as chipStrings} from './constants';\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './trailingaction/index';\nexport * from './chip/index';\nexport * from './chip-set/index';\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCRippleAdapter} from '@material/ripple/adapter';\nimport {MDCRipple, MDCRippleFactory} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCRippleCapableSurface} from '@material/ripple/types';\nimport {MDCChipTrailingActionAdapter} from './adapter';\nimport {strings} from './constants';\nimport {MDCChipTrailingActionFoundation} from './foundation';\nimport {MDCChipTrailingActionInteractionEventDetail, MDCChipTrailingActionNavigationEventDetail} from './types';\n\n/**\n * Creates a trailing action component on the given element.\n */\nexport type MDCChipTrailingActionFactory =\n (el: Element, foundation?: MDCChipTrailingActionFoundation) =>\n MDCChipTrailingAction;\n\nexport class MDCChipTrailingAction extends\n MDCComponent<MDCChipTrailingActionFoundation> implements\n MDCRippleCapableSurface {\n get ripple(): MDCRipple {\n return this.ripple_;\n }\n\n static attachTo(root: Element) {\n return new MDCChipTrailingAction(root);\n }\n\n private ripple_!: MDCRipple; // assigned in initialize()\n private handleClick_!:\n SpecificEventListener<'click'>; // assigned in initialSyncWithDOM()\n private handleKeydown_!:\n SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n\n initialize(\n rippleFactory: MDCRippleFactory = (el, foundation) =>\n new MDCRipple(el, foundation)) {\n // DO NOT INLINE this variable. For backward compatibility, foundations take\n // a Partial<MDCFooAdapter>. To ensure we don't accidentally omit any\n // methods, we need a separate, strongly typed adapter variable.\n const rippleAdapter: MDCRippleAdapter = MDCRipple.createAdapter(this);\n this.ripple_ =\n rippleFactory(this.root, new MDCRippleFoundation(rippleAdapter));\n }\n\n initialSyncWithDOM() {\n this.handleClick_ = (evt: MouseEvent) => {\n this.foundation.handleClick(evt);\n };\n this.handleKeydown_ = (evt: KeyboardEvent) => {\n this.foundation.handleKeydown(evt);\n };\n\n this.listen('click', this.handleClick_);\n this.listen('keydown', this.handleKeydown_);\n }\n\n destroy() {\n this.ripple_.destroy();\n this.unlisten('click', this.handleClick_);\n this.unlisten('keydown', this.handleKeydown_);\n super.destroy();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take\n // a Partial<MDCFooAdapter>. To ensure we don't accidentally omit any\n // methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCChipTrailingActionAdapter = {\n focus: () => {\n // TODO(b/157231863): Migate MDCComponent#root to HTMLElement\n (this.root as HTMLElement).focus();\n },\n getAttribute: (attr) => this.root.getAttribute(attr),\n notifyInteraction: (trigger) =>\n this.emit<MDCChipTrailingActionInteractionEventDetail>(\n strings.INTERACTION_EVENT, {trigger}, true /* shouldBubble */),\n notifyNavigation: (key) => {\n this.emit<MDCChipTrailingActionNavigationEventDetail>(\n strings.NAVIGATION_EVENT, {key}, true /* shouldBubble */);\n },\n setAttribute: (attr, value) => {\n this.root.setAttribute(attr, value);\n },\n };\n return new MDCChipTrailingActionFoundation(adapter);\n }\n\n isNavigable() {\n return this.foundation.isNavigable();\n }\n\n focus() {\n this.foundation.focus();\n }\n\n removeFocus() {\n this.foundation.removeFocus();\n }\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport enum InteractionTrigger {\n UNSPECIFIED, // Default type\n CLICK,\n BACKSPACE_KEY,\n DELETE_KEY,\n SPACEBAR_KEY,\n ENTER_KEY,\n}\n\nexport const strings = {\n ARIA_HIDDEN: 'aria-hidden',\n INTERACTION_EVENT: 'MDCChipTrailingAction:interaction',\n NAVIGATION_EVENT: 'MDCChipTrailingAction:navigation',\n TAB_INDEX: 'tabindex',\n};\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {isNavigationEvent, KEY, normalizeKey} from '@material/dom/keyboard';\n\nimport {MDCChipTrailingActionAdapter} from './adapter';\nimport {InteractionTrigger, strings} from './constants';\n\nexport class MDCChipTrailingActionFoundation extends\n MDCFoundation<MDCChipTrailingActionAdapter> {\n static get strings() {\n return strings;\n }\n\n static get defaultAdapter(): MDCChipTrailingActionAdapter {\n return {\n focus: () => undefined,\n getAttribute: () => null,\n setAttribute: () => undefined,\n notifyInteraction: () => undefined,\n notifyNavigation: () => undefined,\n };\n }\n\n constructor(adapter?: Partial<MDCChipTrailingActionAdapter>) {\n super({...MDCChipTrailingActionFoundation.defaultAdapter, ...adapter});\n }\n\n handleClick(evt: MouseEvent) {\n evt.stopPropagation();\n this.adapter.notifyInteraction(InteractionTrigger.CLICK);\n }\n\n handleKeydown(evt: KeyboardEvent) {\n evt.stopPropagation();\n const key = normalizeKey(evt);\n if (this.shouldNotifyInteractionFromKey_(key)) {\n const trigger = this.getTriggerFromKey_(key);\n this.adapter.notifyInteraction(trigger);\n return;\n }\n\n if (isNavigationEvent(evt)) {\n this.adapter.notifyNavigation(key);\n return;\n }\n }\n\n removeFocus() {\n this.adapter.setAttribute(strings.TAB_INDEX, '-1');\n }\n\n focus() {\n this.adapter.setAttribute(strings.TAB_INDEX, '0');\n this.adapter.focus();\n }\n\n isNavigable() {\n return this.adapter.getAttribute(strings.ARIA_HIDDEN) !== 'true';\n }\n\n private shouldNotifyInteractionFromKey_(key: string): boolean {\n const isFromActionKey = key === KEY.ENTER || key === KEY.SPACEBAR;\n const isFromDeleteKey = key === KEY.BACKSPACE || key === KEY.DELETE;\n\n return isFromActionKey || isFromDeleteKey;\n }\n\n private getTriggerFromKey_(key: string): InteractionTrigger {\n if (key === KEY.SPACEBAR) {\n return InteractionTrigger.SPACEBAR_KEY;\n }\n\n if (key === KEY.ENTER) {\n return InteractionTrigger.ENTER_KEY;\n }\n\n if (key === KEY.DELETE) {\n return InteractionTrigger.DELETE_KEY;\n }\n\n if (key === KEY.BACKSPACE) {\n return InteractionTrigger.BACKSPACE_KEY;\n }\n\n // Default case, should never be returned\n return InteractionTrigger.UNSPECIFIED;\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCChipTrailingActionFoundation;\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport * from './types';\nexport {strings as trailingActionStrings} from './constants';\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCProgressIndicator} from '@material/progress-indicator/component';\nimport {MDCCircularProgressAdapter} from './adapter';\nimport {MDCCircularProgressFoundation} from './foundation';\n\nexport class MDCCircularProgress extends\n MDCComponent<MDCCircularProgressFoundation> implements\n MDCProgressIndicator {\n private determinateCircle_!: HTMLElement;\n\n initialize() {\n this.determinateCircle_ = this.root.querySelector<HTMLElement>(\n MDCCircularProgressFoundation.strings.DETERMINATE_CIRCLE_SELECTOR)!;\n }\n\n static attachTo(root: Element) {\n return new MDCCircularProgress(root);\n }\n\n /**\n * Sets whether the progress indicator is in determinate mode.\n * @param isDeterminate Whether the indicator should be determinate.\n */\n set determinate(value: boolean) {\n this.foundation.setDeterminate(value);\n }\n\n /**\n * Sets the current progress value. In indeterminate mode, this has no\n * visual effect but will be reflected if the indicator is switched to\n * determinate mode.\n * @param value The current progress value, which must be between 0 and 1.\n */\n set progress(value: number) {\n this.foundation.setProgress(value);\n }\n\n /**\n * Whether the progress indicator is hidden.\n */\n get isClosed() {\n return this.foundation.isClosed();\n }\n\n /**\n * Shows the progress indicator.\n */\n open() {\n this.foundation.open();\n }\n\n /**\n * Hides the progress indicator.\n */\n close() {\n this.foundation.close();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take\n // a Partial<MDCFooAdapter>. To ensure we don't accidentally omit any\n // methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCCircularProgressAdapter = {\n addClass: (className: string) => this.root.classList.add(className),\n getDeterminateCircleAttribute: (attributeName: string) =>\n this.determinateCircle_.getAttribute(attributeName),\n hasClass: (className: string) => this.root.classList.contains(className),\n removeClass: (className: string) => this.root.classList.remove(className),\n removeAttribute: (attributeName: string) =>\n this.root.removeAttribute(attributeName),\n setAttribute: (attributeName: string, value: string) =>\n this.root.setAttribute(attributeName, value),\n setDeterminateCircleAttribute: (attributeName: string, value: string) =>\n this.determinateCircle_.setAttribute(attributeName, value),\n };\n return new MDCCircularProgressFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * CSS class names used in component.\n */\nexport const cssClasses = {\n INDETERMINATE_CLASS: 'mdc-circular-progress--indeterminate',\n CLOSED_CLASS: 'mdc-circular-progress--closed',\n};\n\n/**\n * Attributes and selectors used in component.\n */\nexport const strings = {\n DETERMINATE_CIRCLE_SELECTOR: '.mdc-circular-progress__determinate-circle',\n ARIA_VALUENOW: 'aria-valuenow',\n RADIUS: 'r',\n STROKE_DASHOFFSET: 'stroke-dashoffset',\n};\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCProgressIndicatorFoundation} from '@material/progress-indicator/foundation';\nimport {MDCCircularProgressAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCCircularProgressFoundation extends\n MDCFoundation<MDCCircularProgressAdapter> implements\n MDCProgressIndicatorFoundation {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get defaultAdapter(): MDCCircularProgressAdapter {\n return {\n addClass: () => undefined,\n getDeterminateCircleAttribute: () => null,\n hasClass: () => false,\n removeClass: () => undefined,\n removeAttribute: () => undefined,\n setAttribute: () => undefined,\n setDeterminateCircleAttribute: () => undefined,\n };\n }\n\n private isClosed_!: boolean;\n private isDeterminate_!: boolean;\n private progress_!: number;\n private radius_!: number;\n\n constructor(adapter?: Partial<MDCCircularProgressAdapter>) {\n super({...MDCCircularProgressFoundation.defaultAdapter, ...adapter});\n }\n\n init() {\n this.isClosed_ = this.adapter.hasClass(cssClasses.CLOSED_CLASS);\n this.isDeterminate_ =\n !this.adapter.hasClass(cssClasses.INDETERMINATE_CLASS);\n this.progress_ = 0;\n\n if (this.isDeterminate_) {\n this.adapter.setAttribute(\n strings.ARIA_VALUENOW, this.progress_.toString());\n }\n\n this.radius_ =\n Number(this.adapter.getDeterminateCircleAttribute(strings.RADIUS));\n }\n\n isDeterminate() {\n return this.isDeterminate_;\n }\n\n getProgress() {\n return this.progress_;\n }\n\n /**\n * @return Returns whether the progress indicator is hidden.\n */\n isClosed() {\n return this.isClosed_;\n }\n\n /**\n * Sets whether the progress indicator is in determinate mode.\n * @param isDeterminate Whether the indicator should be determinate.\n */\n setDeterminate(isDeterminate: boolean) {\n this.isDeterminate_ = isDeterminate;\n\n if (this.isDeterminate_) {\n this.adapter.removeClass(cssClasses.INDETERMINATE_CLASS);\n this.setProgress(this.progress_);\n } else {\n this.adapter.addClass(cssClasses.INDETERMINATE_CLASS);\n this.adapter.removeAttribute(strings.ARIA_VALUENOW);\n }\n }\n\n /**\n * Sets the current progress value. In indeterminate mode, this has no\n * visual effect but will be reflected if the indicator is switched to\n * determinate mode.\n * @param value The current progress value, which must be between 0 and 1.\n */\n setProgress(value: number) {\n this.progress_ = value;\n if (this.isDeterminate_) {\n const unfilledArcLength =\n (1 - this.progress_) * (2 * Math.PI * this.radius_);\n\n this.adapter.setDeterminateCircleAttribute(\n strings.STROKE_DASHOFFSET, `${unfilledArcLength}`);\n this.adapter.setAttribute(\n strings.ARIA_VALUENOW, this.progress_.toString());\n }\n }\n\n /**\n * Shows the progress indicator.\n */\n open() {\n this.isClosed_ = false;\n this.adapter.removeClass(cssClasses.CLOSED_CLASS);\n }\n\n /**\n * Hides the progress indicator\n */\n close() {\n this.isClosed_ = true;\n this.adapter.addClass(cssClasses.CLOSED_CLASS);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCCircularProgressFoundation;\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCCheckbox, MDCCheckboxFactory} from '@material/checkbox/component';\nimport {closest} from '@material/dom/ponyfill';\n\nimport {MDCDataTableAdapter} from './adapter';\nimport {cssClasses, dataAttributes, events, messages, selectors, SortValue} from './constants';\nimport {MDCDataTableFoundation} from './foundation';\nimport {MDCDataTableRowSelectionChangedEventDetail} from './types';\n\n/**\n * Implementation of `MDCDataTableFoundation`\n */\nexport class MDCDataTable extends MDCComponent<MDCDataTableFoundation> {\n static attachTo(root: Element): MDCDataTable {\n return new MDCDataTable(root);\n }\n\n private headerRowCheckbox!: MDCCheckbox;\n private rowCheckboxList!: MDCCheckbox[];\n private checkboxFactory!: MDCCheckboxFactory;\n private headerRow!: HTMLElement;\n private content!: HTMLElement;\n private handleHeaderRowCheckboxChange!: SpecificEventListener<'change'>;\n private handleRowCheckboxChange!: SpecificEventListener<'change'>;\n private headerRowClickListener!:\n SpecificEventListener<'click'>; // Assigned in `initialSyncWithDOM()`\n\n initialize(checkboxFactory: MDCCheckboxFactory = (el: Element) => new MDCCheckbox(el)) {\n this.checkboxFactory = checkboxFactory;\n }\n\n initialSyncWithDOM() {\n this.headerRow =\n this.root.querySelector(`.${cssClasses.HEADER_ROW}`) as HTMLElement;\n this.handleHeaderRowCheckboxChange = () =>\n this.foundation.handleHeaderRowCheckboxChange();\n this.headerRow.addEventListener(\n 'change', this.handleHeaderRowCheckboxChange);\n\n this.headerRowClickListener = (event) => {\n this.handleHeaderRowClick(event);\n };\n this.headerRow.addEventListener('click', this.headerRowClickListener);\n\n this.content =\n this.root.querySelector(`.${cssClasses.CONTENT}`) as HTMLElement;\n this.handleRowCheckboxChange = (event) =>\n this.foundation.handleRowCheckboxChange(event);\n this.content.addEventListener('change', this.handleRowCheckboxChange);\n\n this.layout();\n }\n\n /**\n * Re-initializes header row checkbox and row checkboxes when selectable rows are added or removed from table.\n */\n layout() {\n this.foundation.layout();\n }\n\n /**\n * @return Returns array of header row cell elements.\n */\n getHeaderCells(): Element[] {\n return [].slice.call(this.root.querySelectorAll(selectors.HEADER_CELL));\n }\n\n /**\n * @return Returns array of row elements.\n */\n getRows(): Element[] {\n return this.foundation.getRows();\n }\n\n /**\n * @return Returns array of selected row ids.\n */\n getSelectedRowIds(): Array<string|null> {\n return this.foundation.getSelectedRowIds();\n }\n\n /**\n * Sets selected row ids. Overwrites previously selected rows.\n * @param rowIds Array of row ids that needs to be selected.\n */\n setSelectedRowIds(rowIds: string[]) {\n this.foundation.setSelectedRowIds(rowIds);\n }\n\n destroy() {\n this.headerRow.removeEventListener(\n 'change', this.handleHeaderRowCheckboxChange);\n this.headerRow.removeEventListener('click', this.headerRowClickListener);\n this.content.removeEventListener('change', this.handleRowCheckboxChange);\n\n this.headerRowCheckbox.destroy();\n this.rowCheckboxList.forEach((checkbox) => {\n checkbox.destroy();\n });\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCDataTableAdapter = {\n addClass: (className) => {\n this.root.classList.add(className);\n },\n removeClass: (className) => {\n this.root.classList.remove(className);\n },\n getHeaderCellElements: () => this.getHeaderCells(),\n getHeaderCellCount: () => this.getHeaderCells().length,\n getAttributeByHeaderCellIndex: (index, attribute) => {\n return this.getHeaderCells()[index].getAttribute(attribute);\n },\n setAttributeByHeaderCellIndex: (index, attribute, value) => {\n this.getHeaderCells()[index].setAttribute(attribute, value);\n },\n setClassNameByHeaderCellIndex: (index, className) => {\n this.getHeaderCells()[index].classList.add(className);\n },\n removeClassNameByHeaderCellIndex: (index, className) => {\n this.getHeaderCells()[index].classList.remove(className);\n },\n notifySortAction: (data) => {\n this.emit(events.SORTED, data, /** shouldBubble */ true);\n },\n getTableBodyHeight: () => {\n const tableBody =\n this.root.querySelector<HTMLElement>(selectors.CONTENT);\n\n if (!tableBody) {\n throw new Error('MDCDataTable: Table body element not found.');\n }\n\n return `${tableBody.getBoundingClientRect().height}px`;\n },\n getTableHeaderHeight: () => {\n const tableHeader =\n this.root.querySelector<HTMLElement>(selectors.HEADER_ROW);\n\n if (!tableHeader) {\n throw new Error('MDCDataTable: Table header element not found.');\n }\n\n return `${tableHeader.getBoundingClientRect().height}px`;\n },\n setProgressIndicatorStyles: (styles) => {\n const progressIndicator =\n this.root.querySelector<HTMLElement>(selectors.PROGRESS_INDICATOR);\n\n if (!progressIndicator) {\n throw new Error(\n 'MDCDataTable: Progress indicator element not found.');\n }\n\n Object.assign(progressIndicator.style, styles);\n },\n addClassAtRowIndex: (rowIndex: number, className: string) => {\n this.getRows()[rowIndex].classList.add(className);\n },\n getRowCount: () => this.getRows().length,\n getRowElements:\n () => [].slice.call(this.root.querySelectorAll(selectors.ROW)),\n getRowIdAtIndex: (rowIndex: number) =>\n this.getRows()[rowIndex].getAttribute(dataAttributes.ROW_ID),\n getRowIndexByChildElement: (el: Element) => {\n return this.getRows().indexOf(\n (closest(el, selectors.ROW) as HTMLElement));\n },\n getSelectedRowCount: () =>\n this.root.querySelectorAll(selectors.ROW_SELECTED).length,\n isCheckboxAtRowIndexChecked: (rowIndex: number) =>\n this.rowCheckboxList[rowIndex].checked,\n isHeaderRowCheckboxChecked: () => this.headerRowCheckbox.checked,\n isRowsSelectable: () => !!this.root.querySelector(selectors.ROW_CHECKBOX),\n notifyRowSelectionChanged:\n (data: MDCDataTableRowSelectionChangedEventDetail) => {\n this.emit(\n events.ROW_SELECTION_CHANGED, {\n row: this.getRowByIndex(data.rowIndex),\n rowId: this.getRowIdByIndex(data.rowIndex),\n rowIndex: data.rowIndex,\n selected: data.selected,\n },\n /** shouldBubble */ true);\n },\n notifySelectedAll: () => {\n this.emit(events.SELECTED_ALL, {}, /** shouldBubble */ true);\n },\n notifyUnselectedAll: () => {\n this.emit(events.UNSELECTED_ALL, {}, /** shouldBubble */ true);\n },\n registerHeaderRowCheckbox: () => {\n if (this.headerRowCheckbox) {\n this.headerRowCheckbox.destroy();\n }\n\n const checkboxEl =\n (this.root.querySelector(selectors.HEADER_ROW_CHECKBOX) as\n HTMLElement);\n this.headerRowCheckbox = this.checkboxFactory(checkboxEl);\n },\n registerRowCheckboxes: () => {\n if (this.rowCheckboxList) {\n this.rowCheckboxList.forEach((checkbox) => {\n checkbox.destroy();\n });\n }\n\n this.rowCheckboxList = [];\n this.getRows().forEach((rowEl) => {\n const checkbox = this.checkboxFactory(\n (rowEl.querySelector(selectors.ROW_CHECKBOX) as HTMLElement));\n this.rowCheckboxList.push(checkbox);\n });\n },\n removeClassAtRowIndex: (rowIndex: number, className: string) => {\n this.getRows()[rowIndex].classList.remove(className);\n },\n setAttributeAtRowIndex:\n (rowIndex: number, attr: string, value: string) => {\n this.getRows()[rowIndex].setAttribute(attr, value);\n },\n setHeaderRowCheckboxChecked: (checked: boolean) => {\n this.headerRowCheckbox.checked = checked;\n },\n setHeaderRowCheckboxIndeterminate: (indeterminate: boolean) => {\n this.headerRowCheckbox.indeterminate = indeterminate;\n },\n setRowCheckboxCheckedAtIndex: (rowIndex: number, checked: boolean) => {\n this.rowCheckboxList[rowIndex].checked = checked;\n },\n setSortStatusLabelByHeaderCellIndex: (\n columnIndex: number, sortValue: SortValue) => {\n const headerCell = this.getHeaderCells()[columnIndex];\n const sortStatusLabel =\n headerCell.querySelector<HTMLElement>(selectors.SORT_STATUS_LABEL);\n\n if (!sortStatusLabel) return;\n\n sortStatusLabel.textContent =\n this.getSortStatusMessageBySortValue(sortValue);\n },\n };\n return new MDCDataTableFoundation(adapter);\n }\n\n private getRowByIndex(index: number): Element {\n return this.getRows()[index];\n }\n\n private getRowIdByIndex(index: number): string|null {\n return this.getRowByIndex(index).getAttribute(dataAttributes.ROW_ID);\n }\n\n private handleHeaderRowClick(event: Event): void {\n const headerCell =\n closest(event.target as Element, selectors.HEADER_CELL_WITH_SORT) as\n HTMLElement;\n\n if (!headerCell) {\n return;\n }\n\n const columnId = headerCell.getAttribute(dataAttributes.COLUMN_ID);\n const columnIndex = this.getHeaderCells().indexOf(headerCell);\n if (columnIndex === -1) {\n return;\n }\n\n this.foundation.handleSortAction({columnId, columnIndex, headerCell});\n }\n\n private getSortStatusMessageBySortValue(sortValue: SortValue): string {\n switch (sortValue) {\n case SortValue.ASCENDING:\n return messages.SORTED_IN_ASCENDING;\n case SortValue.DESCENDING:\n return messages.SORTED_IN_DESCENDING;\n default:\n return '';\n }\n }\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * CSS class names used in component.\n */\nexport const cssClasses = {\n CELL: 'mdc-data-table__cell',\n CELL_NUMERIC: 'mdc-data-table__cell--numeric',\n CONTENT: 'mdc-data-table__content',\n HEADER_CELL: 'mdc-data-table__header-cell',\n HEADER_CELL_LABEL: 'mdc-data-table__header-cell-label',\n HEADER_CELL_SORTED: 'mdc-data-table__header-cell--sorted',\n HEADER_CELL_SORTED_DESCENDING:\n 'mdc-data-table__header-cell--sorted-descending',\n HEADER_CELL_WITH_SORT: 'mdc-data-table__header-cell--with-sort',\n HEADER_CELL_WRAPPER: 'mdc-data-table__header-cell-wrapper',\n HEADER_ROW: 'mdc-data-table__header-row',\n HEADER_ROW_CHECKBOX: 'mdc-data-table__header-row-checkbox',\n IN_PROGRESS: 'mdc-data-table--in-progress',\n PROGRESS_INDICATOR: 'mdc-data-table__progress-indicator',\n ROOT: 'mdc-data-table',\n ROW: 'mdc-data-table__row',\n ROW_CHECKBOX: 'mdc-data-table__row-checkbox',\n ROW_SELECTED: 'mdc-data-table__row--selected',\n SORT_ICON_BUTTON: 'mdc-data-table__sort-icon-button',\n SORT_STATUS_LABEL: 'mdc-data-table__sort-status-label',\n PAGINATION_ROWS_PER_PAGE_SELECT:\n 'mdc-data-table__pagination-rows-per-page-select',\n PAGINATION_ROWS_PER_PAGE_LABEL:\n 'mdc-data-table__pagination-rows-per-page-label',\n};\n\n/**\n * DOM attributes used in component.\n */\nexport const attributes = {\n ARIA_SELECTED: 'aria-selected',\n ARIA_SORT: 'aria-sort',\n};\n\n/**\n * List of data attributes used in component.\n */\nexport const dataAttributes = {\n COLUMN_ID: 'data-column-id',\n ROW_ID: 'data-row-id',\n};\n\n/**\n * CSS selectors used in component.\n */\nexport const selectors = {\n CONTENT: `.${cssClasses.CONTENT}`,\n HEADER_CELL: `.${cssClasses.HEADER_CELL}`,\n HEADER_CELL_WITH_SORT: `.${cssClasses.HEADER_CELL_WITH_SORT}`,\n HEADER_ROW: `.${cssClasses.HEADER_ROW}`,\n HEADER_ROW_CHECKBOX: `.${cssClasses.HEADER_ROW_CHECKBOX}`,\n PROGRESS_INDICATOR: `.${cssClasses.PROGRESS_INDICATOR}`,\n ROW: `.${cssClasses.ROW}`,\n ROW_CHECKBOX: `.${cssClasses.ROW_CHECKBOX}`,\n ROW_SELECTED: `.${cssClasses.ROW_SELECTED}`,\n SORT_ICON_BUTTON: `.${cssClasses.SORT_ICON_BUTTON}`,\n SORT_STATUS_LABEL: `.${cssClasses.SORT_STATUS_LABEL}`,\n};\n\n/**\n * Messages used in component.\n */\nexport const messages = {\n SORTED_IN_DESCENDING: 'Sorted in descending order',\n SORTED_IN_ASCENDING: 'Sorted in ascending order',\n};\n\n/**\n * Attributes and selectors used in component.\n * @deprecated Use `attributes`, `dataAttributes` and `selectors` instead.\n */\nexport const strings = {\n ARIA_SELECTED: attributes.ARIA_SELECTED,\n ARIA_SORT: attributes.ARIA_SORT,\n DATA_ROW_ID_ATTR: dataAttributes.ROW_ID,\n HEADER_ROW_CHECKBOX_SELECTOR: selectors.HEADER_ROW_CHECKBOX,\n ROW_CHECKBOX_SELECTOR: selectors.ROW_CHECKBOX,\n ROW_SELECTED_SELECTOR: selectors.ROW_SELECTED,\n ROW_SELECTOR: selectors.ROW,\n};\n\n/**\n * Sort values defined by ARIA.\n * See https://www.w3.org/WAI/PF/aria/states_and_properties#aria-sort\n */\nexport enum SortValue {\n // Items are sorted in ascending order by this column.\n ASCENDING = 'ascending',\n\n // Items are sorted in descending order by this column.\n DESCENDING = 'descending',\n\n // There is no defined sort applied to the column.\n NONE = 'none',\n\n // A sort algorithm other than ascending or descending has been applied.\n OTHER = 'other',\n}\n\n/**\n * Event names used in component.\n */\nexport const events = {\n ROW_SELECTION_CHANGED: 'MDCDataTable:rowSelectionChanged',\n SELECTED_ALL: 'MDCDataTable:selectedAll',\n UNSELECTED_ALL: 'MDCDataTable:unselectedAll',\n SORTED: 'MDCDataTable:sorted',\n};\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\n\nimport {MDCDataTableAdapter} from './adapter';\nimport {cssClasses, SortValue, strings} from './constants';\nimport {SortActionEventData} from './types';\n\n/**\n * The Foundation of data table component containing pure business logic, any\n * logic requiring DOM manipulation are delegated to adapter methods.\n */\nexport class MDCDataTableFoundation extends MDCFoundation<MDCDataTableAdapter> {\n static get defaultAdapter(): MDCDataTableAdapter {\n return {\n addClass: () => undefined,\n addClassAtRowIndex: () => undefined,\n getAttributeByHeaderCellIndex: () => '',\n getHeaderCellCount: () => 0,\n getHeaderCellElements: () => [],\n getRowCount: () => 0,\n getRowElements: () => [],\n getRowIdAtIndex: () => '',\n getRowIndexByChildElement: () => 0,\n getSelectedRowCount: () => 0,\n getTableBodyHeight: () => '',\n getTableHeaderHeight: () => '',\n isCheckboxAtRowIndexChecked: () => false,\n isHeaderRowCheckboxChecked: () => false,\n isRowsSelectable: () => false,\n notifyRowSelectionChanged: () => undefined,\n notifySelectedAll: () => undefined,\n notifySortAction: () => undefined,\n notifyUnselectedAll: () => undefined,\n registerHeaderRowCheckbox: () => undefined,\n registerRowCheckboxes: () => undefined,\n removeClass: () => undefined,\n removeClassAtRowIndex: () => undefined,\n removeClassNameByHeaderCellIndex: () => undefined,\n setAttributeAtRowIndex: () => undefined,\n setAttributeByHeaderCellIndex: () => undefined,\n setClassNameByHeaderCellIndex: () => undefined,\n setHeaderRowCheckboxChecked: () => undefined,\n setHeaderRowCheckboxIndeterminate: () => undefined,\n setProgressIndicatorStyles: () => undefined,\n setRowCheckboxCheckedAtIndex: () => undefined,\n setSortStatusLabelByHeaderCellIndex: () => undefined,\n };\n }\n\n constructor(adapter?: Partial<MDCDataTableAdapter>) {\n super({...MDCDataTableFoundation.defaultAdapter, ...adapter});\n }\n\n /**\n * Re-initializes header row checkbox and row checkboxes when selectable rows are added or removed from table.\n * Use this if registering checkbox is synchronous.\n */\n layout() {\n if (this.adapter.isRowsSelectable()) {\n this.adapter.registerHeaderRowCheckbox();\n this.adapter.registerRowCheckboxes();\n\n this.setHeaderRowCheckboxState();\n }\n }\n\n /**\n * Re-initializes header row checkbox and row checkboxes when selectable rows are added or removed from table.\n * Use this if registering checkbox is asynchronous.\n */\n async layoutAsync(): Promise<void> {\n if (this.adapter.isRowsSelectable()) {\n await this.adapter.registerHeaderRowCheckbox();\n await this.adapter.registerRowCheckboxes();\n\n this.setHeaderRowCheckboxState();\n }\n }\n\n /**\n * @return Returns array of row elements.\n */\n getRows(): Element[] {\n return this.adapter.getRowElements();\n }\n\n /**\n * @return Array of header cell elements.\n */\n getHeaderCells(): Element[] {\n return this.adapter.getHeaderCellElements();\n }\n\n /**\n * Sets selected row ids. Overwrites previously selected rows.\n * @param rowIds Array of row ids that needs to be selected.\n */\n setSelectedRowIds(rowIds: string[]) {\n for (let rowIndex = 0; rowIndex < this.adapter.getRowCount(); rowIndex++) {\n const rowId = this.adapter.getRowIdAtIndex(rowIndex);\n\n let isSelected = false;\n if (rowId && rowIds.indexOf(rowId) >= 0) {\n isSelected = true;\n }\n\n this.adapter.setRowCheckboxCheckedAtIndex(rowIndex, isSelected);\n this.selectRowAtIndex(rowIndex, isSelected);\n }\n\n this.setHeaderRowCheckboxState();\n }\n\n /**\n * @return Returns array of all row ids.\n */\n getRowIds(): Array<string|null> {\n const rowIds = [];\n for (let rowIndex = 0; rowIndex < this.adapter.getRowCount(); rowIndex++) {\n rowIds.push(this.adapter.getRowIdAtIndex(rowIndex));\n }\n\n return rowIds;\n }\n\n /**\n * @return Returns array of selected row ids.\n */\n getSelectedRowIds(): Array<string|null> {\n const selectedRowIds: Array<string|null> = [];\n for (let rowIndex = 0; rowIndex < this.adapter.getRowCount(); rowIndex++) {\n if (this.adapter.isCheckboxAtRowIndexChecked(rowIndex)) {\n selectedRowIds.push(this.adapter.getRowIdAtIndex(rowIndex));\n }\n }\n\n return selectedRowIds;\n }\n\n /**\n * Handles header row checkbox change event.\n */\n handleHeaderRowCheckboxChange() {\n const isHeaderChecked = this.adapter.isHeaderRowCheckboxChecked();\n\n for (let rowIndex = 0; rowIndex < this.adapter.getRowCount(); rowIndex++) {\n this.adapter.setRowCheckboxCheckedAtIndex(rowIndex, isHeaderChecked);\n this.selectRowAtIndex(rowIndex, isHeaderChecked);\n }\n\n if (isHeaderChecked) {\n this.adapter.notifySelectedAll();\n } else {\n this.adapter.notifyUnselectedAll();\n }\n }\n\n /**\n * Handles change event originated from row checkboxes.\n */\n handleRowCheckboxChange(event: Event) {\n const rowIndex = this.adapter.getRowIndexByChildElement(\n event.target as HTMLInputElement);\n\n if (rowIndex === -1) {\n return;\n }\n\n const selected = this.adapter.isCheckboxAtRowIndexChecked(rowIndex);\n\n this.selectRowAtIndex(rowIndex, selected);\n this.setHeaderRowCheckboxState();\n\n const rowId = this.adapter.getRowIdAtIndex(rowIndex);\n this.adapter.notifyRowSelectionChanged({rowId, rowIndex, selected});\n }\n\n /**\n * Handles sort action on sortable header cell.\n */\n handleSortAction(eventData: SortActionEventData) {\n const {columnId, columnIndex, headerCell} = eventData;\n\n // Reset sort attributes / classes on other header cells.\n for (let index = 0; index < this.adapter.getHeaderCellCount(); index++) {\n if (index === columnIndex) {\n continue;\n }\n\n this.adapter.removeClassNameByHeaderCellIndex(\n index, cssClasses.HEADER_CELL_SORTED);\n this.adapter.removeClassNameByHeaderCellIndex(\n index, cssClasses.HEADER_CELL_SORTED_DESCENDING);\n this.adapter.setAttributeByHeaderCellIndex(\n index, strings.ARIA_SORT, SortValue.NONE);\n this.adapter.setSortStatusLabelByHeaderCellIndex(index, SortValue.NONE);\n }\n\n // Set appropriate sort attributes / classes on target header cell.\n this.adapter.setClassNameByHeaderCellIndex(\n columnIndex, cssClasses.HEADER_CELL_SORTED);\n\n const currentSortValue = this.adapter.getAttributeByHeaderCellIndex(\n columnIndex, strings.ARIA_SORT);\n let sortValue = SortValue.NONE;\n\n // Set to descending if sorted on ascending order.\n if (currentSortValue === SortValue.ASCENDING) {\n this.adapter.setClassNameByHeaderCellIndex(\n columnIndex, cssClasses.HEADER_CELL_SORTED_DESCENDING);\n this.adapter.setAttributeByHeaderCellIndex(\n columnIndex, strings.ARIA_SORT, SortValue.DESCENDING);\n sortValue = SortValue.DESCENDING;\n // Set to ascending if sorted on descending order.\n } else if (currentSortValue === SortValue.DESCENDING) {\n this.adapter.removeClassNameByHeaderCellIndex(\n columnIndex, cssClasses.HEADER_CELL_SORTED_DESCENDING);\n this.adapter.setAttributeByHeaderCellIndex(\n columnIndex, strings.ARIA_SORT, SortValue.ASCENDING);\n sortValue = SortValue.ASCENDING;\n } else {\n // Set to ascending by default when not sorted.\n this.adapter.setAttributeByHeaderCellIndex(\n columnIndex, strings.ARIA_SORT, SortValue.ASCENDING);\n sortValue = SortValue.ASCENDING;\n }\n\n this.adapter.setSortStatusLabelByHeaderCellIndex(columnIndex, sortValue);\n\n this.adapter.notifySortAction({\n columnId,\n columnIndex,\n headerCell,\n sortValue,\n });\n }\n\n /**\n * Shows progress indicator blocking only the table body content when in\n * loading state.\n */\n showProgress() {\n const height = this.adapter.getTableBodyHeight();\n const top = this.adapter.getTableHeaderHeight();\n\n this.adapter.setProgressIndicatorStyles({\n height,\n top,\n });\n this.adapter.addClass(cssClasses.IN_PROGRESS);\n }\n\n /**\n * Hides progress indicator when data table is finished loading.\n */\n hideProgress() {\n this.adapter.removeClass(cssClasses.IN_PROGRESS);\n }\n\n /**\n * Updates header row checkbox state based on number of rows selected.\n */\n private setHeaderRowCheckboxState() {\n if (this.adapter.getSelectedRowCount() === this.adapter.getRowCount()) {\n this.adapter.setHeaderRowCheckboxChecked(true);\n this.adapter.setHeaderRowCheckboxIndeterminate(false);\n } else if (this.adapter.getSelectedRowCount() === 0) {\n this.adapter.setHeaderRowCheckboxIndeterminate(false);\n this.adapter.setHeaderRowCheckboxChecked(false);\n } else {\n this.adapter.setHeaderRowCheckboxIndeterminate(true);\n this.adapter.setHeaderRowCheckboxChecked(false);\n }\n }\n\n /**\n * Sets the attributes of row element based on selection state.\n */\n private selectRowAtIndex(rowIndex: number, selected: boolean) {\n if (selected) {\n this.adapter.addClassAtRowIndex(rowIndex, cssClasses.ROW_SELECTED);\n this.adapter.setAttributeAtRowIndex(\n rowIndex, strings.ARIA_SELECTED, 'true');\n } else {\n this.adapter.removeClassAtRowIndex(rowIndex, cssClasses.ROW_SELECTED);\n this.adapter.setAttributeAtRowIndex(\n rowIndex, strings.ARIA_SELECTED, 'false');\n }\n }\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport * from './constants';\nexport * from './types';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {FocusTrap} from '@material/dom/focus-trap';\nimport {closest, matches} from '@material/dom/ponyfill';\nimport {MDCRipple} from '@material/ripple/component';\nimport {MDCDialogAdapter} from './adapter';\nimport {MDCDialogFoundation} from './foundation';\nimport {MDCDialogCloseEventDetail} from './types';\nimport * as util from './util';\nimport {MDCDialogFocusTrapFactory} from './util';\n\nconst {strings} = MDCDialogFoundation;\n\nexport class MDCDialog extends MDCComponent<MDCDialogFoundation> {\n get isOpen() {\n return this.foundation.isOpen();\n }\n\n get escapeKeyAction() {\n return this.foundation.getEscapeKeyAction();\n }\n\n set escapeKeyAction(action) {\n this.foundation.setEscapeKeyAction(action);\n }\n\n get scrimClickAction() {\n return this.foundation.getScrimClickAction();\n }\n\n set scrimClickAction(action) {\n this.foundation.setScrimClickAction(action);\n }\n\n get autoStackButtons() {\n return this.foundation.getAutoStackButtons();\n }\n\n set autoStackButtons(autoStack) {\n this.foundation.setAutoStackButtons(autoStack);\n }\n\n static attachTo(root: Element) {\n return new MDCDialog(root);\n }\n\n private buttonRipples_!: MDCRipple[]; // assigned in initialize()\n private buttons_!: HTMLElement[]; // assigned in initialize()\n private container_!: HTMLElement; // assigned in initialize()\n private content_!: HTMLElement | null; // assigned in initialize()\n private defaultButton_!: HTMLElement | null; // assigned in initialize()\n\n private focusTrap_!: FocusTrap; // assigned in initialSyncWithDOM()\n private focusTrapFactory_!: MDCDialogFocusTrapFactory; // assigned in initialize()\n\n private handleClick_!: SpecificEventListener<'click'>; // assigned in initialSyncWithDOM()\n private handleKeydown_!: SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n private handleDocumentKeydown_!: SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n private handleLayout_!: EventListener; // assigned in initialSyncWithDOM()\n private handleOpening_!: EventListener; // assigned in initialSyncWithDOM()\n private handleClosing_!: () => void; // assigned in initialSyncWithDOM()\n\n initialize(\n focusTrapFactory: MDCDialogFocusTrapFactory = (el, focusOptions) => new FocusTrap(el, focusOptions),\n ) {\n const container =\n this.root.querySelector<HTMLElement>(strings.CONTAINER_SELECTOR);\n if (!container) {\n throw new Error(`Dialog component requires a ${strings.CONTAINER_SELECTOR} container element`);\n }\n this.container_ = container;\n this.content_ =\n this.root.querySelector<HTMLElement>(strings.CONTENT_SELECTOR);\n this.buttons_ = [].slice.call(\n this.root.querySelectorAll<HTMLElement>(strings.BUTTON_SELECTOR));\n this.defaultButton_ = this.root.querySelector<HTMLElement>(\n `[${strings.BUTTON_DEFAULT_ATTRIBUTE}]`);\n this.focusTrapFactory_ = focusTrapFactory;\n this.buttonRipples_ = [];\n\n for (const buttonEl of this.buttons_) {\n this.buttonRipples_.push(new MDCRipple(buttonEl));\n }\n }\n\n initialSyncWithDOM() {\n this.focusTrap_ = util.createFocusTrapInstance(\n this.container_, this.focusTrapFactory_, this.getInitialFocusEl_() || undefined);\n\n this.handleClick_ = this.foundation.handleClick.bind(this.foundation);\n this.handleKeydown_ = this.foundation.handleKeydown.bind(this.foundation);\n this.handleDocumentKeydown_ =\n this.foundation.handleDocumentKeydown.bind(this.foundation);\n this.handleLayout_ = this.layout.bind(this);\n\n const LAYOUT_EVENTS = ['resize', 'orientationchange'];\n this.handleOpening_ = () => {\n LAYOUT_EVENTS.forEach((evtType) => window.addEventListener(evtType, this.handleLayout_));\n document.addEventListener('keydown', this.handleDocumentKeydown_);\n };\n this.handleClosing_ = () => {\n LAYOUT_EVENTS.forEach((evtType) => window.removeEventListener(evtType, this.handleLayout_));\n document.removeEventListener('keydown', this.handleDocumentKeydown_);\n };\n\n this.listen('click', this.handleClick_);\n this.listen('keydown', this.handleKeydown_);\n this.listen(strings.OPENING_EVENT, this.handleOpening_);\n this.listen(strings.CLOSING_EVENT, this.handleClosing_);\n }\n\n destroy() {\n this.unlisten('click', this.handleClick_);\n this.unlisten('keydown', this.handleKeydown_);\n this.unlisten(strings.OPENING_EVENT, this.handleOpening_);\n this.unlisten(strings.CLOSING_EVENT, this.handleClosing_);\n this.handleClosing_();\n\n this.buttonRipples_.forEach((ripple) => ripple.destroy());\n super.destroy();\n }\n\n layout() {\n this.foundation.layout();\n }\n\n open() {\n this.foundation.open();\n }\n\n close(action = '') {\n this.foundation.close(action);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCDialogAdapter = {\n addBodyClass: (className) => document.body.classList.add(className),\n addClass: (className) => this.root.classList.add(className),\n areButtonsStacked: () => util.areTopsMisaligned(this.buttons_),\n clickDefaultButton: () =>\n this.defaultButton_ && this.defaultButton_.click(),\n eventTargetMatches: (target, selector) =>\n target ? matches(target as Element, selector) : false,\n getActionFromEvent: (evt: Event) => {\n if (!evt.target) {\n return '';\n }\n const element = closest(evt.target as Element, `[${strings.ACTION_ATTRIBUTE}]`);\n return element && element.getAttribute(strings.ACTION_ATTRIBUTE);\n },\n getInitialFocusEl: () => this.getInitialFocusEl_(),\n hasClass: (className) => this.root.classList.contains(className),\n isContentScrollable: () => util.isScrollable(this.content_),\n notifyClosed: (action) => this.emit<MDCDialogCloseEventDetail>(\n strings.CLOSED_EVENT, action ? {action} : {}),\n notifyClosing: (action) => this.emit<MDCDialogCloseEventDetail>(\n strings.CLOSING_EVENT, action ? {action} : {}),\n notifyOpened: () => this.emit(strings.OPENED_EVENT, {}),\n notifyOpening: () => this.emit(strings.OPENING_EVENT, {}),\n releaseFocus: () => this.focusTrap_.releaseFocus(),\n removeBodyClass: (className) => document.body.classList.remove(className),\n removeClass: (className) => this.root.classList.remove(className),\n reverseButtons: () => {\n this.buttons_.reverse();\n this.buttons_.forEach((button) => {\n button.parentElement!.appendChild(button);\n });\n },\n trapFocus: () => this.focusTrap_.trapFocus(),\n };\n return new MDCDialogFoundation(adapter);\n }\n\n private getInitialFocusEl_(): HTMLElement|null {\n return document.querySelector(`[${strings.INITIAL_FOCUS_ATTRIBUTE}]`);\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const cssClasses = {\n CLOSING: 'mdc-dialog--closing',\n OPEN: 'mdc-dialog--open',\n OPENING: 'mdc-dialog--opening',\n SCROLLABLE: 'mdc-dialog--scrollable',\n SCROLL_LOCK: 'mdc-dialog-scroll-lock',\n STACKED: 'mdc-dialog--stacked',\n};\n\nexport const strings = {\n ACTION_ATTRIBUTE: 'data-mdc-dialog-action',\n BUTTON_DEFAULT_ATTRIBUTE: 'data-mdc-dialog-button-default',\n BUTTON_SELECTOR: '.mdc-dialog__button',\n CLOSED_EVENT: 'MDCDialog:closed',\n CLOSE_ACTION: 'close',\n CLOSING_EVENT: 'MDCDialog:closing',\n CONTAINER_SELECTOR: '.mdc-dialog__container',\n CONTENT_SELECTOR: '.mdc-dialog__content',\n DESTROY_ACTION: 'destroy',\n INITIAL_FOCUS_ATTRIBUTE: 'data-mdc-dialog-initial-focus',\n OPENED_EVENT: 'MDCDialog:opened',\n OPENING_EVENT: 'MDCDialog:opening',\n SCRIM_SELECTOR: '.mdc-dialog__scrim',\n SUPPRESS_DEFAULT_PRESS_SELECTOR: [\n 'textarea',\n '.mdc-menu .mdc-list-item',\n ].join(', '),\n SURFACE_SELECTOR: '.mdc-dialog__surface',\n};\n\nexport const numbers = {\n DIALOG_ANIMATION_CLOSE_TIME_MS: 75,\n DIALOG_ANIMATION_OPEN_TIME_MS: 150,\n};\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCDialogAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\n\nexport class MDCDialogFoundation extends MDCFoundation<MDCDialogAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get defaultAdapter(): MDCDialogAdapter {\n return {\n addBodyClass: () => undefined,\n addClass: () => undefined,\n areButtonsStacked: () => false,\n clickDefaultButton: () => undefined,\n eventTargetMatches: () => false,\n getActionFromEvent: () => '',\n getInitialFocusEl: () => null,\n hasClass: () => false,\n isContentScrollable: () => false,\n notifyClosed: () => undefined,\n notifyClosing: () => undefined,\n notifyOpened: () => undefined,\n notifyOpening: () => undefined,\n releaseFocus: () => undefined,\n removeBodyClass: () => undefined,\n removeClass: () => undefined,\n reverseButtons: () => undefined,\n trapFocus: () => undefined,\n };\n }\n\n private isOpen_ = false;\n private animationFrame_ = 0;\n private animationTimer_ = 0;\n private layoutFrame_ = 0;\n private escapeKeyAction_ = strings.CLOSE_ACTION;\n private scrimClickAction_ = strings.CLOSE_ACTION;\n private autoStackButtons_ = true;\n private areButtonsStacked_ = false;\n\n constructor(adapter?: Partial<MDCDialogAdapter>) {\n super({...MDCDialogFoundation.defaultAdapter, ...adapter});\n }\n\n init() {\n if (this.adapter.hasClass(cssClasses.STACKED)) {\n this.setAutoStackButtons(false);\n }\n }\n\n destroy() {\n if (this.isOpen_) {\n this.close(strings.DESTROY_ACTION);\n }\n\n if (this.animationTimer_) {\n clearTimeout(this.animationTimer_);\n this.handleAnimationTimerEnd_();\n }\n\n if (this.layoutFrame_) {\n cancelAnimationFrame(this.layoutFrame_);\n this.layoutFrame_ = 0;\n }\n }\n\n open() {\n this.isOpen_ = true;\n this.adapter.notifyOpening();\n this.adapter.addClass(cssClasses.OPENING);\n\n // Wait a frame once display is no longer \"none\", to establish basis for animation\n this.runNextAnimationFrame_(() => {\n this.adapter.addClass(cssClasses.OPEN);\n this.adapter.addBodyClass(cssClasses.SCROLL_LOCK);\n\n this.layout();\n\n this.animationTimer_ = setTimeout(() => {\n this.handleAnimationTimerEnd_();\n this.adapter.trapFocus(this.adapter.getInitialFocusEl());\n this.adapter.notifyOpened();\n }, numbers.DIALOG_ANIMATION_OPEN_TIME_MS);\n });\n }\n\n close(action = '') {\n if (!this.isOpen_) {\n // Avoid redundant close calls (and events), e.g. from keydown on elements that inherently emit click\n return;\n }\n\n this.isOpen_ = false;\n this.adapter.notifyClosing(action);\n this.adapter.addClass(cssClasses.CLOSING);\n this.adapter.removeClass(cssClasses.OPEN);\n this.adapter.removeBodyClass(cssClasses.SCROLL_LOCK);\n\n cancelAnimationFrame(this.animationFrame_);\n this.animationFrame_ = 0;\n\n clearTimeout(this.animationTimer_);\n this.animationTimer_ = setTimeout(() => {\n this.adapter.releaseFocus();\n this.handleAnimationTimerEnd_();\n this.adapter.notifyClosed(action);\n }, numbers.DIALOG_ANIMATION_CLOSE_TIME_MS);\n }\n\n isOpen() {\n return this.isOpen_;\n }\n\n getEscapeKeyAction(): string {\n return this.escapeKeyAction_;\n }\n\n setEscapeKeyAction(action: string) {\n this.escapeKeyAction_ = action;\n }\n\n getScrimClickAction(): string {\n return this.scrimClickAction_;\n }\n\n setScrimClickAction(action: string) {\n this.scrimClickAction_ = action;\n }\n\n getAutoStackButtons(): boolean {\n return this.autoStackButtons_;\n }\n\n setAutoStackButtons(autoStack: boolean) {\n this.autoStackButtons_ = autoStack;\n }\n\n layout() {\n if (this.layoutFrame_) {\n cancelAnimationFrame(this.layoutFrame_);\n }\n this.layoutFrame_ = requestAnimationFrame(() => {\n this.layoutInternal_();\n this.layoutFrame_ = 0;\n });\n }\n\n /** Handles click on the dialog root element. */\n handleClick(evt: MouseEvent) {\n const isScrim =\n this.adapter.eventTargetMatches(evt.target, strings.SCRIM_SELECTOR);\n // Check for scrim click first since it doesn't require querying ancestors.\n if (isScrim && this.scrimClickAction_ !== '') {\n this.close(this.scrimClickAction_);\n } else {\n const action = this.adapter.getActionFromEvent(evt);\n if (action) {\n this.close(action);\n }\n }\n }\n\n /** Handles keydown on the dialog root element. */\n handleKeydown(evt: KeyboardEvent) {\n const isEnter = evt.key === 'Enter' || evt.keyCode === 13;\n if (!isEnter) {\n return;\n }\n const action = this.adapter.getActionFromEvent(evt);\n if (action) {\n // Action button callback is handled in `handleClick`,\n // since space/enter keydowns on buttons trigger click events.\n return;\n }\n\n const isDefault = !this.adapter.eventTargetMatches(\n evt.target, strings.SUPPRESS_DEFAULT_PRESS_SELECTOR);\n if (isEnter && isDefault) {\n this.adapter.clickDefaultButton();\n }\n }\n\n /** Handles keydown on the document. */\n handleDocumentKeydown(evt: KeyboardEvent) {\n const isEscape = evt.key === 'Escape' || evt.keyCode === 27;\n if (isEscape && this.escapeKeyAction_ !== '') {\n this.close(this.escapeKeyAction_);\n }\n }\n\n private layoutInternal_() {\n if (this.autoStackButtons_) {\n this.detectStackedButtons_();\n }\n this.detectScrollableContent_();\n }\n\n private handleAnimationTimerEnd_() {\n this.animationTimer_ = 0;\n this.adapter.removeClass(cssClasses.OPENING);\n this.adapter.removeClass(cssClasses.CLOSING);\n }\n\n /**\n * Runs the given logic on the next animation frame, using setTimeout to factor in Firefox reflow behavior.\n */\n private runNextAnimationFrame_(callback: () => void) {\n cancelAnimationFrame(this.animationFrame_);\n this.animationFrame_ = requestAnimationFrame(() => {\n this.animationFrame_ = 0;\n clearTimeout(this.animationTimer_);\n this.animationTimer_ = setTimeout(callback, 0);\n });\n }\n\n private detectStackedButtons_() {\n // Remove the class first to let us measure the buttons' natural positions.\n this.adapter.removeClass(cssClasses.STACKED);\n\n const areButtonsStacked = this.adapter.areButtonsStacked();\n\n if (areButtonsStacked) {\n this.adapter.addClass(cssClasses.STACKED);\n }\n\n if (areButtonsStacked !== this.areButtonsStacked_) {\n this.adapter.reverseButtons();\n this.areButtonsStacked_ = areButtonsStacked;\n }\n }\n\n private detectScrollableContent_() {\n // Remove the class first to let us measure the natural height of the content.\n this.adapter.removeClass(cssClasses.SCROLLABLE);\n if (this.adapter.isContentScrollable()) {\n this.adapter.addClass(cssClasses.SCROLLABLE);\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCDialogFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport * as util from './util';\n\nexport {util};\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {FocusOptions, FocusTrap} from '@material/dom/focus-trap';\n\nexport type MDCDialogFocusTrapFactory = (\n element: HTMLElement,\n options: FocusOptions,\n) => FocusTrap;\n\nexport function createFocusTrapInstance(\n surfaceEl: HTMLElement,\n focusTrapFactory: MDCDialogFocusTrapFactory,\n initialFocusEl?: HTMLElement,\n): FocusTrap {\n return focusTrapFactory(surfaceEl, {initialFocusEl});\n}\n\nexport function isScrollable(el: HTMLElement | null): boolean {\n return el ? el.scrollHeight > el.offsetHeight : false;\n}\n\nexport function areTopsMisaligned(els: HTMLElement[]): boolean {\n const tops = new Set();\n [].forEach.call(els, (el: HTMLElement) => tops.add(el.offsetTop));\n return tops.size > 1;\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Priorities for the announce function\n */\nexport enum AnnouncerPriority {\n POLITE = 'polite',\n ASSERTIVE = 'assertive',\n}\n\n/**\n * Announces the given message with optional priority, defaulting to \"polite\"\n */\nexport function announce(message: string, priority?: AnnouncerPriority) {\n Announcer.getInstance().say(message, priority);\n}\n\nclass Announcer {\n private static instance: Announcer;\n private readonly liveRegions: Map<AnnouncerPriority, Element>;\n\n static getInstance(): Announcer {\n if (!Announcer.instance) {\n Announcer.instance = new Announcer();\n }\n\n return Announcer.instance;\n }\n\n // Constructor made private to ensure only the singleton is used\n private constructor() {\n this.liveRegions = new Map();\n }\n\n say(message: string, priority: AnnouncerPriority = AnnouncerPriority.POLITE) {\n const liveRegion = this.getLiveRegion(priority);\n // Reset the region to pick up the message, even if the message is the\n // exact same as before.\n liveRegion.textContent = '';\n // Timeout is necessary for screen readers like NVDA and VoiceOver.\n setTimeout(() => {\n liveRegion.textContent = message;\n document.addEventListener('click', clearLiveRegion);\n }, 1);\n\n function clearLiveRegion() {\n liveRegion.textContent = '';\n document.removeEventListener('click', clearLiveRegion);\n }\n }\n\n private getLiveRegion(priority: AnnouncerPriority): Element {\n const existingLiveRegion = this.liveRegions.get(priority);\n if (existingLiveRegion &&\n document.body.contains(existingLiveRegion as Node)) {\n return existingLiveRegion;\n }\n\n const liveRegion = this.createLiveRegion(priority);\n this.liveRegions.set(priority, liveRegion);\n return liveRegion;\n }\n\n private createLiveRegion(priority: AnnouncerPriority): Element {\n const el = document.createElement('div');\n el.style.position = 'absolute';\n el.style.top = '-9999px';\n el.style.left = '-9999px';\n el.style.height = '1px';\n el.style.overflow = 'hidden';\n el.setAttribute('aria-atomic', 'true');\n el.setAttribute('aria-live', priority);\n document.body.appendChild(el);\n return el;\n }\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Determine whether the current browser supports passive event listeners, and\n * if so, use them.\n */\nexport function applyPassive(globalObj: Window = window):\n boolean | EventListenerOptions {\n return supportsPassiveOption(globalObj) ?\n {passive: true} as AddEventListenerOptions :\n false;\n}\n\nfunction supportsPassiveOption(globalObj: Window = window): boolean {\n // See\n // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\n let passiveSupported = false;\n\n try {\n const options = {\n // This function will be called when the browser\n // attempts to access the passive property.\n get passive() {\n passiveSupported = true;\n return false;\n }\n };\n\n const handler = () => {};\n globalObj.document.addEventListener('test', handler, options);\n globalObj.document.removeEventListener(\n 'test', handler, options as EventListenerOptions);\n } catch (err) {\n passiveSupported = false;\n }\n\n return passiveSupported;\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst FOCUS_SENTINEL_CLASS = 'mdc-dom-focus-sentinel';\n\n/**\n * Utility to trap focus in a given root element, e.g. for modal components such\n * as dialogs. The root should have at least one focusable child element,\n * for setting initial focus when trapping focus.\n * Also tracks the previously focused element, and restores focus to that\n * element when releasing focus.\n */\nexport class FocusTrap {\n // Previously focused element before trapping focus.\n private elFocusedBeforeTrapFocus: HTMLElement|null = null;\n\n constructor(\n private readonly root: HTMLElement,\n private readonly options: FocusOptions = {}) {}\n\n /**\n * Traps focus in `root`. Also focuses on either `initialFocusEl` if set;\n * otherwises sets initial focus to the first focusable child element.\n */\n trapFocus() {\n const focusableEls = this.getFocusableElements(this.root);\n if (focusableEls.length === 0) {\n throw new Error(\n 'FocusTrap: Element must have at least one focusable child.');\n }\n\n this.elFocusedBeforeTrapFocus =\n document.activeElement instanceof HTMLElement ? document.activeElement :\n null;\n this.wrapTabFocus(this.root, focusableEls);\n\n if (!this.options.skipInitialFocus) {\n this.focusInitialElement(focusableEls, this.options.initialFocusEl);\n }\n }\n\n /**\n * Releases focus from `root`. Also restores focus to the previously focused\n * element.\n */\n releaseFocus() {\n [].slice.call(this.root.querySelectorAll(`.${FOCUS_SENTINEL_CLASS}`))\n .forEach((sentinelEl: HTMLElement) => {\n sentinelEl.parentElement!.removeChild(sentinelEl);\n });\n\n if (this.elFocusedBeforeTrapFocus) {\n this.elFocusedBeforeTrapFocus.focus();\n }\n }\n\n /**\n * Wraps tab focus within `el` by adding two hidden sentinel divs which are\n * used to mark the beginning and the end of the tabbable region. When\n * focused, these sentinel elements redirect focus to the first/last\n * children elements of the tabbable region, ensuring that focus is trapped\n * within that region.\n */\n private wrapTabFocus(el: HTMLElement, focusableEls: HTMLElement[]) {\n const sentinelStart = this.createSentinel();\n const sentinelEnd = this.createSentinel();\n\n sentinelStart.addEventListener('focus', () => {\n if (focusableEls.length > 0) {\n focusableEls[focusableEls.length - 1].focus();\n }\n });\n sentinelEnd.addEventListener('focus', () => {\n if (focusableEls.length > 0) {\n focusableEls[0].focus();\n }\n });\n\n el.insertBefore(sentinelStart, el.children[0]);\n el.appendChild(sentinelEnd);\n }\n\n /**\n * Focuses on `initialFocusEl` if defined and a child of the root element.\n * Otherwise, focuses on the first focusable child element of the root.\n */\n private focusInitialElement(\n focusableEls: HTMLElement[], initialFocusEl?: HTMLElement) {\n let focusIndex = 0;\n if (initialFocusEl) {\n focusIndex = Math.max(focusableEls.indexOf(initialFocusEl), 0);\n }\n focusableEls[focusIndex].focus();\n }\n\n private getFocusableElements(root: HTMLElement): HTMLElement[] {\n const focusableEls =\n [].slice.call(root.querySelectorAll(\n '[autofocus], [tabindex], a, input, textarea, select, button')) as\n HTMLElement[];\n return focusableEls.filter((el) => {\n const isDisabledOrHidden = el.getAttribute('aria-disabled') === 'true' ||\n el.getAttribute('disabled') != null ||\n el.getAttribute('hidden') != null ||\n el.getAttribute('aria-hidden') === 'true';\n const isTabbableAndVisible = el.tabIndex >= 0 &&\n el.getBoundingClientRect().width > 0 &&\n !el.classList.contains(FOCUS_SENTINEL_CLASS) && !isDisabledOrHidden;\n\n let isProgrammaticallyHidden = false;\n if (isTabbableAndVisible) {\n const style = getComputedStyle(el);\n isProgrammaticallyHidden =\n style.display === 'none' || style.visibility === 'hidden';\n }\n return isTabbableAndVisible && !isProgrammaticallyHidden;\n });\n }\n\n private createSentinel() {\n const sentinel = document.createElement('div');\n sentinel.setAttribute('tabindex', '0');\n // Don't announce in screen readers.\n sentinel.setAttribute('aria-hidden', 'true');\n sentinel.classList.add(FOCUS_SENTINEL_CLASS);\n return sentinel;\n }\n}\n\n/** Customization options. */\nexport interface FocusOptions {\n // The element to focus initially when trapping focus.\n // Must be a child of the root element.\n initialFocusEl?: HTMLElement;\n\n // Whether to skip initially focusing on any element when trapping focus.\n // By default, focus is set on the first focusable child element of the root.\n // This is useful if the caller wants to handle setting initial focus.\n skipInitialFocus?: boolean;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport * as events from './events';\nimport * as focusTrap from './focus-trap';\nimport * as keyboard from './keyboard';\nimport * as ponyfill from './ponyfill';\n\nexport {events, focusTrap, keyboard, ponyfill};\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * KEY provides normalized string values for keys.\n */\nexport const KEY = {\n UNKNOWN: 'Unknown',\n BACKSPACE: 'Backspace',\n ENTER: 'Enter',\n SPACEBAR: 'Spacebar',\n PAGE_UP: 'PageUp',\n PAGE_DOWN: 'PageDown',\n END: 'End',\n HOME: 'Home',\n ARROW_LEFT: 'ArrowLeft',\n ARROW_UP: 'ArrowUp',\n ARROW_RIGHT: 'ArrowRight',\n ARROW_DOWN: 'ArrowDown',\n DELETE: 'Delete',\n ESCAPE: 'Escape',\n};\n\nconst normalizedKeys = new Set<string>();\n// IE11 has no support for new Map with iterable so we need to initialize this\n// by hand.\nnormalizedKeys.add(KEY.BACKSPACE);\nnormalizedKeys.add(KEY.ENTER);\nnormalizedKeys.add(KEY.SPACEBAR);\nnormalizedKeys.add(KEY.PAGE_UP);\nnormalizedKeys.add(KEY.PAGE_DOWN);\nnormalizedKeys.add(KEY.END);\nnormalizedKeys.add(KEY.HOME);\nnormalizedKeys.add(KEY.ARROW_LEFT);\nnormalizedKeys.add(KEY.ARROW_UP);\nnormalizedKeys.add(KEY.ARROW_RIGHT);\nnormalizedKeys.add(KEY.ARROW_DOWN);\nnormalizedKeys.add(KEY.DELETE);\nnormalizedKeys.add(KEY.ESCAPE);\n\nconst KEY_CODE = {\n BACKSPACE: 8,\n ENTER: 13,\n SPACEBAR: 32,\n PAGE_UP: 33,\n PAGE_DOWN: 34,\n END: 35,\n HOME: 36,\n ARROW_LEFT: 37,\n ARROW_UP: 38,\n ARROW_RIGHT: 39,\n ARROW_DOWN: 40,\n DELETE: 46,\n ESCAPE: 27,\n};\n\nconst mappedKeyCodes = new Map<number, string>();\n// IE11 has no support for new Map with iterable so we need to initialize this\n// by hand.\nmappedKeyCodes.set(KEY_CODE.BACKSPACE, KEY.BACKSPACE);\nmappedKeyCodes.set(KEY_CODE.ENTER, KEY.ENTER);\nmappedKeyCodes.set(KEY_CODE.SPACEBAR, KEY.SPACEBAR);\nmappedKeyCodes.set(KEY_CODE.PAGE_UP, KEY.PAGE_UP);\nmappedKeyCodes.set(KEY_CODE.PAGE_DOWN, KEY.PAGE_DOWN);\nmappedKeyCodes.set(KEY_CODE.END, KEY.END);\nmappedKeyCodes.set(KEY_CODE.HOME, KEY.HOME);\nmappedKeyCodes.set(KEY_CODE.ARROW_LEFT, KEY.ARROW_LEFT);\nmappedKeyCodes.set(KEY_CODE.ARROW_UP, KEY.ARROW_UP);\nmappedKeyCodes.set(KEY_CODE.ARROW_RIGHT, KEY.ARROW_RIGHT);\nmappedKeyCodes.set(KEY_CODE.ARROW_DOWN, KEY.ARROW_DOWN);\nmappedKeyCodes.set(KEY_CODE.DELETE, KEY.DELETE);\nmappedKeyCodes.set(KEY_CODE.ESCAPE, KEY.ESCAPE);\n\nconst navigationKeys = new Set<string>();\n// IE11 has no support for new Set with iterable so we need to initialize this\n// by hand.\nnavigationKeys.add(KEY.PAGE_UP);\nnavigationKeys.add(KEY.PAGE_DOWN);\nnavigationKeys.add(KEY.END);\nnavigationKeys.add(KEY.HOME);\nnavigationKeys.add(KEY.ARROW_LEFT);\nnavigationKeys.add(KEY.ARROW_UP);\nnavigationKeys.add(KEY.ARROW_RIGHT);\nnavigationKeys.add(KEY.ARROW_DOWN);\n\n/**\n * normalizeKey returns the normalized string for a navigational action.\n */\nexport function normalizeKey(evt: KeyboardEvent): string {\n const {key} = evt;\n // If the event already has a normalized key, return it\n if (normalizedKeys.has(key)) {\n return key;\n }\n\n // tslint:disable-next-line:deprecation\n const mappedKey = mappedKeyCodes.get(evt.keyCode);\n if (mappedKey) {\n return mappedKey;\n }\n return KEY.UNKNOWN;\n}\n\n/**\n * isNavigationEvent returns whether the event is a navigation event\n */\nexport function isNavigationEvent(evt: KeyboardEvent): boolean {\n return navigationKeys.has(normalizeKey(evt));\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * @fileoverview A \"ponyfill\" is a polyfill that doesn't modify the global prototype chain.\n * This makes ponyfills safer than traditional polyfills, especially for libraries like MDC.\n */\n\nexport function closest(element: Element, selector: string): Element | null {\n if (element.closest) {\n return element.closest(selector);\n }\n\n let el: Element | null = element;\n while (el) {\n if (matches(el, selector)) {\n return el;\n }\n el = el.parentElement;\n }\n return null;\n}\n\nexport function matches(element: Element, selector: string): boolean {\n const nativeMatches = element.matches\n || element.webkitMatchesSelector\n || element.msMatchesSelector;\n return nativeMatches.call(element, selector);\n}\n\n/**\n * Used to compute the estimated scroll width of elements. When an element is\n * hidden due to display: none; being applied to a parent element, the width is\n * returned as 0. However, the element will have a true width once no longer\n * inside a display: none context. This method computes an estimated width when\n * the element is hidden or returns the true width when the element is visble.\n * @param {Element} element the element whose width to estimate\n */\nexport function estimateScrollWidth(element: Element): number {\n // Check the offsetParent. If the element inherits display: none from any\n // parent, the offsetParent property will be null (see\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent).\n // This check ensures we only clone the node when necessary.\n const htmlEl = element as HTMLElement;\n if (htmlEl.offsetParent !== null) {\n return htmlEl.scrollWidth;\n }\n\n const clone = htmlEl.cloneNode(true) as HTMLElement;\n clone.style.setProperty('position', 'absolute');\n clone.style.setProperty('transform', 'translate(-9999px, -9999px)');\n document.documentElement.appendChild(clone);\n const scrollWidth = clone.scrollWidth;\n document.documentElement.removeChild(clone);\n return scrollWidth;\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {FocusTrap} from '@material/dom/focus-trap';\nimport {MDCList, MDCListFactory} from '@material/list/component';\nimport {MDCListFoundation} from '@material/list/foundation';\nimport {MDCDrawerAdapter} from './adapter';\nimport {MDCDismissibleDrawerFoundation} from './dismissible/foundation';\nimport {MDCModalDrawerFoundation} from './modal/foundation';\nimport * as util from './util';\nimport {MDCDrawerFocusTrapFactory} from './util';\n\nconst {cssClasses, strings} = MDCDismissibleDrawerFoundation;\n\n/**\n * @events `MDCDrawer:closed {}` Emits when the navigation drawer has closed.\n * @events `MDCDrawer:opened {}` Emits when the navigation drawer has opened.\n */\nexport class MDCDrawer extends MDCComponent<MDCDismissibleDrawerFoundation> {\n static attachTo(root: Element): MDCDrawer {\n return new MDCDrawer(root);\n }\n\n /**\n * @return boolean Proxies to the foundation's `open`/`close` methods.\n * Also returns true if drawer is in the open position.\n */\n get open(): boolean {\n return this.foundation.isOpen();\n }\n\n /**\n * Toggles the drawer open and closed.\n */\n set open(isOpen: boolean) {\n if (isOpen) {\n this.foundation.open();\n } else {\n this.foundation.close();\n }\n }\n\n private previousFocus_?: Element | null;\n private scrim_!: HTMLElement | null; // assigned in initialSyncWithDOM()\n private list_?: MDCList; // assigned in initialize()\n\n private focusTrap_?: FocusTrap; // assigned in initialSyncWithDOM()\n private focusTrapFactory_!: MDCDrawerFocusTrapFactory; // assigned in initialize()\n\n private handleScrimClick_?: SpecificEventListener<'click'>; // initialized in initialSyncWithDOM()\n private handleKeydown_!: SpecificEventListener<'keydown'>; // initialized in initialSyncWithDOM()\n private handleTransitionEnd_!: SpecificEventListener<'transitionend'>; // initialized in initialSyncWithDOM()\n\n get list(): MDCList | undefined {\n return this.list_;\n }\n\n initialize(\n focusTrapFactory: MDCDrawerFocusTrapFactory = (el) => new FocusTrap(el),\n listFactory: MDCListFactory = (el) => new MDCList(el),\n ) {\n const listEl =\n this.root.querySelector(`.${MDCListFoundation.cssClasses.ROOT}`);\n if (listEl) {\n this.list_ = listFactory(listEl);\n this.list_.wrapFocus = true;\n }\n this.focusTrapFactory_ = focusTrapFactory;\n }\n\n initialSyncWithDOM() {\n const {MODAL} = cssClasses;\n const {SCRIM_SELECTOR} = strings;\n\n this.scrim_ = (this.root.parentNode as Element)\n .querySelector<HTMLElement>(SCRIM_SELECTOR);\n\n if (this.scrim_ && this.root.classList.contains(MODAL)) {\n this.handleScrimClick_ = () =>\n (this.foundation as MDCModalDrawerFoundation).handleScrimClick();\n this.scrim_.addEventListener('click', this.handleScrimClick_);\n this.focusTrap_ = util.createFocusTrapInstance(\n this.root as HTMLElement, this.focusTrapFactory_);\n }\n\n this.handleKeydown_ = (evt) => this.foundation.handleKeydown(evt);\n this.handleTransitionEnd_ = (evt) =>\n this.foundation.handleTransitionEnd(evt);\n\n this.listen('keydown', this.handleKeydown_);\n this.listen('transitionend', this.handleTransitionEnd_);\n }\n\n destroy() {\n this.unlisten('keydown', this.handleKeydown_);\n this.unlisten('transitionend', this.handleTransitionEnd_);\n\n if (this.list_) {\n this.list_.destroy();\n }\n\n const {MODAL} = cssClasses;\n if (this.scrim_ && this.handleScrimClick_ &&\n this.root.classList.contains(MODAL)) {\n this.scrim_.removeEventListener('click', this.handleScrimClick_);\n // Ensure drawer is closed to hide scrim and release focus\n this.open = false;\n }\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCDrawerAdapter = {\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n hasClass: (className) => this.root.classList.contains(className),\n elementHasClass: (element, className) =>\n element.classList.contains(className),\n saveFocus: () => this.previousFocus_ = document.activeElement,\n restoreFocus: () => {\n const previousFocus = this.previousFocus_ as HTMLOrSVGElement | null;\n if (previousFocus && previousFocus.focus &&\n this.root.contains(document.activeElement)) {\n previousFocus.focus();\n }\n },\n focusActiveNavigationItem: () => {\n const activeNavItemEl = this.root.querySelector<HTMLElement>(\n `.${MDCListFoundation.cssClasses.LIST_ITEM_ACTIVATED_CLASS}`);\n if (activeNavItemEl) {\n activeNavItemEl.focus();\n }\n },\n notifyClose: () =>\n this.emit(strings.CLOSE_EVENT, {}, true /* shouldBubble */),\n notifyOpen: () =>\n this.emit(strings.OPEN_EVENT, {}, true /* shouldBubble */),\n trapFocus: () => this.focusTrap_!.trapFocus(),\n releaseFocus: () => this.focusTrap_!.releaseFocus(),\n };\n // tslint:enable:object-literal-sort-keys\n\n const {DISMISSIBLE, MODAL} = cssClasses;\n if (this.root.classList.contains(DISMISSIBLE)) {\n return new MDCDismissibleDrawerFoundation(adapter);\n } else if (this.root.classList.contains(MODAL)) {\n return new MDCModalDrawerFoundation(adapter);\n } else {\n throw new Error(\n `MDCDrawer: Failed to instantiate component. Supported variants are ${DISMISSIBLE} and ${MODAL}.`);\n }\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n ANIMATE: 'mdc-drawer--animate',\n CLOSING: 'mdc-drawer--closing',\n DISMISSIBLE: 'mdc-drawer--dismissible',\n MODAL: 'mdc-drawer--modal',\n OPEN: 'mdc-drawer--open',\n OPENING: 'mdc-drawer--opening',\n ROOT: 'mdc-drawer',\n};\n\nconst strings = {\n APP_CONTENT_SELECTOR: '.mdc-drawer-app-content',\n CLOSE_EVENT: 'MDCDrawer:closed',\n OPEN_EVENT: 'MDCDrawer:opened',\n SCRIM_SELECTOR: '.mdc-drawer-scrim',\n};\n\nexport {cssClasses, strings};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCDrawerAdapter} from '../adapter';\nimport {cssClasses, strings} from '../constants';\n\nexport class MDCDismissibleDrawerFoundation extends MDCFoundation<MDCDrawerAdapter> {\n static get strings() {\n return strings;\n }\n\n static get cssClasses() {\n return cssClasses;\n }\n\n static get defaultAdapter(): MDCDrawerAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => false,\n elementHasClass: () => false,\n notifyClose: () => undefined,\n notifyOpen: () => undefined,\n saveFocus: () => undefined,\n restoreFocus: () => undefined,\n focusActiveNavigationItem: () => undefined,\n trapFocus: () => undefined,\n releaseFocus: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private animationFrame_ = 0;\n private animationTimer_ = 0;\n\n constructor(adapter?: Partial<MDCDrawerAdapter>) {\n super({...MDCDismissibleDrawerFoundation.defaultAdapter, ...adapter});\n }\n\n destroy() {\n if (this.animationFrame_) {\n cancelAnimationFrame(this.animationFrame_);\n }\n if (this.animationTimer_) {\n clearTimeout(this.animationTimer_);\n }\n }\n\n /**\n * Opens the drawer from the closed state.\n */\n open() {\n if (this.isOpen() || this.isOpening() || this.isClosing()) {\n return;\n }\n\n this.adapter.addClass(cssClasses.OPEN);\n this.adapter.addClass(cssClasses.ANIMATE);\n\n // Wait a frame once display is no longer \"none\", to establish basis for animation\n this.runNextAnimationFrame_(() => {\n this.adapter.addClass(cssClasses.OPENING);\n });\n\n this.adapter.saveFocus();\n }\n\n /**\n * Closes the drawer from the open state.\n */\n close() {\n if (!this.isOpen() || this.isOpening() || this.isClosing()) {\n return;\n }\n\n this.adapter.addClass(cssClasses.CLOSING);\n }\n\n /**\n * Returns true if the drawer is in the open position.\n * @return true if drawer is in open state.\n */\n isOpen(): boolean {\n return this.adapter.hasClass(cssClasses.OPEN);\n }\n\n /**\n * Returns true if the drawer is animating open.\n * @return true if drawer is animating open.\n */\n isOpening(): boolean {\n return this.adapter.hasClass(cssClasses.OPENING) ||\n this.adapter.hasClass(cssClasses.ANIMATE);\n }\n\n /**\n * Returns true if the drawer is animating closed.\n * @return true if drawer is animating closed.\n */\n isClosing(): boolean {\n return this.adapter.hasClass(cssClasses.CLOSING);\n }\n\n /**\n * Keydown handler to close drawer when key is escape.\n */\n handleKeydown(evt: KeyboardEvent) {\n const {keyCode, key} = evt;\n const isEscape = key === 'Escape' || keyCode === 27;\n if (isEscape) {\n this.close();\n }\n }\n\n /**\n * Handles the `transitionend` event when the drawer finishes opening/closing.\n */\n handleTransitionEnd(evt: TransitionEvent) {\n const {OPENING, CLOSING, OPEN, ANIMATE, ROOT} = cssClasses;\n\n // In Edge, transitionend on ripple pseudo-elements yields a target without classList, so check for Element first.\n const isRootElement = this.isElement_(evt.target) &&\n this.adapter.elementHasClass(evt.target, ROOT);\n if (!isRootElement) {\n return;\n }\n\n if (this.isClosing()) {\n this.adapter.removeClass(OPEN);\n this.closed_();\n this.adapter.restoreFocus();\n this.adapter.notifyClose();\n } else {\n this.adapter.focusActiveNavigationItem();\n this.opened_();\n this.adapter.notifyOpen();\n }\n\n this.adapter.removeClass(ANIMATE);\n this.adapter.removeClass(OPENING);\n this.adapter.removeClass(CLOSING);\n }\n\n /**\n * Extension point for when drawer finishes open animation.\n */\n protected opened_() {} // tslint:disable-line:no-empty\n\n /**\n * Extension point for when drawer finishes close animation.\n */\n protected closed_() {} // tslint:disable-line:no-empty\n\n /**\n * Runs the given logic on the next animation frame, using setTimeout to factor in Firefox reflow behavior.\n */\n private runNextAnimationFrame_(callback: () => void) {\n cancelAnimationFrame(this.animationFrame_);\n this.animationFrame_ = requestAnimationFrame(() => {\n this.animationFrame_ = 0;\n clearTimeout(this.animationTimer_);\n this.animationTimer_ = setTimeout(callback, 0);\n });\n }\n\n private isElement_(element: unknown): element is Element {\n // In Edge, transitionend on ripple pseudo-elements yields a target without classList.\n return Boolean((element as Element).classList);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCDismissibleDrawerFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport * as util from './util';\n\nexport {util};\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './dismissible/foundation';\nexport * from './modal/foundation';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCDismissibleDrawerFoundation} from '../dismissible/foundation';\n\n/* istanbul ignore next: subclass is not a branch statement */\nexport class MDCModalDrawerFoundation extends MDCDismissibleDrawerFoundation {\n /**\n * Handles click event on scrim.\n */\n handleScrimClick() {\n this.close();\n }\n\n /**\n * Called when drawer finishes open animation.\n */\n protected opened_() {\n this.adapter.trapFocus();\n }\n\n /**\n * Called when drawer finishes close animation.\n */\n protected closed_() {\n this.adapter.releaseFocus();\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCModalDrawerFoundation;\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {FocusOptions, FocusTrap} from '@material/dom/focus-trap';\n\nexport type MDCDrawerFocusTrapFactory = (\n element: HTMLElement,\n options: FocusOptions,\n) => FocusTrap;\n\nexport function createFocusTrapInstance(\n surfaceEl: HTMLElement,\n focusTrapFactory: MDCDrawerFocusTrapFactory,\n): FocusTrap {\n return focusTrapFactory(surfaceEl, {\n // Component handles focusing on active nav item.\n skipInitialFocus: true, \n });\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {estimateScrollWidth} from '@material/dom/ponyfill';\nimport {MDCFloatingLabelAdapter} from './adapter';\nimport {MDCFloatingLabelFoundation} from './foundation';\n\nexport type MDCFloatingLabelFactory = (el: Element, foundation?: MDCFloatingLabelFoundation) => MDCFloatingLabel;\n\nexport class MDCFloatingLabel extends MDCComponent<MDCFloatingLabelFoundation> {\n static attachTo(root: Element): MDCFloatingLabel {\n return new MDCFloatingLabel(root);\n }\n\n /**\n * Styles the label to produce the label shake for errors.\n * @param shouldShake If true, shakes the label by adding a CSS class; otherwise, stops shaking by removing the class.\n */\n shake(shouldShake: boolean) {\n this.foundation.shake(shouldShake);\n }\n\n /**\n * Styles the label to float/dock.\n * @param shouldFloat If true, floats the label by adding a CSS class; otherwise, docks it by removing the class.\n */\n float(shouldFloat: boolean) {\n this.foundation.float(shouldFloat);\n }\n\n /**\n * Styles the label as required.\n * @param isRequired If true, adds an asterisk to the label, indicating that it is required.\n */\n setRequired(isRequired: boolean) {\n this.foundation.setRequired(isRequired);\n }\n\n getWidth(): number {\n return this.foundation.getWidth();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCFloatingLabelAdapter = {\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n getWidth: () => estimateScrollWidth(this.root),\n registerInteractionHandler: (evtType, handler) =>\n this.listen(evtType, handler),\n deregisterInteractionHandler: (evtType, handler) =>\n this.unlisten(evtType, handler),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCFloatingLabelFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const cssClasses = {\n LABEL_FLOAT_ABOVE: 'mdc-floating-label--float-above',\n LABEL_REQUIRED: 'mdc-floating-label--required',\n LABEL_SHAKE: 'mdc-floating-label--shake',\n ROOT: 'mdc-floating-label',\n};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCFloatingLabelAdapter} from './adapter';\nimport {cssClasses} from './constants';\n\nexport class MDCFloatingLabelFoundation extends MDCFoundation<MDCFloatingLabelAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n /**\n * See {@link MDCFloatingLabelAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCFloatingLabelAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n getWidth: () => 0,\n registerInteractionHandler: () => undefined,\n deregisterInteractionHandler: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private readonly shakeAnimationEndHandler_: SpecificEventListener<'animationend'>;\n\n constructor(adapter?: Partial<MDCFloatingLabelAdapter>) {\n super({...MDCFloatingLabelFoundation.defaultAdapter, ...adapter});\n\n this.shakeAnimationEndHandler_ = () => this.handleShakeAnimationEnd_();\n }\n\n init() {\n this.adapter.registerInteractionHandler('animationend', this.shakeAnimationEndHandler_);\n }\n\n destroy() {\n this.adapter.deregisterInteractionHandler('animationend', this.shakeAnimationEndHandler_);\n }\n\n /**\n * Returns the width of the label element.\n */\n getWidth(): number {\n return this.adapter.getWidth();\n }\n\n /**\n * Styles the label to produce a shake animation to indicate an error.\n * @param shouldShake If true, adds the shake CSS class; otherwise, removes shake class.\n */\n shake(shouldShake: boolean) {\n const {LABEL_SHAKE} = MDCFloatingLabelFoundation.cssClasses;\n if (shouldShake) {\n this.adapter.addClass(LABEL_SHAKE);\n } else {\n this.adapter.removeClass(LABEL_SHAKE);\n }\n }\n\n /**\n * Styles the label to float or dock.\n * @param shouldFloat If true, adds the float CSS class; otherwise, removes float and shake classes to dock the label.\n */\n float(shouldFloat: boolean) {\n const {LABEL_FLOAT_ABOVE, LABEL_SHAKE} = MDCFloatingLabelFoundation.cssClasses;\n if (shouldFloat) {\n this.adapter.addClass(LABEL_FLOAT_ABOVE);\n } else {\n this.adapter.removeClass(LABEL_FLOAT_ABOVE);\n this.adapter.removeClass(LABEL_SHAKE);\n }\n }\n\n /**\n * Styles the label as required.\n * @param isRequired If true, adds an asterisk to the label, indicating that it is required.\n */\n setRequired(isRequired: boolean) {\n const {LABEL_REQUIRED} = MDCFloatingLabelFoundation.cssClasses;\n if (isRequired) {\n this.adapter.addClass(LABEL_REQUIRED);\n } else {\n this.adapter.removeClass(LABEL_REQUIRED);\n }\n }\n\n private handleShakeAnimationEnd_() {\n const {LABEL_SHAKE} = MDCFloatingLabelFoundation.cssClasses;\n this.adapter.removeClass(LABEL_SHAKE);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCFloatingLabelFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCRipple} from '@material/ripple/component';\nimport {MDCFormFieldAdapter} from './adapter';\nimport {MDCFormFieldFoundation} from './foundation';\n\nexport interface MDCFormFieldInput {\n readonly ripple: MDCRipple | undefined;\n}\n\nexport class MDCFormField extends MDCComponent<MDCFormFieldFoundation> {\n static attachTo(root: HTMLElement) {\n return new MDCFormField(root);\n }\n\n input?: MDCFormFieldInput;\n\n private labelEl(): Element|null {\n const {LABEL_SELECTOR} = MDCFormFieldFoundation.strings;\n return this.root.querySelector(LABEL_SELECTOR);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCFormFieldAdapter = {\n activateInputRipple: () => {\n if (this.input && this.input.ripple) {\n this.input.ripple.activate();\n }\n },\n deactivateInputRipple: () => {\n if (this.input && this.input.ripple) {\n this.input.ripple.deactivate();\n }\n },\n deregisterInteractionHandler: (evtType, handler) => {\n const labelEl = this.labelEl();\n if (labelEl) {\n (labelEl as HTMLElement).removeEventListener(evtType, handler);\n }\n },\n registerInteractionHandler: (evtType, handler) => {\n const labelEl = this.labelEl();\n if (labelEl) {\n (labelEl as HTMLElement).addEventListener(evtType, handler);\n }\n },\n };\n return new MDCFormFieldFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const cssClasses = {\n ROOT: 'mdc-form-field',\n};\n\nexport const strings = {\n LABEL_SELECTOR: '.mdc-form-field > label',\n};\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCFormFieldAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCFormFieldFoundation extends MDCFoundation<MDCFormFieldAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get defaultAdapter(): MDCFormFieldAdapter {\n return {\n activateInputRipple: () => undefined,\n deactivateInputRipple: () => undefined,\n deregisterInteractionHandler: () => undefined,\n registerInteractionHandler: () => undefined,\n };\n }\n\n private readonly click: () => void;\n\n constructor(adapter?: Partial<MDCFormFieldAdapter>) {\n super({...MDCFormFieldFoundation.defaultAdapter, ...adapter});\n\n this.click = () => {\n this.handleClick();\n };\n }\n\n init() {\n this.adapter.registerInteractionHandler('click', this.click);\n }\n\n destroy() {\n this.adapter.deregisterInteractionHandler('click', this.click);\n }\n\n private handleClick() {\n this.adapter.activateInputRipple();\n requestAnimationFrame(() => {\n this.adapter.deactivateInputRipple();\n });\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCFormFieldFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCRipple} from '@material/ripple/component';\nimport {MDCIconButtonToggleAdapter} from './adapter';\nimport {MDCIconButtonToggleFoundation} from './foundation';\nimport {MDCIconButtonToggleEventDetail} from './types';\n\nconst {strings} = MDCIconButtonToggleFoundation;\n\nexport class MDCIconButtonToggle extends MDCComponent<MDCIconButtonToggleFoundation> {\n static attachTo(root: HTMLElement) {\n return new MDCIconButtonToggle(root);\n }\n\n private readonly rippleComponent: MDCRipple = this.createRipple();\n private handleClick!:\n SpecificEventListener<'click'>; // assigned in initialSyncWithDOM()\n\n initialSyncWithDOM() {\n this.handleClick = () => {\n this.foundation.handleClick();\n };\n this.listen('click', this.handleClick);\n }\n\n destroy() {\n this.unlisten('click', this.handleClick);\n this.ripple.destroy();\n super.destroy();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCIconButtonToggleAdapter = {\n addClass: (className) => this.root.classList.add(className),\n hasClass: (className) => this.root.classList.contains(className),\n notifyChange: (evtData) => {\n this.emit<MDCIconButtonToggleEventDetail>(\n strings.CHANGE_EVENT, evtData);\n },\n removeClass: (className) => this.root.classList.remove(className),\n getAttr: (attrName) => this.root.getAttribute(attrName),\n setAttr: (attrName, attrValue) =>\n this.root.setAttribute(attrName, attrValue),\n };\n return new MDCIconButtonToggleFoundation(adapter);\n }\n\n get ripple(): MDCRipple {\n return this.rippleComponent;\n }\n\n get on(): boolean {\n return this.foundation.isOn();\n }\n\n set on(isOn: boolean) {\n this.foundation.toggle(isOn);\n }\n\n private createRipple(): MDCRipple {\n const ripple = new MDCRipple(this.root);\n ripple.unbounded = true;\n return ripple;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const cssClasses = {\n ICON_BUTTON_ON: 'mdc-icon-button--on',\n ROOT: 'mdc-icon-button',\n};\n\nexport const strings = {\n ARIA_LABEL: 'aria-label',\n ARIA_PRESSED: 'aria-pressed',\n DATA_ARIA_LABEL_OFF: 'data-aria-label-off',\n DATA_ARIA_LABEL_ON: 'data-aria-label-on',\n CHANGE_EVENT: 'MDCIconButtonToggle:change',\n};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCIconButtonToggleAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCIconButtonToggleFoundation extends MDCFoundation<MDCIconButtonToggleAdapter> {\n /**\n * Whether the icon button has an aria label that changes depending on\n * toggled state.\n */\n private hasToggledAriaLabel: boolean = false;\n\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get defaultAdapter(): MDCIconButtonToggleAdapter {\n return {\n addClass: () => undefined,\n hasClass: () => false,\n notifyChange: () => undefined,\n removeClass: () => undefined,\n getAttr: () => null,\n setAttr: () => undefined,\n };\n }\n\n constructor(adapter?: Partial<MDCIconButtonToggleAdapter>) {\n super({...MDCIconButtonToggleFoundation.defaultAdapter, ...adapter});\n }\n\n init() {\n const ariaLabelOn = this.adapter.getAttr(strings.DATA_ARIA_LABEL_ON);\n const ariaLabelOff = this.adapter.getAttr(strings.DATA_ARIA_LABEL_OFF);\n if (ariaLabelOn && ariaLabelOff) {\n if (this.adapter.getAttr(strings.ARIA_PRESSED) !== null) {\n throw new Error(\n 'MDCIconButtonToggleFoundation: Button should not set ' +\n '`aria-pressed` if it has a toggled aria label.');\n }\n\n this.hasToggledAriaLabel = true;\n } else {\n this.adapter.setAttr(strings.ARIA_PRESSED, String(this.isOn()));\n }\n }\n\n handleClick() {\n this.toggle();\n this.adapter.notifyChange({isOn: this.isOn()});\n }\n\n isOn(): boolean {\n return this.adapter.hasClass(cssClasses.ICON_BUTTON_ON);\n }\n\n toggle(isOn: boolean = !this.isOn()) {\n // Toggle UI based on state.\n if (isOn) {\n this.adapter.addClass(cssClasses.ICON_BUTTON_ON);\n } else {\n this.adapter.removeClass(cssClasses.ICON_BUTTON_ON);\n }\n\n // Toggle aria attributes based on state.\n if (this.hasToggledAriaLabel) {\n const ariaLabel = isOn ?\n this.adapter.getAttr(strings.DATA_ARIA_LABEL_ON) :\n this.adapter.getAttr(strings.DATA_ARIA_LABEL_OFF);\n this.adapter.setAttr(strings.ARIA_LABEL, ariaLabel || '');\n } else {\n this.adapter.setAttr(strings.ARIA_PRESSED, `${isOn}`);\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCIconButtonToggleFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCLineRippleAdapter} from './adapter';\nimport {MDCLineRippleFoundation} from './foundation';\n\nexport type MDCLineRippleFactory = (el: Element, foundation?: MDCLineRippleFoundation) => MDCLineRipple;\n\nexport class MDCLineRipple extends MDCComponent<MDCLineRippleFoundation> {\n static attachTo(root: Element): MDCLineRipple {\n return new MDCLineRipple(root);\n }\n\n /**\n * Activates the line ripple\n */\n activate() {\n this.foundation.activate();\n }\n\n /**\n * Deactivates the line ripple\n */\n deactivate() {\n this.foundation.deactivate();\n }\n\n /**\n * Sets the transform origin given a user's click location.\n * The `rippleCenter` is the x-coordinate of the middle of the ripple.\n */\n setRippleCenter(xCoordinate: number) {\n this.foundation.setRippleCenter(xCoordinate);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCLineRippleAdapter = {\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n hasClass: (className) => this.root.classList.contains(className),\n setStyle: (propertyName, value) => (this.root as HTMLElement).style.setProperty(propertyName, value),\n registerEventHandler: (evtType, handler) => this.listen(evtType, handler),\n deregisterEventHandler: (evtType, handler) => this.unlisten(evtType, handler),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCLineRippleFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n LINE_RIPPLE_ACTIVE: 'mdc-line-ripple--active',\n LINE_RIPPLE_DEACTIVATING: 'mdc-line-ripple--deactivating',\n};\n\nexport {cssClasses};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCLineRippleAdapter} from './adapter';\nimport {cssClasses} from './constants';\n\nexport class MDCLineRippleFoundation extends MDCFoundation<MDCLineRippleAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n /**\n * See {@link MDCLineRippleAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCLineRippleAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => false,\n setStyle: () => undefined,\n registerEventHandler: () => undefined,\n deregisterEventHandler: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private readonly transitionEndHandler_: SpecificEventListener<'transitionend'>;\n\n constructor(adapter?: Partial<MDCLineRippleAdapter>) {\n super({...MDCLineRippleFoundation.defaultAdapter, ...adapter});\n\n this.transitionEndHandler_ = (evt) => this.handleTransitionEnd(evt);\n }\n\n init() {\n this.adapter.registerEventHandler(\n 'transitionend', this.transitionEndHandler_);\n }\n\n destroy() {\n this.adapter.deregisterEventHandler(\n 'transitionend', this.transitionEndHandler_);\n }\n\n activate() {\n this.adapter.removeClass(cssClasses.LINE_RIPPLE_DEACTIVATING);\n this.adapter.addClass(cssClasses.LINE_RIPPLE_ACTIVE);\n }\n\n setRippleCenter(xCoordinate: number) {\n this.adapter.setStyle('transform-origin', `${xCoordinate}px center`);\n }\n\n deactivate() {\n this.adapter.addClass(cssClasses.LINE_RIPPLE_DEACTIVATING);\n }\n\n handleTransitionEnd(evt: TransitionEvent) {\n // Wait for the line ripple to be either transparent or opaque\n // before emitting the animation end event\n const isDeactivating =\n this.adapter.hasClass(cssClasses.LINE_RIPPLE_DEACTIVATING);\n\n if (evt.propertyName === 'opacity') {\n if (isDeactivating) {\n this.adapter.removeClass(cssClasses.LINE_RIPPLE_ACTIVE);\n this.adapter.removeClass(cssClasses.LINE_RIPPLE_DEACTIVATING);\n }\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCLineRippleFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCProgressIndicator} from '@material/progress-indicator/component';\nimport {MDCLinearProgressAdapter} from './adapter';\nimport {MDCLinearProgressFoundation} from './foundation';\n\nexport class MDCLinearProgress extends\n MDCComponent<MDCLinearProgressFoundation> implements MDCProgressIndicator {\n static attachTo(root: Element) {\n return new MDCLinearProgress(root);\n }\n\n set determinate(value: boolean) {\n this.foundation.setDeterminate(value);\n }\n\n set progress(value: number) {\n this.foundation.setProgress(value);\n }\n\n set buffer(value: number) {\n this.foundation.setBuffer(value);\n }\n\n set reverse(value: boolean) {\n this.foundation.setReverse(value);\n }\n\n open() {\n this.foundation.open();\n }\n\n close() {\n this.foundation.close();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCLinearProgressAdapter = {\n addClass: (className: string) => {\n this.root.classList.add(className);\n },\n forceLayout: () => {\n this.root.getBoundingClientRect();\n },\n setBufferBarStyle: (styleProperty: string, value: string) => {\n const bufferBar = this.root.querySelector<HTMLElement>(\n MDCLinearProgressFoundation.strings.BUFFER_BAR_SELECTOR);\n if (bufferBar) {\n bufferBar.style.setProperty(styleProperty, value);\n }\n },\n setPrimaryBarStyle: (styleProperty: string, value: string) => {\n const primaryBar = this.root.querySelector<HTMLElement>(\n MDCLinearProgressFoundation.strings.PRIMARY_BAR_SELECTOR);\n if (primaryBar) {\n primaryBar.style.setProperty(styleProperty, value);\n }\n },\n hasClass: (className: string) => this.root.classList.contains(className),\n removeAttribute: (attributeName: string) => {\n this.root.removeAttribute(attributeName);\n },\n removeClass: (className: string) => {\n this.root.classList.remove(className);\n },\n setAttribute: (attributeName: string, value: string) => {\n this.root.setAttribute(attributeName, value);\n },\n };\n return new MDCLinearProgressFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const cssClasses = {\n CLOSED_CLASS: 'mdc-linear-progress--closed',\n INDETERMINATE_CLASS: 'mdc-linear-progress--indeterminate',\n REVERSED_CLASS: 'mdc-linear-progress--reversed',\n};\n\nexport const strings = {\n ARIA_VALUENOW: 'aria-valuenow',\n BUFFER_BAR_SELECTOR: '.mdc-linear-progress__buffer-bar',\n FLEX_BASIS: 'flex-basis',\n PRIMARY_BAR_SELECTOR: '.mdc-linear-progress__primary-bar',\n};\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {getCorrectPropertyName} from '@material/animation/util';\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCProgressIndicatorFoundation} from '@material/progress-indicator/foundation';\nimport {MDCLinearProgressAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCLinearProgressFoundation extends\n MDCFoundation<MDCLinearProgressAdapter> implements\n MDCProgressIndicatorFoundation {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get defaultAdapter(): MDCLinearProgressAdapter {\n return {\n addClass: () => undefined,\n forceLayout: () => undefined,\n setBufferBarStyle: () => null,\n setPrimaryBarStyle: () => null,\n hasClass: () => false,\n removeAttribute: () => undefined,\n removeClass: () => undefined,\n setAttribute: () => undefined,\n };\n }\n\n private isDeterminate!: boolean;\n private isReversed!: boolean;\n private progress!: number;\n private buffer!: number;\n\n constructor(adapter?: Partial<MDCLinearProgressAdapter>) {\n super({...MDCLinearProgressFoundation.defaultAdapter, ...adapter});\n }\n\n init() {\n this.isDeterminate = !this.adapter.hasClass(cssClasses.INDETERMINATE_CLASS);\n this.isReversed = this.adapter.hasClass(cssClasses.REVERSED_CLASS);\n this.progress = 0;\n this.buffer = 1;\n }\n\n setDeterminate(isDeterminate: boolean) {\n this.isDeterminate = isDeterminate;\n\n if (this.isDeterminate) {\n this.adapter.removeClass(cssClasses.INDETERMINATE_CLASS);\n this.adapter.setAttribute(\n strings.ARIA_VALUENOW, this.progress.toString());\n this.setPrimaryBarProgress(this.progress);\n this.setBufferBarProgress(this.buffer);\n\n return;\n }\n\n if (this.isReversed) {\n // Adding/removing REVERSED_CLASS starts a translate animation, while\n // adding INDETERMINATE_CLASS starts a scale animation. Here, we reset\n // the translate animation in order to keep it in sync with the new\n // scale animation that will start from adding INDETERMINATE_CLASS\n // below.\n this.adapter.removeClass(cssClasses.REVERSED_CLASS);\n this.adapter.forceLayout();\n this.adapter.addClass(cssClasses.REVERSED_CLASS);\n }\n\n this.adapter.addClass(cssClasses.INDETERMINATE_CLASS);\n this.adapter.removeAttribute(strings.ARIA_VALUENOW);\n this.setPrimaryBarProgress(1);\n this.setBufferBarProgress(1);\n }\n\n getDeterminate() {\n return this.isDeterminate;\n }\n\n setProgress(value: number) {\n this.progress = value;\n if (this.isDeterminate) {\n this.setPrimaryBarProgress(value);\n this.adapter.setAttribute(strings.ARIA_VALUENOW, value.toString());\n }\n }\n\n getProgress() {\n return this.progress;\n }\n\n setBuffer(value: number) {\n this.buffer = value;\n if (this.isDeterminate) {\n this.setBufferBarProgress(value);\n }\n }\n\n setReverse(isReversed: boolean) {\n this.isReversed = isReversed;\n\n if (!this.isDeterminate) {\n // Adding INDETERMINATE_CLASS starts a scale animation, while\n // adding/removing REVERSED_CLASS starts a translate animation. Here, we\n // reset the scale animation in order to keep it in sync with the new\n // translate animation that will start from adding/removing REVERSED_CLASS\n // below.\n this.adapter.removeClass(cssClasses.INDETERMINATE_CLASS);\n this.adapter.forceLayout();\n this.adapter.addClass(cssClasses.INDETERMINATE_CLASS);\n }\n\n if (this.isReversed) {\n this.adapter.addClass(cssClasses.REVERSED_CLASS);\n return;\n }\n\n this.adapter.removeClass(cssClasses.REVERSED_CLASS);\n }\n\n open() {\n this.adapter.removeClass(cssClasses.CLOSED_CLASS);\n }\n\n close() {\n this.adapter.addClass(cssClasses.CLOSED_CLASS);\n }\n\n private setPrimaryBarProgress(progressValue: number) {\n const value = `scaleX(${progressValue})`;\n\n // Accessing `window` without a `typeof` check will throw on Node environments.\n const transformProp = typeof window !== 'undefined' ?\n getCorrectPropertyName(window, 'transform') : 'transform';\n this.adapter.setPrimaryBarStyle(transformProp, value);\n }\n\n private setBufferBarProgress(progressValue: number) {\n const value = `${progressValue * 100}%`;\n this.adapter.setBufferBarStyle(strings.FLEX_BASIS, value);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCLinearProgressFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {closest, matches} from '@material/dom/ponyfill';\nimport {MDCListAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\nimport {MDCListFoundation} from './foundation';\nimport {MDCListActionEventDetail, MDCListIndex} from './types';\n\nexport type MDCListFactory = (el: Element, foundation?: MDCListFoundation) => MDCList;\n\nexport class MDCList extends MDCComponent<MDCListFoundation> {\n set vertical(value: boolean) {\n this.foundation.setVerticalOrientation(value);\n }\n\n get listElements(): Element[] {\n return [].slice.call(\n this.root.querySelectorAll(`.${cssClasses.LIST_ITEM_CLASS}`));\n }\n\n set wrapFocus(value: boolean) {\n this.foundation.setWrapFocus(value);\n }\n\n /**\n * @return Whether typeahead is currently matching a user-specified prefix.\n */\n get typeaheadInProgress(): boolean {\n return this.foundation.isTypeaheadInProgress();\n }\n\n /**\n * Sets whether typeahead functionality is enabled on the list.\n * @param hasTypeahead Whether typeahead is enabled.\n */\n set hasTypeahead(hasTypeahead: boolean) {\n this.foundation.setHasTypeahead(hasTypeahead);\n }\n\n set singleSelection(isSingleSelectionList: boolean) {\n this.foundation.setSingleSelection(isSingleSelectionList);\n }\n\n get selectedIndex(): MDCListIndex {\n return this.foundation.getSelectedIndex();\n }\n\n set selectedIndex(index: MDCListIndex) {\n this.foundation.setSelectedIndex(index);\n }\n\n static attachTo(root: Element) {\n return new MDCList(root);\n }\n\n private handleKeydown_!: SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n private handleClick_!: SpecificEventListener<'click'>; // assigned in initialSyncWithDOM()\n private focusInEventListener_!: SpecificEventListener<'focus'>; // assigned in initialSyncWithDOM()\n private focusOutEventListener_!: SpecificEventListener<'focus'>; // assigned in initialSyncWithDOM()\n\n initialSyncWithDOM() {\n this.handleClick_ = this.handleClickEvent_.bind(this);\n this.handleKeydown_ = this.handleKeydownEvent_.bind(this);\n this.focusInEventListener_ = this.handleFocusInEvent_.bind(this);\n this.focusOutEventListener_ = this.handleFocusOutEvent_.bind(this);\n this.listen('keydown', this.handleKeydown_);\n this.listen('click', this.handleClick_);\n this.listen('focusin', this.focusInEventListener_);\n this.listen('focusout', this.focusOutEventListener_);\n this.layout();\n this.initializeListType();\n }\n\n destroy() {\n this.unlisten('keydown', this.handleKeydown_);\n this.unlisten('click', this.handleClick_);\n this.unlisten('focusin', this.focusInEventListener_);\n this.unlisten('focusout', this.focusOutEventListener_);\n }\n\n layout() {\n const direction = this.root.getAttribute(strings.ARIA_ORIENTATION);\n this.vertical = direction !== strings.ARIA_ORIENTATION_HORIZONTAL;\n\n // List items need to have at least tabindex=-1 to be focusable.\n [].slice.call(this.root.querySelectorAll('.mdc-list-item:not([tabindex])'))\n .forEach((el: Element) => {\n el.setAttribute('tabindex', '-1');\n });\n\n // Child button/a elements are not tabbable until the list item is focused.\n [].slice.call(this.root.querySelectorAll(strings.FOCUSABLE_CHILD_ELEMENTS))\n .forEach((el: Element) => el.setAttribute('tabindex', '-1'));\n\n this.foundation.layout();\n }\n\n /**\n * Extracts the primary text from a list item.\n * @param item The list item element.\n * @return The primary text in the element.\n */\n getPrimaryText(item: Element): string {\n const primaryText =\n item.querySelector(`.${cssClasses.LIST_ITEM_PRIMARY_TEXT_CLASS}`);\n if (primaryText) {\n return primaryText.textContent || '';\n }\n\n const singleLineText =\n item.querySelector(`.${cssClasses.LIST_ITEM_TEXT_CLASS}`);\n return (singleLineText && singleLineText.textContent) || '';\n }\n\n /**\n * Initialize selectedIndex value based on pre-selected checkbox list items, single selection or radio.\n */\n initializeListType() {\n const checkboxListItems =\n this.root.querySelectorAll(strings.ARIA_ROLE_CHECKBOX_SELECTOR);\n const singleSelectedListItem = this.root.querySelector(`\n .${cssClasses.LIST_ITEM_ACTIVATED_CLASS},\n .${cssClasses.LIST_ITEM_SELECTED_CLASS}\n `);\n const radioSelectedListItem =\n this.root.querySelector(strings.ARIA_CHECKED_RADIO_SELECTOR);\n\n if (checkboxListItems.length) {\n const preselectedItems =\n this.root.querySelectorAll(strings.ARIA_CHECKED_CHECKBOX_SELECTOR);\n this.selectedIndex =\n [].map.call(preselectedItems, (listItem: Element) => this.listElements.indexOf(listItem)) as number[];\n } else if (singleSelectedListItem) {\n if (singleSelectedListItem.classList.contains(cssClasses.LIST_ITEM_ACTIVATED_CLASS)) {\n this.foundation.setUseActivatedClass(true);\n }\n\n this.singleSelection = true;\n this.selectedIndex = this.listElements.indexOf(singleSelectedListItem);\n } else if (radioSelectedListItem) {\n this.selectedIndex = this.listElements.indexOf(radioSelectedListItem);\n }\n }\n\n /**\n * Updates the list item at itemIndex to the desired isEnabled state.\n * @param itemIndex Index of the list item\n * @param isEnabled Sets the list item to enabled or disabled.\n */\n setEnabled(itemIndex: number, isEnabled: boolean) {\n this.foundation.setEnabled(itemIndex, isEnabled);\n }\n\n /**\n * Given the next desired character from the user, adds it to the typeahead\n * buffer. Then, attempts to find the next option matching the buffer. Wraps\n * around if at the end of options.\n *\n * @param nextChar The next character to add to the prefix buffer.\n * @param startingIndex The index from which to start matching. Defaults to\n * the currently focused index.\n * @return The index of the matched item.\n */\n typeaheadMatchItem(nextChar: string, startingIndex?: number): number {\n return this.foundation.typeaheadMatchItem(\n nextChar, startingIndex, /** skipFocus */ true);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCListAdapter = {\n addClassForElementIndex: (index, className) => {\n const element = this.listElements[index];\n if (element) {\n element.classList.add(className);\n }\n },\n focusItemAtIndex: (index) => {\n const element = this.listElements[index] as HTMLElement | undefined;\n if (element) {\n element.focus();\n }\n },\n getAttributeForElementIndex: (index, attr) =>\n this.listElements[index].getAttribute(attr),\n getFocusedElementIndex: () =>\n this.listElements.indexOf(document.activeElement!),\n getListItemCount: () => this.listElements.length,\n getPrimaryTextAtIndex: (index) =>\n this.getPrimaryText(this.listElements[index]),\n hasCheckboxAtIndex: (index) => {\n const listItem = this.listElements[index];\n return !!listItem.querySelector(strings.CHECKBOX_SELECTOR);\n },\n hasRadioAtIndex: (index) => {\n const listItem = this.listElements[index];\n return !!listItem.querySelector(strings.RADIO_SELECTOR);\n },\n isCheckboxCheckedAtIndex: (index) => {\n const listItem = this.listElements[index];\n const toggleEl = listItem.querySelector<HTMLInputElement>(strings.CHECKBOX_SELECTOR);\n return toggleEl!.checked;\n },\n isFocusInsideList: () => {\n return this.root.contains(document.activeElement);\n },\n isRootFocused: () => document.activeElement === this.root,\n listItemAtIndexHasClass: (index, className) =>\n this.listElements[index].classList.contains(className),\n notifyAction: (index) => {\n this.emit<MDCListActionEventDetail>(strings.ACTION_EVENT, {index}, /** shouldBubble */ true);\n },\n removeClassForElementIndex: (index, className) => {\n const element = this.listElements[index];\n if (element) {\n element.classList.remove(className);\n }\n },\n setAttributeForElementIndex: (index, attr, value) => {\n const element = this.listElements[index];\n if (element) {\n element.setAttribute(attr, value);\n }\n },\n setCheckedCheckboxOrRadioAtIndex: (index, isChecked) => {\n const listItem = this.listElements[index];\n const toggleEl = listItem.querySelector<HTMLInputElement>(strings.CHECKBOX_RADIO_SELECTOR);\n toggleEl!.checked = isChecked;\n\n const event = document.createEvent('Event');\n event.initEvent('change', true, true);\n toggleEl!.dispatchEvent(event);\n },\n setTabIndexForListItemChildren: (listItemIndex, tabIndexValue) => {\n const element = this.listElements[listItemIndex];\n const listItemChildren: Element[] =\n [].slice.call(element.querySelectorAll(strings.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX));\n listItemChildren.forEach((el) => el.setAttribute('tabindex', tabIndexValue));\n },\n };\n return new MDCListFoundation(adapter);\n }\n\n /**\n * Used to figure out which list item this event is targetting. Or returns -1 if\n * there is no list item\n */\n private getListItemIndex_(evt: Event) {\n const eventTarget = evt.target as Element;\n const nearestParent = closest(eventTarget, `.${cssClasses.LIST_ITEM_CLASS}, .${cssClasses.ROOT}`);\n\n // Get the index of the element if it is a list item.\n if (nearestParent && matches(nearestParent, `.${cssClasses.LIST_ITEM_CLASS}`)) {\n return this.listElements.indexOf(nearestParent);\n }\n\n return -1;\n }\n\n /**\n * Used to figure out which element was clicked before sending the event to the foundation.\n */\n private handleFocusInEvent_(evt: FocusEvent) {\n const index = this.getListItemIndex_(evt);\n this.foundation.handleFocusIn(evt, index);\n }\n\n /**\n * Used to figure out which element was clicked before sending the event to the foundation.\n */\n private handleFocusOutEvent_(evt: FocusEvent) {\n const index = this.getListItemIndex_(evt);\n this.foundation.handleFocusOut(evt, index);\n }\n\n /**\n * Used to figure out which element was focused when keydown event occurred before sending the event to the\n * foundation.\n */\n private handleKeydownEvent_(evt: KeyboardEvent) {\n const index = this.getListItemIndex_(evt);\n const target = evt.target as Element;\n this.foundation.handleKeydown(\n evt, target.classList.contains(cssClasses.LIST_ITEM_CLASS), index);\n }\n\n /**\n * Used to figure out which element was clicked before sending the event to the foundation.\n */\n private handleClickEvent_(evt: MouseEvent) {\n const index = this.getListItemIndex_(evt);\n const target = evt.target as Element;\n\n // Toggle the checkbox only if it's not the target of the event, or the checkbox will have 2 change events.\n const toggleCheckbox = !matches(target, strings.CHECKBOX_RADIO_SELECTOR);\n this.foundation.handleClick(index, toggleCheckbox);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n LIST_ITEM_ACTIVATED_CLASS: 'mdc-list-item--activated',\n LIST_ITEM_CLASS: 'mdc-list-item',\n LIST_ITEM_DISABLED_CLASS: 'mdc-list-item--disabled',\n LIST_ITEM_SELECTED_CLASS: 'mdc-list-item--selected',\n LIST_ITEM_TEXT_CLASS: 'mdc-list-item__text',\n LIST_ITEM_PRIMARY_TEXT_CLASS: 'mdc-list-item__primary-text',\n ROOT: 'mdc-list',\n};\n\nconst strings = {\n ACTION_EVENT: 'MDCList:action',\n ARIA_CHECKED: 'aria-checked',\n ARIA_CHECKED_CHECKBOX_SELECTOR: '[role=\"checkbox\"][aria-checked=\"true\"]',\n ARIA_CHECKED_RADIO_SELECTOR: '[role=\"radio\"][aria-checked=\"true\"]',\n ARIA_CURRENT: 'aria-current',\n ARIA_DISABLED: 'aria-disabled',\n ARIA_ORIENTATION: 'aria-orientation',\n ARIA_ORIENTATION_HORIZONTAL: 'horizontal',\n ARIA_ROLE_CHECKBOX_SELECTOR: '[role=\"checkbox\"]',\n ARIA_SELECTED: 'aria-selected',\n CHECKBOX_RADIO_SELECTOR: 'input[type=\"checkbox\"], input[type=\"radio\"]',\n CHECKBOX_SELECTOR: 'input[type=\"checkbox\"]',\n CHILD_ELEMENTS_TO_TOGGLE_TABINDEX: `\n .${cssClasses.LIST_ITEM_CLASS} button:not(:disabled),\n .${cssClasses.LIST_ITEM_CLASS} a\n `,\n FOCUSABLE_CHILD_ELEMENTS: `\n .${cssClasses.LIST_ITEM_CLASS} button:not(:disabled),\n .${cssClasses.LIST_ITEM_CLASS} a,\n .${cssClasses.LIST_ITEM_CLASS} input[type=\"radio\"]:not(:disabled),\n .${cssClasses.LIST_ITEM_CLASS} input[type=\"checkbox\"]:not(:disabled)\n `,\n RADIO_SELECTOR: 'input[type=\"radio\"]',\n};\n\nconst numbers = {\n UNSET_INDEX: -1,\n TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS: 300\n};\n\nexport {strings, cssClasses, numbers};\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst ELEMENTS_KEY_ALLOWED_IN = ['input', 'button', 'textarea', 'select'];\n\n/**\n * Ensures that preventDefault is only called if the containing element\n * doesn't consume the event, and it will cause an unintended scroll.\n *\n * @param evt keyboard event to be prevented.\n */\nexport const preventDefaultEvent = (evt: KeyboardEvent) => {\n const target = evt.target as Element;\n if (!target) {\n return;\n }\n const tagName = `${target.tagName}`.toLowerCase();\n if (ELEMENTS_KEY_ALLOWED_IN.indexOf(tagName) === -1) {\n evt.preventDefault();\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {normalizeKey} from '@material/dom/keyboard';\n\nimport {MDCListAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\nimport * as typeahead from './typeahead';\nimport {MDCListIndex, MDCListTextAndIndex} from './types';\nimport {preventDefaultEvent} from './events';\n\nfunction isNumberArray(selectedIndex: MDCListIndex): selectedIndex is number[] {\n return selectedIndex instanceof Array;\n}\n\nexport class MDCListFoundation extends MDCFoundation<MDCListAdapter> {\n static get strings() {\n return strings;\n }\n\n static get cssClasses() {\n return cssClasses;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get defaultAdapter(): MDCListAdapter {\n return {\n addClassForElementIndex: () => undefined,\n focusItemAtIndex: () => undefined,\n getAttributeForElementIndex: () => null,\n getFocusedElementIndex: () => 0,\n getListItemCount: () => 0,\n hasCheckboxAtIndex: () => false,\n hasRadioAtIndex: () => false,\n isCheckboxCheckedAtIndex: () => false,\n isFocusInsideList: () => false,\n isRootFocused: () => false,\n listItemAtIndexHasClass: () => false,\n notifyAction: () => undefined,\n removeClassForElementIndex: () => undefined,\n setAttributeForElementIndex: () => undefined,\n setCheckedCheckboxOrRadioAtIndex: () => undefined,\n setTabIndexForListItemChildren: () => undefined,\n getPrimaryTextAtIndex: () => '',\n };\n }\n\n private wrapFocus_ = false;\n private isVertical_ = true;\n private isSingleSelectionList_ = false;\n private selectedIndex_: MDCListIndex = numbers.UNSET_INDEX;\n private focusedItemIndex = numbers.UNSET_INDEX;\n private useActivatedClass_ = false;\n private ariaCurrentAttrValue_: string | null = null;\n private isCheckboxList_ = false;\n private isRadioList_ = false;\n\n private hasTypeahead = false;\n // Transiently holds current typeahead prefix from user.\n private readonly typeaheadState = typeahead.initState();\n private sortedIndexByFirstChar = new Map<string, MDCListTextAndIndex[]>();\n\n constructor(adapter?: Partial<MDCListAdapter>) {\n super({...MDCListFoundation.defaultAdapter, ...adapter});\n }\n\n layout() {\n if (this.adapter.getListItemCount() === 0) {\n return;\n }\n\n if (this.adapter.hasCheckboxAtIndex(0)) {\n this.isCheckboxList_ = true;\n } else if (this.adapter.hasRadioAtIndex(0)) {\n this.isRadioList_ = true;\n }\n\n if (this.hasTypeahead) {\n this.sortedIndexByFirstChar = this.typeaheadInitSortedIndex();\n }\n }\n\n /**\n * Sets the private wrapFocus_ variable.\n */\n setWrapFocus(value: boolean) {\n this.wrapFocus_ = value;\n }\n\n /**\n * Sets the isVertical_ private variable.\n */\n setVerticalOrientation(value: boolean) {\n this.isVertical_ = value;\n }\n\n /**\n * Sets the isSingleSelectionList_ private variable.\n */\n setSingleSelection(value: boolean) {\n this.isSingleSelectionList_ = value;\n }\n\n /**\n * Sets whether typeahead is enabled on the list.\n * @param hasTypeahead Whether typeahead is enabled.\n */\n setHasTypeahead(hasTypeahead: boolean) {\n this.hasTypeahead = hasTypeahead;\n if (hasTypeahead) {\n this.sortedIndexByFirstChar = this.typeaheadInitSortedIndex();\n }\n }\n\n /**\n * @return Whether typeahead is currently matching a user-specified prefix.\n */\n isTypeaheadInProgress(): boolean {\n return this.hasTypeahead &&\n typeahead.isTypingInProgress(this.typeaheadState);\n }\n\n /**\n * Sets the useActivatedClass_ private variable.\n */\n setUseActivatedClass(useActivated: boolean) {\n this.useActivatedClass_ = useActivated;\n }\n\n getSelectedIndex(): MDCListIndex {\n return this.selectedIndex_;\n }\n\n setSelectedIndex(index: MDCListIndex) {\n if (!this.isIndexValid_(index)) {\n return;\n }\n\n if (this.isCheckboxList_) {\n this.setCheckboxAtIndex_(index as number[]);\n } else if (this.isRadioList_) {\n this.setRadioAtIndex_(index as number);\n } else {\n this.setSingleSelectionAtIndex_(index as number);\n }\n }\n\n /**\n * Focus in handler for the list items.\n */\n handleFocusIn(_: FocusEvent, listItemIndex: number) {\n if (listItemIndex >= 0) {\n this.focusedItemIndex = listItemIndex;\n this.adapter.setTabIndexForListItemChildren(listItemIndex, '0');\n }\n }\n\n /**\n * Focus out handler for the list items.\n */\n handleFocusOut(_: FocusEvent, listItemIndex: number) {\n if (listItemIndex >= 0) {\n this.adapter.setTabIndexForListItemChildren(listItemIndex, '-1');\n }\n\n /**\n * Between Focusout & Focusin some browsers do not have focus on any element. Setting a delay to wait till the focus\n * is moved to next element.\n */\n setTimeout(() => {\n if (!this.adapter.isFocusInsideList()) {\n this.setTabindexToFirstSelectedItem_();\n }\n }, 0);\n }\n\n /**\n * Key handler for the list.\n */\n handleKeydown(\n event: KeyboardEvent, isRootListItem: boolean, listItemIndex: number) {\n const isArrowLeft = normalizeKey(event) === 'ArrowLeft';\n const isArrowUp = normalizeKey(event) === 'ArrowUp';\n const isArrowRight = normalizeKey(event) === 'ArrowRight';\n const isArrowDown = normalizeKey(event) === 'ArrowDown';\n const isHome = normalizeKey(event) === 'Home';\n const isEnd = normalizeKey(event) === 'End';\n const isEnter = normalizeKey(event) === 'Enter';\n const isSpace = normalizeKey(event) === 'Spacebar';\n\n if (this.adapter.isRootFocused()) {\n if (isArrowUp || isEnd) {\n event.preventDefault();\n this.focusLastElement();\n } else if (isArrowDown || isHome) {\n event.preventDefault();\n this.focusFirstElement();\n }\n\n if (this.hasTypeahead) {\n const handleKeydownOpts: typeahead.HandleKeydownOpts = {\n event,\n focusItemAtIndex: (index) => {\n this.focusItemAtIndex(index)\n },\n focusedItemIndex: -1,\n isTargetListItem: isRootListItem,\n sortedIndexByFirstChar: this.sortedIndexByFirstChar,\n isItemAtIndexDisabled: (index) =>\n this.adapter.listItemAtIndexHasClass(\n index, cssClasses.LIST_ITEM_DISABLED_CLASS),\n };\n\n typeahead.handleKeydown(handleKeydownOpts, this.typeaheadState);\n }\n\n return;\n }\n\n let currentIndex = this.adapter.getFocusedElementIndex();\n if (currentIndex === -1) {\n currentIndex = listItemIndex;\n if (currentIndex < 0) {\n // If this event doesn't have a mdc-list-item ancestor from the\n // current list (not from a sublist), return early.\n return;\n }\n }\n\n if ((this.isVertical_ && isArrowDown) || (!this.isVertical_ && isArrowRight)) {\n preventDefaultEvent(event);\n this.focusNextElement(currentIndex);\n } else if ((this.isVertical_ && isArrowUp) || (!this.isVertical_ && isArrowLeft)) {\n preventDefaultEvent(event);\n this.focusPrevElement(currentIndex);\n } else if (isHome) {\n preventDefaultEvent(event);\n this.focusFirstElement();\n } else if (isEnd) {\n preventDefaultEvent(event);\n this.focusLastElement();\n } else if (isEnter || isSpace) {\n if (isRootListItem) {\n // Return early if enter key is pressed on anchor element which triggers synthetic MouseEvent event.\n const target = event.target as Element | null;\n if (target && target.tagName === 'A' && isEnter) {\n return;\n }\n preventDefaultEvent(event);\n\n if (this.adapter.listItemAtIndexHasClass(\n currentIndex, cssClasses.LIST_ITEM_DISABLED_CLASS)) {\n return;\n }\n\n if (!this.isTypeaheadInProgress()) {\n if (this.isSelectableList_()) {\n this.setSelectedIndexOnAction_(currentIndex);\n }\n this.adapter.notifyAction(currentIndex);\n }\n }\n }\n\n if (this.hasTypeahead) {\n const handleKeydownOpts: typeahead.HandleKeydownOpts = {\n event,\n focusItemAtIndex: (index) => {\n this.focusItemAtIndex(index)\n },\n focusedItemIndex: this.focusedItemIndex,\n isTargetListItem: isRootListItem,\n sortedIndexByFirstChar: this.sortedIndexByFirstChar,\n isItemAtIndexDisabled: (index) => this.adapter.listItemAtIndexHasClass(\n index, cssClasses.LIST_ITEM_DISABLED_CLASS),\n };\n\n typeahead.handleKeydown(handleKeydownOpts, this.typeaheadState);\n }\n }\n\n /**\n * Click handler for the list.\n */\n handleClick(index: number, toggleCheckbox: boolean) {\n if (index === numbers.UNSET_INDEX) {\n return;\n }\n\n this.setTabindexAtIndex_(index);\n this.focusedItemIndex = index;\n\n if (this.adapter.listItemAtIndexHasClass(\n index, cssClasses.LIST_ITEM_DISABLED_CLASS)) {\n return;\n }\n if (this.isSelectableList_()) {\n this.setSelectedIndexOnAction_(index, toggleCheckbox);\n }\n\n this.adapter.notifyAction(index);\n }\n\n /**\n * Focuses the next element on the list.\n */\n focusNextElement(index: number) {\n const count = this.adapter.getListItemCount();\n let nextIndex = index + 1;\n if (nextIndex >= count) {\n if (this.wrapFocus_) {\n nextIndex = 0;\n } else {\n // Return early because last item is already focused.\n return index;\n }\n }\n this.focusItemAtIndex(nextIndex);\n\n return nextIndex;\n }\n\n /**\n * Focuses the previous element on the list.\n */\n focusPrevElement(index: number) {\n let prevIndex = index - 1;\n if (prevIndex < 0) {\n if (this.wrapFocus_) {\n prevIndex = this.adapter.getListItemCount() - 1;\n } else {\n // Return early because first item is already focused.\n return index;\n }\n }\n this.focusItemAtIndex(prevIndex);\n return prevIndex;\n }\n\n focusFirstElement() {\n this.focusItemAtIndex(0);\n return 0;\n }\n\n focusLastElement() {\n const lastIndex = this.adapter.getListItemCount() - 1;\n this.focusItemAtIndex(lastIndex);\n return lastIndex;\n }\n\n /**\n * @param itemIndex Index of the list item\n * @param isEnabled Sets the list item to enabled or disabled.\n */\n setEnabled(itemIndex: number, isEnabled: boolean): void {\n if (!this.isIndexValid_(itemIndex)) {\n return;\n }\n\n if (isEnabled) {\n this.adapter.removeClassForElementIndex(\n itemIndex, cssClasses.LIST_ITEM_DISABLED_CLASS);\n this.adapter.setAttributeForElementIndex(\n itemIndex, strings.ARIA_DISABLED, 'false');\n } else {\n this.adapter.addClassForElementIndex(\n itemIndex, cssClasses.LIST_ITEM_DISABLED_CLASS);\n this.adapter.setAttributeForElementIndex(\n itemIndex, strings.ARIA_DISABLED, 'true');\n }\n }\n\n\n private setSingleSelectionAtIndex_(index: number) {\n if (this.selectedIndex_ === index) {\n return;\n }\n\n let selectedClassName = cssClasses.LIST_ITEM_SELECTED_CLASS;\n if (this.useActivatedClass_) {\n selectedClassName = cssClasses.LIST_ITEM_ACTIVATED_CLASS;\n }\n\n if (this.selectedIndex_ !== numbers.UNSET_INDEX) {\n this.adapter.removeClassForElementIndex(\n this.selectedIndex_ as number, selectedClassName);\n }\n this.adapter.addClassForElementIndex(index, selectedClassName);\n this.setAriaForSingleSelectionAtIndex_(index);\n\n this.selectedIndex_ = index;\n }\n\n /**\n * Sets aria attribute for single selection at given index.\n */\n private setAriaForSingleSelectionAtIndex_(index: number) {\n // Detect the presence of aria-current and get the value only during list initialization when it is in unset state.\n if (this.selectedIndex_ === numbers.UNSET_INDEX) {\n this.ariaCurrentAttrValue_ =\n this.adapter.getAttributeForElementIndex(index, strings.ARIA_CURRENT);\n }\n\n const isAriaCurrent = this.ariaCurrentAttrValue_ !== null;\n const ariaAttribute = isAriaCurrent ? strings.ARIA_CURRENT : strings.ARIA_SELECTED;\n\n if (this.selectedIndex_ !== numbers.UNSET_INDEX) {\n this.adapter.setAttributeForElementIndex(\n this.selectedIndex_ as number, ariaAttribute, 'false');\n }\n\n const ariaAttributeValue = isAriaCurrent ? this.ariaCurrentAttrValue_ : 'true';\n this.adapter.setAttributeForElementIndex(\n index, ariaAttribute, ariaAttributeValue as string);\n }\n\n /**\n * Toggles radio at give index. Radio doesn't change the checked state if it is already checked.\n */\n private setRadioAtIndex_(index: number) {\n this.adapter.setCheckedCheckboxOrRadioAtIndex(index, true);\n\n if (this.selectedIndex_ !== numbers.UNSET_INDEX) {\n this.adapter.setAttributeForElementIndex(\n this.selectedIndex_ as number, strings.ARIA_CHECKED, 'false');\n }\n\n this.adapter.setAttributeForElementIndex(\n index, strings.ARIA_CHECKED, 'true');\n\n this.selectedIndex_ = index;\n }\n\n private setCheckboxAtIndex_(index: number[]) {\n for (let i = 0; i < this.adapter.getListItemCount(); i++) {\n let isChecked = false;\n if (index.indexOf(i) >= 0) {\n isChecked = true;\n }\n\n this.adapter.setCheckedCheckboxOrRadioAtIndex(i, isChecked);\n this.adapter.setAttributeForElementIndex(\n i, strings.ARIA_CHECKED, isChecked ? 'true' : 'false');\n }\n\n this.selectedIndex_ = index;\n }\n\n private setTabindexAtIndex_(index: number) {\n if (this.focusedItemIndex === numbers.UNSET_INDEX && index !== 0) {\n // If no list item was selected set first list item's tabindex to -1.\n // Generally, tabindex is set to 0 on first list item of list that has no preselected items.\n this.adapter.setAttributeForElementIndex(0, 'tabindex', '-1');\n } else if (this.focusedItemIndex >= 0 && this.focusedItemIndex !== index) {\n this.adapter.setAttributeForElementIndex(\n this.focusedItemIndex, 'tabindex', '-1');\n }\n\n this.adapter.setAttributeForElementIndex(index, 'tabindex', '0');\n }\n\n /**\n * @return Return true if it is single selectin list, checkbox list or radio list.\n */\n private isSelectableList_() {\n return this.isSingleSelectionList_ || this.isCheckboxList_ || this.isRadioList_;\n }\n\n private setTabindexToFirstSelectedItem_() {\n let targetIndex = 0;\n\n if (this.isSelectableList_()) {\n if (typeof this.selectedIndex_ === 'number' && this.selectedIndex_ !== numbers.UNSET_INDEX) {\n targetIndex = this.selectedIndex_;\n } else if (isNumberArray(this.selectedIndex_) && this.selectedIndex_.length > 0) {\n targetIndex = this.selectedIndex_.reduce((currentIndex, minIndex) => Math.min(currentIndex, minIndex));\n }\n }\n\n this.setTabindexAtIndex_(targetIndex);\n }\n\n private isIndexValid_(index: MDCListIndex) {\n if (index instanceof Array) {\n if (!this.isCheckboxList_) {\n throw new Error('MDCListFoundation: Array of index is only supported for checkbox based list');\n }\n\n if (index.length === 0) {\n return true;\n } else {\n return index.some((i) => this.isIndexInRange_(i));\n }\n } else if (typeof index === 'number') {\n if (this.isCheckboxList_) {\n throw new Error('MDCListFoundation: Expected array of index for checkbox based list but got number: ' + index);\n }\n return this.isIndexInRange_(index);\n } else {\n return false;\n }\n }\n\n private isIndexInRange_(index: number) {\n const listSize = this.adapter.getListItemCount();\n return index >= 0 && index < listSize;\n }\n\n /**\n * Sets selected index on user action, toggles checkbox / radio based on toggleCheckbox value.\n * User interaction should not toggle list item(s) when disabled.\n */\n private setSelectedIndexOnAction_(index: number, toggleCheckbox = true) {\n if (this.isCheckboxList_) {\n this.toggleCheckboxAtIndex_(index, toggleCheckbox);\n } else {\n this.setSelectedIndex(index);\n }\n }\n\n private toggleCheckboxAtIndex_(index: number, toggleCheckbox: boolean) {\n let isChecked = this.adapter.isCheckboxCheckedAtIndex(index);\n\n if (toggleCheckbox) {\n isChecked = !isChecked;\n this.adapter.setCheckedCheckboxOrRadioAtIndex(index, isChecked);\n }\n\n this.adapter.setAttributeForElementIndex(\n index, strings.ARIA_CHECKED, isChecked ? 'true' : 'false');\n\n // If none of the checkbox items are selected and selectedIndex is not initialized then provide a default value.\n let selectedIndexes = this.selectedIndex_ === numbers.UNSET_INDEX ? [] : (this.selectedIndex_ as number[]).slice();\n\n if (isChecked) {\n selectedIndexes.push(index);\n } else {\n selectedIndexes = selectedIndexes.filter((i) => i !== index);\n }\n\n this.selectedIndex_ = selectedIndexes;\n }\n\n private focusItemAtIndex(index: number) {\n this.setTabindexAtIndex_(index);\n this.adapter.focusItemAtIndex(index);\n this.focusedItemIndex = index;\n }\n\n /**\n * Given the next desired character from the user, adds it to the typeahead\n * buffer. Then, attempts to find the next option matching the buffer. Wraps\n * around if at the end of options.\n *\n * @param nextChar The next character to add to the prefix buffer.\n * @param startingIndex The index from which to start matching. Only relevant\n * when starting a new match sequence. To start a new match sequence,\n * clear the buffer using `clearTypeaheadBuffer`, or wait for the buffer\n * to clear after a set interval defined in list foundation. Defaults to\n * the currently focused index.\n * @return The index of the matched item, or -1 if no match.\n */\n typeaheadMatchItem(\n nextChar: string, startingIndex?: number, skipFocus = false) {\n const opts: typeahead.TypeaheadMatchItemOpts = {\n focusItemAtIndex: (index) => {\n this.focusItemAtIndex(index)\n },\n focusedItemIndex: startingIndex ? startingIndex : this.focusedItemIndex,\n nextChar,\n sortedIndexByFirstChar: this.sortedIndexByFirstChar,\n skipFocus,\n isItemAtIndexDisabled: (index) => this.adapter.listItemAtIndexHasClass(\n index, cssClasses.LIST_ITEM_DISABLED_CLASS)\n };\n return typeahead.matchItem(opts, this.typeaheadState);\n }\n\n /**\n * Initializes the MDCListTextAndIndex data structure by indexing the current\n * list items by primary text.\n *\n * @return The primary texts of all the list items sorted by first character.\n */\n private typeaheadInitSortedIndex() {\n return typeahead.initSortedIndex(\n this.adapter.getListItemCount(), this.adapter.getPrimaryTextAtIndex);\n }\n\n /**\n * Clears the typeahead buffer.\n */\n clearTypeaheadBuffer() {\n typeahead.clearBuffer(this.typeaheadState);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCListFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {normalizeKey} from '@material/dom/keyboard';\n\nimport {numbers} from './constants';\nimport {preventDefaultEvent} from './events';\nimport {MDCListTextAndIndex} from './types';\n\n/**\n * State of a typeahead instance.\n */\nexport interface TypeaheadState {\n typeaheadBuffer: string;\n currentFirstChar: string;\n sortedIndexCursor: number;\n bufferClearTimeout: number;\n}\n\n/**\n * Initializes a state object for typeahead. Use the same reference for calls to\n * typeahead functions.\n *\n * @return The current state of the typeahead process. Each state reference\n * represents a typeahead instance as the reference is typically mutated\n * in-place.\n */\nexport function initState(): TypeaheadState {\n const state: TypeaheadState = {\n bufferClearTimeout: 0,\n currentFirstChar: '',\n sortedIndexCursor: 0,\n typeaheadBuffer: '',\n };\n return state;\n}\n\n/**\n * Initializes typeahead state by indexing the current list items by primary\n * text into the sortedIndexByFirstChar data structure.\n *\n * @param listItemCount numer of items in the list\n * @param getPrimaryTextByItemIndex function that returns the primary text at a\n * given index\n *\n * @return Map that maps the first character of the primary text to the full\n * list text and it's index\n */\nexport function initSortedIndex(\n listItemCount: number,\n getPrimaryTextByItemIndex: (index: number) =>\n string): Map<string, MDCListTextAndIndex[]> {\n const sortedIndexByFirstChar = new Map<string, MDCListTextAndIndex[]>();\n\n // Aggregate item text to index mapping\n for (let i = 0; i < listItemCount; i++) {\n const primaryText = getPrimaryTextByItemIndex(i).trim();\n if (!primaryText) {\n continue;\n }\n\n const firstChar = primaryText[0].toLowerCase();\n if (!sortedIndexByFirstChar.has(firstChar)) {\n sortedIndexByFirstChar.set(firstChar, []);\n }\n sortedIndexByFirstChar.get(firstChar)!.push(\n {text: primaryText.toLowerCase(), index: i});\n }\n\n // Sort the mapping\n // TODO(b/157162694): Investigate replacing forEach with Map.values()\n sortedIndexByFirstChar.forEach((values) => {\n values.sort((first: MDCListTextAndIndex, second: MDCListTextAndIndex) => {\n return first.index - second.index;\n });\n });\n\n return sortedIndexByFirstChar;\n}\n\n/**\n * Arguments for matchItem\n */\nexport interface TypeaheadMatchItemOpts {\n focusItemAtIndex: (index: number) => void;\n nextChar: string;\n focusedItemIndex: number;\n sortedIndexByFirstChar: Map<string, MDCListTextAndIndex[]>;\n skipFocus: boolean;\n isItemAtIndexDisabled: (index: number) => boolean;\n}\n\n/**\n * Given the next desired character from the user, it attempts to find the next\n * list option matching the buffer. Wraps around if at the end of options.\n *\n * @param opts Options and accessors\n * - nextChar - the next character to match against items\n * - sortedIndexByFirstChar - output of `initSortedIndex(...)`\n * - focusedItemIndex - the index of the currently focused item\n * - focusItemAtIndex - function that focuses a list item at given index\n * - skipFocus - whether or not to focus the matched item\n * - isItemAtIndexDisabled - function that determines whether an item at a\n * given index is disabled\n * @param state The typeahead state instance. See `initState`.\n *\n * @return The index of the matched item, or -1 if no match.\n */\nexport function matchItem(\n opts: TypeaheadMatchItemOpts, state: TypeaheadState): number {\n const {\n nextChar,\n focusItemAtIndex,\n sortedIndexByFirstChar,\n focusedItemIndex,\n skipFocus,\n isItemAtIndexDisabled,\n } = opts;\n\n clearTimeout(state.bufferClearTimeout);\n\n state.bufferClearTimeout = setTimeout(() => {\n clearBuffer(state);\n }, numbers.TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS);\n\n state.typeaheadBuffer = state.typeaheadBuffer + nextChar;\n\n let index: number;\n if (state.typeaheadBuffer.length === 1) {\n index = matchFirstChar(\n sortedIndexByFirstChar, focusedItemIndex, isItemAtIndexDisabled, state);\n } else {\n index = matchAllChars(sortedIndexByFirstChar, isItemAtIndexDisabled, state);\n }\n\n if (index !== -1 && !skipFocus) {\n focusItemAtIndex(index);\n }\n return index;\n}\n\n/**\n * Matches the user's single input character in the buffer to the\n * next option that begins with such character. Wraps around if at\n * end of options. Returns -1 if no match is found.\n */\nfunction matchFirstChar(\n sortedIndexByFirstChar: Map<string, MDCListTextAndIndex[]>,\n focusedItemIndex: number, isItemAtIndexDisabled: (index: number) => boolean,\n state: TypeaheadState): number {\n const firstChar = state.typeaheadBuffer[0];\n const itemsMatchingFirstChar = sortedIndexByFirstChar.get(firstChar);\n if (!itemsMatchingFirstChar) {\n return -1;\n }\n\n // Has the same firstChar been recently matched?\n // Also, did starting index remain the same between key presses?\n // If both hold true, simply increment index.\n if (firstChar === state.currentFirstChar &&\n itemsMatchingFirstChar[state.sortedIndexCursor].index ===\n focusedItemIndex) {\n state.sortedIndexCursor =\n (state.sortedIndexCursor + 1) % itemsMatchingFirstChar.length;\n\n const newIndex = itemsMatchingFirstChar[state.sortedIndexCursor].index;\n if (!isItemAtIndexDisabled(newIndex)) {\n return newIndex;\n }\n }\n\n // If we're here, it means one of the following happened:\n // - either firstChar or startingIndex has changed, invalidating the\n // cursor.\n // - The next item of typeahead is disabled, so we have to look further.\n state.currentFirstChar = firstChar;\n\n let newCursorPosition = -1;\n let cursorPosition;\n // Find the first non-disabled item as a fallback.\n for (cursorPosition = 0; cursorPosition < itemsMatchingFirstChar.length;\n cursorPosition++) {\n if (!isItemAtIndexDisabled(itemsMatchingFirstChar[cursorPosition].index)) {\n newCursorPosition = cursorPosition;\n break;\n }\n }\n\n // Advance cursor to first item matching the firstChar that is positioned\n // after starting item. Cursor is unchanged from fallback if there's no\n // such item.\n for (; cursorPosition < itemsMatchingFirstChar.length; cursorPosition++) {\n if (itemsMatchingFirstChar[cursorPosition].index > focusedItemIndex &&\n !isItemAtIndexDisabled(itemsMatchingFirstChar[cursorPosition].index)) {\n newCursorPosition = cursorPosition;\n break;\n }\n }\n\n if (newCursorPosition !== -1) {\n state.sortedIndexCursor = newCursorPosition;\n return itemsMatchingFirstChar[state.sortedIndexCursor].index;\n }\n\n return -1;\n}\n\n/**\n * Attempts to find the next item that matches all of the typeahead buffer.\n * Wraps around if at end of options. Returns -1 if no match is found.\n */\nfunction matchAllChars(\n sortedIndexByFirstChar: Map<string, MDCListTextAndIndex[]>,\n isItemAtIndexDisabled: (index: number) => boolean,\n state: TypeaheadState): number {\n const firstChar = state.typeaheadBuffer[0];\n const itemsMatchingFirstChar = sortedIndexByFirstChar.get(firstChar);\n if (!itemsMatchingFirstChar) {\n return -1;\n }\n\n // Do nothing if text already matches\n const startingItem = itemsMatchingFirstChar[state.sortedIndexCursor];\n if (startingItem.text.lastIndexOf(state.typeaheadBuffer, 0) === 0 &&\n !isItemAtIndexDisabled(startingItem.index)) {\n return startingItem.index;\n }\n\n // Find next item that matches completely; if no match, we'll eventually\n // loop around to same position\n let cursorPosition =\n (state.sortedIndexCursor + 1) % itemsMatchingFirstChar.length;\n let nextCursorPosition = -1;\n while (cursorPosition !== state.sortedIndexCursor) {\n const currentItem = itemsMatchingFirstChar[cursorPosition];\n\n const matches =\n currentItem.text.lastIndexOf(state.typeaheadBuffer, 0) === 0;\n const isEnabled = !isItemAtIndexDisabled(currentItem.index);\n if (matches && isEnabled) {\n nextCursorPosition = cursorPosition;\n break;\n }\n\n cursorPosition = (cursorPosition + 1) % itemsMatchingFirstChar.length;\n }\n\n if (nextCursorPosition !== -1) {\n state.sortedIndexCursor = nextCursorPosition;\n return itemsMatchingFirstChar[state.sortedIndexCursor].index;\n }\n\n return -1;\n}\n\n/**\n * Whether or not the given typeahead instaance state is currently typing.\n *\n * @param state The typeahead state instance. See `initState`.\n */\nexport function isTypingInProgress(state: TypeaheadState) {\n return state.typeaheadBuffer.length > 0;\n}\n\n/**\n * Options for handleKeydown.\n */\nexport interface HandleKeydownOpts {\n event: KeyboardEvent;\n isTargetListItem: boolean;\n focusItemAtIndex: (index: number) => void;\n focusedItemIndex: number;\n sortedIndexByFirstChar: Map<string, MDCListTextAndIndex[]>;\n isItemAtIndexDisabled: (index: number) => boolean;\n}\n\n/**\n * Clears the typeahaed buffer so that it resets item matching to the first\n * character.\n *\n * @param state The typeahead state instance. See `initState`.\n */\nexport function clearBuffer(state: TypeaheadState) {\n state.typeaheadBuffer = '';\n}\n\n/**\n * Given a keydown event, it calculates whether or not to automatically focus a\n * list item depending on what was typed mimicing the typeahead functionality of\n * a standard <select> element that is open.\n *\n * @param opts Options and accessors\n * - event - the KeyboardEvent to handle and parse\n * - sortedIndexByFirstChar - output of `initSortedIndex(...)`\n * - focusedItemIndex - the index of the currently focused item\n * - focusItemAtIndex - function that focuses a list item at given index\n * - isItemAtFocusedIndexDisabled - whether or not the currently focused item\n * is disabled\n * - isTargetListItem - whether or not the event target is a list item\n * @param state The typeahead state instance. See `initState`.\n *\n * @returns index of the item matched by the keydown. -1 if not matched.\n */\nexport function handleKeydown(opts: HandleKeydownOpts, state: TypeaheadState) {\n const {\n event,\n isTargetListItem,\n focusedItemIndex,\n focusItemAtIndex,\n sortedIndexByFirstChar,\n isItemAtIndexDisabled,\n } = opts;\n\n const isArrowLeft = normalizeKey(event) === 'ArrowLeft';\n const isArrowUp = normalizeKey(event) === 'ArrowUp';\n const isArrowRight = normalizeKey(event) === 'ArrowRight';\n const isArrowDown = normalizeKey(event) === 'ArrowDown';\n const isHome = normalizeKey(event) === 'Home';\n const isEnd = normalizeKey(event) === 'End';\n const isEnter = normalizeKey(event) === 'Enter';\n const isSpace = normalizeKey(event) === 'Spacebar';\n\n if (isArrowLeft || isArrowUp || isArrowRight || isArrowDown || isHome ||\n isEnd || isEnter) {\n return -1;\n }\n\n const isCharacterKey = !isSpace && event.key.length === 1;\n\n if (isCharacterKey) {\n preventDefaultEvent(event);\n const matchItemOpts: TypeaheadMatchItemOpts = {\n focusItemAtIndex,\n focusedItemIndex,\n nextChar: event.key.toLowerCase(),\n sortedIndexByFirstChar,\n skipFocus: false,\n isItemAtIndexDisabled,\n };\n return matchItem(matchItemOpts, state);\n }\n\n if (!isSpace) {\n return -1;\n }\n\n if (isTargetListItem) {\n preventDefaultEvent(event);\n }\n\n const typeaheadOnListItem = isTargetListItem && isTypingInProgress(state);\n\n if (typeaheadOnListItem) {\n const matchItemOpts: TypeaheadMatchItemOpts = {\n focusItemAtIndex,\n focusedItemIndex,\n nextChar: ' ',\n sortedIndexByFirstChar,\n skipFocus: false,\n isItemAtIndexDisabled,\n };\n // space participates in typeahead matching if in rapid typing mode\n return matchItem(matchItemOpts, state);\n }\n\n return -1;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCMenuSurfaceAdapter} from './adapter';\nimport {Corner, cssClasses, strings} from './constants';\nimport {MDCMenuSurfaceFoundation} from './foundation';\nimport {MDCMenuDistance} from './types';\nimport * as util from './util';\n\ntype RegisterFunction = () => void;\n\nexport type MDCMenuSurfaceFactory = (el: Element, foundation?: MDCMenuSurfaceFoundation) => MDCMenuSurface;\n\nexport class MDCMenuSurface extends MDCComponent<MDCMenuSurfaceFoundation> {\n static attachTo(root: Element): MDCMenuSurface {\n return new MDCMenuSurface(root);\n }\n\n anchorElement!: Element | null; // assigned in initialSyncWithDOM()\n\n private previousFocus?: HTMLElement|SVGElement|null;\n\n private handleKeydown!:\n SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n private handleBodyClick!:\n SpecificEventListener<'click'>; // assigned in initialSyncWithDOM()\n\n private registerBodyClickListener!:\n RegisterFunction; // assigned in initialSyncWithDOM()\n private deregisterBodyClickListener!:\n RegisterFunction; // assigned in initialSyncWithDOM()\n\n initialSyncWithDOM() {\n const parentEl = this.root.parentElement;\n this.anchorElement = parentEl && parentEl.classList.contains(cssClasses.ANCHOR) ? parentEl : null;\n\n if (this.root.classList.contains(cssClasses.FIXED)) {\n this.setFixedPosition(true);\n }\n\n this.handleKeydown = (event) => {\n this.foundation.handleKeydown(event);\n };\n this.handleBodyClick = (event) => {\n this.foundation.handleBodyClick(event);\n };\n\n // capture so that no race between handleBodyClick and quickOpen when\n // menusurface opened on button click which registers this listener\n this.registerBodyClickListener = () => {\n document.body.addEventListener(\n 'click', this.handleBodyClick, {capture: true});\n };\n this.deregisterBodyClickListener = () => {\n document.body.removeEventListener('click', this.handleBodyClick);\n };\n\n this.listen('keydown', this.handleKeydown);\n this.listen(strings.OPENED_EVENT, this.registerBodyClickListener);\n this.listen(strings.CLOSED_EVENT, this.deregisterBodyClickListener);\n }\n\n destroy() {\n this.unlisten('keydown', this.handleKeydown);\n this.unlisten(strings.OPENED_EVENT, this.registerBodyClickListener);\n this.unlisten(strings.CLOSED_EVENT, this.deregisterBodyClickListener);\n super.destroy();\n }\n\n isOpen(): boolean {\n return this.foundation.isOpen();\n }\n\n open() {\n this.foundation.open();\n }\n\n close(skipRestoreFocus = false) {\n this.foundation.close(skipRestoreFocus);\n }\n\n set quickOpen(quickOpen: boolean) {\n this.foundation.setQuickOpen(quickOpen);\n }\n\n /** Sets the foundation to use page offsets for an positioning when the menu is hoisted to the body. */\n setIsHoisted(isHoisted: boolean) {\n this.foundation.setIsHoisted(isHoisted);\n }\n\n /** Sets the element that the menu-surface is anchored to. */\n setMenuSurfaceAnchorElement(element: Element) {\n this.anchorElement = element;\n }\n\n /** Sets the menu-surface to position: fixed. */\n setFixedPosition(isFixed: boolean) {\n if (isFixed) {\n this.root.classList.add(cssClasses.FIXED);\n } else {\n this.root.classList.remove(cssClasses.FIXED);\n }\n\n this.foundation.setFixedPosition(isFixed);\n }\n\n /** Sets the absolute x/y position to position based on. Requires the menu to be hoisted. */\n setAbsolutePosition(x: number, y: number) {\n this.foundation.setAbsolutePosition(x, y);\n this.setIsHoisted(true);\n }\n\n /**\n * @param corner Default anchor corner alignment of top-left surface corner.\n */\n setAnchorCorner(corner: Corner) {\n this.foundation.setAnchorCorner(corner);\n }\n\n setAnchorMargin(margin: Partial<MDCMenuDistance>) {\n this.foundation.setAnchorMargin(margin);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCMenuSurfaceAdapter = {\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n hasClass: (className) => this.root.classList.contains(className),\n hasAnchor: () => !!this.anchorElement,\n notifyClose: () =>\n this.emit(MDCMenuSurfaceFoundation.strings.CLOSED_EVENT, {}),\n notifyOpen: () =>\n this.emit(MDCMenuSurfaceFoundation.strings.OPENED_EVENT, {}),\n isElementInContainer: (el) => this.root.contains(el),\n isRtl: () =>\n getComputedStyle(this.root).getPropertyValue('direction') === 'rtl',\n setTransformOrigin: (origin) => {\n const propertyName = `${util.getTransformPropertyName(window)}-origin`;\n (this.root as HTMLElement).style.setProperty(propertyName, origin);\n },\n\n isFocused: () => document.activeElement === this.root,\n saveFocus: () => {\n this.previousFocus =\n document.activeElement as HTMLElement | SVGElement | null;\n },\n restoreFocus: () => {\n if (this.root.contains(document.activeElement)) {\n if (this.previousFocus && this.previousFocus.focus) {\n this.previousFocus.focus();\n }\n }\n },\n\n getInnerDimensions: () => {\n return {\n width: (this.root as HTMLElement).offsetWidth,\n height: (this.root as HTMLElement).offsetHeight\n };\n },\n getAnchorDimensions: () => this.anchorElement ?\n this.anchorElement.getBoundingClientRect() :\n null,\n getWindowDimensions: () => {\n return {width: window.innerWidth, height: window.innerHeight};\n },\n getBodyDimensions: () => {\n return {width: document.body.clientWidth, height: document.body.clientHeight};\n },\n getWindowScroll: () => {\n return {x: window.pageXOffset, y: window.pageYOffset};\n },\n setPosition: (position) => {\n const rootHTML = this.root as HTMLElement;\n rootHTML.style.left = 'left' in position ? `${position.left}px` : '';\n rootHTML.style.right = 'right' in position ? `${position.right}px` : '';\n rootHTML.style.top = 'top' in position ? `${position.top}px` : '';\n rootHTML.style.bottom =\n 'bottom' in position ? `${position.bottom}px` : '';\n },\n setMaxHeight: (height) => {\n (this.root as HTMLElement).style.maxHeight = height;\n },\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCMenuSurfaceFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n ANCHOR: 'mdc-menu-surface--anchor',\n ANIMATING_CLOSED: 'mdc-menu-surface--animating-closed',\n ANIMATING_OPEN: 'mdc-menu-surface--animating-open',\n FIXED: 'mdc-menu-surface--fixed',\n IS_OPEN_BELOW: 'mdc-menu-surface--is-open-below',\n OPEN: 'mdc-menu-surface--open',\n ROOT: 'mdc-menu-surface',\n};\n\n// tslint:disable:object-literal-sort-keys\nconst strings = {\n CLOSED_EVENT: 'MDCMenuSurface:closed',\n OPENED_EVENT: 'MDCMenuSurface:opened',\n FOCUSABLE_ELEMENTS: [\n 'button:not(:disabled)', '[href]:not([aria-disabled=\"true\"])', 'input:not(:disabled)',\n 'select:not(:disabled)', 'textarea:not(:disabled)', '[tabindex]:not([tabindex=\"-1\"]):not([aria-disabled=\"true\"])',\n ].join(', '),\n};\n// tslint:enable:object-literal-sort-keys\n\nconst numbers = {\n /** Total duration of menu-surface open animation. */\n TRANSITION_OPEN_DURATION: 120,\n\n /** Total duration of menu-surface close animation. */\n TRANSITION_CLOSE_DURATION: 75,\n\n /** Margin left to the edge of the viewport when menu-surface is at maximum possible height. Also used as a viewport margin. */\n MARGIN_TO_EDGE: 32,\n\n /** Ratio of anchor width to menu-surface width for switching from corner positioning to center positioning. */\n ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO: 0.67,\n};\n\n/**\n * Enum for bits in the {@see Corner) bitmap.\n */\nenum CornerBit {\n BOTTOM = 1,\n CENTER = 2,\n RIGHT = 4,\n FLIP_RTL = 8,\n}\n\n/**\n * Enum for representing an element corner for positioning the menu-surface.\n *\n * The START constants map to LEFT if element directionality is left\n * to right and RIGHT if the directionality is right to left.\n * Likewise END maps to RIGHT or LEFT depending on the directionality.\n */\nenum Corner {\n TOP_LEFT = 0,\n TOP_RIGHT = CornerBit.RIGHT,\n BOTTOM_LEFT = CornerBit.BOTTOM,\n BOTTOM_RIGHT = CornerBit.BOTTOM | CornerBit.RIGHT, // tslint:disable-line:no-bitwise\n TOP_START = CornerBit.FLIP_RTL,\n TOP_END = CornerBit.FLIP_RTL | CornerBit.RIGHT, // tslint:disable-line:no-bitwise\n BOTTOM_START = CornerBit.BOTTOM | CornerBit.FLIP_RTL, // tslint:disable-line:no-bitwise\n BOTTOM_END = CornerBit.BOTTOM | CornerBit.RIGHT | CornerBit.FLIP_RTL, // tslint:disable-line:no-bitwise\n}\n\nexport {cssClasses, strings, numbers, CornerBit, Corner};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCMenuSurfaceAdapter} from './adapter';\nimport {Corner, CornerBit, cssClasses, numbers, strings} from './constants';\nimport {MDCMenuDimensions, MDCMenuDistance, MDCMenuPoint} from './types';\n\ninterface AutoLayoutMeasurements {\n anchorSize: MDCMenuDimensions;\n bodySize: MDCMenuDimensions;\n surfaceSize: MDCMenuDimensions;\n viewportDistance: MDCMenuDistance;\n viewportSize: MDCMenuDimensions;\n windowScroll: MDCMenuPoint;\n}\n\nexport class MDCMenuSurfaceFoundation extends MDCFoundation<MDCMenuSurfaceAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get Corner() {\n return Corner;\n }\n\n /**\n * @see {@link MDCMenuSurfaceAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCMenuSurfaceAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => false,\n hasAnchor: () => false,\n\n isElementInContainer: () => false,\n isFocused: () => false,\n isRtl: () => false,\n\n getInnerDimensions: () => ({height: 0, width: 0}),\n getAnchorDimensions: () => null,\n getWindowDimensions: () => ({height: 0, width: 0}),\n getBodyDimensions: () => ({height: 0, width: 0}),\n getWindowScroll: () => ({x: 0, y: 0}),\n setPosition: () => undefined,\n setMaxHeight: () => undefined,\n setTransformOrigin: () => undefined,\n\n saveFocus: () => undefined,\n restoreFocus: () => undefined,\n\n notifyClose: () => undefined,\n notifyOpen: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private isSurfaceOpen = false;\n private isQuickOpen = false;\n private isHoistedElement = false;\n private isFixedPosition = false;\n\n private openAnimationEndTimerId = 0;\n private closeAnimationEndTimerId = 0;\n private animationRequestId = 0;\n\n private anchorCorner: Corner = Corner.TOP_START;\n\n /**\n * Corner of the menu surface to which menu surface is attached to anchor.\n *\n * Anchor corner --->+----------+\n * | ANCHOR |\n * +----------+\n * Origin corner --->+--------------+\n * | |\n * | |\n * | MENU SURFACE |\n * | |\n * | |\n * +--------------+\n */\n private originCorner: Corner = Corner.TOP_START;\n private readonly anchorMargin:\n MDCMenuDistance = {top: 0, right: 0, bottom: 0, left: 0};\n private readonly position: MDCMenuPoint = {x: 0, y: 0};\n\n private dimensions!: MDCMenuDimensions; // assigned in open()\n private measurements!: AutoLayoutMeasurements; // assigned in open()\n\n constructor(adapter?: Partial<MDCMenuSurfaceAdapter>) {\n super({...MDCMenuSurfaceFoundation.defaultAdapter, ...adapter});\n }\n\n init() {\n const {ROOT, OPEN} = MDCMenuSurfaceFoundation.cssClasses;\n\n if (!this.adapter.hasClass(ROOT)) {\n throw new Error(`${ROOT} class required in root element.`);\n }\n\n if (this.adapter.hasClass(OPEN)) {\n this.isSurfaceOpen = true;\n }\n }\n\n destroy() {\n clearTimeout(this.openAnimationEndTimerId);\n clearTimeout(this.closeAnimationEndTimerId);\n // Cancel any currently running animations.\n cancelAnimationFrame(this.animationRequestId);\n }\n\n /**\n * @param corner Default anchor corner alignment of top-left menu surface corner.\n */\n setAnchorCorner(corner: Corner) {\n this.anchorCorner = corner;\n }\n\n /**\n * Flip menu corner horizontally.\n */\n flipCornerHorizontally() {\n this.originCorner = this.originCorner ^ CornerBit.RIGHT;\n }\n\n /**\n * @param margin Set of margin values from anchor.\n */\n setAnchorMargin(margin: Partial<MDCMenuDistance>) {\n this.anchorMargin.top = margin.top || 0;\n this.anchorMargin.right = margin.right || 0;\n this.anchorMargin.bottom = margin.bottom || 0;\n this.anchorMargin.left = margin.left || 0;\n }\n\n /** Used to indicate if the menu-surface is hoisted to the body. */\n setIsHoisted(isHoisted: boolean) {\n this.isHoistedElement = isHoisted;\n }\n\n /** Used to set the menu-surface calculations based on a fixed position menu. */\n setFixedPosition(isFixedPosition: boolean) {\n this.isFixedPosition = isFixedPosition;\n }\n\n /** Sets the menu-surface position on the page. */\n setAbsolutePosition(x: number, y: number) {\n this.position.x = this.isFinite(x) ? x : 0;\n this.position.y = this.isFinite(y) ? y : 0;\n }\n\n setQuickOpen(quickOpen: boolean) {\n this.isQuickOpen = quickOpen;\n }\n\n isOpen() {\n return this.isSurfaceOpen;\n }\n\n /**\n * Open the menu surface.\n */\n open() {\n if (this.isSurfaceOpen) {\n return;\n }\n\n this.adapter.saveFocus();\n\n if (this.isQuickOpen) {\n this.isSurfaceOpen = true;\n this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);\n this.dimensions = this.adapter.getInnerDimensions();\n this.autoposition();\n this.adapter.notifyOpen();\n } else {\n this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);\n this.animationRequestId = requestAnimationFrame(() => {\n this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);\n this.dimensions = this.adapter.getInnerDimensions();\n this.autoposition();\n this.openAnimationEndTimerId = setTimeout(() => {\n this.openAnimationEndTimerId = 0;\n this.adapter.removeClass(\n MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);\n this.adapter.notifyOpen();\n }, numbers.TRANSITION_OPEN_DURATION);\n });\n\n this.isSurfaceOpen = true;\n }\n }\n\n /**\n * Closes the menu surface.\n */\n close(skipRestoreFocus = false) {\n if (!this.isSurfaceOpen) {\n return;\n }\n\n if (this.isQuickOpen) {\n this.isSurfaceOpen = false;\n if (!skipRestoreFocus) {\n this.maybeRestoreFocus();\n }\n\n this.adapter.removeClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);\n this.adapter.removeClass(\n MDCMenuSurfaceFoundation.cssClasses.IS_OPEN_BELOW);\n this.adapter.notifyClose();\n\n } else {\n this.adapter.addClass(\n MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);\n requestAnimationFrame(() => {\n this.adapter.removeClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);\n this.adapter.removeClass(\n MDCMenuSurfaceFoundation.cssClasses.IS_OPEN_BELOW);\n this.closeAnimationEndTimerId = setTimeout(() => {\n this.closeAnimationEndTimerId = 0;\n this.adapter.removeClass(\n MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);\n this.adapter.notifyClose();\n }, numbers.TRANSITION_CLOSE_DURATION);\n });\n\n this.isSurfaceOpen = false;\n if (!skipRestoreFocus) {\n this.maybeRestoreFocus();\n }\n }\n }\n\n /** Handle clicks and close if not within menu-surface element. */\n handleBodyClick(evt: MouseEvent) {\n const el = evt.target as Element;\n if (this.adapter.isElementInContainer(el)) {\n return;\n }\n this.close();\n }\n\n /** Handle keys that close the surface. */\n handleKeydown(evt: KeyboardEvent) {\n const {keyCode, key} = evt;\n\n const isEscape = key === 'Escape' || keyCode === 27;\n if (isEscape) {\n this.close();\n }\n }\n\n private autoposition() {\n // Compute measurements for autoposition methods reuse.\n this.measurements = this.getAutoLayoutmeasurements();\n\n const corner = this.getoriginCorner();\n const maxMenuSurfaceHeight = this.getMenuSurfaceMaxHeight(corner);\n const verticalAlignment =\n this.hasBit(corner, CornerBit.BOTTOM) ? 'bottom' : 'top';\n let horizontalAlignment =\n this.hasBit(corner, CornerBit.RIGHT) ? 'right' : 'left';\n const horizontalOffset = this.getHorizontalOriginOffset(corner);\n const verticalOffset = this.getVerticalOriginOffset(corner);\n const {anchorSize, surfaceSize} = this.measurements;\n\n const position: Partial<MDCMenuDistance> = {\n [horizontalAlignment]: horizontalOffset,\n [verticalAlignment]: verticalOffset,\n };\n\n // Center align when anchor width is comparable or greater than menu surface, otherwise keep corner.\n if (anchorSize.width / surfaceSize.width > numbers.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO) {\n horizontalAlignment = 'center';\n }\n\n // If the menu-surface has been hoisted to the body, it's no longer relative to the anchor element\n if (this.isHoistedElement || this.isFixedPosition) {\n this.adjustPositionForHoistedElement(position);\n }\n\n this.adapter.setTransformOrigin(\n `${horizontalAlignment} ${verticalAlignment}`);\n this.adapter.setPosition(position);\n this.adapter.setMaxHeight(\n maxMenuSurfaceHeight ? maxMenuSurfaceHeight + 'px' : '');\n\n // If it is opened from the top then add is-open-below class\n if (!this.hasBit(corner, CornerBit.BOTTOM)) {\n this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.IS_OPEN_BELOW);\n }\n }\n\n /**\n * @return Measurements used to position menu surface popup.\n */\n private getAutoLayoutmeasurements(): AutoLayoutMeasurements {\n let anchorRect = this.adapter.getAnchorDimensions();\n const bodySize = this.adapter.getBodyDimensions();\n const viewportSize = this.adapter.getWindowDimensions();\n const windowScroll = this.adapter.getWindowScroll();\n\n if (!anchorRect) {\n // tslint:disable:object-literal-sort-keys Positional properties are more readable when they're grouped together\n anchorRect = {\n top: this.position.y,\n right: this.position.x,\n bottom: this.position.y,\n left: this.position.x,\n width: 0,\n height: 0,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n return {\n anchorSize: anchorRect,\n bodySize,\n surfaceSize: this.dimensions,\n viewportDistance: {\n // tslint:disable:object-literal-sort-keys Positional properties are more readable when they're grouped together\n top: anchorRect.top,\n right: viewportSize.width - anchorRect.right,\n bottom: viewportSize.height - anchorRect.bottom,\n left: anchorRect.left,\n // tslint:enable:object-literal-sort-keys\n },\n viewportSize,\n windowScroll,\n };\n }\n\n /**\n * Computes the corner of the anchor from which to animate and position the\n * menu surface.\n *\n * Only LEFT or RIGHT bit is used to position the menu surface ignoring RTL\n * context. E.g., menu surface will be positioned from right side on TOP_END.\n */\n private getoriginCorner(): Corner {\n let corner = this.originCorner;\n\n const {viewportDistance, anchorSize, surfaceSize} = this.measurements;\n const {MARGIN_TO_EDGE} = MDCMenuSurfaceFoundation.numbers;\n\n const isAnchoredToBottom = this.hasBit(this.anchorCorner, CornerBit.BOTTOM);\n\n let availableTop;\n let availableBottom;\n if (isAnchoredToBottom) {\n availableTop = viewportDistance.top - MARGIN_TO_EDGE + anchorSize.height +\n this.anchorMargin.bottom;\n availableBottom =\n viewportDistance.bottom - MARGIN_TO_EDGE - this.anchorMargin.bottom;\n } else {\n availableTop =\n viewportDistance.top - MARGIN_TO_EDGE + this.anchorMargin.top;\n availableBottom = viewportDistance.bottom - MARGIN_TO_EDGE +\n anchorSize.height - this.anchorMargin.top;\n }\n\n const isAvailableBottom = availableBottom - surfaceSize.height > 0;\n if (!isAvailableBottom && availableTop >= availableBottom) {\n // Attach bottom side of surface to the anchor.\n corner = this.setBit(corner, CornerBit.BOTTOM);\n }\n\n const isRtl = this.adapter.isRtl();\n const isFlipRtl = this.hasBit(this.anchorCorner, CornerBit.FLIP_RTL);\n const hasRightBit = this.hasBit(this.anchorCorner, CornerBit.RIGHT);\n\n // Whether surface attached to right side of anchor element.\n let isAnchoredToRight = false;\n\n // Anchored to start\n if (isRtl && isFlipRtl) {\n isAnchoredToRight = !hasRightBit;\n } else {\n // Anchored to right\n isAnchoredToRight = hasRightBit;\n }\n\n let availableLeft;\n let availableRight;\n if (isAnchoredToRight) {\n availableLeft =\n viewportDistance.left + anchorSize.width + this.anchorMargin.right;\n availableRight = viewportDistance.right - this.anchorMargin.right;\n } else {\n availableLeft = viewportDistance.left + this.anchorMargin.left;\n availableRight =\n viewportDistance.right + anchorSize.width - this.anchorMargin.left;\n }\n\n const isAvailableLeft = availableLeft - surfaceSize.width > 0;\n const isAvailableRight = availableRight - surfaceSize.width > 0;\n const isOriginCornerAlignedToEnd =\n this.hasBit(corner, CornerBit.FLIP_RTL) &&\n this.hasBit(corner, CornerBit.RIGHT);\n\n if (isAvailableRight && isOriginCornerAlignedToEnd && isRtl ||\n !isAvailableLeft && isOriginCornerAlignedToEnd) {\n // Attach left side of surface to the anchor.\n corner = this.unsetBit(corner, CornerBit.RIGHT);\n } else if (\n isAvailableLeft && isAnchoredToRight && isRtl ||\n (isAvailableLeft && !isAnchoredToRight && hasRightBit) ||\n (!isAvailableRight && availableLeft >= availableRight)) {\n // Attach right side of surface to the anchor.\n corner = this.setBit(corner, CornerBit.RIGHT);\n }\n\n return corner;\n }\n\n /**\n * @param corner Origin corner of the menu surface.\n * @return Maximum height of the menu surface, based on available space. 0 indicates should not be set.\n */\n private getMenuSurfaceMaxHeight(corner: Corner): number {\n const {viewportDistance} = this.measurements;\n\n let maxHeight = 0;\n const isBottomAligned = this.hasBit(corner, CornerBit.BOTTOM);\n const isBottomAnchored = this.hasBit(this.anchorCorner, CornerBit.BOTTOM);\n const {MARGIN_TO_EDGE} = MDCMenuSurfaceFoundation.numbers;\n\n // When maximum height is not specified, it is handled from CSS.\n if (isBottomAligned) {\n maxHeight = viewportDistance.top + this.anchorMargin.top - MARGIN_TO_EDGE;\n if (!isBottomAnchored) {\n maxHeight += this.measurements.anchorSize.height;\n }\n } else {\n maxHeight = viewportDistance.bottom - this.anchorMargin.bottom +\n this.measurements.anchorSize.height - MARGIN_TO_EDGE;\n if (isBottomAnchored) {\n maxHeight -= this.measurements.anchorSize.height;\n }\n }\n\n return maxHeight;\n }\n\n /**\n * @param corner Origin corner of the menu surface.\n * @return Horizontal offset of menu surface origin corner from corresponding anchor corner.\n */\n private getHorizontalOriginOffset(corner: Corner): number {\n const {anchorSize} = this.measurements;\n\n // isRightAligned corresponds to using the 'right' property on the surface.\n const isRightAligned = this.hasBit(corner, CornerBit.RIGHT);\n const avoidHorizontalOverlap =\n this.hasBit(this.anchorCorner, CornerBit.RIGHT);\n\n if (isRightAligned) {\n const rightOffset = avoidHorizontalOverlap ?\n anchorSize.width - this.anchorMargin.left :\n this.anchorMargin.right;\n\n // For hoisted or fixed elements, adjust the offset by the difference\n // between viewport width and body width so when we calculate the right\n // value (`adjustPositionForHoistedElement`) based on the element\n // position, the right property is correct.\n if (this.isHoistedElement || this.isFixedPosition) {\n return rightOffset -\n (this.measurements.viewportSize.width -\n this.measurements.bodySize.width);\n }\n\n return rightOffset;\n }\n\n return avoidHorizontalOverlap ? anchorSize.width - this.anchorMargin.right :\n this.anchorMargin.left;\n }\n\n /**\n * @param corner Origin corner of the menu surface.\n * @return Vertical offset of menu surface origin corner from corresponding anchor corner.\n */\n private getVerticalOriginOffset(corner: Corner): number {\n const {anchorSize} = this.measurements;\n const isBottomAligned = this.hasBit(corner, CornerBit.BOTTOM);\n const avoidVerticalOverlap =\n this.hasBit(this.anchorCorner, CornerBit.BOTTOM);\n\n let y = 0;\n if (isBottomAligned) {\n y = avoidVerticalOverlap ? anchorSize.height - this.anchorMargin.top :\n -this.anchorMargin.bottom;\n } else {\n y = avoidVerticalOverlap ?\n (anchorSize.height + this.anchorMargin.bottom) :\n this.anchorMargin.top;\n }\n return y;\n }\n\n /** Calculates the offsets for positioning the menu-surface when the menu-surface has been hoisted to the body. */\n private adjustPositionForHoistedElement(position: Partial<MDCMenuDistance>) {\n const {windowScroll, viewportDistance} = this.measurements;\n\n const props = Object.keys(position) as Array<keyof Partial<MDCMenuDistance>>;\n\n for (const prop of props) {\n let value = position[prop] || 0;\n\n // Hoisted surfaces need to have the anchor elements location on the page added to the\n // position properties for proper alignment on the body.\n value += viewportDistance[prop];\n\n // Surfaces that are absolutely positioned need to have additional calculations for scroll\n // and bottom positioning.\n if (!this.isFixedPosition) {\n if (prop === 'top') {\n value += windowScroll.y;\n } else if (prop === 'bottom') {\n value -= windowScroll.y;\n } else if (prop === 'left') {\n value += windowScroll.x;\n } else { // prop === 'right'\n value -= windowScroll.x;\n }\n }\n\n position[prop] = value;\n }\n }\n\n /**\n * The last focused element when the menu surface was opened should regain focus, if the user is\n * focused on or within the menu surface when it is closed.\n */\n private maybeRestoreFocus() {\n const isRootFocused = this.adapter.isFocused();\n const childHasFocus = document.activeElement &&\n this.adapter.isElementInContainer(document.activeElement);\n if (isRootFocused || childHasFocus) {\n this.adapter.restoreFocus();\n }\n }\n\n private hasBit(corner: Corner, bit: CornerBit): boolean {\n return Boolean(corner & bit); // tslint:disable-line:no-bitwise\n }\n\n private setBit(corner: Corner, bit: CornerBit): Corner {\n return corner | bit; // tslint:disable-line:no-bitwise\n }\n\n private unsetBit(corner: Corner, bit: CornerBit): Corner {\n return corner ^ bit;\n }\n\n /**\n * isFinite that doesn't force conversion to number type.\n * Equivalent to Number.isFinite in ES2015, which is not supported in IE.\n */\n private isFinite(num: number): boolean {\n return typeof num === 'number' && isFinite(num);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCMenuSurfaceFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport * as util from './util';\n\nexport {util};\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\ntype CssTransformPropertyName = ('transform' | 'webkitTransform');\n\nlet cachedCssTransformPropertyName_: CssTransformPropertyName | undefined;\n\n/**\n * Returns the name of the correct transform property to use on the current browser.\n */\nfunction getTransformPropertyName(globalObj: Window, forceRefresh = false): CssTransformPropertyName {\n if (cachedCssTransformPropertyName_ === undefined || forceRefresh) {\n const el = globalObj.document.createElement('div');\n cachedCssTransformPropertyName_ = 'transform' in el.style ? 'transform' : 'webkitTransform';\n }\n return cachedCssTransformPropertyName_;\n}\n\nexport {getTransformPropertyName};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {CustomEventListener, SpecificEventListener} from '@material/base/types';\nimport {closest} from '@material/dom/ponyfill';\nimport {MDCList, MDCListFactory} from '@material/list/component';\nimport {MDCListFoundation} from '@material/list/foundation';\nimport {MDCListActionEvent} from '@material/list/types';\nimport {MDCMenuSurface, MDCMenuSurfaceFactory} from '@material/menu-surface/component';\nimport {Corner} from '@material/menu-surface/constants';\nimport {MDCMenuSurfaceFoundation} from '@material/menu-surface/foundation';\nimport {MDCMenuDistance} from '@material/menu-surface/types';\nimport {MDCMenuAdapter} from './adapter';\nimport {cssClasses, DefaultFocusState, strings} from './constants';\nimport {MDCMenuFoundation} from './foundation';\nimport {MDCMenuItemComponentEventDetail} from './types';\n\nexport type MDCMenuFactory = (el: Element, foundation?: MDCMenuFoundation) => MDCMenu;\n\nexport class MDCMenu extends MDCComponent<MDCMenuFoundation> {\n static attachTo(root: Element) {\n return new MDCMenu(root);\n }\n\n private menuSurfaceFactory_!: MDCMenuSurfaceFactory; // assigned in initialize()\n private listFactory_!: MDCListFactory; // assigned in initialize()\n\n private menuSurface_!: MDCMenuSurface; // assigned in initialSyncWithDOM()\n private list_!: MDCList | null; // assigned in initialSyncWithDOM()\n\n private handleKeydown_!: SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n private handleItemAction_!: CustomEventListener<MDCListActionEvent>; // assigned in initialSyncWithDOM()\n private handleMenuSurfaceOpened_!: EventListener; // assigned in initialSyncWithDOM()\n\n initialize(\n menuSurfaceFactory: MDCMenuSurfaceFactory = (el) => new MDCMenuSurface(el),\n listFactory: MDCListFactory = (el) => new MDCList(el)) {\n this.menuSurfaceFactory_ = menuSurfaceFactory;\n this.listFactory_ = listFactory;\n }\n\n initialSyncWithDOM() {\n this.menuSurface_ = this.menuSurfaceFactory_(this.root);\n\n const list = this.root.querySelector(strings.LIST_SELECTOR);\n if (list) {\n this.list_ = this.listFactory_(list);\n this.list_.wrapFocus = true;\n } else {\n this.list_ = null;\n }\n\n this.handleKeydown_ = (evt) => this.foundation.handleKeydown(evt);\n this.handleItemAction_ = (evt) =>\n this.foundation.handleItemAction(this.items[evt.detail.index]);\n this.handleMenuSurfaceOpened_ = () =>\n this.foundation.handleMenuSurfaceOpened();\n\n this.menuSurface_.listen(MDCMenuSurfaceFoundation.strings.OPENED_EVENT, this.handleMenuSurfaceOpened_);\n this.listen('keydown', this.handleKeydown_);\n this.listen(MDCListFoundation.strings.ACTION_EVENT, this.handleItemAction_);\n }\n\n destroy() {\n if (this.list_) {\n this.list_.destroy();\n }\n\n this.menuSurface_.destroy();\n this.menuSurface_.unlisten(MDCMenuSurfaceFoundation.strings.OPENED_EVENT, this.handleMenuSurfaceOpened_);\n this.unlisten('keydown', this.handleKeydown_);\n this.unlisten(MDCListFoundation.strings.ACTION_EVENT, this.handleItemAction_);\n super.destroy();\n }\n\n get open(): boolean {\n return this.menuSurface_.isOpen();\n }\n\n set open(value: boolean) {\n if (value) {\n this.menuSurface_.open();\n } else {\n this.menuSurface_.close();\n }\n }\n\n get wrapFocus(): boolean {\n return this.list_ ? this.list_.wrapFocus : false;\n }\n\n set wrapFocus(value: boolean) {\n if (this.list_) {\n this.list_.wrapFocus = value;\n }\n }\n\n /**\n * Sets whether the menu has typeahead functionality.\n * @param value Whether typeahead is enabled.\n */\n set hasTypeahead(value: boolean) {\n if (this.list_) {\n this.list_.hasTypeahead = value;\n }\n }\n\n /**\n * @return Whether typeahead logic is currently matching some user prefix.\n */\n get typeaheadInProgress() {\n return this.list_ ? this.list_.typeaheadInProgress : false;\n }\n\n /**\n * Given the next desired character from the user, adds it to the typeahead\n * buffer. Then, attempts to find the next option matching the buffer. Wraps\n * around if at the end of options.\n *\n * @param nextChar The next character to add to the prefix buffer.\n * @param startingIndex The index from which to start matching. Only relevant\n * when starting a new match sequence. To start a new match sequence,\n * clear the buffer using `clearTypeaheadBuffer`, or wait for the buffer\n * to clear after a set interval defined in list foundation. Defaults to\n * the currently focused index.\n * @return The index of the matched item, or -1 if no match.\n */\n typeaheadMatchItem(nextChar: string, startingIndex?: number): number {\n if (this.list_) {\n return this.list_.typeaheadMatchItem(nextChar, startingIndex);\n }\n return -1;\n }\n\n /**\n * Layout the underlying list element in the case of any dynamic updates\n * to its structure.\n */\n layout() {\n if (this.list_) {\n this.list_.layout();\n }\n }\n\n /**\n * Return the items within the menu. Note that this only contains the set of elements within\n * the items container that are proper list items, and not supplemental / presentational DOM\n * elements.\n */\n get items(): Element[] {\n return this.list_ ? this.list_.listElements : [];\n }\n\n set quickOpen(quickOpen: boolean) {\n this.menuSurface_.quickOpen = quickOpen;\n }\n\n /**\n * Sets default focus state where the menu should focus every time when menu\n * is opened. Focuses the list root (`DefaultFocusState.LIST_ROOT`) element by\n * default.\n * @param focusState Default focus state.\n */\n setDefaultFocusState(focusState: DefaultFocusState) {\n this.foundation.setDefaultFocusState(focusState);\n }\n\n /**\n * @param corner Default anchor corner alignment of top-left menu corner.\n */\n setAnchorCorner(corner: Corner) {\n this.menuSurface_.setAnchorCorner(corner);\n }\n\n setAnchorMargin(margin: Partial<MDCMenuDistance>) {\n this.menuSurface_.setAnchorMargin(margin);\n }\n\n /**\n * Sets the list item as the selected row at the specified index.\n * @param index Index of list item within menu.\n */\n setSelectedIndex(index: number) {\n this.foundation.setSelectedIndex(index);\n }\n\n /**\n * Sets the enabled state to isEnabled for the menu item at the given index.\n * @param index Index of the menu item\n * @param isEnabled The desired enabled state of the menu item.\n */\n setEnabled(index: number, isEnabled: boolean): void {\n this.foundation.setEnabled(index, isEnabled);\n }\n\n /**\n * @return The item within the menu at the index specified.\n */\n getOptionByIndex(index: number): Element | null {\n const items = this.items;\n\n if (index < items.length) {\n return this.items[index];\n } else {\n return null;\n }\n }\n\n /**\n * @param index A menu item's index.\n * @return The primary text within the menu at the index specified.\n */\n getPrimaryTextAtIndex(index: number): string {\n const item = this.getOptionByIndex(index);\n if (item && this.list_) {\n return this.list_.getPrimaryText(item) || '';\n }\n return '';\n }\n\n setFixedPosition(isFixed: boolean) {\n this.menuSurface_.setFixedPosition(isFixed);\n }\n\n setIsHoisted(isHoisted: boolean) {\n this.menuSurface_.setIsHoisted(isHoisted);\n }\n\n setAbsolutePosition(x: number, y: number) {\n this.menuSurface_.setAbsolutePosition(x, y);\n }\n\n /**\n * Sets the element that the menu-surface is anchored to.\n */\n setAnchorElement(element: Element) {\n this.menuSurface_.anchorElement = element;\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCMenuAdapter = {\n addClassToElementAtIndex: (index, className) => {\n const list = this.items;\n list[index].classList.add(className);\n },\n removeClassFromElementAtIndex: (index, className) => {\n const list = this.items;\n list[index].classList.remove(className);\n },\n addAttributeToElementAtIndex: (index, attr, value) => {\n const list = this.items;\n list[index].setAttribute(attr, value);\n },\n removeAttributeFromElementAtIndex: (index, attr) => {\n const list = this.items;\n list[index].removeAttribute(attr);\n },\n elementContainsClass: (element, className) =>\n element.classList.contains(className),\n closeSurface: (skipRestoreFocus: boolean) =>\n this.menuSurface_.close(skipRestoreFocus),\n getElementIndex: (element) => this.items.indexOf(element),\n notifySelected: (evtData) =>\n this.emit<MDCMenuItemComponentEventDetail>(strings.SELECTED_EVENT, {\n index: evtData.index,\n item: this.items[evtData.index],\n }),\n getMenuItemCount: () => this.items.length,\n focusItemAtIndex: (index) => (this.items[index] as HTMLElement).focus(),\n focusListRoot: () =>\n (this.root.querySelector(strings.LIST_SELECTOR) as HTMLElement)\n .focus(),\n isSelectableItemAtIndex: (index) =>\n !!closest(this.items[index], `.${cssClasses.MENU_SELECTION_GROUP}`),\n getSelectedSiblingOfItemAtIndex: (index) => {\n const selectionGroupEl = closest(this.items[index], `.${cssClasses.MENU_SELECTION_GROUP}`) as HTMLElement;\n const selectedItemEl = selectionGroupEl.querySelector(`.${cssClasses.MENU_SELECTED_LIST_ITEM}`);\n return selectedItemEl ? this.items.indexOf(selectedItemEl) : -1;\n },\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCMenuFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n MENU_SELECTED_LIST_ITEM: 'mdc-menu-item--selected',\n MENU_SELECTION_GROUP: 'mdc-menu__selection-group',\n ROOT: 'mdc-menu',\n};\n\nconst strings = {\n ARIA_CHECKED_ATTR: 'aria-checked',\n ARIA_DISABLED_ATTR: 'aria-disabled',\n CHECKBOX_SELECTOR: 'input[type=\"checkbox\"]',\n LIST_SELECTOR: '.mdc-list',\n SELECTED_EVENT: 'MDCMenu:selected',\n};\n\nconst numbers = {\n FOCUS_ROOT_INDEX: -1,\n};\n\nenum DefaultFocusState {\n NONE = 0,\n LIST_ROOT = 1,\n FIRST_ITEM = 2,\n LAST_ITEM = 3,\n}\n\nexport {cssClasses, strings, numbers, DefaultFocusState};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {cssClasses as listCssClasses} from '@material/list/constants';\nimport {MDCMenuSurfaceFoundation} from '@material/menu-surface/foundation';\nimport {MDCMenuAdapter} from './adapter';\nimport {cssClasses, DefaultFocusState, numbers, strings} from './constants';\n\nexport class MDCMenuFoundation extends MDCFoundation<MDCMenuAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n private closeAnimationEndTimerId_ = 0;\n private defaultFocusState_ = DefaultFocusState.LIST_ROOT;\n\n /**\n * @see {@link MDCMenuAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCMenuAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClassToElementAtIndex: () => undefined,\n removeClassFromElementAtIndex: () => undefined,\n addAttributeToElementAtIndex: () => undefined,\n removeAttributeFromElementAtIndex: () => undefined,\n elementContainsClass: () => false,\n closeSurface: () => undefined,\n getElementIndex: () => -1,\n notifySelected: () => undefined,\n getMenuItemCount: () => 0,\n focusItemAtIndex: () => undefined,\n focusListRoot: () => undefined,\n getSelectedSiblingOfItemAtIndex: () => -1,\n isSelectableItemAtIndex: () => false,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n constructor(adapter?: Partial<MDCMenuAdapter>) {\n super({...MDCMenuFoundation.defaultAdapter, ...adapter});\n }\n\n destroy() {\n if (this.closeAnimationEndTimerId_) {\n clearTimeout(this.closeAnimationEndTimerId_);\n }\n\n this.adapter.closeSurface();\n }\n\n handleKeydown(evt: KeyboardEvent) {\n const {key, keyCode} = evt;\n const isTab = key === 'Tab' || keyCode === 9;\n\n if (isTab) {\n this.adapter.closeSurface(/** skipRestoreFocus */ true);\n }\n }\n\n handleItemAction(listItem: Element) {\n const index = this.adapter.getElementIndex(listItem);\n if (index < 0) {\n return;\n }\n\n this.adapter.notifySelected({index});\n this.adapter.closeSurface();\n\n // Wait for the menu to close before adding/removing classes that affect styles.\n this.closeAnimationEndTimerId_ = setTimeout(() => {\n // Recompute the index in case the menu contents have changed.\n const recomputedIndex = this.adapter.getElementIndex(listItem);\n if (recomputedIndex >= 0 &&\n this.adapter.isSelectableItemAtIndex(recomputedIndex)) {\n this.setSelectedIndex(recomputedIndex);\n }\n }, MDCMenuSurfaceFoundation.numbers.TRANSITION_CLOSE_DURATION);\n }\n\n handleMenuSurfaceOpened() {\n switch (this.defaultFocusState_) {\n case DefaultFocusState.FIRST_ITEM:\n this.adapter.focusItemAtIndex(0);\n break;\n case DefaultFocusState.LAST_ITEM:\n this.adapter.focusItemAtIndex(this.adapter.getMenuItemCount() - 1);\n break;\n case DefaultFocusState.NONE:\n // Do nothing.\n break;\n default:\n this.adapter.focusListRoot();\n break;\n }\n }\n\n /**\n * Sets default focus state where the menu should focus every time when menu\n * is opened. Focuses the list root (`DefaultFocusState.LIST_ROOT`) element by\n * default.\n */\n setDefaultFocusState(focusState: DefaultFocusState) {\n this.defaultFocusState_ = focusState;\n }\n\n /**\n * Selects the list item at `index` within the menu.\n * @param index Index of list item within the menu.\n */\n setSelectedIndex(index: number) {\n this.validatedIndex_(index);\n\n if (!this.adapter.isSelectableItemAtIndex(index)) {\n throw new Error('MDCMenuFoundation: No selection group at specified index.');\n }\n\n const prevSelectedIndex =\n this.adapter.getSelectedSiblingOfItemAtIndex(index);\n if (prevSelectedIndex >= 0) {\n this.adapter.removeAttributeFromElementAtIndex(\n prevSelectedIndex, strings.ARIA_CHECKED_ATTR);\n this.adapter.removeClassFromElementAtIndex(\n prevSelectedIndex, cssClasses.MENU_SELECTED_LIST_ITEM);\n }\n\n this.adapter.addClassToElementAtIndex(\n index, cssClasses.MENU_SELECTED_LIST_ITEM);\n this.adapter.addAttributeToElementAtIndex(\n index, strings.ARIA_CHECKED_ATTR, 'true');\n }\n\n /**\n * Sets the enabled state to isEnabled for the menu item at the given index.\n * @param index Index of the menu item\n * @param isEnabled The desired enabled state of the menu item.\n */\n setEnabled(index: number, isEnabled: boolean): void {\n this.validatedIndex_(index);\n\n if (isEnabled) {\n this.adapter.removeClassFromElementAtIndex(\n index, listCssClasses.LIST_ITEM_DISABLED_CLASS);\n this.adapter.addAttributeToElementAtIndex(\n index, strings.ARIA_DISABLED_ATTR, 'false');\n } else {\n this.adapter.addClassToElementAtIndex(\n index, listCssClasses.LIST_ITEM_DISABLED_CLASS);\n this.adapter.addAttributeToElementAtIndex(\n index, strings.ARIA_DISABLED_ATTR, 'true');\n }\n }\n\n private validatedIndex_(index: number): void {\n const menuSize = this.adapter.getMenuItemCount();\n const isIndexInRange = index >= 0 && index < menuSize;\n\n if (!isIndexInRange) {\n throw new Error('MDCMenuFoundation: No list item at specified index.');\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCMenuFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport {Corner} from '@material/menu-surface/constants'; // for backward compatibility\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCFloatingLabelFoundation} from '@material/floating-label/foundation';\nimport {MDCNotchedOutlineAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\nimport {MDCNotchedOutlineFoundation} from './foundation';\n\nexport type MDCNotchedOutlineFactory = (el: Element, foundation?: MDCNotchedOutlineFoundation) => MDCNotchedOutline;\n\nexport class MDCNotchedOutline extends MDCComponent<MDCNotchedOutlineFoundation> {\n static attachTo(root: Element): MDCNotchedOutline {\n return new MDCNotchedOutline(root);\n }\n\n private notchElement_!: HTMLElement; // assigned in initialSyncWithDOM()\n\n initialSyncWithDOM() {\n this.notchElement_ =\n this.root.querySelector<HTMLElement>(strings.NOTCH_ELEMENT_SELECTOR)!;\n\n const label = this.root.querySelector<HTMLElement>(\n '.' + MDCFloatingLabelFoundation.cssClasses.ROOT);\n if (label) {\n label.style.transitionDuration = '0s';\n this.root.classList.add(cssClasses.OUTLINE_UPGRADED);\n requestAnimationFrame(() => {\n label.style.transitionDuration = '';\n });\n } else {\n this.root.classList.add(cssClasses.NO_LABEL);\n }\n }\n\n /**\n * Updates classes and styles to open the notch to the specified width.\n * @param notchWidth The notch width in the outline.\n */\n notch(notchWidth: number) {\n this.foundation.notch(notchWidth);\n }\n\n /**\n * Updates classes and styles to close the notch.\n */\n closeNotch() {\n this.foundation.closeNotch();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCNotchedOutlineAdapter = {\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n setNotchWidthProperty: (width) =>\n this.notchElement_.style.setProperty('width', width + 'px'),\n removeNotchWidthProperty: () =>\n this.notchElement_.style.removeProperty('width'),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCNotchedOutlineFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst strings = {\n NOTCH_ELEMENT_SELECTOR: '.mdc-notched-outline__notch',\n};\n\nconst numbers = {\n // This should stay in sync with $mdc-notched-outline-padding * 2.\n NOTCH_ELEMENT_PADDING: 8,\n};\n\nconst cssClasses = {\n NO_LABEL: 'mdc-notched-outline--no-label',\n OUTLINE_NOTCHED: 'mdc-notched-outline--notched',\n OUTLINE_UPGRADED: 'mdc-notched-outline--upgraded',\n};\n\nexport {cssClasses, numbers, strings};\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCNotchedOutlineAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\n\nexport class MDCNotchedOutlineFoundation extends MDCFoundation<MDCNotchedOutlineAdapter> {\n static get strings() {\n return strings;\n }\n\n static get cssClasses() {\n return cssClasses;\n }\n\n static get numbers() {\n return numbers;\n }\n\n /**\n * See {@link MDCNotchedOutlineAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCNotchedOutlineAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n setNotchWidthProperty: () => undefined,\n removeNotchWidthProperty: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n constructor(adapter?: Partial<MDCNotchedOutlineAdapter>) {\n super({...MDCNotchedOutlineFoundation.defaultAdapter, ...adapter});\n }\n\n /**\n * Adds the outline notched selector and updates the notch width calculated based off of notchWidth.\n */\n notch(notchWidth: number) {\n const {OUTLINE_NOTCHED} = MDCNotchedOutlineFoundation.cssClasses;\n\n if (notchWidth > 0) {\n notchWidth += numbers.NOTCH_ELEMENT_PADDING; // Add padding from left/right.\n }\n\n this.adapter.setNotchWidthProperty(notchWidth);\n this.adapter.addClass(OUTLINE_NOTCHED);\n }\n\n /**\n * Removes notched outline selector to close the notch in the outline.\n */\n closeNotch() {\n const {OUTLINE_NOTCHED} = MDCNotchedOutlineFoundation.cssClasses;\n this.adapter.removeClass(OUTLINE_NOTCHED);\n this.adapter.removeNotchWidthProperty();\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCNotchedOutlineFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {applyPassive} from '@material/dom/events';\nimport {MDCRippleAdapter} from '@material/ripple/adapter';\nimport {MDCRipple} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCRippleCapableSurface} from '@material/ripple/types';\nimport {MDCRadioAdapter} from './adapter';\nimport {MDCRadioFoundation} from './foundation';\n\nexport class MDCRadio extends MDCComponent<MDCRadioFoundation> implements MDCRippleCapableSurface {\n static attachTo(root: Element) {\n return new MDCRadio(root);\n }\n\n get checked(): boolean {\n return this.nativeControl_.checked;\n }\n\n set checked(checked: boolean) {\n this.nativeControl_.checked = checked;\n }\n\n get disabled() {\n return this.nativeControl_.disabled;\n }\n\n set disabled(disabled: boolean) {\n this.foundation.setDisabled(disabled);\n }\n\n get value() {\n return this.nativeControl_.value;\n }\n\n set value(value: string) {\n this.nativeControl_.value = value;\n }\n\n get ripple(): MDCRipple {\n return this.ripple_;\n }\n\n private readonly ripple_: MDCRipple = this.createRipple_();\n\n destroy() {\n this.ripple_.destroy();\n super.destroy();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCRadioAdapter = {\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n setNativeControlDisabled: (disabled) => this.nativeControl_.disabled =\n disabled,\n };\n return new MDCRadioFoundation(adapter);\n }\n\n private createRipple_(): MDCRipple {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCRippleAdapter = {\n ...MDCRipple.createAdapter(this),\n registerInteractionHandler: (evtType, handler) => this.nativeControl_.addEventListener(\n evtType, handler, applyPassive()),\n deregisterInteractionHandler: (evtType, handler) => this.nativeControl_.removeEventListener(\n evtType, handler, applyPassive()),\n // Radio buttons technically go \"active\" whenever there is *any* keyboard interaction.\n // This is not the UI we desire.\n isSurfaceActive: () => false,\n isUnbounded: () => true,\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCRipple(this.root, new MDCRippleFoundation(adapter));\n }\n\n private get nativeControl_(): HTMLInputElement {\n const {NATIVE_CONTROL_SELECTOR} = MDCRadioFoundation.strings;\n const el =\n this.root.querySelector<HTMLInputElement>(NATIVE_CONTROL_SELECTOR);\n if (!el) {\n throw new Error(`Radio component requires a ${NATIVE_CONTROL_SELECTOR} element`);\n }\n return el;\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst strings = {\n NATIVE_CONTROL_SELECTOR: '.mdc-radio__native-control',\n};\n\nconst cssClasses = {\n DISABLED: 'mdc-radio--disabled',\n ROOT: 'mdc-radio',\n};\n\nexport {strings, cssClasses};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCRadioAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCRadioFoundation extends MDCFoundation<MDCRadioAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get defaultAdapter(): MDCRadioAdapter {\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n setNativeControlDisabled: () => undefined,\n };\n }\n\n constructor(adapter?: Partial<MDCRadioAdapter>) {\n super({...MDCRadioFoundation.defaultAdapter, ...adapter});\n }\n\n setDisabled(disabled: boolean) {\n const {DISABLED} = MDCRadioFoundation.cssClasses;\n this.adapter.setNativeControlDisabled(disabled);\n if (disabled) {\n this.adapter.addClass(DISABLED);\n } else {\n this.adapter.removeClass(DISABLED);\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCRadioFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {applyPassive} from '@material/dom/events';\nimport {matches} from '@material/dom/ponyfill';\nimport {MDCRippleAdapter} from './adapter';\nimport {MDCRippleFoundation} from './foundation';\nimport {MDCRippleAttachOpts, MDCRippleCapableSurface} from './types';\nimport * as util from './util';\n\nexport type MDCRippleFactory = (el: Element, foundation?: MDCRippleFoundation) => MDCRipple;\n\nexport class MDCRipple extends MDCComponent<MDCRippleFoundation> implements MDCRippleCapableSurface {\n static attachTo(root: Element, opts: MDCRippleAttachOpts = {isUnbounded: undefined}): MDCRipple {\n const ripple = new MDCRipple(root);\n // Only override unbounded behavior if option is explicitly specified\n if (opts.isUnbounded !== undefined) {\n ripple.unbounded = opts.isUnbounded;\n }\n return ripple;\n }\n\n static createAdapter(instance: MDCRippleCapableSurface): MDCRippleAdapter {\n return {\n addClass: (className) => instance.root.classList.add(className),\n browserSupportsCssVars: () => util.supportsCssVariables(window),\n computeBoundingRect: () => instance.root.getBoundingClientRect(),\n containsEventTarget: (target) => instance.root.contains(target as Node),\n deregisterDocumentInteractionHandler: (evtType, handler) =>\n document.documentElement.removeEventListener(\n evtType, handler, applyPassive()),\n deregisterInteractionHandler: (evtType, handler) =>\n (instance.root as HTMLElement)\n .removeEventListener(evtType, handler, applyPassive()),\n deregisterResizeHandler: (handler) =>\n window.removeEventListener('resize', handler),\n getWindowPageOffset: () =>\n ({x: window.pageXOffset, y: window.pageYOffset}),\n isSurfaceActive: () => matches(instance.root, ':active'),\n isSurfaceDisabled: () => Boolean(instance.disabled),\n isUnbounded: () => Boolean(instance.unbounded),\n registerDocumentInteractionHandler: (evtType, handler) =>\n document.documentElement.addEventListener(\n evtType, handler, applyPassive()),\n registerInteractionHandler: (evtType, handler) =>\n (instance.root as HTMLElement)\n .addEventListener(evtType, handler, applyPassive()),\n registerResizeHandler: (handler) =>\n window.addEventListener('resize', handler),\n removeClass: (className) => instance.root.classList.remove(className),\n updateCssVariable: (varName, value) =>\n (instance.root as HTMLElement).style.setProperty(varName, value),\n };\n }\n\n disabled = false;\n\n private unbounded_?: boolean;\n\n get unbounded(): boolean {\n return Boolean(this.unbounded_);\n }\n\n set unbounded(unbounded: boolean) {\n this.unbounded_ = Boolean(unbounded);\n this.setUnbounded_();\n }\n\n activate() {\n this.foundation.activate();\n }\n\n deactivate() {\n this.foundation.deactivate();\n }\n\n layout() {\n this.foundation.layout();\n }\n\n getDefaultFoundation() {\n return new MDCRippleFoundation(MDCRipple.createAdapter(this));\n }\n\n initialSyncWithDOM() {\n const root = this.root as HTMLElement;\n this.unbounded = 'mdcRippleIsUnbounded' in root.dataset;\n }\n\n /**\n * Closure Compiler throws an access control error when directly accessing a\n * protected or private property inside a getter/setter, like unbounded above.\n * By accessing the protected property inside a method, we solve that problem.\n * That's why this function exists.\n */\n private setUnbounded_() {\n this.foundation.setUnbounded(Boolean(this.unbounded_));\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const cssClasses = {\n // Ripple is a special case where the \"root\" component is really a \"mixin\" of sorts,\n // given that it's an 'upgrade' to an existing component. That being said it is the root\n // CSS class that all other CSS classes derive from.\n BG_FOCUSED: 'mdc-ripple-upgraded--background-focused',\n FG_ACTIVATION: 'mdc-ripple-upgraded--foreground-activation',\n FG_DEACTIVATION: 'mdc-ripple-upgraded--foreground-deactivation',\n ROOT: 'mdc-ripple-upgraded',\n UNBOUNDED: 'mdc-ripple-upgraded--unbounded',\n};\n\nexport const strings = {\n VAR_FG_SCALE: '--mdc-ripple-fg-scale',\n VAR_FG_SIZE: '--mdc-ripple-fg-size',\n VAR_FG_TRANSLATE_END: '--mdc-ripple-fg-translate-end',\n VAR_FG_TRANSLATE_START: '--mdc-ripple-fg-translate-start',\n VAR_LEFT: '--mdc-ripple-left',\n VAR_TOP: '--mdc-ripple-top',\n};\n\nexport const numbers = {\n DEACTIVATION_TIMEOUT_MS: 225, // Corresponds to $mdc-ripple-translate-duration (i.e. activation animation duration)\n FG_DEACTIVATION_MS: 150, // Corresponds to $mdc-ripple-fade-out-duration (i.e. deactivation animation duration)\n INITIAL_ORIGIN_SCALE: 0.6,\n PADDING: 10,\n TAP_DELAY_MS: 300, // Delay between touch and simulated mouse events on touch devices\n};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCRippleAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\nimport {MDCRipplePoint} from './types';\nimport {getNormalizedEventCoords} from './util';\n\ninterface ActivationStateType {\n isActivated?: boolean;\n hasDeactivationUXRun?: boolean;\n wasActivatedByPointer?: boolean;\n wasElementMadeActive?: boolean;\n activationEvent?: Event;\n isProgrammatic?: boolean;\n}\n\ninterface FgTranslationCoordinates {\n startPoint: MDCRipplePoint;\n endPoint: MDCRipplePoint;\n}\n\ninterface Coordinates {\n left: number;\n top: number;\n}\n\ntype ActivationEventType = 'touchstart' | 'pointerdown' | 'mousedown' | 'keydown';\ntype DeactivationEventType = 'touchend' | 'pointerup' | 'mouseup' | 'contextmenu';\n\n// Activation events registered on the root element of each instance for activation\nconst ACTIVATION_EVENT_TYPES: ActivationEventType[] = [\n 'touchstart', 'pointerdown', 'mousedown', 'keydown',\n];\n\n// Deactivation events registered on documentElement when a pointer-related down event occurs\nconst POINTER_DEACTIVATION_EVENT_TYPES: DeactivationEventType[] = [\n 'touchend', 'pointerup', 'mouseup', 'contextmenu',\n];\n\n// simultaneous nested activations\nlet activatedTargets: Array<EventTarget | null> = [];\n\nexport class MDCRippleFoundation extends MDCFoundation<MDCRippleAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get defaultAdapter(): MDCRippleAdapter {\n return {\n addClass: () => undefined,\n browserSupportsCssVars: () => true,\n computeBoundingRect: () => ({top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0}),\n containsEventTarget: () => true,\n deregisterDocumentInteractionHandler: () => undefined,\n deregisterInteractionHandler: () => undefined,\n deregisterResizeHandler: () => undefined,\n getWindowPageOffset: () => ({x: 0, y: 0}),\n isSurfaceActive: () => true,\n isSurfaceDisabled: () => true,\n isUnbounded: () => true,\n registerDocumentInteractionHandler: () => undefined,\n registerInteractionHandler: () => undefined,\n registerResizeHandler: () => undefined,\n removeClass: () => undefined,\n updateCssVariable: () => undefined,\n };\n }\n\n private activationAnimationHasEnded_ = false;\n private activationState_: ActivationStateType;\n private activationTimer_ = 0;\n private fgDeactivationRemovalTimer_ = 0;\n private fgScale_ = '0';\n private frame_ = {width: 0, height: 0};\n private initialSize_ = 0;\n private layoutFrame_ = 0;\n private maxRadius_ = 0;\n private unboundedCoords_: Coordinates = {left: 0, top: 0};\n\n private readonly activationTimerCallback_: () => void;\n private readonly activateHandler_: EventHandlerNonNull;\n private readonly deactivateHandler_: EventHandlerNonNull;\n private readonly focusHandler_: EventHandlerNonNull;\n private readonly blurHandler_: EventHandlerNonNull;\n private readonly resizeHandler_: EventHandlerNonNull;\n\n private previousActivationEvent_?: Event;\n\n constructor(adapter?: Partial<MDCRippleAdapter>) {\n super({...MDCRippleFoundation.defaultAdapter, ...adapter});\n\n this.activationState_ = this.defaultActivationState_();\n\n this.activationTimerCallback_ = () => {\n this.activationAnimationHasEnded_ = true;\n this.runDeactivationUXLogicIfReady_();\n };\n this.activateHandler_ = (e) => this.activate_(e);\n this.deactivateHandler_ = () => this.deactivate_();\n this.focusHandler_ = () => this.handleFocus();\n this.blurHandler_ = () => this.handleBlur();\n this.resizeHandler_ = () => this.layout();\n }\n\n init() {\n const supportsPressRipple = this.supportsPressRipple_();\n\n this.registerRootHandlers_(supportsPressRipple);\n\n if (supportsPressRipple) {\n const {ROOT, UNBOUNDED} = MDCRippleFoundation.cssClasses;\n requestAnimationFrame(() => {\n this.adapter.addClass(ROOT);\n if (this.adapter.isUnbounded()) {\n this.adapter.addClass(UNBOUNDED);\n // Unbounded ripples need layout logic applied immediately to set coordinates for both shade and ripple\n this.layoutInternal_();\n }\n });\n }\n }\n\n destroy() {\n if (this.supportsPressRipple_()) {\n if (this.activationTimer_) {\n clearTimeout(this.activationTimer_);\n this.activationTimer_ = 0;\n this.adapter.removeClass(MDCRippleFoundation.cssClasses.FG_ACTIVATION);\n }\n\n if (this.fgDeactivationRemovalTimer_) {\n clearTimeout(this.fgDeactivationRemovalTimer_);\n this.fgDeactivationRemovalTimer_ = 0;\n this.adapter.removeClass(\n MDCRippleFoundation.cssClasses.FG_DEACTIVATION);\n }\n\n const {ROOT, UNBOUNDED} = MDCRippleFoundation.cssClasses;\n requestAnimationFrame(() => {\n this.adapter.removeClass(ROOT);\n this.adapter.removeClass(UNBOUNDED);\n this.removeCssVars_();\n });\n }\n\n this.deregisterRootHandlers_();\n this.deregisterDeactivationHandlers_();\n }\n\n /**\n * @param evt Optional event containing position information.\n */\n activate(evt?: Event): void {\n this.activate_(evt);\n }\n\n deactivate(): void {\n this.deactivate_();\n }\n\n layout(): void {\n if (this.layoutFrame_) {\n cancelAnimationFrame(this.layoutFrame_);\n }\n this.layoutFrame_ = requestAnimationFrame(() => {\n this.layoutInternal_();\n this.layoutFrame_ = 0;\n });\n }\n\n setUnbounded(unbounded: boolean): void {\n const {UNBOUNDED} = MDCRippleFoundation.cssClasses;\n if (unbounded) {\n this.adapter.addClass(UNBOUNDED);\n } else {\n this.adapter.removeClass(UNBOUNDED);\n }\n }\n\n handleFocus(): void {\n requestAnimationFrame(\n () => this.adapter.addClass(MDCRippleFoundation.cssClasses.BG_FOCUSED));\n }\n\n handleBlur(): void {\n requestAnimationFrame(\n () => this.adapter.removeClass(\n MDCRippleFoundation.cssClasses.BG_FOCUSED));\n }\n\n /**\n * We compute this property so that we are not querying information about the client\n * until the point in time where the foundation requests it. This prevents scenarios where\n * client-side feature-detection may happen too early, such as when components are rendered on the server\n * and then initialized at mount time on the client.\n */\n private supportsPressRipple_(): boolean {\n return this.adapter.browserSupportsCssVars();\n }\n\n private defaultActivationState_(): ActivationStateType {\n return {\n activationEvent: undefined,\n hasDeactivationUXRun: false,\n isActivated: false,\n isProgrammatic: false,\n wasActivatedByPointer: false,\n wasElementMadeActive: false,\n };\n }\n\n /**\n * supportsPressRipple Passed from init to save a redundant function call\n */\n private registerRootHandlers_(supportsPressRipple: boolean) {\n if (supportsPressRipple) {\n ACTIVATION_EVENT_TYPES.forEach((evtType) => {\n this.adapter.registerInteractionHandler(evtType, this.activateHandler_);\n });\n if (this.adapter.isUnbounded()) {\n this.adapter.registerResizeHandler(this.resizeHandler_);\n }\n }\n\n this.adapter.registerInteractionHandler('focus', this.focusHandler_);\n this.adapter.registerInteractionHandler('blur', this.blurHandler_);\n }\n\n private registerDeactivationHandlers_(evt: Event) {\n if (evt.type === 'keydown') {\n this.adapter.registerInteractionHandler('keyup', this.deactivateHandler_);\n } else {\n POINTER_DEACTIVATION_EVENT_TYPES.forEach((evtType) => {\n this.adapter.registerDocumentInteractionHandler(\n evtType, this.deactivateHandler_);\n });\n }\n }\n\n private deregisterRootHandlers_() {\n ACTIVATION_EVENT_TYPES.forEach((evtType) => {\n this.adapter.deregisterInteractionHandler(evtType, this.activateHandler_);\n });\n this.adapter.deregisterInteractionHandler('focus', this.focusHandler_);\n this.adapter.deregisterInteractionHandler('blur', this.blurHandler_);\n\n if (this.adapter.isUnbounded()) {\n this.adapter.deregisterResizeHandler(this.resizeHandler_);\n }\n }\n\n private deregisterDeactivationHandlers_() {\n this.adapter.deregisterInteractionHandler('keyup', this.deactivateHandler_);\n POINTER_DEACTIVATION_EVENT_TYPES.forEach((evtType) => {\n this.adapter.deregisterDocumentInteractionHandler(\n evtType, this.deactivateHandler_);\n });\n }\n\n private removeCssVars_() {\n const rippleStrings = MDCRippleFoundation.strings;\n const keys = Object.keys(rippleStrings) as Array<keyof typeof rippleStrings>;\n keys.forEach((key) => {\n if (key.indexOf('VAR_') === 0) {\n this.adapter.updateCssVariable(rippleStrings[key], null);\n }\n });\n }\n\n private activate_(evt?: Event) {\n if (this.adapter.isSurfaceDisabled()) {\n return;\n }\n\n const activationState = this.activationState_;\n if (activationState.isActivated) {\n return;\n }\n\n // Avoid reacting to follow-on events fired by touch device after an already-processed user interaction\n const previousActivationEvent = this.previousActivationEvent_;\n const isSameInteraction = previousActivationEvent && evt !== undefined && previousActivationEvent.type !== evt.type;\n if (isSameInteraction) {\n return;\n }\n\n activationState.isActivated = true;\n activationState.isProgrammatic = evt === undefined;\n activationState.activationEvent = evt;\n activationState.wasActivatedByPointer = activationState.isProgrammatic ? false : evt !== undefined && (\n evt.type === 'mousedown' || evt.type === 'touchstart' || evt.type === 'pointerdown'\n );\n\n const hasActivatedChild = evt !== undefined &&\n activatedTargets.length > 0 &&\n activatedTargets.some(\n (target) => this.adapter.containsEventTarget(target));\n if (hasActivatedChild) {\n // Immediately reset activation state, while preserving logic that prevents touch follow-on events\n this.resetActivationState_();\n return;\n }\n\n if (evt !== undefined) {\n activatedTargets.push(evt.target);\n this.registerDeactivationHandlers_(evt);\n }\n\n activationState.wasElementMadeActive = this.checkElementMadeActive_(evt);\n if (activationState.wasElementMadeActive) {\n this.animateActivation_();\n }\n\n requestAnimationFrame(() => {\n // Reset array on next frame after the current event has had a chance to bubble to prevent ancestor ripples\n activatedTargets = [];\n\n if (!activationState.wasElementMadeActive\n && evt !== undefined\n && ((evt as KeyboardEvent).key === ' ' || (evt as KeyboardEvent).keyCode === 32)) {\n // If space was pressed, try again within an rAF call to detect :active, because different UAs report\n // active states inconsistently when they're called within event handling code:\n // - https://bugs.chromium.org/p/chromium/issues/detail?id=635971\n // - https://bugzilla.mozilla.org/show_bug.cgi?id=1293741\n // We try first outside rAF to support Edge, which does not exhibit this problem, but will crash if a CSS\n // variable is set within a rAF callback for a submit button interaction (#2241).\n activationState.wasElementMadeActive = this.checkElementMadeActive_(evt);\n if (activationState.wasElementMadeActive) {\n this.animateActivation_();\n }\n }\n\n if (!activationState.wasElementMadeActive) {\n // Reset activation state immediately if element was not made active.\n this.activationState_ = this.defaultActivationState_();\n }\n });\n }\n\n private checkElementMadeActive_(evt?: Event) {\n return (evt !== undefined && evt.type === 'keydown') ?\n this.adapter.isSurfaceActive() :\n true;\n }\n\n private animateActivation_() {\n const {VAR_FG_TRANSLATE_START, VAR_FG_TRANSLATE_END} = MDCRippleFoundation.strings;\n const {FG_DEACTIVATION, FG_ACTIVATION} = MDCRippleFoundation.cssClasses;\n const {DEACTIVATION_TIMEOUT_MS} = MDCRippleFoundation.numbers;\n\n this.layoutInternal_();\n\n let translateStart = '';\n let translateEnd = '';\n\n if (!this.adapter.isUnbounded()) {\n const {startPoint, endPoint} = this.getFgTranslationCoordinates_();\n translateStart = `${startPoint.x}px, ${startPoint.y}px`;\n translateEnd = `${endPoint.x}px, ${endPoint.y}px`;\n }\n\n this.adapter.updateCssVariable(VAR_FG_TRANSLATE_START, translateStart);\n this.adapter.updateCssVariable(VAR_FG_TRANSLATE_END, translateEnd);\n // Cancel any ongoing activation/deactivation animations\n clearTimeout(this.activationTimer_);\n clearTimeout(this.fgDeactivationRemovalTimer_);\n this.rmBoundedActivationClasses_();\n this.adapter.removeClass(FG_DEACTIVATION);\n\n // Force layout in order to re-trigger the animation.\n this.adapter.computeBoundingRect();\n this.adapter.addClass(FG_ACTIVATION);\n this.activationTimer_ = setTimeout(() => this.activationTimerCallback_(), DEACTIVATION_TIMEOUT_MS);\n }\n\n private getFgTranslationCoordinates_(): FgTranslationCoordinates {\n const {activationEvent, wasActivatedByPointer} = this.activationState_;\n\n let startPoint;\n if (wasActivatedByPointer) {\n startPoint = getNormalizedEventCoords(\n activationEvent,\n this.adapter.getWindowPageOffset(),\n this.adapter.computeBoundingRect(),\n );\n } else {\n startPoint = {\n x: this.frame_.width / 2,\n y: this.frame_.height / 2,\n };\n }\n // Center the element around the start point.\n startPoint = {\n x: startPoint.x - (this.initialSize_ / 2),\n y: startPoint.y - (this.initialSize_ / 2),\n };\n\n const endPoint = {\n x: (this.frame_.width / 2) - (this.initialSize_ / 2),\n y: (this.frame_.height / 2) - (this.initialSize_ / 2),\n };\n\n return {startPoint, endPoint};\n }\n\n private runDeactivationUXLogicIfReady_() {\n // This method is called both when a pointing device is released, and when the activation animation ends.\n // The deactivation animation should only run after both of those occur.\n const {FG_DEACTIVATION} = MDCRippleFoundation.cssClasses;\n const {hasDeactivationUXRun, isActivated} = this.activationState_;\n const activationHasEnded = hasDeactivationUXRun || !isActivated;\n\n if (activationHasEnded && this.activationAnimationHasEnded_) {\n this.rmBoundedActivationClasses_();\n this.adapter.addClass(FG_DEACTIVATION);\n this.fgDeactivationRemovalTimer_ = setTimeout(() => {\n this.adapter.removeClass(FG_DEACTIVATION);\n }, numbers.FG_DEACTIVATION_MS);\n }\n }\n\n private rmBoundedActivationClasses_() {\n const {FG_ACTIVATION} = MDCRippleFoundation.cssClasses;\n this.adapter.removeClass(FG_ACTIVATION);\n this.activationAnimationHasEnded_ = false;\n this.adapter.computeBoundingRect();\n }\n\n private resetActivationState_() {\n this.previousActivationEvent_ = this.activationState_.activationEvent;\n this.activationState_ = this.defaultActivationState_();\n // Touch devices may fire additional events for the same interaction within a short time.\n // Store the previous event until it's safe to assume that subsequent events are for new interactions.\n setTimeout(() => this.previousActivationEvent_ = undefined, MDCRippleFoundation.numbers.TAP_DELAY_MS);\n }\n\n private deactivate_(): void {\n const activationState = this.activationState_;\n // This can happen in scenarios such as when you have a keyup event that blurs the element.\n if (!activationState.isActivated) {\n return;\n }\n\n const state: ActivationStateType = {...activationState};\n\n if (activationState.isProgrammatic) {\n requestAnimationFrame(() => this.animateDeactivation_(state));\n this.resetActivationState_();\n } else {\n this.deregisterDeactivationHandlers_();\n requestAnimationFrame(() => {\n this.activationState_.hasDeactivationUXRun = true;\n this.animateDeactivation_(state);\n this.resetActivationState_();\n });\n }\n }\n\n private animateDeactivation_({wasActivatedByPointer, wasElementMadeActive}: ActivationStateType) {\n if (wasActivatedByPointer || wasElementMadeActive) {\n this.runDeactivationUXLogicIfReady_();\n }\n }\n\n private layoutInternal_() {\n this.frame_ = this.adapter.computeBoundingRect();\n const maxDim = Math.max(this.frame_.height, this.frame_.width);\n\n // Surface diameter is treated differently for unbounded vs. bounded ripples.\n // Unbounded ripple diameter is calculated smaller since the surface is expected to already be padded appropriately\n // to extend the hitbox, and the ripple is expected to meet the edges of the padded hitbox (which is typically\n // square). Bounded ripples, on the other hand, are fully expected to expand beyond the surface's longest diameter\n // (calculated based on the diagonal plus a constant padding), and are clipped at the surface's border via\n // `overflow: hidden`.\n const getBoundedRadius = () => {\n const hypotenuse = Math.sqrt(Math.pow(this.frame_.width, 2) + Math.pow(this.frame_.height, 2));\n return hypotenuse + MDCRippleFoundation.numbers.PADDING;\n };\n\n this.maxRadius_ = this.adapter.isUnbounded() ? maxDim : getBoundedRadius();\n\n // Ripple is sized as a fraction of the largest dimension of the surface, then scales up using a CSS scale transform\n const initialSize = Math.floor(maxDim * MDCRippleFoundation.numbers.INITIAL_ORIGIN_SCALE);\n // Unbounded ripple size should always be even number to equally center align.\n if (this.adapter.isUnbounded() && initialSize % 2 !== 0) {\n this.initialSize_ = initialSize - 1;\n } else {\n this.initialSize_ = initialSize;\n }\n this.fgScale_ = `${this.maxRadius_ / this.initialSize_}`;\n\n this.updateLayoutCssVars_();\n }\n\n private updateLayoutCssVars_() {\n const {\n VAR_FG_SIZE, VAR_LEFT, VAR_TOP, VAR_FG_SCALE,\n } = MDCRippleFoundation.strings;\n\n this.adapter.updateCssVariable(VAR_FG_SIZE, `${this.initialSize_}px`);\n this.adapter.updateCssVariable(VAR_FG_SCALE, this.fgScale_);\n\n if (this.adapter.isUnbounded()) {\n this.unboundedCoords_ = {\n left: Math.round((this.frame_.width / 2) - (this.initialSize_ / 2)),\n top: Math.round((this.frame_.height / 2) - (this.initialSize_ / 2)),\n };\n\n this.adapter.updateCssVariable(\n VAR_LEFT, `${this.unboundedCoords_.left}px`);\n this.adapter.updateCssVariable(VAR_TOP, `${this.unboundedCoords_.top}px`);\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCRippleFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport * as util from './util';\n\nexport {util};\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport {MDCRipplePoint} from './types';\n\n/**\n * Stores result from supportsCssVariables to avoid redundant processing to\n * detect CSS custom variable support.\n */\nlet supportsCssVariables_: boolean | undefined;\n\nexport function supportsCssVariables(windowObj: Window, forceRefresh = false): boolean {\n const {CSS} = windowObj;\n let supportsCssVars = supportsCssVariables_;\n if (typeof supportsCssVariables_ === 'boolean' && !forceRefresh) {\n return supportsCssVariables_;\n }\n\n const supportsFunctionPresent = CSS && typeof CSS.supports === 'function';\n if (!supportsFunctionPresent) {\n return false;\n }\n\n const explicitlySupportsCssVars = CSS.supports('--css-vars', 'yes');\n // See: https://bugs.webkit.org/show_bug.cgi?id=154669\n // See: README section on Safari\n const weAreFeatureDetectingSafari10plus = (\n CSS.supports('(--css-vars: yes)') &&\n CSS.supports('color', '#00000000')\n );\n\n supportsCssVars =\n explicitlySupportsCssVars || weAreFeatureDetectingSafari10plus;\n\n if (!forceRefresh) {\n supportsCssVariables_ = supportsCssVars;\n }\n return supportsCssVars;\n}\n\nexport function getNormalizedEventCoords(evt: Event | undefined, pageOffset: MDCRipplePoint, clientRect: ClientRect):\n MDCRipplePoint {\n if (!evt) {\n return {x: 0, y: 0};\n }\n const {x, y} = pageOffset;\n const documentX = x + clientRect.left;\n const documentY = y + clientRect.top;\n\n let normalizedX;\n let normalizedY;\n // Determine touch point relative to the ripple container.\n if (evt.type === 'touchstart') {\n const touchEvent = evt as TouchEvent;\n normalizedX = touchEvent.changedTouches[0].pageX - documentX;\n normalizedY = touchEvent.changedTouches[0].pageY - documentY;\n } else {\n const mouseEvent = evt as MouseEvent;\n normalizedX = mouseEvent.pageX - documentX;\n normalizedY = mouseEvent.pageY - documentY;\n }\n\n return {x: normalizedX, y: normalizedY};\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {CustomEventListener, SpecificEventListener} from '@material/base/types';\nimport {MDCFloatingLabel, MDCFloatingLabelFactory} from '@material/floating-label/component';\nimport {MDCLineRipple, MDCLineRippleFactory} from '@material/line-ripple/component';\nimport * as menuSurfaceConstants from '@material/menu-surface/constants';\nimport {MDCMenu, MDCMenuFactory} from '@material/menu/component';\nimport * as menuConstants from '@material/menu/constants';\nimport {MDCMenuItemEvent} from '@material/menu/types';\nimport {MDCNotchedOutline, MDCNotchedOutlineFactory} from '@material/notched-outline/component';\nimport {MDCRippleAdapter} from '@material/ripple/adapter';\nimport {MDCRipple} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCSelectAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\nimport {MDCSelectFoundation} from './foundation';\nimport {MDCSelectHelperText, MDCSelectHelperTextFactory} from './helper-text/component';\nimport {MDCSelectIcon, MDCSelectIconFactory} from './icon/component';\nimport {MDCSelectEventDetail, MDCSelectFoundationMap} from './types';\n\nexport class MDCSelect extends MDCComponent<MDCSelectFoundation> {\n static attachTo(root: Element): MDCSelect {\n return new MDCSelect(root);\n }\n\n private ripple!: MDCRipple|null;\n\n private menu!: MDCMenu; // assigned in menuSetup()\n\n private selectAnchor!: HTMLElement; // assigned in initialize()\n private selectedText!: HTMLElement; // assigned in initialize()\n\n private menuElement!: Element; // assigned in menuSetup()\n private leadingIcon?: MDCSelectIcon; // assigned in initialize()\n private helperText!: MDCSelectHelperText|null; // assigned in initialize()\n private lineRipple!: MDCLineRipple|null; // assigned in initialize()\n private label!: MDCFloatingLabel|null; // assigned in initialize()\n private outline!: MDCNotchedOutline|null; // assigned in initialize()\n private handleChange!:\n SpecificEventListener<'change'>; // assigned in initialize()\n private handleFocus!:\n SpecificEventListener<'focus'>; // assigned in initialize()\n private handleBlur!:\n SpecificEventListener<'blur'>; // assigned in initialize()\n private handleClick!:\n SpecificEventListener<'click'>; // assigned in initialize()\n private handleKeydown!:\n SpecificEventListener<'keydown'>; // assigned in initialize()\n private handleMenuOpened!: EventListener; // assigned in initialize()\n private handleMenuClosed!: EventListener; // assigned in initialize()\n private handleMenuItemAction!:\n CustomEventListener<MDCMenuItemEvent>; // assigned in initialize()\n\n initialize(\n labelFactory: MDCFloatingLabelFactory = (el) => new MDCFloatingLabel(el),\n lineRippleFactory: MDCLineRippleFactory = (el) => new MDCLineRipple(el),\n outlineFactory: MDCNotchedOutlineFactory = (el) => new MDCNotchedOutline(el),\n menuFactory: MDCMenuFactory = (el) => new MDCMenu(el),\n iconFactory: MDCSelectIconFactory = (el) => new MDCSelectIcon(el),\n helperTextFactory: MDCSelectHelperTextFactory = (el) => new MDCSelectHelperText(el),\n ) {\n this.selectAnchor =\n this.root.querySelector(strings.SELECT_ANCHOR_SELECTOR) as HTMLElement;\n this.selectedText =\n this.root.querySelector(strings.SELECTED_TEXT_SELECTOR) as HTMLElement;\n\n if (!this.selectedText) {\n throw new Error(\n 'MDCSelect: Missing required element: The following selector must be present: ' +\n `'${strings.SELECTED_TEXT_SELECTOR}'`,\n );\n }\n\n if (this.selectAnchor.hasAttribute(strings.ARIA_CONTROLS)) {\n const helperTextElement = document.getElementById(\n this.selectAnchor.getAttribute(strings.ARIA_CONTROLS)!);\n if (helperTextElement) {\n this.helperText = helperTextFactory(helperTextElement);\n }\n }\n\n this.menuSetup(menuFactory);\n\n const labelElement = this.root.querySelector(strings.LABEL_SELECTOR);\n this.label = labelElement ? labelFactory(labelElement) : null;\n\n const lineRippleElement =\n this.root.querySelector(strings.LINE_RIPPLE_SELECTOR);\n this.lineRipple =\n lineRippleElement ? lineRippleFactory(lineRippleElement) : null;\n\n const outlineElement = this.root.querySelector(strings.OUTLINE_SELECTOR);\n this.outline = outlineElement ? outlineFactory(outlineElement) : null;\n\n const leadingIcon = this.root.querySelector(strings.LEADING_ICON_SELECTOR);\n if (leadingIcon) {\n this.leadingIcon = iconFactory(leadingIcon);\n }\n\n if (!this.root.classList.contains(cssClasses.OUTLINED)) {\n this.ripple = this.createRipple();\n }\n }\n\n /**\n * Initializes the select's event listeners and internal state based\n * on the environment's state.\n */\n initialSyncWithDOM() {\n this.handleChange = () => {\n this.foundation.handleChange();\n };\n this.handleFocus = () => {\n this.foundation.handleFocus();\n };\n this.handleBlur = () => {\n this.foundation.handleBlur();\n };\n this.handleClick = (evt) => {\n this.selectAnchor.focus();\n this.foundation.handleClick(this.getNormalizedXCoordinate(evt));\n };\n this.handleKeydown = (evt) => {\n this.foundation.handleKeydown(evt);\n };\n this.handleMenuItemAction = (evt) => {\n this.foundation.handleMenuItemAction(evt.detail.index);\n };\n this.handleMenuOpened = () => {\n this.foundation.handleMenuOpened();\n };\n this.handleMenuClosed = () => {\n this.foundation.handleMenuClosed();\n };\n\n this.selectAnchor.addEventListener('focus', this.handleFocus);\n this.selectAnchor.addEventListener('blur', this.handleBlur);\n\n this.selectAnchor.addEventListener(\n 'click', this.handleClick as EventListener);\n\n this.selectAnchor.addEventListener('keydown', this.handleKeydown);\n this.menu.listen(\n menuSurfaceConstants.strings.CLOSED_EVENT, this.handleMenuClosed);\n this.menu.listen(\n menuSurfaceConstants.strings.OPENED_EVENT, this.handleMenuOpened);\n this.menu.listen(\n menuConstants.strings.SELECTED_EVENT, this.handleMenuItemAction);\n }\n\n destroy() {\n this.selectAnchor.removeEventListener('change', this.handleChange);\n this.selectAnchor.removeEventListener('focus', this.handleFocus);\n this.selectAnchor.removeEventListener('blur', this.handleBlur);\n this.selectAnchor.removeEventListener('keydown', this.handleKeydown);\n this.selectAnchor.removeEventListener(\n 'click', this.handleClick as EventListener);\n\n this.menu.unlisten(\n menuSurfaceConstants.strings.CLOSED_EVENT, this.handleMenuClosed);\n this.menu.unlisten(\n menuSurfaceConstants.strings.OPENED_EVENT, this.handleMenuOpened);\n this.menu.unlisten(\n menuConstants.strings.SELECTED_EVENT, this.handleMenuItemAction);\n this.menu.destroy();\n\n if (this.ripple) {\n this.ripple.destroy();\n }\n if (this.outline) {\n this.outline.destroy();\n }\n if (this.leadingIcon) {\n this.leadingIcon.destroy();\n }\n if (this.helperText) {\n this.helperText.destroy();\n }\n\n super.destroy();\n }\n\n get value(): string {\n return this.foundation.getValue();\n }\n\n set value(value: string) {\n this.foundation.setValue(value);\n }\n\n get selectedIndex(): number {\n return this.foundation.getSelectedIndex();\n }\n\n set selectedIndex(selectedIndex: number) {\n this.foundation.setSelectedIndex(selectedIndex, /** closeMenu */ true);\n }\n\n get disabled(): boolean {\n return this.foundation.getDisabled();\n }\n\n set disabled(disabled: boolean) {\n this.foundation.setDisabled(disabled);\n }\n\n set leadingIconAriaLabel(label: string) {\n this.foundation.setLeadingIconAriaLabel(label);\n }\n\n /**\n * Sets the text content of the leading icon.\n */\n set leadingIconContent(content: string) {\n this.foundation.setLeadingIconContent(content);\n }\n\n /**\n * Sets the text content of the helper text.\n */\n set helperTextContent(content: string) {\n this.foundation.setHelperTextContent(content);\n }\n\n /**\n * Enables or disables the default validation scheme where a required select\n * must be non-empty. Set to false for custom validation.\n * @param useDefaultValidation Set this to false to ignore default\n * validation scheme.\n */\n set useDefaultValidation(useDefaultValidation: boolean) {\n this.foundation.setUseDefaultValidation(useDefaultValidation);\n }\n\n /**\n * Sets the current invalid state of the select.\n */\n set valid(isValid: boolean) {\n this.foundation.setValid(isValid);\n }\n\n /**\n * Checks if the select is in a valid state.\n */\n get valid(): boolean {\n return this.foundation.isValid();\n }\n\n /**\n * Sets the control to the required state.\n */\n set required(isRequired: boolean) {\n this.foundation.setRequired(isRequired);\n }\n\n /**\n * Returns whether the select is required.\n */\n get required(): boolean {\n return this.foundation.getRequired();\n }\n\n /**\n * Re-calculates if the notched outline should be notched and if the label\n * should float.\n */\n layout() {\n this.foundation.layout();\n }\n\n /**\n * Synchronizes the list of options with the state of the foundation. Call\n * this whenever menu options are dynamically updated.\n */\n layoutOptions() {\n this.foundation.layoutOptions();\n this.menu.layout();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCSelectAdapter = {\n ...this.getSelectAdapterMethods(),\n ...this.getCommonAdapterMethods(),\n ...this.getOutlineAdapterMethods(),\n ...this.getLabelAdapterMethods(),\n };\n return new MDCSelectFoundation(adapter, this.getFoundationMap());\n }\n\n /**\n * Handles setup for the menu.\n */\n private menuSetup(menuFactory: MDCMenuFactory) {\n this.menuElement = this.root.querySelector(strings.MENU_SELECTOR)!;\n this.menu = menuFactory(this.menuElement);\n this.menu.hasTypeahead = true;\n }\n\n private createRipple(): MDCRipple {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCRippleAdapter = {\n ...MDCRipple.createAdapter({root: this.selectAnchor}),\n registerInteractionHandler: (evtType, handler) => {\n this.selectAnchor.addEventListener(evtType, handler);\n },\n deregisterInteractionHandler: (evtType, handler) => {\n this.selectAnchor.removeEventListener(evtType, handler);\n },\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCRipple(this.selectAnchor, new MDCRippleFoundation(adapter));\n }\n\n private getSelectAdapterMethods() {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n getSelectedMenuItem: () =>\n this.menuElement.querySelector(strings.SELECTED_ITEM_SELECTOR),\n getMenuItemAttr: (menuItem: Element, attr: string) =>\n menuItem.getAttribute(attr),\n setSelectedText: (text: string) => {\n this.selectedText.textContent = text;\n },\n isSelectAnchorFocused: () => document.activeElement === this.selectAnchor,\n getSelectAnchorAttr: (attr: string) =>\n this.selectAnchor.getAttribute(attr),\n setSelectAnchorAttr: (attr: string, value: string) => {\n this.selectAnchor.setAttribute(attr, value);\n },\n removeSelectAnchorAttr: (attr: string) => {\n this.selectAnchor.removeAttribute(attr);\n },\n addMenuClass: (className: string) => {\n this.menuElement.classList.add(className);\n },\n removeMenuClass: (className: string) => {\n this.menuElement.classList.remove(className);\n },\n openMenu: () => {\n this.menu.open = true;\n },\n closeMenu: () => {\n this.menu.open = false;\n },\n getAnchorElement: () =>\n this.root.querySelector(strings.SELECT_ANCHOR_SELECTOR)!,\n setMenuAnchorElement: (anchorEl: HTMLElement) => {\n this.menu.setAnchorElement(anchorEl);\n },\n setMenuAnchorCorner: (anchorCorner: menuSurfaceConstants.Corner) => {\n this.menu.setAnchorCorner(anchorCorner);\n },\n setMenuWrapFocus: (wrapFocus: boolean) => {\n this.menu.wrapFocus = wrapFocus;\n },\n setAttributeAtIndex:\n (index: number, attributeName: string, attributeValue: string) => {\n this.menu.items[index].setAttribute(attributeName, attributeValue);\n },\n removeAttributeAtIndex: (index: number, attributeName: string) => {\n this.menu.items[index].removeAttribute(attributeName);\n },\n focusMenuItemAtIndex: (index: number) => {\n (this.menu.items[index] as HTMLElement).focus();\n },\n getMenuItemCount: () => this.menu.items.length,\n getMenuItemValues: () => this.menu.items.map(\n (el) => el.getAttribute(strings.VALUE_ATTR) || ''),\n getMenuItemTextAtIndex: (index: number) =>\n this.menu.getPrimaryTextAtIndex(index),\n addClassAtIndex: (index: number, className: string) => {\n this.menu.items[index].classList.add(className);\n },\n removeClassAtIndex: (index: number, className: string) => {\n this.menu.items[index].classList.remove(className);\n },\n isTypeaheadInProgress: () => this.menu.typeaheadInProgress,\n typeaheadMatchItem: (nextChar: string, startingIndex: number) =>\n this.menu.typeaheadMatchItem(nextChar, startingIndex),\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private getCommonAdapterMethods() {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: (className: string) => {\n this.root.classList.add(className);\n },\n removeClass: (className: string) => {\n this.root.classList.remove(className);\n },\n hasClass: (className: string) => this.root.classList.contains(className),\n setRippleCenter: (normalizedX: number) => {\n this.lineRipple && this.lineRipple.setRippleCenter(normalizedX)\n },\n activateBottomLine: () => {\n this.lineRipple && this.lineRipple.activate();\n },\n deactivateBottomLine: () => {\n this.lineRipple && this.lineRipple.deactivate();\n },\n notifyChange: (value: string) => {\n const index = this.selectedIndex;\n this.emit<MDCSelectEventDetail>(strings.CHANGE_EVENT, {value, index}, true /* shouldBubble */);\n },\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private getOutlineAdapterMethods() {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n hasOutline: () => Boolean(this.outline),\n notchOutline: (labelWidth: number) => {\n this.outline && this.outline.notch(labelWidth);\n },\n closeOutline: () => {\n this.outline && this.outline.closeNotch();\n },\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private getLabelAdapterMethods() {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n hasLabel: () => !!this.label,\n floatLabel: (shouldFloat: boolean) => {\n this.label && this.label.float(shouldFloat);\n },\n getLabelWidth: () => this.label ? this.label.getWidth() : 0,\n setLabelRequired: (isRequired: boolean) => {\n this.label && this.label.setRequired(isRequired);\n },\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n /**\n * Calculates where the line ripple should start based on the x coordinate within the component.\n */\n private getNormalizedXCoordinate(evt: MouseEvent|TouchEvent): number {\n const targetClientRect = (evt.target as Element).getBoundingClientRect();\n const xCoordinate =\n this.isTouchEvent(evt) ? evt.touches[0].clientX : evt.clientX;\n return xCoordinate - targetClientRect.left;\n }\n\n private isTouchEvent(evt: MouseEvent|TouchEvent): evt is TouchEvent {\n return Boolean((evt as TouchEvent).touches);\n }\n\n /**\n * Returns a map of all subcomponents to subfoundations.\n */\n private getFoundationMap(): Partial<MDCSelectFoundationMap> {\n return {\n helperText: this.helperText ? this.helperText.foundationForSelect :\n undefined,\n leadingIcon: this.leadingIcon ? this.leadingIcon.foundationForSelect :\n undefined,\n };\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n ACTIVATED: 'mdc-select--activated',\n DISABLED: 'mdc-select--disabled',\n FOCUSED: 'mdc-select--focused',\n INVALID: 'mdc-select--invalid',\n MENU_INVALID: 'mdc-select__menu--invalid',\n OUTLINED: 'mdc-select--outlined',\n REQUIRED: 'mdc-select--required',\n ROOT: 'mdc-select',\n SELECTED_ITEM_CLASS: 'mdc-list-item--selected',\n WITH_LEADING_ICON: 'mdc-select--with-leading-icon',\n};\n\nconst strings = {\n ARIA_CONTROLS: 'aria-controls',\n ARIA_SELECTED_ATTR: 'aria-selected',\n CHANGE_EVENT: 'MDCSelect:change',\n LABEL_SELECTOR: '.mdc-floating-label',\n LEADING_ICON_SELECTOR: '.mdc-select__icon',\n LINE_RIPPLE_SELECTOR: '.mdc-line-ripple',\n MENU_SELECTOR: '.mdc-select__menu',\n OUTLINE_SELECTOR: '.mdc-notched-outline',\n SELECTED_ITEM_SELECTOR: `.${cssClasses.SELECTED_ITEM_CLASS}`,\n SELECTED_TEXT_SELECTOR: '.mdc-select__selected-text',\n SELECT_ANCHOR_SELECTOR: '.mdc-select__anchor',\n VALUE_ATTR: 'data-value',\n};\n\nconst numbers = {\n LABEL_SCALE: 0.75,\n UNSET_INDEX: -1,\n};\n\nexport {cssClasses, strings, numbers};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {KEY, normalizeKey} from '@material/dom/keyboard';\nimport {Corner} from '@material/menu-surface/constants';\n\nimport {MDCSelectAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\nimport {MDCSelectHelperTextFoundation} from './helper-text/foundation';\nimport {MDCSelectIconFoundation} from './icon/foundation';\nimport {MDCSelectFoundationMap} from './types';\n\nexport class MDCSelectFoundation extends MDCFoundation<MDCSelectAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get strings() {\n return strings;\n }\n\n /**\n * See {@link MDCSelectAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCSelectAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => false,\n activateBottomLine: () => undefined,\n deactivateBottomLine: () => undefined,\n getSelectedMenuItem: () => null,\n hasLabel: () => false,\n floatLabel: () => undefined,\n getLabelWidth: () => 0,\n setLabelRequired: () => undefined,\n hasOutline: () => false,\n notchOutline: () => undefined,\n closeOutline: () => undefined,\n setRippleCenter: () => undefined,\n notifyChange: () => undefined,\n setSelectedText: () => undefined,\n isSelectAnchorFocused: () => false,\n getSelectAnchorAttr: () => '',\n setSelectAnchorAttr: () => undefined,\n removeSelectAnchorAttr: () => undefined,\n addMenuClass: () => undefined,\n removeMenuClass: () => undefined,\n openMenu: () => undefined,\n closeMenu: () => undefined,\n getAnchorElement: () => null,\n setMenuAnchorElement: () => undefined,\n setMenuAnchorCorner: () => undefined,\n setMenuWrapFocus: () => undefined,\n setAttributeAtIndex: () => undefined,\n focusMenuItemAtIndex: () => undefined,\n getMenuItemCount: () => 0,\n getMenuItemValues: () => [],\n getMenuItemTextAtIndex: () => '',\n getMenuItemAttr: () => '',\n addClassAtIndex: () => undefined,\n removeClassAtIndex: () => undefined,\n isTypeaheadInProgress: () => false,\n typeaheadMatchItem: () => -1,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private readonly leadingIcon: MDCSelectIconFoundation|undefined;\n private readonly helperText: MDCSelectHelperTextFoundation|undefined;\n\n // Index of the currently selected menu item.\n private selectedIndex: number = numbers.UNSET_INDEX;\n // VALUE_ATTR values of the menu items.\n private menuItemValues: string[] = [];\n // Disabled state\n private disabled = false;\n // isMenuOpen is used to track the state of the menu by listening to the\n // MDCMenuSurface:closed event For reference, menu.open will return false if\n // the menu is still closing, but isMenuOpen returns false only after the menu\n // has closed\n private isMenuOpen = false;\n // By default, select is invalid if it is required but no value is selected.\n private useDefaultValidation = true;\n private customValidity = true;\n\n /* istanbul ignore next: optional argument is not a branch statement */\n /**\n * @param adapter\n * @param foundationMap Map from subcomponent names to their subfoundations.\n */\n constructor(adapter?: Partial<MDCSelectAdapter>, foundationMap: Partial<MDCSelectFoundationMap> = {}) {\n super({...MDCSelectFoundation.defaultAdapter, ...adapter});\n\n this.leadingIcon = foundationMap.leadingIcon;\n this.helperText = foundationMap.helperText;\n }\n\n /** Returns the index of the currently selected menu item, or -1 if none. */\n getSelectedIndex(): number {\n return this.selectedIndex;\n }\n\n setSelectedIndex(index: number, closeMenu = false) {\n if (index >= this.adapter.getMenuItemCount()) {\n return;\n }\n\n this.removeSelectionAtIndex(this.selectedIndex);\n this.setSelectionAtIndex(index);\n\n if (closeMenu) {\n this.adapter.closeMenu();\n }\n\n this.handleChange();\n }\n\n setValue(value: string) {\n const index = this.menuItemValues.indexOf(value);\n this.setSelectedIndex(index);\n }\n\n getValue() {\n const listItem = this.adapter.getSelectedMenuItem();\n if (listItem) {\n return this.adapter.getMenuItemAttr(listItem, strings.VALUE_ATTR) || '';\n }\n return '';\n }\n\n getDisabled() {\n return this.disabled;\n }\n\n setDisabled(isDisabled: boolean) {\n this.disabled = isDisabled;\n if (this.disabled) {\n this.adapter.addClass(cssClasses.DISABLED);\n this.adapter.closeMenu();\n } else {\n this.adapter.removeClass(cssClasses.DISABLED);\n }\n\n if (this.leadingIcon) {\n this.leadingIcon.setDisabled(this.disabled);\n }\n\n if (this.disabled) {\n // Prevent click events from focusing select. Simply pointer-events: none\n // is not enough since screenreader clicks may bypass this.\n this.adapter.removeSelectAnchorAttr('tabindex');\n } else {\n this.adapter.setSelectAnchorAttr('tabindex', '0');\n }\n\n this.adapter.setSelectAnchorAttr('aria-disabled', this.disabled.toString());\n }\n\n /** Opens the menu. */\n openMenu() {\n this.adapter.addClass(cssClasses.ACTIVATED);\n this.adapter.openMenu();\n this.isMenuOpen = true;\n this.adapter.setSelectAnchorAttr('aria-expanded', 'true');\n }\n\n /**\n * @param content Sets the content of the helper text.\n */\n setHelperTextContent(content: string) {\n if (this.helperText) {\n this.helperText.setContent(content);\n }\n }\n\n /**\n * Re-calculates if the notched outline should be notched and if the label\n * should float.\n */\n layout() {\n if (this.adapter.hasLabel()) {\n const optionHasValue = this.getValue().length > 0;\n const isFocused = this.adapter.hasClass(cssClasses.FOCUSED);\n const shouldFloatAndNotch = optionHasValue || isFocused;\n const isRequired = this.adapter.hasClass(cssClasses.REQUIRED);\n\n this.notchOutline(shouldFloatAndNotch);\n this.adapter.floatLabel(shouldFloatAndNotch);\n this.adapter.setLabelRequired(isRequired);\n }\n }\n\n /**\n * Synchronizes the list of options with the state of the foundation. Call\n * this whenever menu options are dynamically updated.\n */\n layoutOptions() {\n this.menuItemValues = this.adapter.getMenuItemValues();\n const selectedIndex = this.menuItemValues.indexOf(this.getValue());\n this.setSelectionAtIndex(selectedIndex);\n }\n\n handleMenuOpened() {\n if (this.menuItemValues.length === 0) {\n return;\n }\n\n // Menu should open to the last selected element, should open to first menu item otherwise.\n const focusItemIndex = this.selectedIndex >= 0 ? this.selectedIndex : 0;\n this.adapter.focusMenuItemAtIndex(focusItemIndex);\n }\n\n handleMenuClosed() {\n this.adapter.removeClass(cssClasses.ACTIVATED);\n this.isMenuOpen = false;\n this.adapter.setSelectAnchorAttr('aria-expanded', 'false');\n\n // Unfocus the select if menu is closed without a selection\n if (!this.adapter.isSelectAnchorFocused()) {\n this.blur();\n }\n }\n\n /**\n * Handles value changes, via change event or programmatic updates.\n */\n handleChange() {\n this.layout();\n this.adapter.notifyChange(this.getValue());\n\n const isRequired = this.adapter.hasClass(cssClasses.REQUIRED);\n if (isRequired && this.useDefaultValidation) {\n this.setValid(this.isValid());\n if (this.helperText) {\n this.helperText.setValidity(this.isValid());\n }\n }\n }\n\n handleMenuItemAction(index: number) {\n this.setSelectedIndex(index, /** closeMenu */ true);\n }\n\n /**\n * Handles focus events from select element.\n */\n handleFocus() {\n this.adapter.addClass(cssClasses.FOCUSED);\n this.layout();\n\n this.adapter.activateBottomLine();\n }\n\n /**\n * Handles blur events from select element.\n */\n handleBlur() {\n if (this.isMenuOpen) {\n return;\n }\n this.blur();\n }\n\n handleClick(normalizedX: number) {\n if (this.disabled) {\n return;\n }\n\n if (this.isMenuOpen) {\n this.adapter.closeMenu();\n return;\n }\n\n this.adapter.setRippleCenter(normalizedX);\n\n this.openMenu();\n }\n\n /**\n * Handles keydown events on select element. Depending on the type of\n * character typed, does typeahead matching or opens menu.\n */\n handleKeydown(event: KeyboardEvent) {\n if (this.isMenuOpen || !this.adapter.hasClass(cssClasses.FOCUSED)) {\n return;\n }\n\n const isEnter = normalizeKey(event) === KEY.ENTER;\n const isSpace = normalizeKey(event) === KEY.SPACEBAR;\n const arrowUp = normalizeKey(event) === KEY.ARROW_UP;\n const arrowDown = normalizeKey(event) === KEY.ARROW_DOWN;\n\n // Typeahead\n if (!isSpace && event.key && event.key.length === 1 ||\n isSpace && this.adapter.isTypeaheadInProgress()) {\n const key = isSpace ? ' ' : event.key;\n const typeaheadNextIndex =\n this.adapter.typeaheadMatchItem(key, this.selectedIndex);\n if (typeaheadNextIndex >= 0) {\n this.setSelectedIndex(typeaheadNextIndex);\n }\n event.preventDefault();\n return;\n }\n\n if (!isEnter && !isSpace && !arrowUp && !arrowDown) {\n return;\n }\n\n // Increment/decrement index as necessary and open menu.\n if (arrowUp && this.selectedIndex > 0) {\n this.setSelectedIndex(this.selectedIndex - 1);\n } else if (\n arrowDown && this.selectedIndex < this.adapter.getMenuItemCount() - 1) {\n this.setSelectedIndex(this.selectedIndex + 1);\n }\n\n this.openMenu();\n event.preventDefault();\n }\n\n /**\n * Opens/closes the notched outline.\n */\n notchOutline(openNotch: boolean) {\n if (!this.adapter.hasOutline()) {\n return;\n }\n const isFocused = this.adapter.hasClass(cssClasses.FOCUSED);\n\n if (openNotch) {\n const labelScale = numbers.LABEL_SCALE;\n const labelWidth = this.adapter.getLabelWidth() * labelScale;\n this.adapter.notchOutline(labelWidth);\n } else if (!isFocused) {\n this.adapter.closeOutline();\n }\n }\n\n /**\n * Sets the aria label of the leading icon.\n */\n setLeadingIconAriaLabel(label: string) {\n if (this.leadingIcon) {\n this.leadingIcon.setAriaLabel(label);\n }\n }\n\n /**\n * Sets the text content of the leading icon.\n */\n setLeadingIconContent(content: string) {\n if (this.leadingIcon) {\n this.leadingIcon.setContent(content);\n }\n }\n\n setUseDefaultValidation(useDefaultValidation: boolean) {\n this.useDefaultValidation = useDefaultValidation;\n }\n\n setValid(isValid: boolean) {\n if (!this.useDefaultValidation) {\n this.customValidity = isValid;\n }\n\n this.adapter.setSelectAnchorAttr('aria-invalid', (!isValid).toString());\n if (isValid) {\n this.adapter.removeClass(cssClasses.INVALID);\n this.adapter.removeMenuClass(cssClasses.MENU_INVALID);\n } else {\n this.adapter.addClass(cssClasses.INVALID);\n this.adapter.addMenuClass(cssClasses.MENU_INVALID);\n }\n }\n\n isValid() {\n if (this.useDefaultValidation &&\n this.adapter.hasClass(cssClasses.REQUIRED) &&\n !this.adapter.hasClass(cssClasses.DISABLED)) {\n // See notes for required attribute under https://www.w3.org/TR/html52/sec-forms.html#the-select-element\n // TL;DR: Invalid if no index is selected, or if the first index is selected and has an empty value.\n return this.selectedIndex !== numbers.UNSET_INDEX &&\n (this.selectedIndex !== 0 || Boolean(this.getValue()));\n }\n return this.customValidity;\n }\n\n setRequired(isRequired: boolean) {\n if (isRequired) {\n this.adapter.addClass(cssClasses.REQUIRED);\n } else {\n this.adapter.removeClass(cssClasses.REQUIRED);\n }\n this.adapter.setSelectAnchorAttr('aria-required', isRequired.toString());\n this.adapter.setLabelRequired(isRequired);\n }\n\n getRequired() {\n return this.adapter.getSelectAnchorAttr('aria-required') === 'true';\n }\n\n init() {\n const anchorEl = this.adapter.getAnchorElement();\n if (anchorEl) {\n this.adapter.setMenuAnchorElement(anchorEl);\n this.adapter.setMenuAnchorCorner(Corner.BOTTOM_START);\n }\n this.adapter.setMenuWrapFocus(false);\n\n this.setDisabled(this.adapter.hasClass(cssClasses.DISABLED));\n this.layoutOptions();\n this.layout();\n }\n\n /**\n * Unfocuses the select component.\n */\n private blur() {\n this.adapter.removeClass(cssClasses.FOCUSED);\n this.layout();\n this.adapter.deactivateBottomLine();\n\n const isRequired = this.adapter.hasClass(cssClasses.REQUIRED);\n if (isRequired && this.useDefaultValidation) {\n this.setValid(this.isValid());\n if (this.helperText) {\n this.helperText.setValidity(this.isValid());\n }\n }\n }\n\n private setSelectionAtIndex(index: number) {\n this.selectedIndex = index;\n\n if (index === numbers.UNSET_INDEX) {\n this.adapter.setSelectedText('');\n return;\n }\n\n this.adapter.setSelectedText(\n this.adapter.getMenuItemTextAtIndex(index).trim());\n this.adapter.addClassAtIndex(index, cssClasses.SELECTED_ITEM_CLASS);\n this.adapter.setAttributeAtIndex(index, strings.ARIA_SELECTED_ATTR, 'true');\n }\n\n private removeSelectionAtIndex(index: number) {\n if (index !== numbers.UNSET_INDEX) {\n this.adapter.removeClassAtIndex(index, cssClasses.SELECTED_ITEM_CLASS);\n this.adapter.setAttributeAtIndex(\n index, strings.ARIA_SELECTED_ATTR, 'false');\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCSelectFoundation;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCSelectHelperTextAdapter} from './adapter';\nimport {MDCSelectHelperTextFoundation} from './foundation';\n\nexport type MDCSelectHelperTextFactory =\n (el: Element, foundation?: MDCSelectHelperTextFoundation) => MDCSelectHelperText;\n\nexport class MDCSelectHelperText extends MDCComponent<MDCSelectHelperTextFoundation> {\n static attachTo(root: Element): MDCSelectHelperText {\n return new MDCSelectHelperText(root);\n }\n\n // Provided for access by MDCSelect component\n get foundationForSelect(): MDCSelectHelperTextFoundation {\n return this.foundation;\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCSelectHelperTextAdapter = {\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n hasClass: (className) => this.root.classList.contains(className),\n setAttr: (attr, value) => this.root.setAttribute(attr, value),\n removeAttr: (attr) => this.root.removeAttribute(attr),\n setContent: (content) => {\n this.root.textContent = content;\n },\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCSelectHelperTextFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst strings = {\n ARIA_HIDDEN: 'aria-hidden',\n ROLE: 'role',\n};\n\nconst cssClasses = {\n HELPER_TEXT_VALIDATION_MSG: 'mdc-select-helper-text--validation-msg',\n HELPER_TEXT_VALIDATION_MSG_PERSISTENT:\n 'mdc-select-helper-text--validation-msg-persistent',\n};\n\nexport {strings, cssClasses};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCSelectHelperTextAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCSelectHelperTextFoundation extends MDCFoundation<MDCSelectHelperTextAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n /**\n * See {@link MDCSelectHelperTextAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCSelectHelperTextAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => false,\n setAttr: () => undefined,\n removeAttr: () => undefined,\n setContent: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n constructor(adapter?: Partial<MDCSelectHelperTextAdapter>) {\n super({...MDCSelectHelperTextFoundation.defaultAdapter, ...adapter});\n }\n\n /**\n * Sets the content of the helper text field.\n */\n setContent(content: string) {\n this.adapter.setContent(content);\n }\n\n /**\n * Sets the helper text to act as a validation message.\n * By default, validation messages are hidden when the select is valid and\n * visible when the select is invalid.\n *\n * @param isValidation True to make the helper text act as an error validation\n * message.\n */\n setValidation(isValidation: boolean) {\n if (isValidation) {\n this.adapter.addClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n } else {\n this.adapter.removeClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n }\n }\n\n /**\n * Sets the persistency of the validation helper text.\n * This keeps the validation message visible even if the select is valid,\n * though it will be displayed in the normal (grey) color.\n */\n setValidationMsgPersistent(isPersistent: boolean) {\n if (isPersistent) {\n this.adapter.addClass(cssClasses.HELPER_TEXT_VALIDATION_MSG_PERSISTENT);\n } else {\n this.adapter.removeClass(\n cssClasses.HELPER_TEXT_VALIDATION_MSG_PERSISTENT);\n }\n }\n\n /**\n * Makes the helper text visible to screen readers.\n */\n showToScreenReader() {\n this.adapter.removeAttr(strings.ARIA_HIDDEN);\n }\n\n /**\n * When acting as a validation message, shows/hides the helper text and\n * triggers alerts as necessary based on the select's validity.\n */\n setValidity(selectIsValid: boolean) {\n const isValidationMsg =\n this.adapter.hasClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n\n if (!isValidationMsg) {\n // Non-validating helper-text is always displayed and does not participate\n // in validation logic.\n return;\n }\n\n const isPersistentValidationMsg =\n this.adapter.hasClass(cssClasses.HELPER_TEXT_VALIDATION_MSG_PERSISTENT);\n\n // Validating helper text is displayed if select is invalid, unless it is\n // set as persistent, in which case it always displays.\n const msgShouldDisplay = !selectIsValid || isPersistentValidationMsg;\n if (msgShouldDisplay) {\n this.showToScreenReader();\n\n // In addition to displaying, also trigger an alert if the select\n // has become invalid.\n if (!selectIsValid) {\n this.adapter.setAttr(strings.ROLE, 'alert');\n } else {\n this.adapter.removeAttr(strings.ROLE);\n }\n return;\n }\n\n // Hide everything.\n this.adapter.removeAttr(strings.ROLE);\n this.hide();\n }\n\n /**\n * Hides the help text from screen readers.\n */\n private hide() {\n this.adapter.setAttr(strings.ARIA_HIDDEN, 'true');\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCSelectHelperTextFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport {cssClasses as helperTextCssClasses, strings as helperTextStrings} from './constants';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCSelectIconAdapter} from './adapter';\nimport {MDCSelectIconFoundation} from './foundation';\n\nexport type MDCSelectIconFactory = (el: Element, foundation?: MDCSelectIconFoundation) => MDCSelectIcon;\n\nexport class MDCSelectIcon extends MDCComponent<MDCSelectIconFoundation> {\n static attachTo(root: Element): MDCSelectIcon {\n return new MDCSelectIcon(root);\n }\n\n // Provided for access by MDCSelect component\n get foundationForSelect(): MDCSelectIconFoundation {\n return this.foundation;\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCSelectIconAdapter = {\n getAttr: (attr) => this.root.getAttribute(attr),\n setAttr: (attr, value) => this.root.setAttribute(attr, value),\n removeAttr: (attr) => this.root.removeAttribute(attr),\n setContent: (content) => {\n this.root.textContent = content;\n },\n registerInteractionHandler: (evtType, handler) =>\n this.listen(evtType, handler),\n deregisterInteractionHandler: (evtType, handler) =>\n this.unlisten(evtType, handler),\n notifyIconAction: () => this.emit(\n MDCSelectIconFoundation.strings.ICON_EVENT, {} /* evtData */,\n true /* shouldBubble */),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCSelectIconFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst strings = {\n ICON_EVENT: 'MDCSelect:icon',\n ICON_ROLE: 'button',\n};\n\nexport {strings};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCSelectIconAdapter} from './adapter';\nimport {strings} from './constants';\n\ntype InteractionEventType = 'click' | 'keydown';\n\nconst INTERACTION_EVENTS: InteractionEventType[] = ['click', 'keydown'];\n\nexport class MDCSelectIconFoundation extends MDCFoundation<MDCSelectIconAdapter> {\n static get strings() {\n return strings;\n }\n\n /**\n * See {@link MDCSelectIconAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCSelectIconAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n getAttr: () => null,\n setAttr: () => undefined,\n removeAttr: () => undefined,\n setContent: () => undefined,\n registerInteractionHandler: () => undefined,\n deregisterInteractionHandler: () => undefined,\n notifyIconAction: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private savedTabIndex_: string | null = null;\n\n // assigned in initialSyncWithDOM()\n private readonly interactionHandler_!: SpecificEventListener<InteractionEventType>;\n\n constructor(adapter?: Partial<MDCSelectIconAdapter>) {\n super({...MDCSelectIconFoundation.defaultAdapter, ...adapter});\n\n this.interactionHandler_ = (evt) => this.handleInteraction(evt);\n }\n\n init() {\n this.savedTabIndex_ = this.adapter.getAttr('tabindex');\n\n INTERACTION_EVENTS.forEach((evtType) => {\n this.adapter.registerInteractionHandler(\n evtType, this.interactionHandler_);\n });\n }\n\n destroy() {\n INTERACTION_EVENTS.forEach((evtType) => {\n this.adapter.deregisterInteractionHandler(\n evtType, this.interactionHandler_);\n });\n }\n\n setDisabled(disabled: boolean) {\n if (!this.savedTabIndex_) {\n return;\n }\n\n if (disabled) {\n this.adapter.setAttr('tabindex', '-1');\n this.adapter.removeAttr('role');\n } else {\n this.adapter.setAttr('tabindex', this.savedTabIndex_);\n this.adapter.setAttr('role', strings.ICON_ROLE);\n }\n }\n\n setAriaLabel(label: string) {\n this.adapter.setAttr('aria-label', label);\n }\n\n setContent(content: string) {\n this.adapter.setContent(content);\n }\n\n handleInteraction(evt: MouseEvent | KeyboardEvent) {\n const isEnterKey = (evt as KeyboardEvent).key === 'Enter' || (evt as KeyboardEvent).keyCode === 13;\n if (evt.type === 'click' || isEnterKey) {\n this.adapter.notifyIconAction();\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCSelectIconFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport {strings as iconStrings} from './constants';\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\nexport * from './helper-text/index';\nexport * from './icon/index';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {applyPassive} from '@material/dom/events';\nimport {MDCSliderAdapter} from './adapter';\nimport {strings} from './constants';\nimport {MDCSliderFoundation} from './foundation';\n\nexport class MDCSlider extends MDCComponent<MDCSliderFoundation> {\n static attachTo(root: Element) {\n return new MDCSlider(root);\n }\n\n private thumbContainer_!: HTMLElement; // assigned in initialize()\n private track_!: HTMLElement; // assigned in initialize()\n private pinValueMarker_!: HTMLElement; // assigned in initialize()\n private trackMarkerContainer_!: HTMLElement; // assigned in initialize()\n\n get value(): number {\n return this.foundation.getValue();\n }\n\n set value(value: number) {\n this.foundation.setValue(value);\n }\n\n get min(): number {\n return this.foundation.getMin();\n }\n\n set min(min: number) {\n this.foundation.setMin(min);\n }\n\n get max(): number {\n return this.foundation.getMax();\n }\n\n set max(max: number) {\n this.foundation.setMax(max);\n }\n\n get step(): number {\n return this.foundation.getStep();\n }\n\n set step(step: number) {\n this.foundation.setStep(step);\n }\n\n get disabled(): boolean {\n return this.foundation.isDisabled();\n }\n\n set disabled(disabled: boolean) {\n this.foundation.setDisabled(disabled);\n }\n\n initialize() {\n this.thumbContainer_ =\n this.root.querySelector<HTMLElement>(strings.THUMB_CONTAINER_SELECTOR)!;\n this.track_ = this.root.querySelector<HTMLElement>(strings.TRACK_SELECTOR)!;\n this.pinValueMarker_ = this.root.querySelector<HTMLElement>(\n strings.PIN_VALUE_MARKER_SELECTOR)!;\n this.trackMarkerContainer_ = this.root.querySelector<HTMLElement>(\n strings.TRACK_MARKER_CONTAINER_SELECTOR)!;\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take\n // a Partial<MDCFooAdapter>. To ensure we don't accidentally omit any\n // methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same\n // order as the adapter interface.\n const adapter: MDCSliderAdapter = {\n hasClass: (className) => this.root.classList.contains(className),\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n getAttribute: (name) => this.root.getAttribute(name),\n setAttribute: (name, value) => this.root.setAttribute(name, value),\n removeAttribute: (name) => this.root.removeAttribute(name),\n computeBoundingRect: () => this.root.getBoundingClientRect(),\n getTabIndex: () => (this.root as HTMLElement).tabIndex,\n registerInteractionHandler: (evtType, handler) =>\n this.listen(evtType, handler, applyPassive()),\n deregisterInteractionHandler: (evtType, handler) =>\n this.unlisten(evtType, handler, applyPassive()),\n registerThumbContainerInteractionHandler: (evtType, handler) => {\n this.thumbContainer_.addEventListener(evtType, handler, applyPassive());\n },\n deregisterThumbContainerInteractionHandler: (evtType, handler) => {\n this.thumbContainer_.removeEventListener(\n evtType, handler, applyPassive());\n },\n registerBodyInteractionHandler: (evtType, handler) =>\n document.body.addEventListener(evtType, handler),\n deregisterBodyInteractionHandler: (evtType, handler) =>\n document.body.removeEventListener(evtType, handler),\n registerResizeHandler: (handler) =>\n window.addEventListener('resize', handler),\n deregisterResizeHandler: (handler) =>\n window.removeEventListener('resize', handler),\n notifyInput: () => this.emit<MDCSlider>(\n strings.INPUT_EVENT,\n this), // TODO(acdvorak): Create detail interface\n notifyChange: () => this.emit<MDCSlider>(\n strings.CHANGE_EVENT,\n this), // TODO(acdvorak): Create detail interface\n setThumbContainerStyleProperty: (propertyName, value) => {\n this.thumbContainer_.style.setProperty(propertyName, value);\n },\n setTrackStyleProperty: (propertyName, value) =>\n this.track_.style.setProperty(propertyName, value),\n setMarkerValue: (value) => this.pinValueMarker_.innerText =\n value.toLocaleString(),\n setTrackMarkers: (step, max, min) => {\n const stepStr = step.toLocaleString();\n const maxStr = max.toLocaleString();\n const minStr = min.toLocaleString();\n // keep calculation in css for better rounding/subpixel behavior\n const markerAmount = `((${maxStr} - ${minStr}) / ${stepStr})`;\n const markerWidth = `2px`;\n const markerBkgdImage = `linear-gradient(to right, currentColor ${\n markerWidth}, transparent 0)`;\n const markerBkgdLayout = `0 center / calc((100% - ${markerWidth}) / ${\n markerAmount}) 100% repeat-x`;\n const markerBkgdShorthand = `${markerBkgdImage} ${markerBkgdLayout}`;\n this.trackMarkerContainer_.style.setProperty(\n 'background', markerBkgdShorthand);\n },\n isRTL: () => getComputedStyle(this.root).direction === 'rtl',\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCSliderFoundation(adapter);\n }\n\n initialSyncWithDOM() {\n const origValueNow = this.parseFloat_(\n this.root.getAttribute(strings.ARIA_VALUENOW), this.value);\n const min = this.parseFloat_(\n this.root.getAttribute(strings.ARIA_VALUEMIN), this.min);\n const max = this.parseFloat_(\n this.root.getAttribute(strings.ARIA_VALUEMAX), this.max);\n\n // min and max need to be set in the right order to avoid throwing an error\n // when the new min is greater than the default max.\n if (min >= this.max) {\n this.max = max;\n this.min = min;\n } else {\n this.min = min;\n this.max = max;\n }\n\n this.step = this.parseFloat_(\n this.root.getAttribute(strings.STEP_DATA_ATTR), this.step);\n this.value = origValueNow;\n this.disabled =\n (this.root.hasAttribute(strings.ARIA_DISABLED) &&\n this.root.getAttribute(strings.ARIA_DISABLED) !== 'false');\n this.foundation.setupTrackMarker();\n }\n\n layout() {\n this.foundation.layout();\n }\n\n stepUp(amount = (this.step || 1)) {\n this.value += amount;\n }\n\n stepDown(amount = (this.step || 1)) {\n this.value -= amount;\n }\n\n private parseFloat_(str: string|null, defaultValue: number) {\n const num = parseFloat(str!); // tslint:disable-line:ban\n const isNumeric = typeof num === 'number' && isFinite(num);\n return isNumeric ? num : defaultValue;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n ACTIVE: 'mdc-slider--active',\n DISABLED: 'mdc-slider--disabled',\n DISCRETE: 'mdc-slider--discrete',\n FOCUS: 'mdc-slider--focus',\n HAS_TRACK_MARKER: 'mdc-slider--display-markers',\n IN_TRANSIT: 'mdc-slider--in-transit',\n IS_DISCRETE: 'mdc-slider--discrete',\n DISABLE_TOUCH_ACTION: 'mdc-slider--disable-touch-action',\n};\n\nconst strings = {\n ARIA_DISABLED: 'aria-disabled',\n ARIA_VALUEMAX: 'aria-valuemax',\n ARIA_VALUEMIN: 'aria-valuemin',\n ARIA_VALUENOW: 'aria-valuenow',\n CHANGE_EVENT: 'MDCSlider:change',\n INPUT_EVENT: 'MDCSlider:input',\n PIN_VALUE_MARKER_SELECTOR: '.mdc-slider__pin-value-marker',\n STEP_DATA_ATTR: 'data-step',\n THUMB_CONTAINER_SELECTOR: '.mdc-slider__thumb-container',\n TRACK_MARKER_CONTAINER_SELECTOR: '.mdc-slider__track-marker-container',\n TRACK_SELECTOR: '.mdc-slider__track',\n};\n\nconst numbers = {\n PAGE_FACTOR: 4,\n};\n\nexport {cssClasses, strings, numbers};\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {getCorrectEventName, getCorrectPropertyName} from '@material/animation/util';\nimport {MDCFoundation} from '@material/base/foundation';\nimport {EventType, SpecificEventListener} from '@material/base/types';\nimport {MDCSliderAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\n\ntype UpEventType = 'mouseup'|'pointerup'|'touchend';\ntype DownEventType = 'mousedown'|'pointerdown'|'touchstart';\ntype MoveEventType = 'mousemove'|'pointermove'|'touchmove';\ntype MouseLikeEvent = MouseEvent|PointerEvent|TouchEvent;\n\ntype MoveEventMap = {\n readonly[K in DownEventType]: MoveEventType;\n};\n\n// Accessing `window` without a `typeof` check will throw on Node environments.\nconst hasWindow = typeof window !== 'undefined';\nconst hasPointerEventSupport = hasWindow && !!window.PointerEvent;\n\nconst DOWN_EVENTS: DownEventType[] =\n hasPointerEventSupport ? ['pointerdown'] : ['mousedown', 'touchstart'];\nconst UP_EVENTS: UpEventType[] =\n hasPointerEventSupport ? ['pointerup'] : ['mouseup', 'touchend'];\n\nconst MOVE_EVENT_MAP: MoveEventMap = {\n mousedown: 'mousemove',\n pointerdown: 'pointermove',\n touchstart: 'touchmove',\n};\n\nconst KEY_IDS = {\n ARROW_DOWN: 'ArrowDown',\n ARROW_LEFT: 'ArrowLeft',\n ARROW_RIGHT: 'ArrowRight',\n ARROW_UP: 'ArrowUp',\n END: 'End',\n HOME: 'Home',\n PAGE_DOWN: 'PageDown',\n PAGE_UP: 'PageUp',\n};\n\nexport class MDCSliderFoundation extends MDCFoundation<MDCSliderAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get defaultAdapter(): MDCSliderAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same\n // order as the adapter interface.\n return {\n hasClass: () => false,\n addClass: () => undefined,\n removeClass: () => undefined,\n getAttribute: () => null,\n setAttribute: () => undefined,\n removeAttribute: () => undefined,\n computeBoundingRect: () =>\n ({top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0}),\n getTabIndex: () => 0,\n registerInteractionHandler: () => undefined,\n deregisterInteractionHandler: () => undefined,\n registerThumbContainerInteractionHandler: () => undefined,\n deregisterThumbContainerInteractionHandler: () => undefined,\n registerBodyInteractionHandler: () => undefined,\n deregisterBodyInteractionHandler: () => undefined,\n registerResizeHandler: () => undefined,\n deregisterResizeHandler: () => undefined,\n notifyInput: () => undefined,\n notifyChange: () => undefined,\n setThumbContainerStyleProperty: () => undefined,\n setTrackStyleProperty: () => undefined,\n setMarkerValue: () => undefined,\n setTrackMarkers: () => undefined,\n isRTL: () => false,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private rect_!: ClientRect; // assigned in layout() via init()\n\n /**\n * We set this to NaN since we want it to be a number, but we can't use '0' or\n * '-1' because those could be valid tabindices set by the client code.\n */\n private savedTabIndex_ = NaN;\n\n private active_ = false;\n private inTransit_ = false;\n private isDiscrete_ = false;\n private hasTrackMarker_ = false;\n private handlingThumbTargetEvt_ = false;\n private min_ = 0;\n private max_ = 100;\n private step_ = 0;\n private value_ = 0;\n private disabled_ = false;\n private preventFocusState_ = false;\n\n private readonly thumbContainerPointerHandler_:\n SpecificEventListener<DownEventType>;\n private readonly interactionStartHandler_:\n SpecificEventListener<DownEventType>;\n private readonly keydownHandler_: SpecificEventListener<'keydown'>;\n private readonly focusHandler_: SpecificEventListener<'focus'>;\n private readonly blurHandler_: SpecificEventListener<'blur'>;\n private readonly resizeHandler_: SpecificEventListener<'resize'>;\n\n constructor(adapter?: Partial<MDCSliderAdapter>) {\n super({...MDCSliderFoundation.defaultAdapter, ...adapter});\n\n this.thumbContainerPointerHandler_ = () => this.handlingThumbTargetEvt_ =\n true;\n this.interactionStartHandler_ = (evt: MouseLikeEvent) =>\n this.handleDown_(evt);\n this.keydownHandler_ = (evt) => this.handleKeydown_(evt);\n this.focusHandler_ = () => this.handleFocus_();\n this.blurHandler_ = () => this.handleBlur_();\n this.resizeHandler_ = () => this.layout();\n }\n\n init() {\n this.isDiscrete_ = this.adapter.hasClass(cssClasses.IS_DISCRETE);\n this.hasTrackMarker_ = this.adapter.hasClass(cssClasses.HAS_TRACK_MARKER);\n\n DOWN_EVENTS.forEach((evtName) => {\n this.adapter.registerInteractionHandler(\n evtName, this.interactionStartHandler_);\n this.adapter.registerThumbContainerInteractionHandler(\n evtName, this.thumbContainerPointerHandler_);\n });\n\n if (hasPointerEventSupport) {\n /*\n * When pointermove happens, if too much sliding happens, the browser\n * believes you are panning in the x direction and stops firing\n * pointermove events and supplies its own gestures. (similar to\n * preventing default on touchmove)\n */\n this.adapter.addClass(cssClasses.DISABLE_TOUCH_ACTION);\n }\n\n this.adapter.registerInteractionHandler('keydown', this.keydownHandler_);\n this.adapter.registerInteractionHandler('focus', this.focusHandler_);\n this.adapter.registerInteractionHandler('blur', this.blurHandler_);\n this.adapter.registerResizeHandler(this.resizeHandler_);\n\n this.layout();\n\n // At last step, provide a reasonable default value to discrete slider\n if (this.isDiscrete_ && this.getStep() === 0) {\n this.step_ = 1;\n }\n }\n\n destroy() {\n DOWN_EVENTS.forEach((evtName) => {\n this.adapter.deregisterInteractionHandler(\n evtName, this.interactionStartHandler_);\n this.adapter.deregisterThumbContainerInteractionHandler(\n evtName, this.thumbContainerPointerHandler_);\n });\n\n this.adapter.deregisterInteractionHandler('keydown', this.keydownHandler_);\n this.adapter.deregisterInteractionHandler('focus', this.focusHandler_);\n this.adapter.deregisterInteractionHandler('blur', this.blurHandler_);\n this.adapter.deregisterResizeHandler(this.resizeHandler_);\n }\n\n setupTrackMarker() {\n if (this.isDiscrete_ && this.hasTrackMarker_ && this.getStep() !== 0) {\n this.adapter.setTrackMarkers(\n this.getStep(), this.getMax(), this.getMin());\n }\n }\n\n layout() {\n this.rect_ = this.adapter.computeBoundingRect();\n this.updateUIForCurrentValue_();\n }\n\n getValue(): number {\n return this.value_;\n }\n\n setValue(value: number) {\n this.setValue_(value, false);\n }\n\n getMax(): number {\n return this.max_;\n }\n\n setMax(max: number) {\n if (max < this.min_) {\n throw new Error(\n 'Cannot set max to be less than the slider\\'s minimum value');\n }\n this.max_ = max;\n this.setValue_(this.value_, false, true);\n this.adapter.setAttribute(strings.ARIA_VALUEMAX, String(this.max_));\n this.setupTrackMarker();\n }\n\n getMin(): number {\n return this.min_;\n }\n\n setMin(min: number) {\n if (min > this.max_) {\n throw new Error(\n 'Cannot set min to be greater than the slider\\'s maximum value');\n }\n this.min_ = min;\n this.setValue_(this.value_, false, true);\n this.adapter.setAttribute(strings.ARIA_VALUEMIN, String(this.min_));\n this.setupTrackMarker();\n }\n\n getStep(): number {\n return this.step_;\n }\n\n setStep(step: number) {\n if (step < 0) {\n throw new Error('Step cannot be set to a negative number');\n }\n if (this.isDiscrete_ && (typeof (step) !== 'number' || step < 1)) {\n step = 1;\n }\n this.step_ = step;\n this.setValue_(this.value_, false, true);\n this.setupTrackMarker();\n }\n\n isDisabled(): boolean {\n return this.disabled_;\n }\n\n setDisabled(disabled: boolean) {\n this.disabled_ = disabled;\n this.toggleClass_(cssClasses.DISABLED, this.disabled_);\n if (this.disabled_) {\n this.savedTabIndex_ = this.adapter.getTabIndex();\n this.adapter.setAttribute(strings.ARIA_DISABLED, 'true');\n this.adapter.removeAttribute('tabindex');\n } else {\n this.adapter.removeAttribute(strings.ARIA_DISABLED);\n if (!isNaN(this.savedTabIndex_)) {\n this.adapter.setAttribute('tabindex', String(this.savedTabIndex_));\n }\n }\n }\n\n /**\n * Called when the user starts interacting with the slider\n */\n private handleDown_(downEvent: MouseLikeEvent) {\n if (this.disabled_) {\n return;\n }\n\n this.preventFocusState_ = true;\n this.setInTransit_(!this.handlingThumbTargetEvt_);\n this.handlingThumbTargetEvt_ = false;\n this.setActive_(true);\n\n const moveHandler = (moveEvent: MouseLikeEvent) => {\n this.handleMove_(moveEvent);\n };\n\n const moveEventType = MOVE_EVENT_MAP[downEvent.type as DownEventType];\n\n // Note: upHandler is [de]registered on ALL potential pointer-related\n // release event types, since some browsers do not always fire these\n // consistently in pairs. (See\n // https://github.com/material-components/material-components-web/issues/1192)\n const upHandler = () => {\n this.handleUp_();\n this.adapter.deregisterBodyInteractionHandler(\n moveEventType, moveHandler);\n UP_EVENTS.forEach(\n (evtName) => this.adapter.deregisterBodyInteractionHandler(\n evtName, upHandler));\n };\n\n this.adapter.registerBodyInteractionHandler(moveEventType, moveHandler);\n UP_EVENTS.forEach(\n (evtName) =>\n this.adapter.registerBodyInteractionHandler(evtName, upHandler));\n this.setValueFromEvt_(downEvent);\n }\n\n /**\n * Called when the user moves the slider\n */\n private handleMove_(evt: MouseLikeEvent) {\n evt.preventDefault();\n this.setValueFromEvt_(evt);\n }\n\n /**\n * Called when the user's interaction with the slider ends\n */\n private handleUp_() {\n this.setActive_(false);\n this.adapter.notifyChange();\n }\n\n /**\n * Returns the clientX of the event\n */\n private getClientX_(evt: MouseLikeEvent): number {\n if ((evt as TouchEvent).targetTouches &&\n (evt as TouchEvent).targetTouches.length > 0) {\n return (evt as TouchEvent).targetTouches[0].clientX;\n }\n return (evt as MouseEvent).clientX;\n }\n\n /**\n * Sets the slider value from an event\n */\n private setValueFromEvt_(evt: MouseLikeEvent) {\n const clientX = this.getClientX_(evt);\n const value = this.computeValueFromClientX_(clientX);\n this.setValue_(value, true);\n }\n\n /**\n * Computes the new value from the clientX position\n */\n private computeValueFromClientX_(clientX: number): number {\n const {max_: max, min_: min} = this;\n const xPos = clientX - this.rect_.left;\n let pctComplete = xPos / this.rect_.width;\n if (this.adapter.isRTL()) {\n pctComplete = 1 - pctComplete;\n }\n // Fit the percentage complete between the range [min,max]\n // by remapping from [0, 1] to [min, min+(max-min)].\n return min + pctComplete * (max - min);\n }\n\n /**\n * Handles keydown events\n */\n private handleKeydown_(evt: KeyboardEvent) {\n const keyId = this.getKeyId_(evt);\n const value = this.getValueForKeyId_(keyId);\n if (isNaN(value)) {\n return;\n }\n\n // Prevent page from scrolling due to key presses that would normally scroll\n // the page\n evt.preventDefault();\n this.adapter.addClass(cssClasses.FOCUS);\n this.setValue_(value, true);\n this.adapter.notifyChange();\n }\n\n /**\n * Returns the computed name of the event\n */\n private getKeyId_(kbdEvt: KeyboardEvent): string {\n if (kbdEvt.key === KEY_IDS.ARROW_LEFT || kbdEvt.keyCode === 37) {\n return KEY_IDS.ARROW_LEFT;\n }\n if (kbdEvt.key === KEY_IDS.ARROW_RIGHT || kbdEvt.keyCode === 39) {\n return KEY_IDS.ARROW_RIGHT;\n }\n if (kbdEvt.key === KEY_IDS.ARROW_UP || kbdEvt.keyCode === 38) {\n return KEY_IDS.ARROW_UP;\n }\n if (kbdEvt.key === KEY_IDS.ARROW_DOWN || kbdEvt.keyCode === 40) {\n return KEY_IDS.ARROW_DOWN;\n }\n if (kbdEvt.key === KEY_IDS.HOME || kbdEvt.keyCode === 36) {\n return KEY_IDS.HOME;\n }\n if (kbdEvt.key === KEY_IDS.END || kbdEvt.keyCode === 35) {\n return KEY_IDS.END;\n }\n if (kbdEvt.key === KEY_IDS.PAGE_UP || kbdEvt.keyCode === 33) {\n return KEY_IDS.PAGE_UP;\n }\n if (kbdEvt.key === KEY_IDS.PAGE_DOWN || kbdEvt.keyCode === 34) {\n return KEY_IDS.PAGE_DOWN;\n }\n return '';\n }\n\n /**\n * Computes the value given a keyboard key ID\n */\n private getValueForKeyId_(keyId: string): number {\n const {max_: max, min_: min, step_: step} = this;\n let delta = step || (max - min) / 100;\n const valueNeedsToBeFlipped = this.adapter.isRTL() &&\n (keyId === KEY_IDS.ARROW_LEFT || keyId === KEY_IDS.ARROW_RIGHT);\n if (valueNeedsToBeFlipped) {\n delta = -delta;\n }\n\n switch (keyId) {\n case KEY_IDS.ARROW_LEFT:\n case KEY_IDS.ARROW_DOWN:\n return this.value_ - delta;\n case KEY_IDS.ARROW_RIGHT:\n case KEY_IDS.ARROW_UP:\n return this.value_ + delta;\n case KEY_IDS.HOME:\n return this.min_;\n case KEY_IDS.END:\n return this.max_;\n case KEY_IDS.PAGE_UP:\n return this.value_ + delta * numbers.PAGE_FACTOR;\n case KEY_IDS.PAGE_DOWN:\n return this.value_ - delta * numbers.PAGE_FACTOR;\n default:\n return NaN;\n }\n }\n\n private handleFocus_() {\n if (this.preventFocusState_) {\n return;\n }\n this.adapter.addClass(cssClasses.FOCUS);\n }\n\n private handleBlur_() {\n this.preventFocusState_ = false;\n this.adapter.removeClass(cssClasses.FOCUS);\n }\n\n /**\n * Sets the value of the slider\n */\n private setValue_(value: number, shouldFireInput: boolean, force = false) {\n if (value === this.value_ && !force) {\n return;\n }\n\n const {min_: min, max_: max} = this;\n const valueSetToBoundary = value === min || value === max;\n if (this.step_ && !valueSetToBoundary) {\n value = this.quantize_(value);\n }\n if (value < min) {\n value = min;\n } else if (value > max) {\n value = max;\n }\n value = value || 0; // coerce -0 to 0\n this.value_ = value;\n this.adapter.setAttribute(strings.ARIA_VALUENOW, String(this.value_));\n this.updateUIForCurrentValue_();\n\n if (shouldFireInput) {\n this.adapter.notifyInput();\n if (this.isDiscrete_) {\n this.adapter.setMarkerValue(value);\n }\n }\n }\n\n /**\n * Calculates the quantized value\n */\n private quantize_(value: number): number {\n const numSteps = Math.round(value / this.step_);\n return numSteps * this.step_;\n }\n\n private updateUIForCurrentValue_() {\n const {max_: max, min_: min, value_: value} = this;\n const pctComplete = (value - min) / (max - min);\n let translatePx = pctComplete * this.rect_.width;\n if (this.adapter.isRTL()) {\n translatePx = this.rect_.width - translatePx;\n }\n\n const transformProp = hasWindow ? getCorrectPropertyName(window, 'transform') : 'transform';\n const transitionendEvtName =\n hasWindow ? getCorrectEventName(window, 'transitionend') as EventType : 'transitionend';\n\n if (this.inTransit_) {\n const onTransitionEnd = () => {\n this.setInTransit_(false);\n this.adapter.deregisterThumbContainerInteractionHandler(\n transitionendEvtName, onTransitionEnd);\n };\n this.adapter.registerThumbContainerInteractionHandler(\n transitionendEvtName, onTransitionEnd);\n }\n\n requestAnimationFrame(() => {\n // NOTE(traviskaufman): It would be nice to use calc() here,\n // but IE cannot handle calcs in transforms correctly.\n // See: https://goo.gl/NC2itk\n // Also note that the -50% offset is used to center the slider thumb.\n this.adapter.setThumbContainerStyleProperty(\n transformProp, `translateX(${translatePx}px) translateX(-50%)`);\n this.adapter.setTrackStyleProperty(\n transformProp, `scaleX(${pctComplete})`);\n });\n }\n\n /**\n * Toggles the active state of the slider\n */\n private setActive_(active: boolean) {\n this.active_ = active;\n this.toggleClass_(cssClasses.ACTIVE, this.active_);\n }\n\n /**\n * Toggles the inTransit state of the slider\n */\n private setInTransit_(inTransit: boolean) {\n this.inTransit_ = inTransit;\n this.toggleClass_(cssClasses.IN_TRANSIT, this.inTransit_);\n }\n\n /**\n * Conditionally adds or removes a class based on shouldBePresent\n */\n private toggleClass_(className: string, shouldBePresent: boolean) {\n if (shouldBePresent) {\n this.adapter.addClass(className);\n } else {\n this.adapter.removeClass(className);\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility\n// with MDC Web v0.44.0 and earlier.\nexport default MDCSliderFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {closest} from '@material/dom/ponyfill';\nimport {MDCSnackbarAdapter} from './adapter';\nimport {strings} from './constants';\nimport {MDCSnackbarFoundation} from './foundation';\nimport {MDCSnackbarAnnouncer, MDCSnackbarAnnouncerFactory, MDCSnackbarCloseEventDetail} from './types';\nimport * as util from './util';\n\nconst {\n SURFACE_SELECTOR, LABEL_SELECTOR, ACTION_SELECTOR, DISMISS_SELECTOR,\n OPENING_EVENT, OPENED_EVENT, CLOSING_EVENT, CLOSED_EVENT,\n} = strings;\n\nexport class MDCSnackbar extends MDCComponent<MDCSnackbarFoundation> {\n static attachTo(root: Element) {\n return new MDCSnackbar(root);\n }\n\n private announce_!: MDCSnackbarAnnouncer; // assigned in initialize()\n\n private actionEl_!: Element; // assigned in initialSyncWithDOM()\n private labelEl_!: Element; // assigned in initialSyncWithDOM()\n private surfaceEl_!: Element; // assigned in initialSyncWithDOM()\n\n private handleKeyDown_!: SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n private handleSurfaceClick_!: SpecificEventListener<'click'>; // assigned in initialSyncWithDOM()\n\n initialize(announcerFactory: MDCSnackbarAnnouncerFactory = () => util.announce) {\n this.announce_ = announcerFactory();\n }\n\n initialSyncWithDOM() {\n this.surfaceEl_ = this.root.querySelector(SURFACE_SELECTOR)!;\n this.labelEl_ = this.root.querySelector(LABEL_SELECTOR)!;\n this.actionEl_ = this.root.querySelector(ACTION_SELECTOR)!;\n\n this.handleKeyDown_ = (evt) => this.foundation.handleKeyDown(evt);\n this.handleSurfaceClick_ = (evt) => {\n const target = evt.target as Element;\n if (this.isActionButton_(target)) {\n this.foundation.handleActionButtonClick(evt);\n } else if (this.isActionIcon_(target)) {\n this.foundation.handleActionIconClick(evt);\n }\n };\n\n this.registerKeyDownHandler_(this.handleKeyDown_);\n this.registerSurfaceClickHandler_(this.handleSurfaceClick_);\n }\n\n destroy() {\n super.destroy();\n this.deregisterKeyDownHandler_(this.handleKeyDown_);\n this.deregisterSurfaceClickHandler_(this.handleSurfaceClick_);\n }\n\n open() {\n this.foundation.open();\n }\n\n /**\n * @param reason Why the snackbar was closed. Value will be passed to CLOSING_EVENT and CLOSED_EVENT via the\n * `event.detail.reason` property. Standard values are REASON_ACTION and REASON_DISMISS, but custom\n * client-specific values may also be used if desired.\n */\n close(reason = '') {\n this.foundation.close(reason);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCSnackbarAdapter = {\n addClass: (className) => this.root.classList.add(className),\n announce: () => this.announce_(this.labelEl_),\n notifyClosed: (reason) => this.emit<MDCSnackbarCloseEventDetail>(\n CLOSED_EVENT, reason ? {reason} : {}),\n notifyClosing: (reason) => this.emit<MDCSnackbarCloseEventDetail>(\n CLOSING_EVENT, reason ? {reason} : {}),\n notifyOpened: () => this.emit(OPENED_EVENT, {}),\n notifyOpening: () => this.emit(OPENING_EVENT, {}),\n removeClass: (className) => this.root.classList.remove(className),\n };\n return new MDCSnackbarFoundation(adapter);\n }\n\n get timeoutMs(): number {\n return this.foundation.getTimeoutMs();\n }\n\n set timeoutMs(timeoutMs: number) {\n this.foundation.setTimeoutMs(timeoutMs);\n }\n\n get closeOnEscape(): boolean {\n return this.foundation.getCloseOnEscape();\n }\n\n set closeOnEscape(closeOnEscape: boolean) {\n this.foundation.setCloseOnEscape(closeOnEscape);\n }\n\n get isOpen(): boolean {\n return this.foundation.isOpen();\n }\n\n get labelText(): string {\n // This property only returns null if the node is a document, DOCTYPE, or notation.\n // On Element nodes, it always returns a string.\n return this.labelEl_.textContent!;\n }\n\n set labelText(labelText: string) {\n this.labelEl_.textContent = labelText;\n }\n\n get actionButtonText(): string {\n return this.actionEl_.textContent!;\n }\n\n set actionButtonText(actionButtonText: string) {\n this.actionEl_.textContent = actionButtonText;\n }\n\n private registerKeyDownHandler_(handler: SpecificEventListener<'keydown'>) {\n this.listen('keydown', handler);\n }\n\n private deregisterKeyDownHandler_(handler: SpecificEventListener<'keydown'>) {\n this.unlisten('keydown', handler);\n }\n\n private registerSurfaceClickHandler_(handler: SpecificEventListener<'click'>) {\n this.surfaceEl_.addEventListener('click', handler as EventListener);\n }\n\n private deregisterSurfaceClickHandler_(handler: SpecificEventListener<'click'>) {\n this.surfaceEl_.removeEventListener('click', handler as EventListener);\n }\n\n private isActionButton_(target: Element): boolean {\n return Boolean(closest(target, ACTION_SELECTOR));\n }\n\n private isActionIcon_(target: Element): boolean {\n return Boolean(closest(target, DISMISS_SELECTOR));\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n CLOSING: 'mdc-snackbar--closing',\n OPEN: 'mdc-snackbar--open',\n OPENING: 'mdc-snackbar--opening',\n};\n\nconst strings = {\n ACTION_SELECTOR: '.mdc-snackbar__action',\n ARIA_LIVE_LABEL_TEXT_ATTR: 'data-mdc-snackbar-label-text',\n CLOSED_EVENT: 'MDCSnackbar:closed',\n CLOSING_EVENT: 'MDCSnackbar:closing',\n DISMISS_SELECTOR: '.mdc-snackbar__dismiss',\n LABEL_SELECTOR: '.mdc-snackbar__label',\n OPENED_EVENT: 'MDCSnackbar:opened',\n OPENING_EVENT: 'MDCSnackbar:opening',\n REASON_ACTION: 'action',\n REASON_DISMISS: 'dismiss',\n SURFACE_SELECTOR: '.mdc-snackbar__surface',\n};\n\nconst numbers = {\n DEFAULT_AUTO_DISMISS_TIMEOUT_MS: 5000,\n INDETERMINATE: -1,\n MAX_AUTO_DISMISS_TIMEOUT_MS: 10000,\n MIN_AUTO_DISMISS_TIMEOUT_MS: 4000,\n\n // These variables need to be kept in sync with the values in _variables.scss.\n SNACKBAR_ANIMATION_CLOSE_TIME_MS: 75,\n SNACKBAR_ANIMATION_OPEN_TIME_MS: 150,\n\n /**\n * Number of milliseconds to wait between temporarily clearing the label text\n * in the DOM and subsequently restoring it. This is necessary to force IE 11\n * to pick up the `aria-live` content change and announce it to the user.\n */\n ARIA_LIVE_DELAY_MS: 1000,\n};\n\nexport {cssClasses, strings, numbers};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCSnackbarAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\n\nconst {OPENING, OPEN, CLOSING} = cssClasses;\nconst {REASON_ACTION, REASON_DISMISS} = strings;\n\nexport class MDCSnackbarFoundation extends MDCFoundation<MDCSnackbarAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get defaultAdapter(): MDCSnackbarAdapter {\n return {\n addClass: () => undefined,\n announce: () => undefined,\n notifyClosed: () => undefined,\n notifyClosing: () => undefined,\n notifyOpened: () => undefined,\n notifyOpening: () => undefined,\n removeClass: () => undefined,\n };\n }\n\n private isOpen_ = false;\n private animationFrame_ = 0;\n private animationTimer_ = 0;\n private autoDismissTimer_ = 0;\n private autoDismissTimeoutMs_ = numbers.DEFAULT_AUTO_DISMISS_TIMEOUT_MS;\n private closeOnEscape_ = true;\n\n constructor(adapter?: Partial<MDCSnackbarAdapter>) {\n super({...MDCSnackbarFoundation.defaultAdapter, ...adapter});\n }\n\n destroy() {\n this.clearAutoDismissTimer_();\n cancelAnimationFrame(this.animationFrame_);\n this.animationFrame_ = 0;\n clearTimeout(this.animationTimer_);\n this.animationTimer_ = 0;\n this.adapter.removeClass(OPENING);\n this.adapter.removeClass(OPEN);\n this.adapter.removeClass(CLOSING);\n }\n\n open() {\n this.clearAutoDismissTimer_();\n this.isOpen_ = true;\n this.adapter.notifyOpening();\n this.adapter.removeClass(CLOSING);\n this.adapter.addClass(OPENING);\n this.adapter.announce();\n\n // Wait a frame once display is no longer \"none\", to establish basis for animation\n this.runNextAnimationFrame_(() => {\n this.adapter.addClass(OPEN);\n\n this.animationTimer_ = setTimeout(() => {\n const timeoutMs = this.getTimeoutMs();\n this.handleAnimationTimerEnd_();\n this.adapter.notifyOpened();\n if (timeoutMs !== numbers.INDETERMINATE) {\n this.autoDismissTimer_ = setTimeout(() => {\n this.close(REASON_DISMISS);\n }, timeoutMs);\n }\n }, numbers.SNACKBAR_ANIMATION_OPEN_TIME_MS);\n });\n }\n\n /**\n * @param reason Why the snackbar was closed. Value will be passed to CLOSING_EVENT and CLOSED_EVENT via the\n * `event.detail.reason` property. Standard values are REASON_ACTION and REASON_DISMISS, but custom\n * client-specific values may also be used if desired.\n */\n close(reason = '') {\n if (!this.isOpen_) {\n // Avoid redundant close calls (and events), e.g. repeated interactions as the snackbar is animating closed\n return;\n }\n\n cancelAnimationFrame(this.animationFrame_);\n this.animationFrame_ = 0;\n this.clearAutoDismissTimer_();\n\n this.isOpen_ = false;\n this.adapter.notifyClosing(reason);\n this.adapter.addClass(cssClasses.CLOSING);\n this.adapter.removeClass(cssClasses.OPEN);\n this.adapter.removeClass(cssClasses.OPENING);\n\n clearTimeout(this.animationTimer_);\n this.animationTimer_ = setTimeout(() => {\n this.handleAnimationTimerEnd_();\n this.adapter.notifyClosed(reason);\n }, numbers.SNACKBAR_ANIMATION_CLOSE_TIME_MS);\n }\n\n isOpen(): boolean {\n return this.isOpen_;\n }\n\n getTimeoutMs(): number {\n return this.autoDismissTimeoutMs_;\n }\n\n setTimeoutMs(timeoutMs: number) {\n // Use shorter variable names to make the code more readable\n const minValue = numbers.MIN_AUTO_DISMISS_TIMEOUT_MS;\n const maxValue = numbers.MAX_AUTO_DISMISS_TIMEOUT_MS;\n const indeterminateValue = numbers.INDETERMINATE;\n\n if (timeoutMs === numbers.INDETERMINATE || (timeoutMs <= maxValue && timeoutMs >= minValue)) {\n this.autoDismissTimeoutMs_ = timeoutMs;\n } else {\n throw new Error(`\n timeoutMs must be an integer in the range ${minValue}–${maxValue}\n (or ${indeterminateValue} to disable), but got '${timeoutMs}'`);\n }\n }\n\n getCloseOnEscape(): boolean {\n return this.closeOnEscape_;\n }\n\n setCloseOnEscape(closeOnEscape: boolean) {\n this.closeOnEscape_ = closeOnEscape;\n }\n\n handleKeyDown(evt: KeyboardEvent) {\n const isEscapeKey = evt.key === 'Escape' || evt.keyCode === 27;\n if (isEscapeKey && this.getCloseOnEscape()) {\n this.close(REASON_DISMISS);\n }\n }\n\n handleActionButtonClick(_evt: MouseEvent) {\n this.close(REASON_ACTION);\n }\n\n handleActionIconClick(_evt: MouseEvent) {\n this.close(REASON_DISMISS);\n }\n\n private clearAutoDismissTimer_() {\n clearTimeout(this.autoDismissTimer_);\n this.autoDismissTimer_ = 0;\n }\n\n private handleAnimationTimerEnd_() {\n this.animationTimer_ = 0;\n this.adapter.removeClass(cssClasses.OPENING);\n this.adapter.removeClass(cssClasses.CLOSING);\n }\n\n /**\n * Runs the given logic on the next animation frame, using setTimeout to factor in Firefox reflow behavior.\n */\n private runNextAnimationFrame_(callback: () => void) {\n cancelAnimationFrame(this.animationFrame_);\n this.animationFrame_ = requestAnimationFrame(() => {\n this.animationFrame_ = 0;\n clearTimeout(this.animationTimer_);\n this.animationTimer_ = setTimeout(callback, 0);\n });\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCSnackbarFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport * as util from './util';\n\nexport {util};\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {numbers, strings} from './constants';\n\nconst {ARIA_LIVE_DELAY_MS} = numbers;\nconst {ARIA_LIVE_LABEL_TEXT_ATTR} = strings;\n\nfunction announce(ariaEl: Element, labelEl: Element = ariaEl) {\n const priority = ariaEl.getAttribute('aria-live');\n\n // Trim text to ignore ` ` (see below).\n // textContent is only null if the node is a document, DOCTYPE, or notation.\n const labelText = labelEl.textContent!.trim();\n if (!labelText || !priority) {\n return;\n }\n\n // Temporarily disable `aria-live` to prevent JAWS+Firefox from announcing the message twice.\n ariaEl.setAttribute('aria-live', 'off');\n\n // Temporarily clear `textContent` to force a DOM mutation event that will be detected by screen readers.\n // `aria-live` elements are only announced when the element's `textContent` *changes*, so snackbars\n // sent to the browser in the initial HTML response won't be read unless we clear the element's `textContent` first.\n // Similarly, displaying the same snackbar message twice in a row doesn't trigger a DOM mutation event,\n // so screen readers won't announce the second message unless we first clear `textContent`.\n //\n // We have to clear the label text two different ways to make it work in all browsers and screen readers:\n //\n // 1. `textContent = ''` is required for IE11 + JAWS\n // 2. `innerHTML = ' '` is required for Chrome + JAWS and NVDA\n //\n // All other browser/screen reader combinations support both methods.\n //\n // The wrapper `<span>` visually hides the space character so that it doesn't cause jank when added/removed.\n // N.B.: Setting `position: absolute`, `opacity: 0`, or `height: 0` prevents Chrome from detecting the DOM change.\n //\n // This technique has been tested in:\n //\n // * JAWS 2019:\n // - Chrome 70\n // - Firefox 60 (ESR)\n // - IE 11\n // * NVDA 2018:\n // - Chrome 70\n // - Firefox 60 (ESR)\n // - IE 11\n // * ChromeVox 53\n labelEl.textContent = '';\n labelEl.innerHTML = '<span style=\"display: inline-block; width: 0; height: 1px;\"> </span>';\n\n // Prevent visual jank by temporarily displaying the label text in the ::before pseudo-element.\n // CSS generated content is normally announced by screen readers\n // (except in IE 11; see https://tink.uk/accessibility-support-for-css-generated-content/);\n // however, `aria-live` is turned off, so this DOM update will be ignored by screen readers.\n labelEl.setAttribute(ARIA_LIVE_LABEL_TEXT_ATTR, labelText);\n\n setTimeout(() => {\n // Allow screen readers to announce changes to the DOM again.\n ariaEl.setAttribute('aria-live', priority);\n\n // Remove the message from the ::before pseudo-element.\n labelEl.removeAttribute(ARIA_LIVE_LABEL_TEXT_ATTR);\n\n // Restore the original label text, which will be announced by screen readers.\n labelEl.textContent = labelText;\n }, ARIA_LIVE_DELAY_MS);\n}\n\nexport {announce};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {EventType, SpecificEventListener} from '@material/base/types';\nimport {applyPassive} from '@material/dom/events';\nimport {matches} from '@material/dom/ponyfill';\nimport {MDCRippleAdapter} from '@material/ripple/adapter';\nimport {MDCRipple} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCRippleCapableSurface} from '@material/ripple/types';\nimport {MDCSwitchAdapter} from './adapter';\nimport {MDCSwitchFoundation} from './foundation';\n\nexport class MDCSwitch extends MDCComponent<MDCSwitchFoundation> implements MDCRippleCapableSurface {\n static attachTo(root: HTMLElement) {\n return new MDCSwitch(root);\n }\n\n private readonly ripple_ = this.createRipple_();\n\n // Initialized in `initialSyncWithDOM`.\n private changeHandler_!: EventListener;\n\n destroy() {\n super.destroy();\n this.ripple_.destroy();\n this.nativeControl_.removeEventListener('change', this.changeHandler_);\n }\n\n initialSyncWithDOM() {\n this.changeHandler_ = (...args) => this.foundation.handleChange(...args);\n this.nativeControl_.addEventListener('change', this.changeHandler_);\n\n // Sometimes the checked state of the input element is saved in the history.\n // The switch styling should match the checked state of the input element.\n // Do an initial sync between the native control and the foundation.\n this.checked = this.checked;\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCSwitchAdapter = {\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n setNativeControlChecked: (checked) => this.nativeControl_.checked =\n checked,\n setNativeControlDisabled: (disabled) => this.nativeControl_.disabled =\n disabled,\n setNativeControlAttr: (attr, value) =>\n this.nativeControl_.setAttribute(attr, value),\n };\n return new MDCSwitchFoundation(adapter);\n }\n\n get ripple() {\n return this.ripple_;\n }\n\n get checked() {\n return this.nativeControl_.checked;\n }\n\n set checked(checked) {\n this.foundation.setChecked(checked);\n }\n\n get disabled() {\n return this.nativeControl_.disabled;\n }\n\n set disabled(disabled) {\n this.foundation.setDisabled(disabled);\n }\n\n private createRipple_(): MDCRipple {\n const {RIPPLE_SURFACE_SELECTOR} = MDCSwitchFoundation.strings;\n const rippleSurface =\n this.root.querySelector(RIPPLE_SURFACE_SELECTOR) as HTMLElement;\n\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCRippleAdapter = {\n ...MDCRipple.createAdapter(this),\n addClass: (className: string) => rippleSurface.classList.add(className),\n computeBoundingRect: () => rippleSurface.getBoundingClientRect(),\n deregisterInteractionHandler: <K extends EventType>(\n evtType: K, handler: SpecificEventListener<K>) => {\n this.nativeControl_.removeEventListener(evtType, handler, applyPassive());\n },\n isSurfaceActive: () => matches(this.nativeControl_, ':active'),\n isUnbounded: () => true,\n registerInteractionHandler: <K extends EventType>(\n evtType: K, handler: SpecificEventListener<K>) => {\n this.nativeControl_.addEventListener(evtType, handler, applyPassive());\n },\n removeClass: (className: string) => {\n rippleSurface.classList.remove(className);\n },\n updateCssVariable: (varName: string, value: string) => {\n rippleSurface.style.setProperty(varName, value);\n },\n };\n return new MDCRipple(this.root, new MDCRippleFoundation(adapter));\n }\n\n private get nativeControl_() {\n const {NATIVE_CONTROL_SELECTOR} = MDCSwitchFoundation.strings;\n return this.root.querySelector(NATIVE_CONTROL_SELECTOR) as HTMLInputElement;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/** CSS classes used by the switch. */\nconst cssClasses = {\n /** Class used for a switch that is in the \"checked\" (on) position. */\n CHECKED: 'mdc-switch--checked',\n /** Class used for a switch that is disabled. */\n DISABLED: 'mdc-switch--disabled',\n};\n\n/** String constants used by the switch. */\nconst strings = {\n /** Aria attribute for checked or unchecked state of switch */\n ARIA_CHECKED_ATTR: 'aria-checked',\n /** A CSS selector used to locate the native HTML control for the switch. */\n NATIVE_CONTROL_SELECTOR: '.mdc-switch__native-control',\n /** A CSS selector used to locate the ripple surface element for the switch. */\n RIPPLE_SURFACE_SELECTOR: '.mdc-switch__thumb-underlay',\n};\n\nexport {cssClasses, strings};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCSwitchAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCSwitchFoundation extends MDCFoundation<MDCSwitchAdapter> {\n /** The string constants used by the switch. */\n static get strings() {\n return strings;\n }\n\n /** The CSS classes used by the switch. */\n static get cssClasses() {\n return cssClasses;\n }\n\n /** The default Adapter for the switch. */\n static get defaultAdapter(): MDCSwitchAdapter {\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n setNativeControlChecked: () => undefined,\n setNativeControlDisabled: () => undefined,\n setNativeControlAttr: () => undefined,\n };\n }\n\n constructor(adapter?: Partial<MDCSwitchAdapter>) {\n super({...MDCSwitchFoundation.defaultAdapter, ...adapter});\n }\n\n /** Sets the checked state of the switch. */\n setChecked(checked: boolean) {\n this.adapter.setNativeControlChecked(checked);\n this.updateAriaChecked_(checked);\n this.updateCheckedStyling_(checked);\n }\n\n /** Sets the disabled state of the switch. */\n setDisabled(disabled: boolean) {\n this.adapter.setNativeControlDisabled(disabled);\n if (disabled) {\n this.adapter.addClass(cssClasses.DISABLED);\n } else {\n this.adapter.removeClass(cssClasses.DISABLED);\n }\n }\n\n /** Handles the change event for the switch native control. */\n handleChange(evt: Event) {\n const nativeControl = evt.target as HTMLInputElement;\n this.updateAriaChecked_(nativeControl.checked);\n this.updateCheckedStyling_(nativeControl.checked);\n }\n\n /** Updates the styling of the switch based on its checked state. */\n private updateCheckedStyling_(checked: boolean) {\n if (checked) {\n this.adapter.addClass(cssClasses.CHECKED);\n } else {\n this.adapter.removeClass(cssClasses.CHECKED);\n }\n }\n\n private updateAriaChecked_(checked: boolean) {\n this.adapter.setNativeControlAttr(\n strings.ARIA_CHECKED_ATTR, `${!!checked}`);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCSwitchFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {CustomEventListener, SpecificEventListener} from '@material/base/types';\nimport {MDCTabScroller, MDCTabScrollerFactory} from '@material/tab-scroller/component';\nimport {MDCTab, MDCTabFactory} from '@material/tab/component';\nimport {MDCTabFoundation} from '@material/tab/foundation';\nimport {MDCTabInteractionEvent} from '@material/tab/types';\nimport {MDCTabBarAdapter} from './adapter';\nimport {MDCTabBarFoundation} from './foundation';\nimport {MDCTabBarActivatedEventDetail} from './types';\n\nconst {strings} = MDCTabBarFoundation;\n\nlet tabIdCounter = 0;\n\nexport class MDCTabBar extends MDCComponent<MDCTabBarFoundation> {\n static attachTo(root: Element): MDCTabBar {\n return new MDCTabBar(root);\n }\n\n private tabList_!: MDCTab[]; // assigned in initialize()\n private tabScroller_!: MDCTabScroller | null; // assigned in initialize()\n private handleTabInteraction_!: CustomEventListener<MDCTabInteractionEvent>; // assigned in initialSyncWithDOM()\n private handleKeyDown_!: SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n\n set focusOnActivate(focusOnActivate: boolean) {\n this.tabList_.forEach((tab) => tab.focusOnActivate = focusOnActivate);\n }\n\n set useAutomaticActivation(useAutomaticActivation: boolean) {\n this.foundation.setUseAutomaticActivation(useAutomaticActivation);\n }\n\n initialize(\n tabFactory: MDCTabFactory = (el) => new MDCTab(el),\n tabScrollerFactory: MDCTabScrollerFactory = (el) => new MDCTabScroller(el),\n ) {\n this.tabList_ = this.instantiateTabs_(tabFactory);\n this.tabScroller_ = this.instantiateTabScroller_(tabScrollerFactory);\n }\n\n initialSyncWithDOM() {\n this.handleTabInteraction_ = (evt) =>\n this.foundation.handleTabInteraction(evt);\n this.handleKeyDown_ = (evt) => this.foundation.handleKeyDown(evt);\n\n this.listen(MDCTabFoundation.strings.INTERACTED_EVENT, this.handleTabInteraction_);\n this.listen('keydown', this.handleKeyDown_);\n\n for (let i = 0; i < this.tabList_.length; i++) {\n if (this.tabList_[i].active) {\n this.scrollIntoView(i);\n break;\n }\n }\n }\n\n destroy() {\n super.destroy();\n this.unlisten(MDCTabFoundation.strings.INTERACTED_EVENT, this.handleTabInteraction_);\n this.unlisten('keydown', this.handleKeyDown_);\n this.tabList_.forEach((tab) => tab.destroy());\n\n if (this.tabScroller_) {\n this.tabScroller_.destroy();\n }\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCTabBarAdapter = {\n scrollTo: (scrollX) => this.tabScroller_!.scrollTo(scrollX),\n incrementScroll: (scrollXIncrement) =>\n this.tabScroller_!.incrementScroll(scrollXIncrement),\n getScrollPosition: () => this.tabScroller_!.getScrollPosition(),\n getScrollContentWidth: () => this.tabScroller_!.getScrollContentWidth(),\n getOffsetWidth: () => (this.root as HTMLElement).offsetWidth,\n isRTL: () => window.getComputedStyle(this.root).getPropertyValue(\n 'direction') === 'rtl',\n setActiveTab: (index) => this.foundation.activateTab(index),\n activateTabAtIndex: (index, clientRect) =>\n this.tabList_[index].activate(clientRect),\n deactivateTabAtIndex: (index) => this.tabList_[index].deactivate(),\n focusTabAtIndex: (index) => this.tabList_[index].focus(),\n getTabIndicatorClientRectAtIndex: (index) =>\n this.tabList_[index].computeIndicatorClientRect(),\n getTabDimensionsAtIndex: (index) =>\n this.tabList_[index].computeDimensions(),\n getPreviousActiveTabIndex: () => {\n for (let i = 0; i < this.tabList_.length; i++) {\n if (this.tabList_[i].active) {\n return i;\n }\n }\n return -1;\n },\n getFocusedTabIndex: () => {\n const tabElements = this.getTabElements_();\n const activeElement = document.activeElement!;\n return tabElements.indexOf(activeElement);\n },\n getIndexOfTabById: (id) => {\n for (let i = 0; i < this.tabList_.length; i++) {\n if (this.tabList_[i].id === id) {\n return i;\n }\n }\n return -1;\n },\n getTabListLength: () => this.tabList_.length,\n notifyTabActivated: (index) => this.emit<MDCTabBarActivatedEventDetail>(\n strings.TAB_ACTIVATED_EVENT, {index}, true),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCTabBarFoundation(adapter);\n }\n\n /**\n * Activates the tab at the given index\n * @param index The index of the tab\n */\n activateTab(index: number) {\n this.foundation.activateTab(index);\n }\n\n /**\n * Scrolls the tab at the given index into view\n * @param index THe index of the tab\n */\n scrollIntoView(index: number) {\n this.foundation.scrollIntoView(index);\n }\n\n /**\n * Returns all the tab elements in a nice clean array\n */\n private getTabElements_(): Element[] {\n return [].slice.call(this.root.querySelectorAll(strings.TAB_SELECTOR));\n }\n\n /**\n * Instantiates tab components on all child tab elements\n */\n private instantiateTabs_(tabFactory: MDCTabFactory) {\n return this.getTabElements_().map((el) => {\n el.id = el.id || `mdc-tab-${++tabIdCounter}`;\n return tabFactory(el);\n });\n }\n\n /**\n * Instantiates tab scroller component on the child tab scroller element\n */\n private instantiateTabScroller_(tabScrollerFactory: MDCTabScrollerFactory): MDCTabScroller | null {\n const tabScrollerElement =\n this.root.querySelector(strings.TAB_SCROLLER_SELECTOR);\n if (tabScrollerElement) {\n return tabScrollerFactory(tabScrollerElement);\n }\n return null;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst strings = {\n ARROW_LEFT_KEY: 'ArrowLeft',\n ARROW_RIGHT_KEY: 'ArrowRight',\n END_KEY: 'End',\n ENTER_KEY: 'Enter',\n HOME_KEY: 'Home',\n SPACE_KEY: 'Space',\n TAB_ACTIVATED_EVENT: 'MDCTabBar:activated',\n TAB_SCROLLER_SELECTOR: '.mdc-tab-scroller',\n TAB_SELECTOR: '.mdc-tab',\n};\n\nconst numbers = {\n ARROW_LEFT_KEYCODE: 37,\n ARROW_RIGHT_KEYCODE: 39,\n END_KEYCODE: 35,\n ENTER_KEYCODE: 13,\n EXTRA_SCROLL_AMOUNT: 20,\n HOME_KEYCODE: 36,\n SPACE_KEYCODE: 32,\n};\n\nexport {numbers, strings};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCTabDimensions, MDCTabInteractionEvent} from '@material/tab/types';\nimport {MDCTabBarAdapter} from './adapter';\nimport {numbers, strings} from './constants';\n\nconst ACCEPTABLE_KEYS = new Set<string>();\n// IE11 has no support for new Set with iterable so we need to initialize this by hand\nACCEPTABLE_KEYS.add(strings.ARROW_LEFT_KEY);\nACCEPTABLE_KEYS.add(strings.ARROW_RIGHT_KEY);\nACCEPTABLE_KEYS.add(strings.END_KEY);\nACCEPTABLE_KEYS.add(strings.HOME_KEY);\nACCEPTABLE_KEYS.add(strings.ENTER_KEY);\nACCEPTABLE_KEYS.add(strings.SPACE_KEY);\n\nconst KEYCODE_MAP = new Map<number, string>();\n// IE11 has no support for new Map with iterable so we need to initialize this by hand\nKEYCODE_MAP.set(numbers.ARROW_LEFT_KEYCODE, strings.ARROW_LEFT_KEY);\nKEYCODE_MAP.set(numbers.ARROW_RIGHT_KEYCODE, strings.ARROW_RIGHT_KEY);\nKEYCODE_MAP.set(numbers.END_KEYCODE, strings.END_KEY);\nKEYCODE_MAP.set(numbers.HOME_KEYCODE, strings.HOME_KEY);\nKEYCODE_MAP.set(numbers.ENTER_KEYCODE, strings.ENTER_KEY);\nKEYCODE_MAP.set(numbers.SPACE_KEYCODE, strings.SPACE_KEY);\n\nexport class MDCTabBarFoundation extends MDCFoundation<MDCTabBarAdapter> {\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n static get defaultAdapter(): MDCTabBarAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n scrollTo: () => undefined,\n incrementScroll: () => undefined,\n getScrollPosition: () => 0,\n getScrollContentWidth: () => 0,\n getOffsetWidth: () => 0,\n isRTL: () => false,\n setActiveTab: () => undefined,\n activateTabAtIndex: () => undefined,\n deactivateTabAtIndex: () => undefined,\n focusTabAtIndex: () => undefined,\n getTabIndicatorClientRectAtIndex: () => ({top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0}),\n getTabDimensionsAtIndex: () => ({rootLeft: 0, rootRight: 0, contentLeft: 0, contentRight: 0}),\n getPreviousActiveTabIndex: () => -1,\n getFocusedTabIndex: () => -1,\n getIndexOfTabById: () => -1,\n getTabListLength: () => 0,\n notifyTabActivated: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private useAutomaticActivation_ = false;\n\n constructor(adapter?: Partial<MDCTabBarAdapter>) {\n super({...MDCTabBarFoundation.defaultAdapter, ...adapter});\n }\n\n /**\n * Switches between automatic and manual activation modes.\n * See https://www.w3.org/TR/wai-aria-practices/#tabpanel for examples.\n */\n setUseAutomaticActivation(useAutomaticActivation: boolean) {\n this.useAutomaticActivation_ = useAutomaticActivation;\n }\n\n activateTab(index: number) {\n const previousActiveIndex = this.adapter.getPreviousActiveTabIndex();\n if (!this.indexIsInRange_(index) || index === previousActiveIndex) {\n return;\n }\n\n let previousClientRect;\n if (previousActiveIndex !== -1) {\n this.adapter.deactivateTabAtIndex(previousActiveIndex);\n previousClientRect =\n this.adapter.getTabIndicatorClientRectAtIndex(previousActiveIndex);\n }\n\n this.adapter.activateTabAtIndex(index, previousClientRect);\n this.scrollIntoView(index);\n\n this.adapter.notifyTabActivated(index);\n }\n\n handleKeyDown(evt: KeyboardEvent) {\n // Get the key from the event\n const key = this.getKeyFromEvent_(evt);\n\n // Early exit if the event key isn't one of the keyboard navigation keys\n if (key === undefined) {\n return;\n }\n\n // Prevent default behavior for movement keys, but not for activation keys, since :active is used to apply ripple\n if (!this.isActivationKey_(key)) {\n evt.preventDefault();\n }\n\n if (this.useAutomaticActivation_) {\n if (this.isActivationKey_(key)) {\n return;\n }\n\n const index = this.determineTargetFromKey_(\n this.adapter.getPreviousActiveTabIndex(), key);\n this.adapter.setActiveTab(index);\n this.scrollIntoView(index);\n } else {\n const focusedTabIndex = this.adapter.getFocusedTabIndex();\n if (this.isActivationKey_(key)) {\n this.adapter.setActiveTab(focusedTabIndex);\n } else {\n const index = this.determineTargetFromKey_(focusedTabIndex, key);\n this.adapter.focusTabAtIndex(index);\n this.scrollIntoView(index);\n }\n }\n }\n\n /**\n * Handles the MDCTab:interacted event\n */\n handleTabInteraction(evt: MDCTabInteractionEvent) {\n this.adapter.setActiveTab(this.adapter.getIndexOfTabById(evt.detail.tabId));\n }\n\n /**\n * Scrolls the tab at the given index into view\n * @param index The tab index to make visible\n */\n scrollIntoView(index: number) {\n // Early exit if the index is out of range\n if (!this.indexIsInRange_(index)) {\n return;\n }\n\n // Always scroll to 0 if scrolling to the 0th index\n if (index === 0) {\n return this.adapter.scrollTo(0);\n }\n\n // Always scroll to the max value if scrolling to the Nth index\n // MDCTabScroller.scrollTo() will never scroll past the max possible value\n if (index === this.adapter.getTabListLength() - 1) {\n return this.adapter.scrollTo(this.adapter.getScrollContentWidth());\n }\n\n if (this.isRTL_()) {\n return this.scrollIntoViewRTL_(index);\n }\n\n this.scrollIntoView_(index);\n }\n\n /**\n * Private method for determining the index of the destination tab based on what key was pressed\n * @param origin The original index from which to determine the destination\n * @param key The name of the key\n */\n private determineTargetFromKey_(origin: number, key: string): number {\n const isRTL = this.isRTL_();\n const maxIndex = this.adapter.getTabListLength() - 1;\n const shouldGoToEnd = key === strings.END_KEY;\n const shouldDecrement = key === strings.ARROW_LEFT_KEY && !isRTL || key === strings.ARROW_RIGHT_KEY && isRTL;\n const shouldIncrement = key === strings.ARROW_RIGHT_KEY && !isRTL || key === strings.ARROW_LEFT_KEY && isRTL;\n let index = origin;\n\n if (shouldGoToEnd) {\n index = maxIndex;\n } else if (shouldDecrement) {\n index -= 1;\n } else if (shouldIncrement) {\n index += 1;\n } else {\n index = 0;\n }\n\n if (index < 0) {\n index = maxIndex;\n } else if (index > maxIndex) {\n index = 0;\n }\n\n return index;\n }\n\n /**\n * Calculates the scroll increment that will make the tab at the given index visible\n * @param index The index of the tab\n * @param nextIndex The index of the next tab\n * @param scrollPosition The current scroll position\n * @param barWidth The width of the Tab Bar\n */\n private calculateScrollIncrement_(\n index: number,\n nextIndex: number,\n scrollPosition: number,\n barWidth: number,\n ): number {\n const nextTabDimensions = this.adapter.getTabDimensionsAtIndex(nextIndex);\n const relativeContentLeft = nextTabDimensions.contentLeft - scrollPosition - barWidth;\n const relativeContentRight = nextTabDimensions.contentRight - scrollPosition;\n const leftIncrement = relativeContentRight - numbers.EXTRA_SCROLL_AMOUNT;\n const rightIncrement = relativeContentLeft + numbers.EXTRA_SCROLL_AMOUNT;\n\n if (nextIndex < index) {\n return Math.min(leftIncrement, 0);\n }\n\n return Math.max(rightIncrement, 0);\n }\n\n /**\n * Calculates the scroll increment that will make the tab at the given index visible in RTL\n * @param index The index of the tab\n * @param nextIndex The index of the next tab\n * @param scrollPosition The current scroll position\n * @param barWidth The width of the Tab Bar\n * @param scrollContentWidth The width of the scroll content\n */\n private calculateScrollIncrementRTL_(\n index: number,\n nextIndex: number,\n scrollPosition: number,\n barWidth: number,\n scrollContentWidth: number,\n ): number {\n const nextTabDimensions = this.adapter.getTabDimensionsAtIndex(nextIndex);\n const relativeContentLeft = scrollContentWidth - nextTabDimensions.contentLeft - scrollPosition;\n const relativeContentRight = scrollContentWidth - nextTabDimensions.contentRight - scrollPosition - barWidth;\n const leftIncrement = relativeContentRight + numbers.EXTRA_SCROLL_AMOUNT;\n const rightIncrement = relativeContentLeft - numbers.EXTRA_SCROLL_AMOUNT;\n\n if (nextIndex > index) {\n return Math.max(leftIncrement, 0);\n }\n\n return Math.min(rightIncrement, 0);\n }\n\n /**\n * Determines the index of the adjacent tab closest to either edge of the Tab Bar\n * @param index The index of the tab\n * @param tabDimensions The dimensions of the tab\n * @param scrollPosition The current scroll position\n * @param barWidth The width of the tab bar\n */\n private findAdjacentTabIndexClosestToEdge_(\n index: number,\n tabDimensions: MDCTabDimensions,\n scrollPosition: number,\n barWidth: number,\n ): number {\n /**\n * Tabs are laid out in the Tab Scroller like this:\n *\n * Scroll Position\n * +---+\n * | | Bar Width\n * | +-----------------------------------+\n * | | |\n * | V V\n * | +-----------------------------------+\n * V | Tab Scroller |\n * +------------+--------------+-------------------+\n * | Tab | Tab | Tab |\n * +------------+--------------+-------------------+\n * | |\n * +-----------------------------------+\n *\n * To determine the next adjacent index, we look at the Tab root left and\n * Tab root right, both relative to the scroll position. If the Tab root\n * left is less than 0, then we know it's out of view to the left. If the\n * Tab root right minus the bar width is greater than 0, we know the Tab is\n * out of view to the right. From there, we either increment or decrement\n * the index.\n */\n const relativeRootLeft = tabDimensions.rootLeft - scrollPosition;\n const relativeRootRight = tabDimensions.rootRight - scrollPosition - barWidth;\n const relativeRootDelta = relativeRootLeft + relativeRootRight;\n const leftEdgeIsCloser = relativeRootLeft < 0 || relativeRootDelta < 0;\n const rightEdgeIsCloser = relativeRootRight > 0 || relativeRootDelta > 0;\n\n if (leftEdgeIsCloser) {\n return index - 1;\n }\n\n if (rightEdgeIsCloser) {\n return index + 1;\n }\n\n return -1;\n }\n\n /**\n * Determines the index of the adjacent tab closest to either edge of the Tab Bar in RTL\n * @param index The index of the tab\n * @param tabDimensions The dimensions of the tab\n * @param scrollPosition The current scroll position\n * @param barWidth The width of the tab bar\n * @param scrollContentWidth The width of the scroller content\n */\n private findAdjacentTabIndexClosestToEdgeRTL_(\n index: number,\n tabDimensions: MDCTabDimensions,\n scrollPosition: number,\n barWidth: number,\n scrollContentWidth: number,\n ): number {\n const rootLeft = scrollContentWidth - tabDimensions.rootLeft - barWidth - scrollPosition;\n const rootRight = scrollContentWidth - tabDimensions.rootRight - scrollPosition;\n const rootDelta = rootLeft + rootRight;\n const leftEdgeIsCloser = rootLeft > 0 || rootDelta > 0;\n const rightEdgeIsCloser = rootRight < 0 || rootDelta < 0;\n\n if (leftEdgeIsCloser) {\n return index + 1;\n }\n\n if (rightEdgeIsCloser) {\n return index - 1;\n }\n\n return -1;\n }\n\n /**\n * Returns the key associated with a keydown event\n * @param evt The keydown event\n */\n private getKeyFromEvent_(evt: KeyboardEvent): string {\n if (ACCEPTABLE_KEYS.has(evt.key)) {\n return evt.key;\n }\n return KEYCODE_MAP.get(evt.keyCode)!;\n }\n\n private isActivationKey_(key: string) {\n return key === strings.SPACE_KEY || key === strings.ENTER_KEY;\n }\n\n /**\n * Returns whether a given index is inclusively between the ends\n * @param index The index to test\n */\n private indexIsInRange_(index: number) {\n return index >= 0 && index < this.adapter.getTabListLength();\n }\n\n /**\n * Returns the view's RTL property\n */\n private isRTL_(): boolean {\n return this.adapter.isRTL();\n }\n\n /**\n * Scrolls the tab at the given index into view for left-to-right user agents.\n * @param index The index of the tab to scroll into view\n */\n private scrollIntoView_(index: number) {\n const scrollPosition = this.adapter.getScrollPosition();\n const barWidth = this.adapter.getOffsetWidth();\n const tabDimensions = this.adapter.getTabDimensionsAtIndex(index);\n const nextIndex = this.findAdjacentTabIndexClosestToEdge_(index, tabDimensions, scrollPosition, barWidth);\n\n if (!this.indexIsInRange_(nextIndex)) {\n return;\n }\n\n const scrollIncrement = this.calculateScrollIncrement_(index, nextIndex, scrollPosition, barWidth);\n this.adapter.incrementScroll(scrollIncrement);\n }\n\n /**\n * Scrolls the tab at the given index into view in RTL\n * @param index The tab index to make visible\n */\n private scrollIntoViewRTL_(index: number) {\n const scrollPosition = this.adapter.getScrollPosition();\n const barWidth = this.adapter.getOffsetWidth();\n const tabDimensions = this.adapter.getTabDimensionsAtIndex(index);\n const scrollWidth = this.adapter.getScrollContentWidth();\n const nextIndex = this.findAdjacentTabIndexClosestToEdgeRTL_(\n index, tabDimensions, scrollPosition, barWidth, scrollWidth);\n\n if (!this.indexIsInRange_(nextIndex)) {\n return;\n }\n\n const scrollIncrement = this.calculateScrollIncrementRTL_(index, nextIndex, scrollPosition, barWidth, scrollWidth);\n this.adapter.incrementScroll(scrollIncrement);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabBarFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\n\nimport {MDCTabIndicatorAdapter} from './adapter';\nimport {MDCFadingTabIndicatorFoundation} from './fading-foundation';\nimport {MDCTabIndicatorFoundation} from './foundation';\nimport {MDCSlidingTabIndicatorFoundation} from './sliding-foundation';\n\nexport type MDCTabIndicatorFactory = (el: Element, foundation?: MDCTabIndicatorFoundation) => MDCTabIndicator;\n\nexport class MDCTabIndicator extends MDCComponent<MDCTabIndicatorFoundation> {\n static attachTo(root: Element): MDCTabIndicator {\n return new MDCTabIndicator(root);\n }\n\n private content_!: HTMLElement; // assigned in initialize()\n\n initialize() {\n this.content_ = this.root.querySelector<HTMLElement>(\n MDCTabIndicatorFoundation.strings.CONTENT_SELECTOR)!;\n }\n\n computeContentClientRect(): ClientRect {\n return this.foundation.computeContentClientRect();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCTabIndicatorAdapter = {\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n computeContentClientRect: () => this.content_.getBoundingClientRect(),\n setContentStyleProperty: (prop, value) =>\n this.content_.style.setProperty(prop, value),\n };\n // tslint:enable:object-literal-sort-keys\n\n if (this.root.classList.contains(\n MDCTabIndicatorFoundation.cssClasses.FADE)) {\n return new MDCFadingTabIndicatorFoundation(adapter);\n }\n\n // Default to the sliding indicator\n return new MDCSlidingTabIndicatorFoundation(adapter);\n }\n\n activate(previousIndicatorClientRect?: ClientRect) {\n this.foundation.activate(previousIndicatorClientRect);\n }\n\n deactivate() {\n this.foundation.deactivate();\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n ACTIVE: 'mdc-tab-indicator--active',\n FADE: 'mdc-tab-indicator--fade',\n NO_TRANSITION: 'mdc-tab-indicator--no-transition',\n};\n\nconst strings = {\n CONTENT_SELECTOR: '.mdc-tab-indicator__content',\n};\n\nexport {\n cssClasses,\n strings,\n};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTabIndicatorFoundation} from './foundation';\n\n/* istanbul ignore next: subclass is not a branch statement */\nexport class MDCFadingTabIndicatorFoundation extends MDCTabIndicatorFoundation {\n activate() {\n this.adapter.addClass(MDCTabIndicatorFoundation.cssClasses.ACTIVE);\n }\n\n deactivate() {\n this.adapter.removeClass(MDCTabIndicatorFoundation.cssClasses.ACTIVE);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCFadingTabIndicatorFoundation;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCTabIndicatorAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport abstract class MDCTabIndicatorFoundation extends MDCFoundation<MDCTabIndicatorAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get defaultAdapter(): MDCTabIndicatorAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n computeContentClientRect: () => ({top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0}),\n setContentStyleProperty: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n constructor(adapter?: Partial<MDCTabIndicatorAdapter>) {\n super({...MDCTabIndicatorFoundation.defaultAdapter, ...adapter});\n }\n\n computeContentClientRect(): ClientRect {\n return this.adapter.computeContentClientRect();\n }\n\n abstract activate(previousIndicatorClientRect?: ClientRect): void;\n abstract deactivate(): void;\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabIndicatorFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './fading-foundation';\nexport * from './sliding-foundation';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTabIndicatorFoundation} from './foundation';\n\n/* istanbul ignore next: subclass is not a branch statement */\nexport class MDCSlidingTabIndicatorFoundation extends MDCTabIndicatorFoundation {\n activate(previousIndicatorClientRect?: ClientRect) {\n // Early exit if no indicator is present to handle cases where an indicator\n // may be activated without a prior indicator state\n if (!previousIndicatorClientRect) {\n this.adapter.addClass(MDCTabIndicatorFoundation.cssClasses.ACTIVE);\n return;\n }\n\n // This animation uses the FLIP approach. You can read more about it at the link below:\n // https://aerotwist.com/blog/flip-your-animations/\n\n // Calculate the dimensions based on the dimensions of the previous indicator\n const currentClientRect = this.computeContentClientRect();\n const widthDelta = previousIndicatorClientRect.width / currentClientRect.width;\n const xPosition = previousIndicatorClientRect.left - currentClientRect.left;\n this.adapter.addClass(MDCTabIndicatorFoundation.cssClasses.NO_TRANSITION);\n this.adapter.setContentStyleProperty(\n 'transform', `translateX(${xPosition}px) scaleX(${widthDelta})`);\n\n // Force repaint before updating classes and transform to ensure the transform properly takes effect\n this.computeContentClientRect();\n\n this.adapter.removeClass(\n MDCTabIndicatorFoundation.cssClasses.NO_TRANSITION);\n this.adapter.addClass(MDCTabIndicatorFoundation.cssClasses.ACTIVE);\n this.adapter.setContentStyleProperty('transform', '');\n }\n\n deactivate() {\n this.adapter.removeClass(MDCTabIndicatorFoundation.cssClasses.ACTIVE);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCSlidingTabIndicatorFoundation;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {applyPassive} from '@material/dom/events';\nimport {matches} from '@material/dom/ponyfill';\nimport {MDCTabScrollerAdapter} from './adapter';\nimport {MDCTabScrollerFoundation} from './foundation';\nimport * as util from './util';\n\ntype InteractionEventType = 'wheel' | 'touchstart' | 'pointerdown' | 'mousedown' | 'keydown';\n\nexport type MDCTabScrollerFactory = (el: Element, foundation?: MDCTabScrollerFoundation) => MDCTabScroller;\n\nexport class MDCTabScroller extends MDCComponent<MDCTabScrollerFoundation> {\n static attachTo(root: Element): MDCTabScroller {\n return new MDCTabScroller(root);\n }\n\n private content_!: HTMLElement; // assigned in initialize()\n private area_!: HTMLElement; // assigned in initialize()\n private handleInteraction_!: SpecificEventListener<InteractionEventType>; // assigned in initialSyncWithDOM()\n private handleTransitionEnd_!: SpecificEventListener<'transitionend'>; // assigned in initialSyncWithDOM()\n\n initialize() {\n this.area_ = this.root.querySelector<HTMLElement>(\n MDCTabScrollerFoundation.strings.AREA_SELECTOR)!;\n this.content_ = this.root.querySelector<HTMLElement>(\n MDCTabScrollerFoundation.strings.CONTENT_SELECTOR)!;\n }\n\n initialSyncWithDOM() {\n this.handleInteraction_ = () => this.foundation.handleInteraction();\n this.handleTransitionEnd_ = (evt) => this.foundation.handleTransitionEnd(evt);\n\n this.area_.addEventListener('wheel', this.handleInteraction_, applyPassive());\n this.area_.addEventListener('touchstart', this.handleInteraction_, applyPassive());\n this.area_.addEventListener('pointerdown', this.handleInteraction_, applyPassive());\n this.area_.addEventListener('mousedown', this.handleInteraction_, applyPassive());\n this.area_.addEventListener('keydown', this.handleInteraction_, applyPassive());\n this.content_.addEventListener('transitionend', this.handleTransitionEnd_);\n }\n\n destroy() {\n super.destroy();\n\n this.area_.removeEventListener('wheel', this.handleInteraction_, applyPassive());\n this.area_.removeEventListener('touchstart', this.handleInteraction_, applyPassive());\n this.area_.removeEventListener('pointerdown', this.handleInteraction_, applyPassive());\n this.area_.removeEventListener('mousedown', this.handleInteraction_, applyPassive());\n this.area_.removeEventListener('keydown', this.handleInteraction_, applyPassive());\n this.content_.removeEventListener('transitionend', this.handleTransitionEnd_);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCTabScrollerAdapter = {\n eventTargetMatchesSelector: (evtTarget, selector) =>\n matches(evtTarget as Element, selector),\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n addScrollAreaClass: (className) => this.area_.classList.add(className),\n setScrollAreaStyleProperty: (prop, value) =>\n this.area_.style.setProperty(prop, value),\n setScrollContentStyleProperty: (prop, value) =>\n this.content_.style.setProperty(prop, value),\n getScrollContentStyleValue: (propName) =>\n window.getComputedStyle(this.content_).getPropertyValue(propName),\n setScrollAreaScrollLeft: (scrollX) => this.area_.scrollLeft = scrollX,\n getScrollAreaScrollLeft: () => this.area_.scrollLeft,\n getScrollContentOffsetWidth: () => this.content_.offsetWidth,\n getScrollAreaOffsetWidth: () => this.area_.offsetWidth,\n computeScrollAreaClientRect: () => this.area_.getBoundingClientRect(),\n computeScrollContentClientRect: () =>\n this.content_.getBoundingClientRect(),\n computeHorizontalScrollbarHeight: () =>\n util.computeHorizontalScrollbarHeight(document),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCTabScrollerFoundation(adapter);\n }\n\n /**\n * Returns the current visual scroll position\n */\n getScrollPosition(): number {\n return this.foundation.getScrollPosition();\n }\n\n /**\n * Returns the width of the scroll content\n */\n getScrollContentWidth(): number {\n return this.content_.offsetWidth;\n }\n\n /**\n * Increments the scroll value by the given amount\n * @param scrollXIncrement The pixel value by which to increment the scroll value\n */\n incrementScroll(scrollXIncrement: number) {\n this.foundation.incrementScroll(scrollXIncrement);\n }\n\n /**\n * Scrolls to the given pixel position\n * @param scrollX The pixel value to scroll to\n */\n scrollTo(scrollX: number) {\n this.foundation.scrollTo(scrollX);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n ANIMATING: 'mdc-tab-scroller--animating',\n SCROLL_AREA_SCROLL: 'mdc-tab-scroller__scroll-area--scroll',\n SCROLL_TEST: 'mdc-tab-scroller__test',\n};\n\nconst strings = {\n AREA_SELECTOR: '.mdc-tab-scroller__scroll-area',\n CONTENT_SELECTOR: '.mdc-tab-scroller__scroll-content',\n};\n\nexport {\n cssClasses,\n strings,\n};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCTabScrollerAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\nimport {MDCTabScrollerRTLDefault} from './rtl-default-scroller';\nimport {MDCTabScrollerRTLNegative} from './rtl-negative-scroller';\nimport {MDCTabScrollerRTLReverse} from './rtl-reverse-scroller';\nimport {MDCTabScrollerRTL} from './rtl-scroller';\nimport {MDCTabScrollerAnimation, MDCTabScrollerHorizontalEdges} from './types';\n\nexport class MDCTabScrollerFoundation extends MDCFoundation<MDCTabScrollerAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get defaultAdapter(): MDCTabScrollerAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n eventTargetMatchesSelector: () => false,\n addClass: () => undefined,\n removeClass: () => undefined,\n addScrollAreaClass: () => undefined,\n setScrollAreaStyleProperty: () => undefined,\n setScrollContentStyleProperty: () => undefined,\n getScrollContentStyleValue: () => '',\n setScrollAreaScrollLeft: () => undefined,\n getScrollAreaScrollLeft: () => 0,\n getScrollContentOffsetWidth: () => 0,\n getScrollAreaOffsetWidth: () => 0,\n computeScrollAreaClientRect: () => ({top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0}),\n computeScrollContentClientRect: () => ({top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0}),\n computeHorizontalScrollbarHeight: () => 0,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n /**\n * Controls whether we should handle the transitionend and interaction events during the animation.\n */\n private isAnimating_ = false;\n\n /**\n * The MDCTabScrollerRTL instance varies per browser and allows us to encapsulate the peculiar browser behavior\n * of RTL scrolling in it's own class.\n */\n private rtlScrollerInstance_?: MDCTabScrollerRTL;\n\n constructor(adapter?: Partial<MDCTabScrollerAdapter>) {\n super({...MDCTabScrollerFoundation.defaultAdapter, ...adapter});\n }\n\n init() {\n // Compute horizontal scrollbar height on scroller with overflow initially hidden, then update overflow to scroll\n // and immediately adjust bottom margin to avoid the scrollbar initially appearing before JS runs.\n const horizontalScrollbarHeight =\n this.adapter.computeHorizontalScrollbarHeight();\n this.adapter.setScrollAreaStyleProperty(\n 'margin-bottom', -horizontalScrollbarHeight + 'px');\n this.adapter.addScrollAreaClass(\n MDCTabScrollerFoundation.cssClasses.SCROLL_AREA_SCROLL);\n }\n\n /**\n * Computes the current visual scroll position\n */\n getScrollPosition(): number {\n if (this.isRTL_()) {\n return this.computeCurrentScrollPositionRTL_();\n }\n\n const currentTranslateX = this.calculateCurrentTranslateX_();\n const scrollLeft = this.adapter.getScrollAreaScrollLeft();\n return scrollLeft - currentTranslateX;\n }\n\n /**\n * Handles interaction events that occur during transition\n */\n handleInteraction() {\n // Early exit if we aren't animating\n if (!this.isAnimating_) {\n return;\n }\n\n // Prevent other event listeners from handling this event\n this.stopScrollAnimation_();\n }\n\n /**\n * Handles the transitionend event\n */\n handleTransitionEnd(evt: Event) {\n // Early exit if we aren't animating or the event was triggered by a different element.\n const evtTarget = evt.target as Element;\n if (!this.isAnimating_ ||\n !this.adapter.eventTargetMatchesSelector(\n evtTarget, MDCTabScrollerFoundation.strings.CONTENT_SELECTOR)) {\n return;\n }\n\n this.isAnimating_ = false;\n this.adapter.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);\n }\n\n /**\n * Increment the scroll value by the scrollXIncrement using animation.\n * @param scrollXIncrement The value by which to increment the scroll position\n */\n incrementScroll(scrollXIncrement: number) {\n // Early exit for non-operational increment values\n if (scrollXIncrement === 0) {\n return;\n }\n\n this.animate_(this.getIncrementScrollOperation_(scrollXIncrement));\n }\n\n /**\n * Increment the scroll value by the scrollXIncrement without animation.\n * @param scrollXIncrement The value by which to increment the scroll position\n */\n incrementScrollImmediate(scrollXIncrement: number) {\n // Early exit for non-operational increment values\n if (scrollXIncrement === 0) {\n return;\n }\n\n const operation = this.getIncrementScrollOperation_(scrollXIncrement);\n if (operation.scrollDelta === 0) {\n return;\n }\n\n this.stopScrollAnimation_();\n this.adapter.setScrollAreaScrollLeft(operation.finalScrollPosition);\n }\n\n /**\n * Scrolls to the given scrollX value\n */\n scrollTo(scrollX: number) {\n if (this.isRTL_()) {\n return this.scrollToRTL_(scrollX);\n }\n\n this.scrollTo_(scrollX);\n }\n\n /**\n * @return Browser-specific {@link MDCTabScrollerRTL} instance.\n */\n getRTLScroller(): MDCTabScrollerRTL {\n if (!this.rtlScrollerInstance_) {\n this.rtlScrollerInstance_ = this.rtlScrollerFactory_();\n }\n\n return this.rtlScrollerInstance_;\n }\n\n /**\n * @return translateX value from a CSS matrix transform function string.\n */\n private calculateCurrentTranslateX_(): number {\n const transformValue = this.adapter.getScrollContentStyleValue('transform');\n // Early exit if no transform is present\n if (transformValue === 'none') {\n return 0;\n }\n\n // The transform value comes back as a matrix transformation in the form\n // of `matrix(a, b, c, d, tx, ty)`. We only care about tx (translateX) so\n // we're going to grab all the parenthesized values, strip out tx, and\n // parse it.\n const match = /\\((.+?)\\)/.exec(transformValue);\n if (!match) {\n return 0;\n }\n\n const matrixParams = match[1];\n\n // tslint:disable-next-line:ban-ts-ignore \"Unused vars\" should be a linter warning, not a compiler error.\n // @ts-ignore These unused variables should retain their semantic names for clarity.\n const [a, b, c, d, tx, ty] = matrixParams.split(',');\n\n return parseFloat(tx); // tslint:disable-line:ban\n }\n\n /**\n * Calculates a safe scroll value that is > 0 and < the max scroll value\n * @param scrollX The distance to scroll\n */\n private clampScrollValue_(scrollX: number): number {\n const edges = this.calculateScrollEdges_();\n return Math.min(Math.max(edges.left, scrollX), edges.right);\n }\n\n private computeCurrentScrollPositionRTL_(): number {\n const translateX = this.calculateCurrentTranslateX_();\n return this.getRTLScroller().getScrollPositionRTL(translateX);\n }\n\n private calculateScrollEdges_(): MDCTabScrollerHorizontalEdges {\n const contentWidth = this.adapter.getScrollContentOffsetWidth();\n const rootWidth = this.adapter.getScrollAreaOffsetWidth();\n return {\n left: 0,\n right: contentWidth - rootWidth,\n };\n }\n\n /**\n * Internal scroll method\n * @param scrollX The new scroll position\n */\n private scrollTo_(scrollX: number) {\n const currentScrollX = this.getScrollPosition();\n const safeScrollX = this.clampScrollValue_(scrollX);\n const scrollDelta = safeScrollX - currentScrollX;\n this.animate_({\n finalScrollPosition: safeScrollX,\n scrollDelta,\n });\n }\n\n /**\n * Internal RTL scroll method\n * @param scrollX The new scroll position\n */\n private scrollToRTL_(scrollX: number) {\n const animation = this.getRTLScroller().scrollToRTL(scrollX);\n this.animate_(animation);\n }\n\n /**\n * Internal method to compute the increment scroll operation values.\n * @param scrollX The desired scroll position increment\n * @return MDCTabScrollerAnimation with the sanitized values for performing the scroll operation.\n */\n private getIncrementScrollOperation_(scrollX: number): MDCTabScrollerAnimation {\n if (this.isRTL_()) {\n return this.getRTLScroller().incrementScrollRTL(scrollX);\n }\n\n const currentScrollX = this.getScrollPosition();\n const targetScrollX = scrollX + currentScrollX;\n const safeScrollX = this.clampScrollValue_(targetScrollX);\n const scrollDelta = safeScrollX - currentScrollX;\n return {\n finalScrollPosition: safeScrollX,\n scrollDelta,\n };\n }\n\n /**\n * Animates the tab scrolling\n * @param animation The animation to apply\n */\n private animate_(animation: MDCTabScrollerAnimation) {\n // Early exit if translateX is 0, which means there's no animation to perform\n if (animation.scrollDelta === 0) {\n return;\n }\n\n this.stopScrollAnimation_();\n // This animation uses the FLIP approach.\n // Read more here: https://aerotwist.com/blog/flip-your-animations/\n this.adapter.setScrollAreaScrollLeft(animation.finalScrollPosition);\n this.adapter.setScrollContentStyleProperty(\n 'transform', `translateX(${animation.scrollDelta}px)`);\n // Force repaint\n this.adapter.computeScrollAreaClientRect();\n\n requestAnimationFrame(() => {\n this.adapter.addClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);\n this.adapter.setScrollContentStyleProperty('transform', 'none');\n });\n\n this.isAnimating_ = true;\n }\n\n /**\n * Stops scroll animation\n */\n private stopScrollAnimation_() {\n this.isAnimating_ = false;\n const currentScrollPosition = this.getAnimatingScrollPosition_();\n this.adapter.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);\n this.adapter.setScrollContentStyleProperty('transform', 'translateX(0px)');\n this.adapter.setScrollAreaScrollLeft(currentScrollPosition);\n }\n\n /**\n * Gets the current scroll position during animation\n */\n private getAnimatingScrollPosition_(): number {\n const currentTranslateX = this.calculateCurrentTranslateX_();\n const scrollLeft = this.adapter.getScrollAreaScrollLeft();\n if (this.isRTL_()) {\n return this.getRTLScroller().getAnimatingScrollPosition(scrollLeft, currentTranslateX);\n }\n\n return scrollLeft - currentTranslateX;\n }\n\n /**\n * Determines the RTL Scroller to use\n */\n private rtlScrollerFactory_(): MDCTabScrollerRTL {\n // Browsers have three different implementations of scrollLeft in RTL mode,\n // dependent on the browser. The behavior is based off the max LTR\n // scrollLeft value and 0.\n //\n // * Default scrolling in RTL *\n // - Left-most value: 0\n // - Right-most value: Max LTR scrollLeft value\n //\n // * Negative scrolling in RTL *\n // - Left-most value: Negated max LTR scrollLeft value\n // - Right-most value: 0\n //\n // * Reverse scrolling in RTL *\n // - Left-most value: Max LTR scrollLeft value\n // - Right-most value: 0\n //\n // We use those principles below to determine which RTL scrollLeft\n // behavior is implemented in the current browser.\n const initialScrollLeft = this.adapter.getScrollAreaScrollLeft();\n this.adapter.setScrollAreaScrollLeft(initialScrollLeft - 1);\n const newScrollLeft = this.adapter.getScrollAreaScrollLeft();\n\n // If the newScrollLeft value is negative,then we know that the browser has\n // implemented negative RTL scrolling, since all other implementations have\n // only positive values.\n if (newScrollLeft < 0) {\n // Undo the scrollLeft test check\n this.adapter.setScrollAreaScrollLeft(initialScrollLeft);\n return new MDCTabScrollerRTLNegative(this.adapter);\n }\n\n const rootClientRect = this.adapter.computeScrollAreaClientRect();\n const contentClientRect = this.adapter.computeScrollContentClientRect();\n const rightEdgeDelta = Math.round(contentClientRect.right - rootClientRect.right);\n // Undo the scrollLeft test check\n this.adapter.setScrollAreaScrollLeft(initialScrollLeft);\n\n // By calculating the clientRect of the root element and the clientRect of\n // the content element, we can determine how much the scroll value changed\n // when we performed the scrollLeft subtraction above.\n if (rightEdgeDelta === newScrollLeft) {\n return new MDCTabScrollerRTLReverse(this.adapter);\n }\n\n return new MDCTabScrollerRTLDefault(this.adapter);\n }\n\n private isRTL_(): boolean {\n return this.adapter.getScrollContentStyleValue('direction') === 'rtl';\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabScrollerFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport * as util from './util';\n\nexport {util};\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTabScrollerRTL} from './rtl-scroller';\nimport {MDCTabScrollerAnimation, MDCTabScrollerHorizontalEdges} from './types';\n\nexport class MDCTabScrollerRTLDefault extends MDCTabScrollerRTL {\n getScrollPositionRTL(): number {\n const currentScrollLeft = this.adapter.getScrollAreaScrollLeft();\n const {right} = this.calculateScrollEdges_();\n // Scroll values on most browsers are ints instead of floats so we round\n return Math.round(right - currentScrollLeft);\n }\n\n scrollToRTL(scrollX: number): MDCTabScrollerAnimation {\n const edges = this.calculateScrollEdges_();\n const currentScrollLeft = this.adapter.getScrollAreaScrollLeft();\n const clampedScrollLeft = this.clampScrollValue_(edges.right - scrollX);\n return {\n finalScrollPosition: clampedScrollLeft,\n scrollDelta: clampedScrollLeft - currentScrollLeft,\n };\n }\n\n incrementScrollRTL(scrollX: number): MDCTabScrollerAnimation {\n const currentScrollLeft = this.adapter.getScrollAreaScrollLeft();\n const clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX);\n return {\n finalScrollPosition: clampedScrollLeft,\n scrollDelta: clampedScrollLeft - currentScrollLeft,\n };\n }\n\n getAnimatingScrollPosition(scrollX: number): number {\n return scrollX;\n }\n\n private calculateScrollEdges_(): MDCTabScrollerHorizontalEdges {\n const contentWidth = this.adapter.getScrollContentOffsetWidth();\n const rootWidth = this.adapter.getScrollAreaOffsetWidth();\n return {\n left: 0,\n right: contentWidth - rootWidth,\n };\n }\n\n private clampScrollValue_(scrollX: number): number {\n const edges = this.calculateScrollEdges_();\n return Math.min(Math.max(edges.left, scrollX), edges.right);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabScrollerRTLDefault;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTabScrollerRTL} from './rtl-scroller';\nimport {MDCTabScrollerAnimation, MDCTabScrollerHorizontalEdges} from './types';\n\nexport class MDCTabScrollerRTLNegative extends MDCTabScrollerRTL {\n getScrollPositionRTL(translateX: number): number {\n const currentScrollLeft = this.adapter.getScrollAreaScrollLeft();\n return Math.round(translateX - currentScrollLeft);\n }\n\n scrollToRTL(scrollX: number): MDCTabScrollerAnimation {\n const currentScrollLeft = this.adapter.getScrollAreaScrollLeft();\n const clampedScrollLeft = this.clampScrollValue_(-scrollX);\n return {\n finalScrollPosition: clampedScrollLeft,\n scrollDelta: clampedScrollLeft - currentScrollLeft,\n };\n }\n\n incrementScrollRTL(scrollX: number): MDCTabScrollerAnimation {\n const currentScrollLeft = this.adapter.getScrollAreaScrollLeft();\n const clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX);\n return {\n finalScrollPosition: clampedScrollLeft,\n scrollDelta: clampedScrollLeft - currentScrollLeft,\n };\n }\n\n getAnimatingScrollPosition(scrollX: number, translateX: number): number {\n return scrollX - translateX;\n }\n\n private calculateScrollEdges_(): MDCTabScrollerHorizontalEdges {\n const contentWidth = this.adapter.getScrollContentOffsetWidth();\n const rootWidth = this.adapter.getScrollAreaOffsetWidth();\n return {\n left: rootWidth - contentWidth,\n right: 0,\n };\n }\n\n private clampScrollValue_(scrollX: number): number {\n const edges = this.calculateScrollEdges_();\n return Math.max(Math.min(edges.right, scrollX), edges.left);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabScrollerRTLNegative;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTabScrollerRTL} from './rtl-scroller';\nimport {MDCTabScrollerAnimation, MDCTabScrollerHorizontalEdges} from './types';\n\nexport class MDCTabScrollerRTLReverse extends MDCTabScrollerRTL {\n getScrollPositionRTL(translateX: number): number {\n const currentScrollLeft = this.adapter.getScrollAreaScrollLeft();\n // Scroll values on most browsers are ints instead of floats so we round\n return Math.round(currentScrollLeft - translateX);\n }\n\n scrollToRTL(scrollX: number): MDCTabScrollerAnimation {\n const currentScrollLeft = this.adapter.getScrollAreaScrollLeft();\n const clampedScrollLeft = this.clampScrollValue_(scrollX);\n return {\n finalScrollPosition: clampedScrollLeft,\n scrollDelta: currentScrollLeft - clampedScrollLeft,\n };\n }\n\n incrementScrollRTL(scrollX: number): MDCTabScrollerAnimation {\n const currentScrollLeft = this.adapter.getScrollAreaScrollLeft();\n const clampedScrollLeft = this.clampScrollValue_(currentScrollLeft + scrollX);\n return {\n finalScrollPosition: clampedScrollLeft,\n scrollDelta: currentScrollLeft - clampedScrollLeft,\n };\n }\n\n getAnimatingScrollPosition(scrollX: number, translateX: number): number {\n return scrollX + translateX;\n }\n\n private calculateScrollEdges_(): MDCTabScrollerHorizontalEdges {\n const contentWidth = this.adapter.getScrollContentOffsetWidth();\n const rootWidth = this.adapter.getScrollAreaOffsetWidth();\n return {\n left: contentWidth - rootWidth,\n right: 0,\n };\n }\n\n private clampScrollValue_(scrollX: number): number {\n const edges = this.calculateScrollEdges_();\n return Math.min(Math.max(edges.right, scrollX), edges.left);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabScrollerRTLReverse;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTabScrollerAdapter} from './adapter';\nimport {MDCTabScrollerAnimation} from './types';\n\nexport abstract class MDCTabScrollerRTL {\n constructor(protected readonly adapter: MDCTabScrollerAdapter) {}\n\n abstract getScrollPositionRTL(translateX: number): number;\n\n abstract scrollToRTL(scrollX: number): MDCTabScrollerAnimation;\n\n abstract incrementScrollRTL(scrollX: number): MDCTabScrollerAnimation;\n\n /**\n * @param scrollX The current scrollX position\n * @param translateX The current translateX position\n */\n abstract getAnimatingScrollPosition(scrollX: number, translateX: number): number;\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabScrollerRTL;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {cssClasses} from './constants';\n\n/**\n * Stores result from computeHorizontalScrollbarHeight to avoid redundant processing.\n */\nlet horizontalScrollbarHeight_: number | undefined;\n\n/**\n * Computes the height of browser-rendered horizontal scrollbars using a self-created test element.\n * May return 0 (e.g. on OS X browsers under default configuration).\n */\nexport function computeHorizontalScrollbarHeight(documentObj: Document, shouldCacheResult = true): number {\n if (shouldCacheResult && typeof horizontalScrollbarHeight_ !== 'undefined') {\n return horizontalScrollbarHeight_;\n }\n\n const el = documentObj.createElement('div');\n el.classList.add(cssClasses.SCROLL_TEST);\n documentObj.body.appendChild(el);\n\n const horizontalScrollbarHeight = el.offsetHeight - el.clientHeight;\n documentObj.body.removeChild(el);\n\n if (shouldCacheResult) {\n horizontalScrollbarHeight_ = horizontalScrollbarHeight;\n }\n return horizontalScrollbarHeight;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCRipple, MDCRippleFactory} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCRippleCapableSurface} from '@material/ripple/types';\nimport {MDCTabIndicator, MDCTabIndicatorFactory} from '@material/tab-indicator/component';\nimport {MDCTabAdapter} from './adapter';\nimport {MDCTabFoundation} from './foundation';\nimport {MDCTabDimensions, MDCTabInteractionEventDetail} from './types';\n\nexport type MDCTabFactory = (el: Element, foundation?: MDCTabFoundation) => MDCTab;\n\nexport class MDCTab extends MDCComponent<MDCTabFoundation> implements MDCRippleCapableSurface {\n static attachTo(root: Element): MDCTab {\n return new MDCTab(root);\n }\n\n id!: string; // assigned in initialize();\n\n private ripple_!: MDCRipple; // assigned in initialize();\n private tabIndicator_!: MDCTabIndicator; // assigned in initialize();\n private content_!: HTMLElement; // assigned in initialize();\n private handleClick_!: SpecificEventListener<'click'>; // assigned in initialize();\n\n initialize(\n rippleFactory: MDCRippleFactory = (el, foundation) => new MDCRipple(el, foundation),\n tabIndicatorFactory: MDCTabIndicatorFactory = (el) => new MDCTabIndicator(el),\n ) {\n this.id = this.root.id;\n const rippleSurface = this.root.querySelector<HTMLElement>(\n MDCTabFoundation.strings.RIPPLE_SELECTOR)!;\n const rippleAdapter = {\n ...MDCRipple.createAdapter(this),\n addClass: (className: string) => rippleSurface.classList.add(className),\n removeClass: (className: string) => rippleSurface.classList.remove(className),\n updateCssVariable: (varName: string, value: string) => rippleSurface.style.setProperty(varName, value),\n };\n const rippleFoundation = new MDCRippleFoundation(rippleAdapter);\n this.ripple_ = rippleFactory(this.root, rippleFoundation);\n\n const tabIndicatorElement = this.root.querySelector(\n MDCTabFoundation.strings.TAB_INDICATOR_SELECTOR)!;\n this.tabIndicator_ = tabIndicatorFactory(tabIndicatorElement);\n this.content_ = this.root.querySelector<HTMLElement>(\n MDCTabFoundation.strings.CONTENT_SELECTOR)!;\n }\n\n initialSyncWithDOM() {\n this.handleClick_ = () => this.foundation.handleClick();\n this.listen('click', this.handleClick_);\n }\n\n destroy() {\n this.unlisten('click', this.handleClick_);\n this.ripple_.destroy();\n super.destroy();\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCTabAdapter = {\n setAttr: (attr, value) => this.root.setAttribute(attr, value),\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n hasClass: (className) => this.root.classList.contains(className),\n activateIndicator: (previousIndicatorClientRect) =>\n this.tabIndicator_.activate(previousIndicatorClientRect),\n deactivateIndicator: () => this.tabIndicator_.deactivate(),\n notifyInteracted: () => this.emit<MDCTabInteractionEventDetail>(\n MDCTabFoundation.strings.INTERACTED_EVENT, {tabId: this.id},\n true /* bubble */),\n getOffsetLeft: () => (this.root as HTMLElement).offsetLeft,\n getOffsetWidth: () => (this.root as HTMLElement).offsetWidth,\n getContentOffsetLeft: () => this.content_.offsetLeft,\n getContentOffsetWidth: () => this.content_.offsetWidth,\n focus: () => (this.root as HTMLElement).focus(),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCTabFoundation(adapter);\n }\n\n /**\n * Getter for the active state of the tab\n */\n get active(): boolean {\n return this.foundation.isActive();\n }\n\n set focusOnActivate(focusOnActivate: boolean) {\n this.foundation.setFocusOnActivate(focusOnActivate);\n }\n\n /**\n * Activates the tab\n */\n activate(computeIndicatorClientRect?: ClientRect) {\n this.foundation.activate(computeIndicatorClientRect);\n }\n\n /**\n * Deactivates the tab\n */\n deactivate() {\n this.foundation.deactivate();\n }\n\n /**\n * Returns the indicator's client rect\n */\n computeIndicatorClientRect(): ClientRect {\n return this.tabIndicator_.computeContentClientRect();\n }\n\n computeDimensions(): MDCTabDimensions {\n return this.foundation.computeDimensions();\n }\n\n /**\n * Focuses the tab\n */\n focus() {\n (this.root as HTMLElement).focus();\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n ACTIVE: 'mdc-tab--active',\n};\n\nconst strings = {\n ARIA_SELECTED: 'aria-selected',\n CONTENT_SELECTOR: '.mdc-tab__content',\n INTERACTED_EVENT: 'MDCTab:interacted',\n RIPPLE_SELECTOR: '.mdc-tab__ripple',\n TABINDEX: 'tabIndex',\n TAB_INDICATOR_SELECTOR: '.mdc-tab-indicator',\n};\n\nexport {\n cssClasses,\n strings,\n};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCTabAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\nimport {MDCTabDimensions} from './types';\n\nexport class MDCTabFoundation extends MDCFoundation<MDCTabAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get defaultAdapter(): MDCTabAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => false,\n setAttr: () => undefined,\n activateIndicator: () => undefined,\n deactivateIndicator: () => undefined,\n notifyInteracted: () => undefined,\n getOffsetLeft: () => 0,\n getOffsetWidth: () => 0,\n getContentOffsetLeft: () => 0,\n getContentOffsetWidth: () => 0,\n focus: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private focusOnActivate_ = true;\n\n constructor(adapter?: Partial<MDCTabAdapter>) {\n super({...MDCTabFoundation.defaultAdapter, ...adapter});\n }\n\n handleClick() {\n // It's up to the parent component to keep track of the active Tab and\n // ensure we don't activate a Tab that's already active.\n this.adapter.notifyInteracted();\n }\n\n isActive(): boolean {\n return this.adapter.hasClass(cssClasses.ACTIVE);\n }\n\n /**\n * Sets whether the tab should focus itself when activated\n */\n setFocusOnActivate(focusOnActivate: boolean) {\n this.focusOnActivate_ = focusOnActivate;\n }\n\n /**\n * Activates the Tab\n */\n activate(previousIndicatorClientRect?: ClientRect) {\n this.adapter.addClass(cssClasses.ACTIVE);\n this.adapter.setAttr(strings.ARIA_SELECTED, 'true');\n this.adapter.setAttr(strings.TABINDEX, '0');\n this.adapter.activateIndicator(previousIndicatorClientRect);\n if (this.focusOnActivate_) {\n this.adapter.focus();\n }\n }\n\n /**\n * Deactivates the Tab\n */\n deactivate() {\n // Early exit\n if (!this.isActive()) {\n return;\n }\n\n this.adapter.removeClass(cssClasses.ACTIVE);\n this.adapter.setAttr(strings.ARIA_SELECTED, 'false');\n this.adapter.setAttr(strings.TABINDEX, '-1');\n this.adapter.deactivateIndicator();\n }\n\n /**\n * Returns the dimensions of the Tab\n */\n computeDimensions(): MDCTabDimensions {\n const rootWidth = this.adapter.getOffsetWidth();\n const rootLeft = this.adapter.getOffsetLeft();\n const contentWidth = this.adapter.getContentOffsetWidth();\n const contentLeft = this.adapter.getContentOffsetLeft();\n\n return {\n contentLeft: rootLeft + contentLeft,\n contentRight: rootLeft + contentLeft + contentWidth,\n rootLeft,\n rootRight: rootLeft + rootWidth,\n };\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCTextFieldCharacterCounterAdapter} from './adapter';\nimport {MDCTextFieldCharacterCounterFoundation} from './foundation';\n\nexport type MDCTextFieldCharacterCounterFactory =\n (el: Element, foundation?: MDCTextFieldCharacterCounterFoundation) => MDCTextFieldCharacterCounter;\n\nexport class MDCTextFieldCharacterCounter extends MDCComponent<MDCTextFieldCharacterCounterFoundation> {\n static attachTo(root: Element): MDCTextFieldCharacterCounter {\n return new MDCTextFieldCharacterCounter(root);\n }\n\n // Provided for access by MDCTextField component\n get foundationForTextField(): MDCTextFieldCharacterCounterFoundation {\n return this.foundation;\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n const adapter: MDCTextFieldCharacterCounterAdapter = {\n setContent: (content) => {\n this.root.textContent = content;\n },\n };\n return new MDCTextFieldCharacterCounterFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n ROOT: 'mdc-text-field-character-counter',\n};\n\nconst strings = {\n ROOT_SELECTOR: `.${cssClasses.ROOT}`,\n};\n\nexport {strings, cssClasses};\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCTextFieldCharacterCounterAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCTextFieldCharacterCounterFoundation extends MDCFoundation<MDCTextFieldCharacterCounterAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n /**\n * See {@link MDCTextFieldCharacterCounterAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCTextFieldCharacterCounterAdapter {\n return {\n setContent: () => undefined,\n };\n }\n\n constructor(adapter?: Partial<MDCTextFieldCharacterCounterAdapter>) {\n super({...MDCTextFieldCharacterCounterFoundation.defaultAdapter, ...adapter});\n }\n\n setCounterValue(currentLength: number, maxLength: number) {\n currentLength = Math.min(currentLength, maxLength);\n this.adapter.setContent(`${currentLength} / ${maxLength}`);\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTextFieldCharacterCounterFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport {cssClasses as characterCountCssClasses, strings as characterCountStrings} from './constants';\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {applyPassive} from '@material/dom/events';\nimport * as ponyfill from '@material/dom/ponyfill';\nimport {MDCFloatingLabel, MDCFloatingLabelFactory} from '@material/floating-label/component';\nimport {MDCLineRipple, MDCLineRippleFactory} from '@material/line-ripple/component';\nimport {MDCNotchedOutline, MDCNotchedOutlineFactory} from '@material/notched-outline/component';\nimport {MDCRippleAdapter} from '@material/ripple/adapter';\nimport {MDCRipple, MDCRippleFactory} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCRippleCapableSurface} from '@material/ripple/types';\n\nimport {MDCTextFieldAdapter, MDCTextFieldInputAdapter, MDCTextFieldLabelAdapter, MDCTextFieldLineRippleAdapter, MDCTextFieldOutlineAdapter, MDCTextFieldRootAdapter,} from './adapter';\nimport {MDCTextFieldCharacterCounter, MDCTextFieldCharacterCounterFactory,} from './character-counter/component';\nimport {MDCTextFieldCharacterCounterFoundation} from './character-counter/foundation';\nimport {cssClasses, strings} from './constants';\nimport {MDCTextFieldFoundation} from './foundation';\nimport {MDCTextFieldHelperText, MDCTextFieldHelperTextFactory,} from './helper-text/component';\nimport {MDCTextFieldHelperTextFoundation} from './helper-text/foundation';\nimport {MDCTextFieldIcon, MDCTextFieldIconFactory} from './icon/component';\nimport {MDCTextFieldFoundationMap} from './types';\n\nexport class MDCTextField extends MDCComponent<MDCTextFieldFoundation> implements MDCRippleCapableSurface {\n static attachTo(root: Element): MDCTextField {\n return new MDCTextField(root);\n }\n\n ripple!: MDCRipple | null; // assigned in initialize()\n\n // The only required sub-element.\n private input_!: HTMLInputElement; // assigned in initialize()\n\n // Optional sub-elements.\n private characterCounter_!: MDCTextFieldCharacterCounter | null; // assigned in initialize()\n private helperText_!: MDCTextFieldHelperText | null; // assigned in initialize()\n private label_!: MDCFloatingLabel | null; // assigned in initialize()\n private leadingIcon_!: MDCTextFieldIcon | null; // assigned in initialize()\n private lineRipple_!: MDCLineRipple | null; // assigned in initialize()\n private outline_!: MDCNotchedOutline | null; // assigned in initialize()\n private trailingIcon_!: MDCTextFieldIcon | null; // assigned in initialize()\n private prefix_!: Element|null; // assigned in initialize()\n private suffix_!: Element|null; // assigned in initialize()\n\n initialize(\n rippleFactory: MDCRippleFactory = (el, foundation) => new MDCRipple(el, foundation),\n lineRippleFactory: MDCLineRippleFactory = (el) => new MDCLineRipple(el),\n helperTextFactory: MDCTextFieldHelperTextFactory = (el) => new MDCTextFieldHelperText(el),\n characterCounterFactory: MDCTextFieldCharacterCounterFactory = (el) => new MDCTextFieldCharacterCounter(el),\n iconFactory: MDCTextFieldIconFactory = (el) => new MDCTextFieldIcon(el),\n labelFactory: MDCFloatingLabelFactory = (el) => new MDCFloatingLabel(el),\n outlineFactory: MDCNotchedOutlineFactory = (el) => new MDCNotchedOutline(el),\n ) {\n this.input_ = this.root.querySelector<HTMLInputElement>(strings.INPUT_SELECTOR)!;\n\n const labelElement = this.root.querySelector(strings.LABEL_SELECTOR);\n this.label_ = labelElement ? labelFactory(labelElement) : null;\n\n const lineRippleElement = this.root.querySelector(strings.LINE_RIPPLE_SELECTOR);\n this.lineRipple_ = lineRippleElement ? lineRippleFactory(lineRippleElement) : null;\n\n const outlineElement = this.root.querySelector(strings.OUTLINE_SELECTOR);\n this.outline_ = outlineElement ? outlineFactory(outlineElement) : null;\n\n // Helper text\n const helperTextStrings = MDCTextFieldHelperTextFoundation.strings;\n const nextElementSibling = this.root.nextElementSibling;\n const hasHelperLine = (nextElementSibling && nextElementSibling.classList.contains(cssClasses.HELPER_LINE));\n const helperTextEl =\n hasHelperLine && nextElementSibling && nextElementSibling.querySelector(helperTextStrings.ROOT_SELECTOR);\n this.helperText_ = helperTextEl ? helperTextFactory(helperTextEl) : null;\n\n // Character counter\n const characterCounterStrings = MDCTextFieldCharacterCounterFoundation.strings;\n let characterCounterEl = this.root.querySelector(characterCounterStrings.ROOT_SELECTOR);\n // If character counter is not found in root element search in sibling element.\n if (!characterCounterEl && hasHelperLine && nextElementSibling) {\n characterCounterEl = nextElementSibling.querySelector(characterCounterStrings.ROOT_SELECTOR);\n }\n this.characterCounter_ = characterCounterEl ? characterCounterFactory(characterCounterEl) : null;\n\n // Leading icon\n const leadingIconEl =\n this.root.querySelector(strings.LEADING_ICON_SELECTOR);\n this.leadingIcon_ = leadingIconEl ? iconFactory(leadingIconEl) : null;\n\n // Trailing icon\n const trailingIconEl =\n this.root.querySelector(strings.TRAILING_ICON_SELECTOR);\n this.trailingIcon_ = trailingIconEl ? iconFactory(trailingIconEl) : null;\n\n // Prefix and Suffix\n this.prefix_ = this.root.querySelector(strings.PREFIX_SELECTOR);\n this.suffix_ = this.root.querySelector(strings.SUFFIX_SELECTOR);\n\n this.ripple = this.createRipple_(rippleFactory);\n }\n\n destroy() {\n if (this.ripple) {\n this.ripple.destroy();\n }\n if (this.lineRipple_) {\n this.lineRipple_.destroy();\n }\n if (this.helperText_) {\n this.helperText_.destroy();\n }\n if (this.characterCounter_) {\n this.characterCounter_.destroy();\n }\n if (this.leadingIcon_) {\n this.leadingIcon_.destroy();\n }\n if (this.trailingIcon_) {\n this.trailingIcon_.destroy();\n }\n if (this.label_) {\n this.label_.destroy();\n }\n if (this.outline_) {\n this.outline_.destroy();\n }\n super.destroy();\n }\n\n /**\n * Initializes the Text Field's internal state based on the environment's\n * state.\n */\n initialSyncWithDOM() {\n this.disabled = this.input_.disabled;\n }\n\n get value(): string {\n return this.foundation.getValue();\n }\n\n /**\n * @param value The value to set on the input.\n */\n set value(value: string) {\n this.foundation.setValue(value);\n }\n\n get disabled(): boolean {\n return this.foundation.isDisabled();\n }\n\n /**\n * @param disabled Sets the Text Field disabled or enabled.\n */\n set disabled(disabled: boolean) {\n this.foundation.setDisabled(disabled);\n }\n\n get valid(): boolean {\n return this.foundation.isValid();\n }\n\n /**\n * @param valid Sets the Text Field valid or invalid.\n */\n set valid(valid: boolean) {\n this.foundation.setValid(valid);\n }\n\n get required(): boolean {\n return this.input_.required;\n }\n\n /**\n * @param required Sets the Text Field to required.\n */\n set required(required: boolean) {\n this.input_.required = required;\n }\n\n get pattern(): string {\n return this.input_.pattern;\n }\n\n /**\n * @param pattern Sets the input element's validation pattern.\n */\n set pattern(pattern: string) {\n this.input_.pattern = pattern;\n }\n\n get minLength(): number {\n return this.input_.minLength;\n }\n\n /**\n * @param minLength Sets the input element's minLength.\n */\n set minLength(minLength: number) {\n this.input_.minLength = minLength;\n }\n\n get maxLength(): number {\n return this.input_.maxLength;\n }\n\n /**\n * @param maxLength Sets the input element's maxLength.\n */\n set maxLength(maxLength: number) {\n // Chrome throws exception if maxLength is set to a value less than zero\n if (maxLength < 0) {\n this.input_.removeAttribute('maxLength');\n } else {\n this.input_.maxLength = maxLength;\n }\n }\n\n get min(): string {\n return this.input_.min;\n }\n\n /**\n * @param min Sets the input element's min.\n */\n set min(min: string) {\n this.input_.min = min;\n }\n\n get max(): string {\n return this.input_.max;\n }\n\n /**\n * @param max Sets the input element's max.\n */\n set max(max: string) {\n this.input_.max = max;\n }\n\n get step(): string {\n return this.input_.step;\n }\n\n /**\n * @param step Sets the input element's step.\n */\n set step(step: string) {\n this.input_.step = step;\n }\n\n /**\n * Sets the helper text element content.\n */\n set helperTextContent(content: string) {\n this.foundation.setHelperTextContent(content);\n }\n\n /**\n * Sets the aria label of the leading icon.\n */\n set leadingIconAriaLabel(label: string) {\n this.foundation.setLeadingIconAriaLabel(label);\n }\n\n /**\n * Sets the text content of the leading icon.\n */\n set leadingIconContent(content: string) {\n this.foundation.setLeadingIconContent(content);\n }\n\n /**\n * Sets the aria label of the trailing icon.\n */\n set trailingIconAriaLabel(label: string) {\n this.foundation.setTrailingIconAriaLabel(label);\n }\n\n /**\n * Sets the text content of the trailing icon.\n */\n set trailingIconContent(content: string) {\n this.foundation.setTrailingIconContent(content);\n }\n\n /**\n * Enables or disables the use of native validation. Use this for custom validation.\n * @param useNativeValidation Set this to false to ignore native input validation.\n */\n set useNativeValidation(useNativeValidation: boolean) {\n this.foundation.setUseNativeValidation(useNativeValidation);\n }\n\n /**\n * Gets the text content of the prefix, or null if it does not exist.\n */\n get prefixText(): string|null {\n return this.prefix_ ? this.prefix_.textContent : null;\n }\n\n /**\n * Sets the text content of the prefix, if it exists.\n */\n set prefixText(prefixText: string|null) {\n if (this.prefix_) {\n this.prefix_.textContent = prefixText;\n }\n }\n\n /**\n * Gets the text content of the suffix, or null if it does not exist.\n */\n get suffixText(): string|null {\n return this.suffix_ ? this.suffix_.textContent : null;\n }\n\n /**\n * Sets the text content of the suffix, if it exists.\n */\n set suffixText(suffixText: string|null) {\n if (this.suffix_) {\n this.suffix_.textContent = suffixText;\n }\n }\n\n /**\n * Focuses the input element.\n */\n focus() {\n this.input_.focus();\n }\n\n /**\n * Recomputes the outline SVG path for the outline element.\n */\n layout() {\n const openNotch = this.foundation.shouldFloat;\n this.foundation.notchOutline(openNotch);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCTextFieldAdapter = {\n ...this.getRootAdapterMethods_(),\n ...this.getInputAdapterMethods_(),\n ...this.getLabelAdapterMethods_(),\n ...this.getLineRippleAdapterMethods_(),\n ...this.getOutlineAdapterMethods_(),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCTextFieldFoundation(adapter, this.getFoundationMap_());\n }\n\n private getRootAdapterMethods_(): MDCTextFieldRootAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n hasClass: (className) => this.root.classList.contains(className),\n registerTextFieldInteractionHandler: (evtType, handler) => this.listen(evtType, handler),\n deregisterTextFieldInteractionHandler: (evtType, handler) => this.unlisten(evtType, handler),\n registerValidationAttributeChangeHandler: (handler) => {\n const getAttributesList = (mutationsList: MutationRecord[]): string[] => {\n return mutationsList\n .map((mutation) => mutation.attributeName)\n .filter((attributeName) => attributeName) as string[];\n };\n const observer = new MutationObserver((mutationsList) => handler(getAttributesList(mutationsList)));\n const config = {attributes: true};\n observer.observe(this.input_, config);\n return observer;\n },\n deregisterValidationAttributeChangeHandler: (observer) => observer.disconnect(),\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private getInputAdapterMethods_(): MDCTextFieldInputAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n getNativeInput: () => this.input_,\n isFocused: () => document.activeElement === this.input_,\n registerInputInteractionHandler: (evtType, handler) =>\n this.input_.addEventListener(evtType, handler, applyPassive()),\n deregisterInputInteractionHandler: (evtType, handler) =>\n this.input_.removeEventListener(evtType, handler, applyPassive()),\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private getLabelAdapterMethods_(): MDCTextFieldLabelAdapter {\n return {\n floatLabel: (shouldFloat) => this.label_ && this.label_.float(shouldFloat),\n getLabelWidth: () => this.label_ ? this.label_.getWidth() : 0,\n hasLabel: () => Boolean(this.label_),\n shakeLabel: (shouldShake) => this.label_ && this.label_.shake(shouldShake),\n setLabelRequired: (isRequired) => this.label_ && this.label_.setRequired(isRequired),\n };\n }\n\n private getLineRippleAdapterMethods_(): MDCTextFieldLineRippleAdapter {\n return {\n activateLineRipple: () => {\n if (this.lineRipple_) {\n this.lineRipple_.activate();\n }\n },\n deactivateLineRipple: () => {\n if (this.lineRipple_) {\n this.lineRipple_.deactivate();\n }\n },\n setLineRippleTransformOrigin: (normalizedX) => {\n if (this.lineRipple_) {\n this.lineRipple_.setRippleCenter(normalizedX);\n }\n },\n };\n }\n\n private getOutlineAdapterMethods_(): MDCTextFieldOutlineAdapter {\n return {\n closeOutline: () => this.outline_ && this.outline_.closeNotch(),\n hasOutline: () => Boolean(this.outline_),\n notchOutline: (labelWidth) => this.outline_ && this.outline_.notch(labelWidth),\n };\n }\n\n /**\n * @return A map of all subcomponents to subfoundations.\n */\n private getFoundationMap_(): Partial<MDCTextFieldFoundationMap> {\n return {\n characterCounter: this.characterCounter_ ?\n this.characterCounter_.foundationForTextField :\n undefined,\n helperText: this.helperText_ ? this.helperText_.foundationForTextField :\n undefined,\n leadingIcon: this.leadingIcon_ ?\n this.leadingIcon_.foundationForTextField :\n undefined,\n trailingIcon: this.trailingIcon_ ?\n this.trailingIcon_.foundationForTextField :\n undefined,\n };\n }\n\n private createRipple_(rippleFactory: MDCRippleFactory): MDCRipple | null {\n const isTextArea = this.root.classList.contains(cssClasses.TEXTAREA);\n const isOutlined = this.root.classList.contains(cssClasses.OUTLINED);\n\n if (isTextArea || isOutlined) {\n return null;\n }\n\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCRippleAdapter = {\n ...MDCRipple.createAdapter(this),\n isSurfaceActive: () => ponyfill.matches(this.input_, ':active'),\n registerInteractionHandler: (evtType, handler) => this.input_.addEventListener(evtType, handler, applyPassive()),\n deregisterInteractionHandler: (evtType, handler) =>\n this.input_.removeEventListener(evtType, handler, applyPassive()),\n };\n // tslint:enable:object-literal-sort-keys\n return rippleFactory(this.root, new MDCRippleFoundation(adapter));\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst strings = {\n ARIA_CONTROLS: 'aria-controls',\n INPUT_SELECTOR: '.mdc-text-field__input',\n LABEL_SELECTOR: '.mdc-floating-label',\n LEADING_ICON_SELECTOR: '.mdc-text-field__icon--leading',\n LINE_RIPPLE_SELECTOR: '.mdc-line-ripple',\n OUTLINE_SELECTOR: '.mdc-notched-outline',\n PREFIX_SELECTOR: '.mdc-text-field__affix--prefix',\n SUFFIX_SELECTOR: '.mdc-text-field__affix--suffix',\n TRAILING_ICON_SELECTOR: '.mdc-text-field__icon--trailing'\n};\n\nconst cssClasses = {\n DISABLED: 'mdc-text-field--disabled',\n FOCUSED: 'mdc-text-field--focused',\n FULLWIDTH: 'mdc-text-field--fullwidth',\n HELPER_LINE: 'mdc-text-field-helper-line',\n INVALID: 'mdc-text-field--invalid',\n LABEL_FLOATING: 'mdc-text-field--label-floating',\n NO_LABEL: 'mdc-text-field--no-label',\n OUTLINED: 'mdc-text-field--outlined',\n ROOT: 'mdc-text-field',\n TEXTAREA: 'mdc-text-field--textarea',\n WITH_LEADING_ICON: 'mdc-text-field--with-leading-icon',\n WITH_TRAILING_ICON: 'mdc-text-field--with-trailing-icon',\n};\n\nconst numbers = {\n LABEL_SCALE: 0.75,\n};\n\n/**\n * Whitelist based off of https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation\n * under the \"Validation-related attributes\" section.\n */\nconst VALIDATION_ATTR_WHITELIST = [\n 'pattern', 'min', 'max', 'required', 'step', 'minlength', 'maxlength',\n];\n\n/**\n * Label should always float for these types as they show some UI even if value is empty.\n */\nconst ALWAYS_FLOAT_TYPES = [\n 'color', 'date', 'datetime-local', 'month', 'range', 'time', 'week',\n];\n\nexport {cssClasses, strings, numbers, VALIDATION_ATTR_WHITELIST, ALWAYS_FLOAT_TYPES};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCTextFieldAdapter} from './adapter';\nimport {MDCTextFieldCharacterCounterFoundation} from './character-counter/foundation';\nimport {ALWAYS_FLOAT_TYPES, cssClasses, numbers, strings, VALIDATION_ATTR_WHITELIST} from './constants';\nimport {MDCTextFieldHelperTextFoundation} from './helper-text/foundation';\nimport {MDCTextFieldIconFoundation} from './icon/foundation';\nimport {MDCTextFieldFoundationMap, MDCTextFieldNativeInputElement} from './types';\n\ntype PointerDownEventType = 'mousedown' | 'touchstart';\ntype InteractionEventType = 'click' | 'keydown';\n\nconst POINTERDOWN_EVENTS: PointerDownEventType[] = ['mousedown', 'touchstart'];\nconst INTERACTION_EVENTS: InteractionEventType[] = ['click', 'keydown'];\n\nexport class MDCTextFieldFoundation extends MDCFoundation<MDCTextFieldAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n static get numbers() {\n return numbers;\n }\n\n private get shouldAlwaysFloat_(): boolean {\n const type = this.getNativeInput_().type;\n return ALWAYS_FLOAT_TYPES.indexOf(type) >= 0;\n }\n\n get shouldFloat(): boolean {\n return this.shouldAlwaysFloat_ || this.isFocused_ || !!this.getValue() || this.isBadInput_();\n }\n\n get shouldShake(): boolean {\n return !this.isFocused_ && !this.isValid() && !!this.getValue();\n }\n\n /**\n * See {@link MDCTextFieldAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCTextFieldAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => true,\n registerTextFieldInteractionHandler: () => undefined,\n deregisterTextFieldInteractionHandler: () => undefined,\n registerInputInteractionHandler: () => undefined,\n deregisterInputInteractionHandler: () => undefined,\n registerValidationAttributeChangeHandler: () => new MutationObserver(() => undefined),\n deregisterValidationAttributeChangeHandler: () => undefined,\n getNativeInput: () => null,\n isFocused: () => false,\n activateLineRipple: () => undefined,\n deactivateLineRipple: () => undefined,\n setLineRippleTransformOrigin: () => undefined,\n shakeLabel: () => undefined,\n floatLabel: () => undefined,\n setLabelRequired: () => undefined,\n hasLabel: () => false,\n getLabelWidth: () => 0,\n hasOutline: () => false,\n notchOutline: () => undefined,\n closeOutline: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private isFocused_ = false;\n private receivedUserInput_ = false;\n private isValid_ = true;\n private useNativeValidation_ = true;\n\n private readonly inputFocusHandler_: () => void;\n private readonly inputBlurHandler_: SpecificEventListener<'blur'>;\n private readonly inputInputHandler_: SpecificEventListener<'input'>;\n private readonly setPointerXOffset_: SpecificEventListener<PointerDownEventType>;\n private readonly textFieldInteractionHandler_: SpecificEventListener<InteractionEventType>;\n private readonly validationAttributeChangeHandler_: (attributesList: string[]) => void;\n private validationObserver_!: MutationObserver; // assigned in init()\n\n private readonly helperText_?: MDCTextFieldHelperTextFoundation;\n private readonly characterCounter_?: MDCTextFieldCharacterCounterFoundation;\n private readonly leadingIcon_?: MDCTextFieldIconFoundation;\n private readonly trailingIcon_?: MDCTextFieldIconFoundation;\n\n /**\n * @param adapter\n * @param foundationMap Map from subcomponent names to their subfoundations.\n */\n constructor(adapter?: Partial<MDCTextFieldAdapter>, foundationMap: Partial<MDCTextFieldFoundationMap> = {}) {\n super({...MDCTextFieldFoundation.defaultAdapter, ...adapter});\n\n this.helperText_ = foundationMap.helperText;\n this.characterCounter_ = foundationMap.characterCounter;\n this.leadingIcon_ = foundationMap.leadingIcon;\n this.trailingIcon_ = foundationMap.trailingIcon;\n\n this.inputFocusHandler_ = () => this.activateFocus();\n this.inputBlurHandler_ = () => this.deactivateFocus();\n this.inputInputHandler_ = () => this.handleInput();\n this.setPointerXOffset_ = (evt) => this.setTransformOrigin(evt);\n this.textFieldInteractionHandler_ = () => this.handleTextFieldInteraction();\n this.validationAttributeChangeHandler_ = (attributesList) => this.handleValidationAttributeChange(attributesList);\n }\n\n init() {\n if (this.adapter.hasLabel() && this.getNativeInput_().required) {\n this.adapter.setLabelRequired(true);\n }\n\n if (this.adapter.isFocused()) {\n this.inputFocusHandler_();\n } else if (this.adapter.hasLabel() && this.shouldFloat) {\n this.notchOutline(true);\n this.adapter.floatLabel(true);\n this.styleFloating_(true);\n }\n\n this.adapter.registerInputInteractionHandler('focus', this.inputFocusHandler_);\n this.adapter.registerInputInteractionHandler('blur', this.inputBlurHandler_);\n this.adapter.registerInputInteractionHandler('input', this.inputInputHandler_);\n POINTERDOWN_EVENTS.forEach((evtType) => {\n this.adapter.registerInputInteractionHandler(evtType, this.setPointerXOffset_);\n });\n INTERACTION_EVENTS.forEach((evtType) => {\n this.adapter.registerTextFieldInteractionHandler(evtType, this.textFieldInteractionHandler_);\n });\n this.validationObserver_ =\n this.adapter.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler_);\n this.setCharacterCounter_(this.getValue().length);\n }\n\n destroy() {\n this.adapter.deregisterInputInteractionHandler('focus', this.inputFocusHandler_);\n this.adapter.deregisterInputInteractionHandler('blur', this.inputBlurHandler_);\n this.adapter.deregisterInputInteractionHandler('input', this.inputInputHandler_);\n POINTERDOWN_EVENTS.forEach((evtType) => {\n this.adapter.deregisterInputInteractionHandler(evtType, this.setPointerXOffset_);\n });\n INTERACTION_EVENTS.forEach((evtType) => {\n this.adapter.deregisterTextFieldInteractionHandler(evtType, this.textFieldInteractionHandler_);\n });\n this.adapter.deregisterValidationAttributeChangeHandler(this.validationObserver_);\n }\n\n /**\n * Handles user interactions with the Text Field.\n */\n handleTextFieldInteraction() {\n const nativeInput = this.adapter.getNativeInput();\n if (nativeInput && nativeInput.disabled) {\n return;\n }\n this.receivedUserInput_ = true;\n }\n\n /**\n * Handles validation attribute changes\n */\n handleValidationAttributeChange(attributesList: string[]): void {\n attributesList.some((attributeName) => {\n if (VALIDATION_ATTR_WHITELIST.indexOf(attributeName) > -1) {\n this.styleValidity_(true);\n this.adapter.setLabelRequired(this.getNativeInput_().required);\n return true;\n }\n return false;\n });\n\n if (attributesList.indexOf('maxlength') > -1) {\n this.setCharacterCounter_(this.getValue().length);\n }\n }\n\n /**\n * Opens/closes the notched outline.\n */\n notchOutline(openNotch: boolean) {\n if (!this.adapter.hasOutline()) {\n return;\n }\n\n if (openNotch) {\n const labelWidth = this.adapter.getLabelWidth() * numbers.LABEL_SCALE;\n this.adapter.notchOutline(labelWidth);\n } else {\n this.adapter.closeOutline();\n }\n }\n\n /**\n * Activates the text field focus state.\n */\n activateFocus() {\n this.isFocused_ = true;\n this.styleFocused_(this.isFocused_);\n this.adapter.activateLineRipple();\n if (this.adapter.hasLabel()) {\n this.notchOutline(this.shouldFloat);\n this.adapter.floatLabel(this.shouldFloat);\n this.styleFloating_(this.shouldFloat);\n this.adapter.shakeLabel(this.shouldShake);\n }\n if (this.helperText_) {\n this.helperText_.showToScreenReader();\n }\n }\n\n /**\n * Sets the line ripple's transform origin, so that the line ripple activate\n * animation will animate out from the user's click location.\n */\n setTransformOrigin(evt: TouchEvent | MouseEvent): void {\n if (this.isDisabled() || this.adapter.hasOutline()) {\n return;\n }\n\n const touches = (evt as TouchEvent).touches;\n const targetEvent = touches ? touches[0] : evt;\n const targetClientRect = (targetEvent.target as Element).getBoundingClientRect();\n const normalizedX = (targetEvent as MouseEvent).clientX - targetClientRect.left;\n this.adapter.setLineRippleTransformOrigin(normalizedX);\n }\n\n /**\n * Handles input change of text input and text area.\n */\n handleInput() {\n this.autoCompleteFocus();\n this.setCharacterCounter_(this.getValue().length);\n }\n\n /**\n * Activates the Text Field's focus state in cases when the input value\n * changes without user input (e.g. programmatically).\n */\n autoCompleteFocus() {\n if (!this.receivedUserInput_) {\n this.activateFocus();\n }\n }\n\n /**\n * Deactivates the Text Field's focus state.\n */\n deactivateFocus() {\n this.isFocused_ = false;\n this.adapter.deactivateLineRipple();\n const isValid = this.isValid();\n this.styleValidity_(isValid);\n this.styleFocused_(this.isFocused_);\n if (this.adapter.hasLabel()) {\n this.notchOutline(this.shouldFloat);\n this.adapter.floatLabel(this.shouldFloat);\n this.styleFloating_(this.shouldFloat);\n this.adapter.shakeLabel(this.shouldShake);\n }\n if (!this.shouldFloat) {\n this.receivedUserInput_ = false;\n }\n }\n\n getValue(): string {\n return this.getNativeInput_().value;\n }\n\n /**\n * @param value The value to set on the input Element.\n */\n setValue(value: string): void {\n // Prevent Safari from moving the caret to the end of the input when the value has not changed.\n if (this.getValue() !== value) {\n this.getNativeInput_().value = value;\n }\n this.setCharacterCounter_(value.length);\n const isValid = this.isValid();\n this.styleValidity_(isValid);\n if (this.adapter.hasLabel()) {\n this.notchOutline(this.shouldFloat);\n this.adapter.floatLabel(this.shouldFloat);\n this.styleFloating_(this.shouldFloat);\n this.adapter.shakeLabel(this.shouldShake);\n }\n }\n\n /**\n * @return The custom validity state, if set; otherwise, the result of a native validity check.\n */\n isValid(): boolean {\n return this.useNativeValidation_\n ? this.isNativeInputValid_() : this.isValid_;\n }\n\n /**\n * @param isValid Sets the custom validity state of the Text Field.\n */\n setValid(isValid: boolean): void {\n this.isValid_ = isValid;\n this.styleValidity_(isValid);\n\n const shouldShake = !isValid && !this.isFocused_ && !!this.getValue();\n if (this.adapter.hasLabel()) {\n this.adapter.shakeLabel(shouldShake);\n }\n }\n\n /**\n * Enables or disables the use of native validation. Use this for custom validation.\n * @param useNativeValidation Set this to false to ignore native input validation.\n */\n setUseNativeValidation(useNativeValidation: boolean): void {\n this.useNativeValidation_ = useNativeValidation;\n }\n\n isDisabled(): boolean {\n return this.getNativeInput_().disabled;\n }\n\n /**\n * @param disabled Sets the text-field disabled or enabled.\n */\n setDisabled(disabled: boolean): void {\n this.getNativeInput_().disabled = disabled;\n this.styleDisabled_(disabled);\n }\n\n /**\n * @param content Sets the content of the helper text.\n */\n setHelperTextContent(content: string): void {\n if (this.helperText_) {\n this.helperText_.setContent(content);\n }\n }\n\n /**\n * Sets the aria label of the leading icon.\n */\n setLeadingIconAriaLabel(label: string): void {\n if (this.leadingIcon_) {\n this.leadingIcon_.setAriaLabel(label);\n }\n }\n\n /**\n * Sets the text content of the leading icon.\n */\n setLeadingIconContent(content: string): void {\n if (this.leadingIcon_) {\n this.leadingIcon_.setContent(content);\n }\n }\n\n /**\n * Sets the aria label of the trailing icon.\n */\n setTrailingIconAriaLabel(label: string): void {\n if (this.trailingIcon_) {\n this.trailingIcon_.setAriaLabel(label);\n }\n }\n\n /**\n * Sets the text content of the trailing icon.\n */\n setTrailingIconContent(content: string): void {\n if (this.trailingIcon_) {\n this.trailingIcon_.setContent(content);\n }\n }\n\n /**\n * Sets character counter values that shows characters used and the total character limit.\n */\n private setCharacterCounter_(currentLength: number): void {\n if (!this.characterCounter_) {\n return;\n }\n\n const maxLength = this.getNativeInput_().maxLength;\n if (maxLength === -1) {\n throw new Error('MDCTextFieldFoundation: Expected maxlength html property on text input or textarea.');\n }\n\n this.characterCounter_.setCounterValue(currentLength, maxLength);\n }\n\n /**\n * @return True if the Text Field input fails in converting the user-supplied value.\n */\n private isBadInput_(): boolean {\n // The badInput property is not supported in IE 11 💩.\n return this.getNativeInput_().validity.badInput || false;\n }\n\n /**\n * @return The result of native validity checking (ValidityState.valid).\n */\n private isNativeInputValid_(): boolean {\n return this.getNativeInput_().validity.valid;\n }\n\n /**\n * Styles the component based on the validity state.\n */\n private styleValidity_(isValid: boolean): void {\n const {INVALID} = MDCTextFieldFoundation.cssClasses;\n if (isValid) {\n this.adapter.removeClass(INVALID);\n } else {\n this.adapter.addClass(INVALID);\n }\n if (this.helperText_) {\n this.helperText_.setValidity(isValid);\n }\n }\n\n /**\n * Styles the component based on the focused state.\n */\n private styleFocused_(isFocused: boolean): void {\n const {FOCUSED} = MDCTextFieldFoundation.cssClasses;\n if (isFocused) {\n this.adapter.addClass(FOCUSED);\n } else {\n this.adapter.removeClass(FOCUSED);\n }\n }\n\n /**\n * Styles the component based on the disabled state.\n */\n private styleDisabled_(isDisabled: boolean): void {\n const {DISABLED, INVALID} = MDCTextFieldFoundation.cssClasses;\n if (isDisabled) {\n this.adapter.addClass(DISABLED);\n this.adapter.removeClass(INVALID);\n } else {\n this.adapter.removeClass(DISABLED);\n }\n\n if (this.leadingIcon_) {\n this.leadingIcon_.setDisabled(isDisabled);\n }\n\n if (this.trailingIcon_) {\n this.trailingIcon_.setDisabled(isDisabled);\n }\n }\n\n /**\n * Styles the component based on the label floating state.\n */\n private styleFloating_(isFloating: boolean): void {\n const {LABEL_FLOATING} = MDCTextFieldFoundation.cssClasses;\n if (isFloating) {\n this.adapter.addClass(LABEL_FLOATING);\n } else {\n this.adapter.removeClass(LABEL_FLOATING);\n }\n }\n\n /**\n * @return The native text input element from the host environment, or an object with the same shape for unit tests.\n */\n private getNativeInput_(): MDCTextFieldNativeInputElement {\n // this.adapter may be undefined in foundation unit tests. This happens when testdouble is creating a mock object\n // and invokes the shouldShake/shouldFloat getters (which in turn call getValue(), which calls this method) before\n // init() has been called from the MDCTextField constructor. To work around that issue, we return a dummy object.\n const nativeInput = this.adapter ? this.adapter.getNativeInput() : null;\n return nativeInput || {\n disabled: false,\n maxLength: -1,\n required: false,\n type: 'input',\n validity: {\n badInput: false,\n valid: true,\n },\n value: '',\n };\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTextFieldFoundation;\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCTextFieldHelperTextAdapter} from './adapter';\nimport {MDCTextFieldHelperTextFoundation} from './foundation';\n\nexport type MDCTextFieldHelperTextFactory =\n (el: Element, foundation?: MDCTextFieldHelperTextFoundation) => MDCTextFieldHelperText;\n\nexport class MDCTextFieldHelperText extends MDCComponent<MDCTextFieldHelperTextFoundation> {\n static attachTo(root: Element): MDCTextFieldHelperText {\n return new MDCTextFieldHelperText(root);\n }\n\n // Provided for access by MDCTextField component\n get foundationForTextField(): MDCTextFieldHelperTextFoundation {\n return this.foundation;\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCTextFieldHelperTextAdapter = {\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n hasClass: (className) => this.root.classList.contains(className),\n setAttr: (attr, value) => this.root.setAttribute(attr, value),\n removeAttr: (attr) => this.root.removeAttribute(attr),\n setContent: (content) => {\n this.root.textContent = content;\n },\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCTextFieldHelperTextFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n HELPER_TEXT_PERSISTENT: 'mdc-text-field-helper-text--persistent',\n HELPER_TEXT_VALIDATION_MSG: 'mdc-text-field-helper-text--validation-msg',\n ROOT: 'mdc-text-field-helper-text',\n};\n\nconst strings = {\n ARIA_HIDDEN: 'aria-hidden',\n ROLE: 'role',\n ROOT_SELECTOR: `.${cssClasses.ROOT}`,\n};\n\nexport {strings, cssClasses};\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCTextFieldHelperTextAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\nexport class MDCTextFieldHelperTextFoundation extends MDCFoundation<MDCTextFieldHelperTextAdapter> {\n static get cssClasses() {\n return cssClasses;\n }\n\n static get strings() {\n return strings;\n }\n\n /**\n * See {@link MDCTextFieldHelperTextAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCTextFieldHelperTextAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => false,\n setAttr: () => undefined,\n removeAttr: () => undefined,\n setContent: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n constructor(adapter?: Partial<MDCTextFieldHelperTextAdapter>) {\n super({...MDCTextFieldHelperTextFoundation.defaultAdapter, ...adapter});\n }\n\n /**\n * Sets the content of the helper text field.\n */\n setContent(content: string) {\n this.adapter.setContent(content);\n }\n\n /**\n * @param isPersistent Sets the persistency of the helper text.\n */\n setPersistent(isPersistent: boolean) {\n if (isPersistent) {\n this.adapter.addClass(cssClasses.HELPER_TEXT_PERSISTENT);\n } else {\n this.adapter.removeClass(cssClasses.HELPER_TEXT_PERSISTENT);\n }\n }\n\n /**\n * @param isValidation True to make the helper text act as an error validation message.\n */\n setValidation(isValidation: boolean) {\n if (isValidation) {\n this.adapter.addClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n } else {\n this.adapter.removeClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n }\n }\n\n /**\n * Makes the helper text visible to the screen reader.\n */\n showToScreenReader() {\n this.adapter.removeAttr(strings.ARIA_HIDDEN);\n }\n\n /**\n * Sets the validity of the helper text based on the input validity.\n */\n setValidity(inputIsValid: boolean) {\n const helperTextIsPersistent = this.adapter.hasClass(cssClasses.HELPER_TEXT_PERSISTENT);\n const helperTextIsValidationMsg = this.adapter.hasClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n const validationMsgNeedsDisplay = helperTextIsValidationMsg && !inputIsValid;\n\n if (validationMsgNeedsDisplay) {\n this.adapter.setAttr(strings.ROLE, 'alert');\n } else {\n this.adapter.removeAttr(strings.ROLE);\n }\n\n if (!helperTextIsPersistent && !validationMsgNeedsDisplay) {\n this.hide_();\n }\n }\n\n /**\n * Hides the help text from screen readers.\n */\n private hide_() {\n this.adapter.setAttr(strings.ARIA_HIDDEN, 'true');\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTextFieldHelperTextFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport {cssClasses as helperTextCssClasses, strings as helperTextStrings} from './constants';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {MDCTextFieldIconAdapter} from './adapter';\nimport {MDCTextFieldIconFoundation} from './foundation';\n\nexport type MDCTextFieldIconFactory = (el: Element, foundation?: MDCTextFieldIconFoundation) => MDCTextFieldIcon;\n\nexport class MDCTextFieldIcon extends MDCComponent<MDCTextFieldIconFoundation> {\n static attachTo(root: Element): MDCTextFieldIcon {\n return new MDCTextFieldIcon(root);\n }\n\n // Provided for access by MDCTextField component\n get foundationForTextField(): MDCTextFieldIconFoundation {\n return this.foundation;\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCTextFieldIconAdapter = {\n getAttr: (attr) => this.root.getAttribute(attr),\n setAttr: (attr, value) => this.root.setAttribute(attr, value),\n removeAttr: (attr) => this.root.removeAttribute(attr),\n setContent: (content) => {\n this.root.textContent = content;\n },\n registerInteractionHandler: (evtType, handler) => this.listen(evtType, handler),\n deregisterInteractionHandler: (evtType, handler) => this.unlisten(evtType, handler),\n notifyIconAction: () => this.emit(\n MDCTextFieldIconFoundation.strings.ICON_EVENT, {} /* evtData */, true /* shouldBubble */),\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCTextFieldIconFoundation(adapter);\n }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst strings = {\n ICON_EVENT: 'MDCTextField:icon',\n ICON_ROLE: 'button',\n};\n\nconst cssClasses = {\n ROOT: 'mdc-text-field__icon',\n};\n\nexport {strings, cssClasses};\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCTextFieldIconAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\ntype InteractionEventType = 'click' | 'keydown';\n\nconst INTERACTION_EVENTS: InteractionEventType[] = ['click', 'keydown'];\n\nexport class MDCTextFieldIconFoundation extends MDCFoundation<MDCTextFieldIconAdapter> {\n static get strings() {\n return strings;\n }\n\n static get cssClasses() {\n return cssClasses;\n }\n\n /**\n * See {@link MDCTextFieldIconAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCTextFieldIconAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n getAttr: () => null,\n setAttr: () => undefined,\n removeAttr: () => undefined,\n setContent: () => undefined,\n registerInteractionHandler: () => undefined,\n deregisterInteractionHandler: () => undefined,\n notifyIconAction: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private savedTabIndex_: string | null = null;\n private readonly interactionHandler_: SpecificEventListener<InteractionEventType>;\n\n constructor(adapter?: Partial<MDCTextFieldIconAdapter>) {\n super({...MDCTextFieldIconFoundation.defaultAdapter, ...adapter});\n\n this.interactionHandler_ = (evt) => this.handleInteraction(evt);\n }\n\n init() {\n this.savedTabIndex_ = this.adapter.getAttr('tabindex');\n\n INTERACTION_EVENTS.forEach((evtType) => {\n this.adapter.registerInteractionHandler(evtType, this.interactionHandler_);\n });\n }\n\n destroy() {\n INTERACTION_EVENTS.forEach((evtType) => {\n this.adapter.deregisterInteractionHandler(evtType, this.interactionHandler_);\n });\n }\n\n setDisabled(disabled: boolean) {\n if (!this.savedTabIndex_) {\n return;\n }\n\n if (disabled) {\n this.adapter.setAttr('tabindex', '-1');\n this.adapter.removeAttr('role');\n } else {\n this.adapter.setAttr('tabindex', this.savedTabIndex_);\n this.adapter.setAttr('role', strings.ICON_ROLE);\n }\n }\n\n setAriaLabel(label: string) {\n this.adapter.setAttr('aria-label', label);\n }\n\n setContent(content: string) {\n this.adapter.setContent(content);\n }\n\n handleInteraction(evt: MouseEvent | KeyboardEvent) {\n const isEnterKey = (evt as KeyboardEvent).key === 'Enter' || (evt as KeyboardEvent).keyCode === 13;\n if (evt.type === 'click' || isEnterKey) {\n evt.preventDefault(); // stop click from causing host label to focus\n // input\n this.adapter.notifyIconAction();\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTextFieldIconFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport {cssClasses as iconCssClasses, strings as iconStrings} from './constants';\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\nexport * from './character-counter/index';\nexport * from './helper-text/index';\nexport * from './icon/index';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCRipple, MDCRippleFactory} from '@material/ripple/component';\nimport {MDCTopAppBarAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\nimport {MDCFixedTopAppBarFoundation} from './fixed/foundation';\nimport {MDCTopAppBarBaseFoundation} from './foundation';\nimport {MDCShortTopAppBarFoundation} from './short/foundation';\nimport {MDCTopAppBarFoundation} from './standard/foundation';\n\nexport class MDCTopAppBar extends MDCComponent<MDCTopAppBarBaseFoundation> {\n static attachTo(root: Element): MDCTopAppBar {\n return new MDCTopAppBar(root);\n }\n\n private handleNavigationClick_!: SpecificEventListener<'click'>; // assigned in initialSyncWithDOM()\n private handleWindowResize_!: SpecificEventListener<'resize'>; // assigned in initialSyncWithDOM()\n private handleTargetScroll_!: SpecificEventListener<'scroll'>; // assigned in initialSyncWithDOM()\n private navIcon_!: Element | null;\n private iconRipples_!: MDCRipple[];\n private scrollTarget_!: EventTarget;\n\n initialize(rippleFactory: MDCRippleFactory = (el) => MDCRipple.attachTo(el)) {\n this.navIcon_ = this.root.querySelector(strings.NAVIGATION_ICON_SELECTOR);\n\n // Get all icons in the toolbar and instantiate the ripples\n const icons: Element[] =\n [].slice.call(this.root.querySelectorAll(strings.ACTION_ITEM_SELECTOR));\n if (this.navIcon_) {\n icons.push(this.navIcon_);\n }\n\n this.iconRipples_ = icons.map((icon) => {\n const ripple = rippleFactory(icon);\n ripple.unbounded = true;\n return ripple;\n });\n\n this.scrollTarget_ = window;\n }\n\n initialSyncWithDOM() {\n this.handleNavigationClick_ =\n this.foundation.handleNavigationClick.bind(this.foundation);\n this.handleWindowResize_ =\n this.foundation.handleWindowResize.bind(this.foundation);\n this.handleTargetScroll_ =\n this.foundation.handleTargetScroll.bind(this.foundation);\n\n this.scrollTarget_.addEventListener('scroll', this.handleTargetScroll_ as EventListener);\n\n if (this.navIcon_) {\n this.navIcon_.addEventListener('click', this.handleNavigationClick_ as EventListener);\n }\n\n const isFixed = this.root.classList.contains(cssClasses.FIXED_CLASS);\n const isShort = this.root.classList.contains(cssClasses.SHORT_CLASS);\n if (!isShort && !isFixed) {\n window.addEventListener('resize', this.handleWindowResize_ as EventListener);\n }\n }\n\n destroy() {\n this.iconRipples_.forEach((iconRipple) => iconRipple.destroy());\n this.scrollTarget_.removeEventListener('scroll', this.handleTargetScroll_ as EventListener);\n if (this.navIcon_) {\n this.navIcon_.removeEventListener('click', this.handleNavigationClick_ as EventListener);\n }\n const isFixed = this.root.classList.contains(cssClasses.FIXED_CLASS);\n const isShort = this.root.classList.contains(cssClasses.SHORT_CLASS);\n if (!isShort && !isFixed) {\n window.removeEventListener('resize', this.handleWindowResize_ as EventListener);\n }\n super.destroy();\n }\n\n setScrollTarget(target: EventTarget) {\n // Remove scroll handler from the previous scroll target\n this.scrollTarget_.removeEventListener('scroll', this.handleTargetScroll_ as EventListener);\n\n this.scrollTarget_ = target;\n\n // Initialize scroll handler on the new scroll target\n this.handleTargetScroll_ =\n this.foundation.handleTargetScroll.bind(this.foundation);\n this.scrollTarget_.addEventListener('scroll', this.handleTargetScroll_ as EventListener);\n }\n\n getDefaultFoundation() {\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n const adapter: MDCTopAppBarAdapter = {\n hasClass: (className) => this.root.classList.contains(className),\n addClass: (className) => this.root.classList.add(className),\n removeClass: (className) => this.root.classList.remove(className),\n setStyle: (property, value) =>\n (this.root as HTMLElement).style.setProperty(property, value),\n getTopAppBarHeight: () => this.root.clientHeight,\n notifyNavigationIconClicked: () =>\n this.emit(strings.NAVIGATION_EVENT, {}),\n getViewportScrollY: () => {\n const win = this.scrollTarget_ as Window;\n const el = this.scrollTarget_ as Element;\n return win.pageYOffset !== undefined ? win.pageYOffset : el.scrollTop;\n },\n getTotalActionItems: () =>\n this.root.querySelectorAll(strings.ACTION_ITEM_SELECTOR).length,\n };\n // tslint:enable:object-literal-sort-keys\n\n let foundation: MDCTopAppBarBaseFoundation;\n if (this.root.classList.contains(cssClasses.SHORT_CLASS)) {\n foundation = new MDCShortTopAppBarFoundation(adapter);\n } else if (this.root.classList.contains(cssClasses.FIXED_CLASS)) {\n foundation = new MDCFixedTopAppBarFoundation(adapter);\n } else {\n foundation = new MDCTopAppBarFoundation(adapter);\n }\n\n return foundation;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nconst cssClasses = {\n FIXED_CLASS: 'mdc-top-app-bar--fixed',\n FIXED_SCROLLED_CLASS: 'mdc-top-app-bar--fixed-scrolled',\n SHORT_CLASS: 'mdc-top-app-bar--short',\n SHORT_COLLAPSED_CLASS: 'mdc-top-app-bar--short-collapsed',\n SHORT_HAS_ACTION_ITEM_CLASS: 'mdc-top-app-bar--short-has-action-item',\n};\n\nconst numbers = {\n DEBOUNCE_THROTTLE_RESIZE_TIME_MS: 100,\n MAX_TOP_APP_BAR_HEIGHT: 128,\n};\n\nconst strings = {\n ACTION_ITEM_SELECTOR: '.mdc-top-app-bar__action-item',\n NAVIGATION_EVENT: 'MDCTopAppBar:nav',\n NAVIGATION_ICON_SELECTOR: '.mdc-top-app-bar__navigation-icon',\n ROOT_SELECTOR: '.mdc-top-app-bar',\n TITLE_SELECTOR: '.mdc-top-app-bar__title',\n};\n\nexport {cssClasses, numbers, strings};\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {cssClasses} from '../constants';\nimport {MDCTopAppBarFoundation} from '../standard/foundation';\n\nexport class MDCFixedTopAppBarFoundation extends MDCTopAppBarFoundation {\n /**\n * State variable for the previous scroll iteration top app bar state\n */\n private wasScrolled_ = false;\n\n /**\n * Scroll handler for applying/removing the modifier class on the fixed top app bar.\n * @override\n */\n handleTargetScroll() {\n const currentScroll = this.adapter.getViewportScrollY();\n\n if (currentScroll <= 0) {\n if (this.wasScrolled_) {\n this.adapter.removeClass(cssClasses.FIXED_SCROLLED_CLASS);\n this.wasScrolled_ = false;\n }\n } else {\n if (!this.wasScrolled_) {\n this.adapter.addClass(cssClasses.FIXED_SCROLLED_CLASS);\n this.wasScrolled_ = true;\n }\n }\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCFixedTopAppBarFoundation;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {MDCTopAppBarAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\n\nexport class MDCTopAppBarBaseFoundation extends MDCFoundation<MDCTopAppBarAdapter> {\n static get strings() {\n return strings;\n }\n\n static get cssClasses() {\n return cssClasses;\n }\n\n static get numbers() {\n return numbers;\n }\n\n /**\n * See {@link MDCTopAppBarAdapter} for typing information on parameters and return types.\n */\n static get defaultAdapter(): MDCTopAppBarAdapter {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: () => undefined,\n removeClass: () => undefined,\n hasClass: () => false,\n setStyle: () => undefined,\n getTopAppBarHeight: () => 0,\n notifyNavigationIconClicked: () => undefined,\n getViewportScrollY: () => 0,\n getTotalActionItems: () => 0,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n /* istanbul ignore next: optional argument is not a branch statement */\n constructor(adapter?: Partial<MDCTopAppBarAdapter>) {\n super({...MDCTopAppBarBaseFoundation.defaultAdapter, ...adapter});\n }\n\n /** Other variants of TopAppBar foundation overrides this method */\n handleTargetScroll() {} // tslint:disable-line:no-empty\n /** Other variants of TopAppBar foundation overrides this method */\n handleWindowResize() {} // tslint:disable-line:no-empty\n\n handleNavigationClick() {\n this.adapter.notifyNavigationIconClicked();\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTopAppBarBaseFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './fixed/foundation';\nexport * from './short/foundation';\nexport * from './standard/foundation';\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTopAppBarAdapter} from '../adapter';\nimport {cssClasses} from '../constants';\nimport {MDCTopAppBarBaseFoundation} from '../foundation';\n\nexport class MDCShortTopAppBarFoundation extends MDCTopAppBarBaseFoundation {\n // Public visibility for backward compatibility.\n get isCollapsed(): boolean {\n return this.isCollapsed_;\n }\n\n private isCollapsed_ = false;\n\n private isAlwaysCollapsed_ = false;\n\n /* istanbul ignore next: optional argument is not a branch statement */\n constructor(adapter?: Partial<MDCTopAppBarAdapter>) {\n super(adapter);\n }\n\n init() {\n super.init();\n\n if (this.adapter.getTotalActionItems() > 0) {\n this.adapter.addClass(cssClasses.SHORT_HAS_ACTION_ITEM_CLASS);\n }\n\n // If initialized with SHORT_COLLAPSED_CLASS, the bar should always be collapsed\n this.setAlwaysCollapsed(\n this.adapter.hasClass(cssClasses.SHORT_COLLAPSED_CLASS));\n }\n\n /**\n * Set if the short top app bar should always be collapsed.\n *\n * @param value When `true`, bar will always be collapsed. When `false`, bar may collapse or expand based on scroll.\n */\n setAlwaysCollapsed(value: boolean) {\n this.isAlwaysCollapsed_ = !!value;\n if (this.isAlwaysCollapsed_) {\n this.collapse_();\n } else {\n // let maybeCollapseBar_ determine if the bar should be collapsed\n this.maybeCollapseBar_();\n }\n }\n\n getAlwaysCollapsed() {\n return this.isAlwaysCollapsed_;\n }\n\n /**\n * Scroll handler for applying/removing the collapsed modifier class on the short top app bar.\n * @override\n */\n handleTargetScroll() {\n this.maybeCollapseBar_();\n }\n\n private maybeCollapseBar_() {\n if (this.isAlwaysCollapsed_) {\n return;\n }\n const currentScroll = this.adapter.getViewportScrollY();\n\n if (currentScroll <= 0) {\n if (this.isCollapsed_) {\n this.uncollapse_();\n }\n } else {\n if (!this.isCollapsed_) {\n this.collapse_();\n }\n }\n }\n\n private uncollapse_() {\n this.adapter.removeClass(cssClasses.SHORT_COLLAPSED_CLASS);\n this.isCollapsed_ = false;\n }\n\n private collapse_() {\n this.adapter.addClass(cssClasses.SHORT_COLLAPSED_CLASS);\n this.isCollapsed_ = true;\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCShortTopAppBarFoundation;\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCTopAppBarAdapter} from '../adapter';\nimport {numbers} from '../constants';\nimport {MDCTopAppBarBaseFoundation} from '../foundation';\n\nconst INITIAL_VALUE = 0;\n\nexport class MDCTopAppBarFoundation extends MDCTopAppBarBaseFoundation {\n /**\n * Indicates if the top app bar was docked in the previous scroll handler iteration.\n */\n private wasDocked_ = true;\n\n /**\n * Indicates if the top app bar is docked in the fully shown position.\n */\n private isDockedShowing_ = true;\n\n /**\n * Variable for current scroll position of the top app bar\n */\n private currentAppBarOffsetTop_ = 0;\n\n /**\n * Used to prevent the top app bar from being scrolled out of view during resize events\n */\n private isCurrentlyBeingResized_ = false;\n\n /**\n * The timeout that's used to throttle the resize events\n */\n private resizeThrottleId_ = INITIAL_VALUE;\n\n /**\n * Used for diffs of current scroll position vs previous scroll position\n */\n private lastScrollPosition_: number;\n\n /**\n * Used to verify when the top app bar is completely showing or completely hidden\n */\n private topAppBarHeight_: number;\n\n /**\n * The timeout that's used to debounce toggling the isCurrentlyBeingResized_ variable after a resize\n */\n private resizeDebounceId_ = INITIAL_VALUE;\n\n /* istanbul ignore next: optional argument is not a branch statement */\n constructor(adapter?: Partial<MDCTopAppBarAdapter>) {\n super(adapter);\n\n this.lastScrollPosition_ = this.adapter.getViewportScrollY();\n this.topAppBarHeight_ = this.adapter.getTopAppBarHeight();\n }\n\n destroy() {\n super.destroy();\n this.adapter.setStyle('top', '');\n }\n\n /**\n * Scroll handler for the default scroll behavior of the top app bar.\n * @override\n */\n handleTargetScroll() {\n const currentScrollPosition = Math.max(this.adapter.getViewportScrollY(), 0);\n const diff = currentScrollPosition - this.lastScrollPosition_;\n this.lastScrollPosition_ = currentScrollPosition;\n\n // If the window is being resized the lastScrollPosition_ needs to be updated but the\n // current scroll of the top app bar should stay in the same position.\n if (!this.isCurrentlyBeingResized_) {\n this.currentAppBarOffsetTop_ -= diff;\n\n if (this.currentAppBarOffsetTop_ > 0) {\n this.currentAppBarOffsetTop_ = 0;\n } else if (Math.abs(this.currentAppBarOffsetTop_) > this.topAppBarHeight_) {\n this.currentAppBarOffsetTop_ = -this.topAppBarHeight_;\n }\n\n this.moveTopAppBar_();\n }\n }\n\n /**\n * Top app bar resize handler that throttle/debounce functions that execute updates.\n * @override\n */\n handleWindowResize() {\n // Throttle resize events 10 p/s\n if (!this.resizeThrottleId_) {\n this.resizeThrottleId_ = setTimeout(() => {\n this.resizeThrottleId_ = INITIAL_VALUE;\n this.throttledResizeHandler_();\n }, numbers.DEBOUNCE_THROTTLE_RESIZE_TIME_MS);\n }\n\n this.isCurrentlyBeingResized_ = true;\n\n if (this.resizeDebounceId_) {\n clearTimeout(this.resizeDebounceId_);\n }\n\n this.resizeDebounceId_ = setTimeout(() => {\n this.handleTargetScroll();\n this.isCurrentlyBeingResized_ = false;\n this.resizeDebounceId_ = INITIAL_VALUE;\n }, numbers.DEBOUNCE_THROTTLE_RESIZE_TIME_MS);\n }\n\n /**\n * Function to determine if the DOM needs to update.\n */\n private checkForUpdate_(): boolean {\n const offscreenBoundaryTop = -this.topAppBarHeight_;\n const hasAnyPixelsOffscreen = this.currentAppBarOffsetTop_ < 0;\n const hasAnyPixelsOnscreen = this.currentAppBarOffsetTop_ > offscreenBoundaryTop;\n const partiallyShowing = hasAnyPixelsOffscreen && hasAnyPixelsOnscreen;\n\n // If it's partially showing, it can't be docked.\n if (partiallyShowing) {\n this.wasDocked_ = false;\n } else {\n // Not previously docked and not partially showing, it's now docked.\n if (!this.wasDocked_) {\n this.wasDocked_ = true;\n return true;\n } else if (this.isDockedShowing_ !== hasAnyPixelsOnscreen) {\n this.isDockedShowing_ = hasAnyPixelsOnscreen;\n return true;\n }\n }\n\n return partiallyShowing;\n }\n\n /**\n * Function to move the top app bar if needed.\n */\n private moveTopAppBar_() {\n if (this.checkForUpdate_()) {\n // Once the top app bar is fully hidden we use the max potential top app bar height as our offset\n // so the top app bar doesn't show if the window resizes and the new height > the old height.\n let offset = this.currentAppBarOffsetTop_;\n if (Math.abs(offset) >= this.topAppBarHeight_) {\n offset = -numbers.MAX_TOP_APP_BAR_HEIGHT;\n }\n\n this.adapter.setStyle('top', offset + 'px');\n }\n }\n\n /**\n * Throttled function that updates the top app bar scrolled values if the\n * top app bar height changes.\n */\n private throttledResizeHandler_() {\n const currentHeight = this.adapter.getTopAppBarHeight();\n if (this.topAppBarHeight_ !== currentHeight) {\n this.wasDocked_ = false;\n\n // Since the top app bar has a different height depending on the screen width, this\n // will ensure that the top app bar remains in the correct location if\n // completely hidden and a resize makes the top app bar a different height.\n this.currentAppBarOffsetTop_ -= this.topAppBarHeight_ - currentHeight;\n this.topAppBarHeight_ = currentHeight;\n }\n this.handleTargetScroll();\n }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTopAppBarFoundation;\n"],"sourceRoot":""}
|